mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
[AC-2483] Added new Add Access UI to the collection dialog for AC (#9090)
* added new Add Access UI to the collection dialog for AC
This commit is contained in:
@@ -59,6 +59,7 @@ export interface CollectionDialogParams {
|
||||
*/
|
||||
limitNestedCollections?: boolean;
|
||||
readonly?: boolean;
|
||||
isAddAccessCollection?: boolean;
|
||||
}
|
||||
|
||||
export interface CollectionDialogResult {
|
||||
@@ -100,6 +101,7 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
protected PermissionMode = PermissionMode;
|
||||
protected showDeleteButton = false;
|
||||
protected showAddAccessWarning = false;
|
||||
|
||||
constructor(
|
||||
@Inject(DIALOG_DATA) private params: CollectionDialogParams,
|
||||
@@ -251,6 +253,7 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
||||
this.handleFormGroupReadonly(this.dialogReadonly);
|
||||
|
||||
this.loading = false;
|
||||
this.showAddAccessWarning = this.handleAddAccessWarning(flexibleCollectionsV1);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -362,6 +365,18 @@ export class CollectionDialogComponent implements OnInit, OnDestroy {
|
||||
this.destroy$.complete();
|
||||
}
|
||||
|
||||
private handleAddAccessWarning(flexibleCollectionsV1: boolean): boolean {
|
||||
if (
|
||||
flexibleCollectionsV1 &&
|
||||
!this.organization?.allowAdminAccessToAllCollectionItems &&
|
||||
this.params.isAddAccessCollection
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private handleFormGroupReadonly(readonly: boolean) {
|
||||
if (readonly) {
|
||||
this.formGroup.controls.name.disable();
|
||||
|
||||
Reference in New Issue
Block a user