mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +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>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</bit-menu>
|
</bit-menu>
|
||||||
|
@if (!decryptionFailure && !hideMenu) {
|
||||||
<button
|
<button
|
||||||
*ngIf="!decryptionFailure"
|
|
||||||
[disabled]="disabled || disableMenu"
|
|
||||||
[bitMenuTriggerFor]="cipherOptions"
|
[bitMenuTriggerFor]="cipherOptions"
|
||||||
|
[disabled]="disabled"
|
||||||
size="small"
|
size="small"
|
||||||
bitIconButton="bwi-ellipsis-v"
|
bitIconButton="bwi-ellipsis-v"
|
||||||
type="button"
|
type="button"
|
||||||
appA11yTitle="{{ (disableMenu ? 'missingPermissions' : 'options') | i18n }}"
|
|
||||||
appStopProp
|
appStopProp
|
||||||
|
appA11yTitle="{{ 'options' | i18n }}"
|
||||||
></button>
|
></button>
|
||||||
<bit-menu #cipherOptions>
|
<bit-menu #cipherOptions>
|
||||||
<ng-container *ngIf="isNotDeletedLoginCipher">
|
<ng-container *ngIf="isNotDeletedLoginCipher">
|
||||||
@@ -162,4 +162,5 @@
|
|||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</bit-menu>
|
</bit-menu>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -189,8 +189,14 @@ export class VaultCipherRowComponent<C extends CipherViewLike> implements OnInit
|
|||||||
return this.i18nService.t("noAccess");
|
return this.i18nService.t("noAccess");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected get showCopyUsername(): boolean {
|
||||||
|
const usernameCopy = CipherViewLikeUtils.hasCopyableValue(this.cipher, "username");
|
||||||
|
return this.isNotDeletedLoginCipher && usernameCopy;
|
||||||
|
}
|
||||||
|
|
||||||
protected get showCopyPassword(): boolean {
|
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 {
|
protected get showCopyTotp(): boolean {
|
||||||
@@ -201,16 +207,20 @@ export class VaultCipherRowComponent<C extends CipherViewLike> implements OnInit
|
|||||||
return this.isNotDeletedLoginCipher && this.canLaunch;
|
return this.isNotDeletedLoginCipher && this.canLaunch;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get disableMenu() {
|
protected get isDeletedCanRestore(): boolean {
|
||||||
|
return CipherViewLikeUtils.isDeleted(this.cipher) && this.canRestoreCipher;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected get hideMenu() {
|
||||||
return !(
|
return !(
|
||||||
this.isNotDeletedLoginCipher ||
|
this.isDeletedCanRestore ||
|
||||||
|
this.showCopyUsername ||
|
||||||
this.showCopyPassword ||
|
this.showCopyPassword ||
|
||||||
this.showCopyTotp ||
|
this.showCopyTotp ||
|
||||||
this.showLaunchUri ||
|
this.showLaunchUri ||
|
||||||
this.showAttachments ||
|
this.showAttachments ||
|
||||||
this.showClone ||
|
this.showClone ||
|
||||||
this.canEditCipher ||
|
this.canEditCipher
|
||||||
(CipherViewLikeUtils.isDeleted(this.cipher) && this.canRestoreCipher)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user