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

fix bulk menu (#14079)

This commit is contained in:
Brandon Treston
2025-04-01 16:02:45 -04:00
committed by GitHub
parent 17f661e3d1
commit 027331620b
2 changed files with 19 additions and 2 deletions

View File

@@ -52,10 +52,12 @@
{{ "permission" | i18n }} {{ "permission" | i18n }}
</th> </th>
<th bitCell class="tw-w-12 tw-text-right"> <th bitCell class="tw-w-12 tw-text-right">
@let featureFlaggedDisable =
(limitItemDeletion$ | async) ? (disableMenu$ | async) : disableMenu;
<button <button
[disabled]="disabled || isEmpty || disableMenu" [disabled]="disabled || isEmpty || featureFlaggedDisable"
[bitMenuTriggerFor]="headerMenu" [bitMenuTriggerFor]="headerMenu"
[attr.title]="disableMenu ? ('missingPermissions' | i18n) : ''" [attr.title]="featureFlaggedDisable ? ('missingPermissions' | i18n) : ''"
bitIconButton="bwi-ellipsis-v" bitIconButton="bwi-ellipsis-v"
size="small" size="small"
type="button" type="button"

View File

@@ -85,6 +85,7 @@ export class VaultItemsComponent {
protected selection = new SelectionModel<VaultItem>(true, [], true); protected selection = new SelectionModel<VaultItem>(true, [], true);
protected canDeleteSelected$: Observable<boolean>; protected canDeleteSelected$: Observable<boolean>;
protected canRestoreSelected$: Observable<boolean>; protected canRestoreSelected$: Observable<boolean>;
protected disableMenu$: Observable<boolean>;
constructor( constructor(
protected cipherAuthorizationService: CipherAuthorizationService, protected cipherAuthorizationService: CipherAuthorizationService,
@@ -140,6 +141,20 @@ export class VaultItemsComponent {
}), }),
map((canRestore) => canRestore && this.showBulkTrashOptions), map((canRestore) => canRestore && this.showBulkTrashOptions),
); );
this.disableMenu$ = combineLatest([this.limitItemDeletion$, this.canDeleteSelected$]).pipe(
map(([enabled, canDelete]) => {
if (enabled) {
return (
!this.bulkMoveAllowed &&
!this.showAssignToCollections() &&
!canDelete &&
!this.showBulkEditCollectionAccess
);
}
return false;
}),
);
} }
get showExtraColumn() { get showExtraColumn() {