mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
PM-14914/ssh-key-item-type-filtering-web (#11990)
This commit is contained in:
@@ -68,6 +68,9 @@ export class VaultFilterComponent implements OnInit, OnDestroy {
|
|||||||
if (this.activeFilter.cipherType === CipherType.SecureNote) {
|
if (this.activeFilter.cipherType === CipherType.SecureNote) {
|
||||||
return "searchSecureNote";
|
return "searchSecureNote";
|
||||||
}
|
}
|
||||||
|
if (this.activeFilter.cipherType === CipherType.SshKey) {
|
||||||
|
return "searchSshKey";
|
||||||
|
}
|
||||||
if (this.activeFilter.selectedFolderNode?.node) {
|
if (this.activeFilter.selectedFolderNode?.node) {
|
||||||
return "searchFolder";
|
return "searchFolder";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,6 +306,12 @@ export class VaultFilterService implements VaultFilterServiceAbstraction {
|
|||||||
type: CipherType.SecureNote,
|
type: CipherType.SecureNote,
|
||||||
icon: "bwi-sticky-note",
|
icon: "bwi-sticky-note",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "sshKey",
|
||||||
|
name: this.i18nService.t("typeSshKey"),
|
||||||
|
type: CipherType.SshKey,
|
||||||
|
icon: "bwi-key",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.buildTypeTree(
|
return this.buildTypeTree(
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ export function createFilterFunction(filter: RoutedVaultFilterModel): FilterFunc
|
|||||||
if (filter.type === "note" && cipher.type !== CipherType.SecureNote) {
|
if (filter.type === "note" && cipher.type !== CipherType.SecureNote) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (filter.type === "sshKey" && cipher.type !== CipherType.SshKey) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (filter.type === "trash" && !cipher.isDeleted) {
|
if (filter.type === "trash" && !cipher.isDeleted) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
export const All = "all";
|
export const All = "all";
|
||||||
|
|
||||||
// TODO: Remove `All` when moving to vertical navigation.
|
// 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];
|
export type RoutedVaultFilterItemType = (typeof itemTypes)[number];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user