1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-28 10:33:31 +00:00

Merge remote-tracking branch 'origin' into auth/pm-14943/auth-request-extension-dialog-approve

This commit is contained in:
Patrick Pimentel
2025-09-02 17:19:29 -04:00
154 changed files with 22618 additions and 887 deletions

View File

@@ -118,15 +118,18 @@ describe("VaultFilter", () => {
});
describe("given an organizational cipher (with organization and collections)", () => {
const collection1 = "e9652fc0-1fe4-48d5-a3d8-d821e32fbd98";
const collection2 = "42a971a5-8c16-48a3-a725-4be27cd99bc9";
const cipher = createCipher({
organizationId: "organizationId",
collectionIds: ["collectionId", "anotherId"],
collectionIds: [collection1, collection2],
});
it("should return true when filter matches collection id", () => {
const filterFunction = createFilterFunction({
selectedCollection: true,
selectedCollectionId: "collectionId",
selectedCollectionId: collection1,
});
const result = filterFunction(cipher);
@@ -137,7 +140,7 @@ describe("VaultFilter", () => {
it("should return false when filter does not match collection id", () => {
const filterFunction = createFilterFunction({
selectedCollection: true,
selectedCollectionId: "nonMatchingId",
selectedCollectionId: "1ea7ad96-3fc1-4567-8fe5-91aa9f697fd1",
});
const result = filterFunction(cipher);

View File

@@ -1,5 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { asUuid } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
import { CipherType } from "@bitwarden/common/vault/enums";
import {
CipherViewLike,
@@ -65,7 +66,8 @@ export class VaultFilter {
}
if (this.selectedCollection && this.selectedCollectionId != null && cipherPassesFilter) {
cipherPassesFilter =
cipher.collectionIds != null && cipher.collectionIds.includes(this.selectedCollectionId);
cipher.collectionIds != null &&
cipher.collectionIds.includes(asUuid(this.selectedCollectionId));
}
if (this.selectedOrganizationId != null && cipherPassesFilter) {
cipherPassesFilter = cipher.organizationId === this.selectedOrganizationId;