mirror of
https://github.com/bitwarden/browser
synced 2026-02-26 17:43:22 +00:00
Merge branch 'main' into PM-29919-Add-dropdown-to-select-email-verification-and-emails-field-to-Send-when-creating-or-editing-a-Send
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
</bit-callout>
|
||||
|
||||
@if (SendUIRefresh$ | async) {
|
||||
<div class="tw-mb-4 tw-max-w-md">
|
||||
<div class="tw-mb-4">
|
||||
<bit-search
|
||||
[(ngModel)]="searchText"
|
||||
[placeholder]="'searchSends' | i18n"
|
||||
|
||||
@@ -142,4 +142,45 @@ describe("VaultCipherRowComponent", () => {
|
||||
expect(overlayContent).not.toContain('appcopyfield="password"');
|
||||
});
|
||||
});
|
||||
|
||||
describe("showAssignToCollections", () => {
|
||||
let archivedCipher: CipherView;
|
||||
|
||||
beforeEach(() => {
|
||||
archivedCipher = new CipherView();
|
||||
archivedCipher.id = "cipher-1";
|
||||
archivedCipher.name = "Test Cipher";
|
||||
archivedCipher.type = CipherType.Login;
|
||||
archivedCipher.organizationId = "org-1";
|
||||
archivedCipher.deletedDate = null;
|
||||
archivedCipher.archivedDate = new Date();
|
||||
|
||||
component.cipher = archivedCipher;
|
||||
component.organizations = [{ id: "org-1" } as any];
|
||||
component.canAssignCollections = true;
|
||||
component.disabled = false;
|
||||
});
|
||||
|
||||
it("returns true when cipher is archived and conditions are met", () => {
|
||||
expect(component["showAssignToCollections"]).toBe(true);
|
||||
});
|
||||
|
||||
it("returns false when cipher is deleted", () => {
|
||||
archivedCipher.deletedDate = new Date();
|
||||
|
||||
expect(component["showAssignToCollections"]).toBe(false);
|
||||
});
|
||||
|
||||
it("returns false when user cannot assign collections", () => {
|
||||
component.canAssignCollections = false;
|
||||
|
||||
expect(component["showAssignToCollections"]).toBe(false);
|
||||
});
|
||||
|
||||
it("returns false when there are no organizations", () => {
|
||||
component.organizations = [];
|
||||
|
||||
expect(component["showAssignToCollections"]).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -217,11 +217,7 @@ export class VaultCipherRowComponent<C extends CipherViewLike> implements OnInit
|
||||
return CipherViewLikeUtils.decryptionFailure(this.cipher);
|
||||
}
|
||||
|
||||
// Do Not show Assign to Collections option if item is archived
|
||||
protected get showAssignToCollections() {
|
||||
if (CipherViewLikeUtils.isArchived(this.cipher)) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
this.organizations?.length &&
|
||||
this.canAssignCollections &&
|
||||
|
||||
@@ -12647,5 +12647,8 @@
|
||||
},
|
||||
"youHavePremium": {
|
||||
"message": "You have Premium"
|
||||
},
|
||||
"emailProtected": {
|
||||
"message": "Email protected"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user