mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
[PM-22614] replace disable cipher menu with hide (#15194)
* replace the disableMenu logic to be a hideMenu with ngIf * adding disable back for disabled rows during vault sync --------- Co-authored-by: kejaeger <138028972+kejaeger@users.noreply.github.com>
This commit is contained in:
@@ -93,15 +93,15 @@
|
||||
</span>
|
||||
</button>
|
||||
</bit-menu>
|
||||
@if (!decryptionFailure && !hideMenu) {
|
||||
<button
|
||||
*ngIf="!decryptionFailure"
|
||||
[disabled]="disabled || disableMenu"
|
||||
[bitMenuTriggerFor]="cipherOptions"
|
||||
[disabled]="disabled"
|
||||
size="small"
|
||||
bitIconButton="bwi-ellipsis-v"
|
||||
type="button"
|
||||
appA11yTitle="{{ (disableMenu ? 'missingPermissions' : 'options') | i18n }}"
|
||||
appStopProp
|
||||
appA11yTitle="{{ 'options' | i18n }}"
|
||||
></button>
|
||||
<bit-menu #cipherOptions>
|
||||
<ng-container *ngIf="isNotDeletedLoginCipher">
|
||||
@@ -162,4 +162,5 @@
|
||||
</span>
|
||||
</button>
|
||||
</bit-menu>
|
||||
}
|
||||
</td>
|
||||
|
||||
@@ -189,8 +189,14 @@ export class VaultCipherRowComponent<C extends CipherViewLike> implements OnInit
|
||||
return this.i18nService.t("noAccess");
|
||||
}
|
||||
|
||||
protected get showCopyUsername(): boolean {
|
||||
const usernameCopy = CipherViewLikeUtils.hasCopyableValue(this.cipher, "username");
|
||||
return this.isNotDeletedLoginCipher && usernameCopy;
|
||||
}
|
||||
|
||||
protected get showCopyPassword(): boolean {
|
||||
return this.isNotDeletedLoginCipher && this.cipher.viewPassword;
|
||||
const passwordCopy = CipherViewLikeUtils.hasCopyableValue(this.cipher, "password");
|
||||
return this.isNotDeletedLoginCipher && this.cipher.viewPassword && passwordCopy;
|
||||
}
|
||||
|
||||
protected get showCopyTotp(): boolean {
|
||||
@@ -201,16 +207,20 @@ export class VaultCipherRowComponent<C extends CipherViewLike> implements OnInit
|
||||
return this.isNotDeletedLoginCipher && this.canLaunch;
|
||||
}
|
||||
|
||||
protected get disableMenu() {
|
||||
protected get isDeletedCanRestore(): boolean {
|
||||
return CipherViewLikeUtils.isDeleted(this.cipher) && this.canRestoreCipher;
|
||||
}
|
||||
|
||||
protected get hideMenu() {
|
||||
return !(
|
||||
this.isNotDeletedLoginCipher ||
|
||||
this.isDeletedCanRestore ||
|
||||
this.showCopyUsername ||
|
||||
this.showCopyPassword ||
|
||||
this.showCopyTotp ||
|
||||
this.showLaunchUri ||
|
||||
this.showAttachments ||
|
||||
this.showClone ||
|
||||
this.canEditCipher ||
|
||||
(CipherViewLikeUtils.isDeleted(this.cipher) && this.canRestoreCipher)
|
||||
this.canEditCipher
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user