1
0
mirror of https://github.com/bitwarden/web synced 2025-12-12 14:23:18 +00:00

Feature/split manage collections permission (#1211)

* Update guard services and routing

* Add depenent checkbox to handle sub permissions

* Present new collections premissions

* Use new split permissions

* Rename to nested-checkbox.component

* Clarify css class name

* update jslib
This commit is contained in:
Matt Gibson
2021-10-05 11:12:44 -05:00
committed by GitHub
parent 7a43510cf5
commit 998d36a5d1
20 changed files with 181 additions and 72 deletions

View File

@@ -0,0 +1,37 @@
import {
Component,
EventEmitter,
Input,
Output,
} from '@angular/core';
import { Utils } from 'jslib-common/misc/utils';
@Component({
selector: 'app-nested-checkbox',
templateUrl: 'nested-checkbox.component.html',
})
export class NestedCheckboxComponent {
@Input() parentId: string;
@Input() checkboxes: { id: string, get: () => boolean, set: (v: boolean) => void; }[];
@Output() onSavedUser = new EventEmitter();
@Output() onDeletedUser = new EventEmitter();
get parentIndeterminate() {
return !this.parentChecked &&
this.checkboxes.some(c => c.get());
}
get parentChecked() {
return this.checkboxes.every(c => c.get());
}
set parentChecked(value: boolean) {
this.checkboxes.forEach(c => {
c.set(value);
});
}
pascalize(s: string) {
return Utils.camelToPascalCase(s);
}
}