Vito 79789cb070 [ADF-2553] added select box and updating role (#3148)
* [ADF-2553] start adding dropdown

* [ADF-2553] added select box and updating role

* [ADF-2553] added some fixes

* [ADF-2554] added test for component phase 1

* [ADF-2553] fixed error and added tests

* [ADF-2553] added documentation and improved api call
2018-04-08 16:25:51 +01:00

44 lines
2.5 KiB
HTML

<div id="adf-permission-display-container" class="adf-display-permission-container">
<adf-datatable [rows]="permissionList" class="adf-datatable-permission">
<data-columns>
<data-column key="icon" type="icon" [sortable]="false">
</data-column>
<data-column title="{{'PERMISSION_MANAGER.PERMISSION_DISPLAY.AUTHORITY_ID' | translate}}" key="authorityId"></data-column>
<data-column title="{{'PERMISSION_MANAGER.PERMISSION_DISPLAY.ROLE' | translate}}" key="name">
<ng-template let-entry="$implicit">
<mat-form-field *ngIf="!entry.row.getValue('isInherited') else show_only_label">
<mat-select id="adf-select-role-permission"
value="{{entry.data.getValue(entry.row, entry.col)}}"
(selectionChange)="saveNewRole($event, entry.row.obj)">
<mat-option *ngFor="let role of settableRoles" [value]="role">
{{ role }}
</mat-option>
</mat-select>
</mat-form-field>
<ng-template #show_only_label>
<span>{{entry.data.getValue(entry.row, entry.col)}}</span>
</ng-template>
</ng-template>
</data-column>
<data-column title="{{'PERMISSION_MANAGER.PERMISSION_DISPLAY.INHERITED' | translate}}" key="isInherited">
<ng-template let-entry="$implicit">
<mat-chip-list>
<mat-chip *ngIf="!!entry.data.getValue(entry.row, entry.col) else locally_set_chip"
id="adf-permission-inherited-label"
color="primary" selected="true">{{'PERMISSION_MANAGER.PERMISSION_DISPLAY.INHERITED' | translate}}</mat-chip>
</mat-chip-list>
<ng-template #locally_set_chip>
<mat-chip-list>
<mat-chip id="adf-permission-locallyset-label"
color="accent" selected="true">
{{'PERMISSION_MANAGER.PERMISSION_DISPLAY.LOCALLY_SET' | translate}}
</mat-chip>
</mat-chip-list>
</ng-template>
</ng-template>
</data-column>
</data-columns>
</adf-datatable>
</div>