1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01:00

[AC-2500] Collection row menus - adjust feature flagging (#9116)

This commit is contained in:
Thomas Rittson 2024-05-14 08:30:02 +10:00 committed by GitHub
parent 8e4073f1ca
commit 8c5841a76a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 24 additions and 11 deletions

View File

@ -83,9 +83,7 @@
{{ "access" | i18n }}
</button>
</ng-container>
<ng-container
*ngIf="flexibleCollectionsV1Enabled && !canEditCollection && canViewCollectionInfo"
>
<ng-container *ngIf="!canEditCollection && canViewCollectionInfo">
<button type="button" bitMenuItem (click)="edit(true)">
<i class="bwi bwi-fw bwi-pencil-square" aria-hidden="true"></i>
{{ "viewInfo" | i18n }}

View File

@ -168,7 +168,7 @@ export class VaultItemsComponent {
protected canViewCollectionInfo(collection: CollectionView) {
const organization = this.allOrganizations.find((o) => o.id === collection.organizationId);
return collection.canViewCollectionInfo(organization);
return collection.canViewCollectionInfo(organization, this.flexibleCollectionsV1Enabled);
}
protected toggleAll() {

View File

@ -88,7 +88,14 @@ export class CollectionAdminView extends CollectionView {
/**
* Returns true if the user can view collection info and access in a read-only state from the Admin Console
*/
override canViewCollectionInfo(org: Organization | undefined): boolean {
override canViewCollectionInfo(
org: Organization | undefined,
flexibleCollectionsV1Enabled: boolean,
): boolean {
if (!flexibleCollectionsV1Enabled) {
return false;
}
if (this.isUnassignedCollection) {
return false;
}

View File

@ -28,7 +28,11 @@
</bit-breadcrumbs>
<ng-container slot="title-suffix">
<ng-container *ngIf="collection != null && (canEditCollection || canDeleteCollection)">
<ng-container
*ngIf="
collection != null && (canEditCollection || canDeleteCollection || canViewCollectionInfo)
"
>
<button
bitIconButton="bwi-angle-down"
[bitMenuTriggerFor]="editCollectionMenu"
@ -55,9 +59,7 @@
{{ "access" | i18n }}
</button>
</ng-container>
<ng-container
*ngIf="flexibleCollectionsV1Enabled && !canEditCollection && canViewCollectionInfo"
>
<ng-container *ngIf="!canEditCollection && canViewCollectionInfo">
<button
type="button"
bitMenuItem

View File

@ -211,7 +211,10 @@ export class VaultHeaderComponent implements OnInit {
}
get canViewCollectionInfo(): boolean {
return this.collection.node.canViewCollectionInfo(this.organization);
return this.collection.node.canViewCollectionInfo(
this.organization,
this.flexibleCollectionsV1Enabled,
);
}
get canCreateCollection(): boolean {

View File

@ -92,7 +92,10 @@ export class CollectionView implements View, ITreeNodeObject {
/**
* Returns true if the user can view collection info and access in a read-only state from the individual vault
*/
canViewCollectionInfo(org: Organization | undefined): boolean {
canViewCollectionInfo(
org: Organization | undefined,
flexibleCollectionsV1Enabled: boolean,
): boolean {
return false;
}