1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[AC-2117] Update access selector to update permission list when flexible collections flag is updated (#7847)

This commit is contained in:
Shane Melton
2024-02-08 09:35:38 -08:00
committed by GitHub
parent 8c3754fd43
commit c2ed6383c6

View File

@@ -192,7 +192,12 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
/**
* Enable Flexible Collections changes (feature flag)
*/
@Input() flexibleCollectionsEnabled: boolean;
@Input() set flexibleCollectionsEnabled(value: boolean) {
this._flexibleCollectionsEnabled = value;
this.permissionList = getPermissionList(value);
}
private _flexibleCollectionsEnabled: boolean;
constructor(
private readonly formBuilder: FormBuilder,
@@ -257,7 +262,7 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
}
async ngOnInit() {
this.permissionList = getPermissionList(this.flexibleCollectionsEnabled);
this.permissionList = getPermissionList(this._flexibleCollectionsEnabled);
// Watch the internal formArray for changes and propagate them
this.selectionList.formArray.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((v) => {
if (!this.notifyOnChange || this.pauseChangeNotification) {