1
0
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:
bmbitwarden
2026-01-15 15:51:00 -05:00
committed by GitHub
28 changed files with 955 additions and 215 deletions

View File

@@ -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"

View File

@@ -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();
});
});
});

View File

@@ -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 &&

View File

@@ -12647,5 +12647,8 @@
},
"youHavePremium": {
"message": "You have Premium"
},
"emailProtected": {
"message": "Email protected"
}
}