1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-28 15:23:53 +00:00

[PM-30889] Remove clone option from archive item desktop (#18457)

* remove clone option from archive item desktop for users who lose premium status
This commit is contained in:
Jason Ng
2026-01-22 08:58:17 -05:00
committed by GitHub
parent 1ccacb03a6
commit eee6fb895c
2 changed files with 18 additions and 9 deletions

View File

@@ -36,15 +36,11 @@
>
<i class="bwi bwi-undo bwi-fw bwi-lg" aria-hidden="true"></i>
</button>
<button
type="button"
class="primary"
*ngIf="cipher.id && !cipher?.organizationId && !cipher.isDeleted && action === 'view'"
(click)="clone()"
appA11yTitle="{{ 'clone' | i18n }}"
>
<i class="bwi bwi-files bwi-fw bwi-lg" aria-hidden="true"></i>
</button>
@if (showCloneOption) {
<button type="button" class="primary" (click)="clone()" appA11yTitle="{{ 'clone' | i18n }}">
<i class="bwi bwi-files bwi-fw bwi-lg" aria-hidden="true"></i>
</button>
}
</ng-container>
<div class="right" *ngIf="hasFooterAction">
<button

View File

@@ -75,6 +75,7 @@ export class ItemFooterComponent implements OnInit, OnChanges {
protected showArchiveButton = false;
protected showUnarchiveButton = false;
protected userCanArchive = false;
constructor(
protected cipherService: CipherService,
@@ -134,6 +135,16 @@ export class ItemFooterComponent implements OnInit, OnChanges {
);
}
protected get showCloneOption() {
return (
this.cipher.id &&
!this.cipher?.organizationId &&
!this.cipher.isDeleted &&
this.action === "view" &&
(!this.cipher.isArchived || this.userCanArchive)
);
}
cancel() {
this.onCancel.emit(this.cipher);
}
@@ -241,6 +252,8 @@ export class ItemFooterComponent implements OnInit, OnChanges {
),
);
this.userCanArchive = userCanArchive;
this.showArchiveButton =
cipherCanBeArchived && userCanArchive && this.action === "view" && !this.cipher.isArchived;