2022-11-15 01:06:12 -08:00
|
|
|
<form [formGroup]="form" [class.opacity-50]="disabled">
|
2022-11-13 22:58:07 -08:00
|
|
|
<label class="form-label">{{title}}</label>
|
2022-11-13 07:23:33 -08:00
|
|
|
<ul class="list-group">
|
2022-11-13 22:58:07 -08:00
|
|
|
<li class="list-group-item d-flex">
|
|
|
|
|
<div class="col-3" i18n>Type</div>
|
|
|
|
|
<div class="col" i18n>All</div>
|
|
|
|
|
<div class="col" i18n>Add</div>
|
|
|
|
|
<div class="col" i18n>Change</div>
|
|
|
|
|
<div class="col" i18n>Delete</div>
|
|
|
|
|
<div class="col" i18n>View</div>
|
|
|
|
|
</li>
|
2024-04-23 08:16:28 -07:00
|
|
|
@for (type of allowedTypes; track type) {
|
|
|
|
|
<li class="list-group-item d-flex" [formGroupName]="type">
|
|
|
|
|
<div class="col-3">{{type}}:</div>
|
|
|
|
|
<div class="col form-check form-check-inline form-switch" [ngbPopover]="inheritedWarning" [disablePopover]="!isInherited(type)" placement="left" triggers="mouseenter:mouseleave">
|
|
|
|
|
<input type="checkbox" class="form-check-input" id="{{type}}_all" (change)="toggleAll($event, type)" [checked]="typesWithAllActions.has(type) || isInherited(type)" [attr.disabled]="disabled || isInherited(type) ? true : null">
|
|
|
|
|
<label class="form-check-label visually-hidden" for="{{type}}_all" i18n>All</label>
|
2023-12-19 15:02:05 -08:00
|
|
|
</div>
|
|
|
|
|
@for (action of PermissionAction | keyvalue; track action) {
|
2024-04-23 08:16:28 -07:00
|
|
|
<div class="col form-check form-check-inline" [ngbPopover]="inheritedWarning" [disablePopover]="!isInherited(type, action.key)" placement="left" triggers="mouseenter:mouseleave">
|
|
|
|
|
<input type="checkbox" class="form-check-input" id="{{type}}_{{action.key}}" formControlName="{{action.key}}">
|
2024-05-29 00:07:32 -07:00
|
|
|
<label class="form-check-label visually-hidden" for="{{type}}_{{action.key}}">{{action.key}}</label>
|
2023-12-19 15:02:05 -08:00
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</li>
|
|
|
|
|
}
|
|
|
|
|
@if (error) {
|
|
|
|
|
<div class="invalid-feedback d-block">{{error}}</div>
|
|
|
|
|
}
|
2022-11-13 07:23:33 -08:00
|
|
|
</ul>
|
|
|
|
|
</form>
|