<eg-perm-group-map-dialog #addMappingDialog
[permGroup]="selected ? selected.callerData : null"
[orgDepths]="orgDepths"
+ [depthNames]="depthNames"
[permMaps]="groupPermMaps()" [permissions]="permissions">
</eg-perm-group-map-dialog>
</div>
<div class="row font-weight-bold">
- <div class="col-lg-5" i18n>Permissions</div>
- <div class="col-lg-4" i18n>Group</div>
- <div class="col-lg-1" i18n>Depth</div>
+ <div class="col-lg-4" i18n>Permissions</div>
+ <div class="col-lg-3" i18n>Group</div>
+ <div class="col-lg-3" i18n>Depth</div>
<div class="col-lg-1" i18n>Grantable?</div>
<div class="col-lg-1" i18n>Delete?</div>
</div>
<div class="row" *ngFor="let map of groupPermMaps()"
[ngClass]="{'bg-warning': map.isdeleted()}">
- <div class="col-lg-5">
+ <div class="col-lg-4">
<span class="label-with-material-icon">
<span i18n-title title="{{map.perm().description() || map.perm().code()}}">
{{map.perm().code()}}
</span>
</div>
<ng-container *ngIf="permIsInherited(map); else nativeMap">
- <div class="col-lg-4">
+ <div class="col-lg-3">
<button class="btn btn-link m-0 p-0"
(click)="selectGroup(map.grp().id())">
{{map.grp().name()}}
</button>
</div>
- <div class="col-lg-1 text-center">{{map.depth()}}</div>
+ <div class="col-lg-3">{{depthNames[map.depth()]}}</div>
<div class="col-lg-1 d-flex flex-column justify-content-center">
<div class="d-flex justify-content-center p-1 rounded">
<eg-bool [value]="map.grantable() === 't'"></eg-bool>
<div class="col-lg-1 font-italic" i18n>Inherited</div>
</ng-container>
<ng-template #nativeMap>
- <div class="col-lg-4">{{map.grp().name()}}</div>
- <div class="col-lg-1">
+ <div class="col-lg-3">{{map.grp().name()}}</div>
+ <div class="col-lg-3">
<select [ngModel]="map.depth()" class="p-1"
(ngModelChange)="map.depth($event); map.ischanged(true)">
- <option *ngFor="let d of orgDepths" value="{{d}}">{{d}}</option>
+ <option *ngFor="let d of orgDepths" value="{{d}}">{{depthNames[d]}}</option>
</select>
</div>
<div class="col-lg-1 d-flex flex-column justify-content-center">
permEntries: ComboboxEntry[];
permMaps: IdlObject[];
orgDepths: number[];
+ depthNames: string[];
filterText: string;
// Have to fetch quite a bit of data for this UI.
}
setOrgDepths() {
- const depths = this.org.typeList().map(t => Number(t.depth()));
+ const orgTypes = this.org.typeList();
+ const depths = orgTypes.map(t => Number(t.depth()));
const depths2 = [];
+ const names = [];
depths.forEach(d => {
if (!depths2.includes(d)) {
depths2.push(d);
}
});
this.orgDepths = depths2.sort();
+ this.orgDepths.forEach( i=> {
+ names.push(orgTypes.filter(t => t.depth() == i).map(t => t.name()).sort().join(","));
+ });
+ this.depthNames = names;
}
// Returns maps for this group and ancestors