1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 06:43:35 +00:00

PM-14914/ssh-key-item-type-filtering-web (#11990)

This commit is contained in:
aj-bw
2024-11-14 10:05:43 -05:00
committed by GitHub
parent 2e6d98938a
commit a08c9776cb
4 changed files with 22 additions and 1 deletions

View File

@@ -68,6 +68,9 @@ export class VaultFilterComponent implements OnInit, OnDestroy {
if (this.activeFilter.cipherType === CipherType.SecureNote) {
return "searchSecureNote";
}
if (this.activeFilter.cipherType === CipherType.SshKey) {
return "searchSshKey";
}
if (this.activeFilter.selectedFolderNode?.node) {
return "searchFolder";
}

View File

@@ -306,6 +306,12 @@ export class VaultFilterService implements VaultFilterServiceAbstraction {
type: CipherType.SecureNote,
icon: "bwi-sticky-note",
},
{
id: "sshKey",
name: this.i18nService.t("typeSshKey"),
type: CipherType.SshKey,
icon: "bwi-key",
},
];
return this.buildTypeTree(

View File

@@ -23,6 +23,9 @@ export function createFilterFunction(filter: RoutedVaultFilterModel): FilterFunc
if (filter.type === "note" && cipher.type !== CipherType.SecureNote) {
return false;
}
if (filter.type === "sshKey" && cipher.type !== CipherType.SshKey) {
return false;
}
if (filter.type === "trash" && !cipher.isDeleted) {
return false;
}

View File

@@ -1,7 +1,16 @@
export const All = "all";
// TODO: Remove `All` when moving to vertical navigation.
const itemTypes = ["favorites", "login", "card", "identity", "note", "trash", All] as const;
const itemTypes = [
"favorites",
"login",
"card",
"identity",
"note",
"sshKey",
"trash",
All,
] as const;
export type RoutedVaultFilterItemType = (typeof itemTypes)[number];