mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
[AC-2117] Update access selector to update permission list when flexible collections flag is updated (#7847)
This commit is contained in:
@@ -192,7 +192,12 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
|
|||||||
/**
|
/**
|
||||||
* Enable Flexible Collections changes (feature flag)
|
* 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(
|
constructor(
|
||||||
private readonly formBuilder: FormBuilder,
|
private readonly formBuilder: FormBuilder,
|
||||||
@@ -257,7 +262,7 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
|
|||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.permissionList = getPermissionList(this.flexibleCollectionsEnabled);
|
this.permissionList = getPermissionList(this._flexibleCollectionsEnabled);
|
||||||
// Watch the internal formArray for changes and propagate them
|
// Watch the internal formArray for changes and propagate them
|
||||||
this.selectionList.formArray.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((v) => {
|
this.selectionList.formArray.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((v) => {
|
||||||
if (!this.notifyOnChange || this.pauseChangeNotification) {
|
if (!this.notifyOnChange || this.pauseChangeNotification) {
|
||||||
|
|||||||
Reference in New Issue
Block a user