|
|
|
|
@ -5,6 +5,7 @@ import { map, shareReplay } from "rxjs";
@@ -5,6 +5,7 @@ import { map, shareReplay } from "rxjs";
|
|
|
|
|
import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; |
|
|
|
|
import { RestrictedItemTypesService } from "@bitwarden/common/vault/services/restricted-item-types.service"; |
|
|
|
|
import { NavigationModule, A11yTitleDirective } from "@bitwarden/components"; |
|
|
|
|
import { I18nPipe } from "@bitwarden/ui-common"; |
|
|
|
|
import { VaultFilter, CipherTypeFilter } from "@bitwarden/vault"; |
|
|
|
|
|
|
|
|
|
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
|
|
|
|
@ -12,7 +13,7 @@ import { VaultFilter, CipherTypeFilter } from "@bitwarden/vault";
@@ -12,7 +13,7 @@ import { VaultFilter, CipherTypeFilter } from "@bitwarden/vault";
|
|
|
|
|
@Component({ |
|
|
|
|
selector: "app-type-filter", |
|
|
|
|
templateUrl: "type-filter.component.html", |
|
|
|
|
imports: [CommonModule, A11yTitleDirective, NavigationModule], |
|
|
|
|
imports: [CommonModule, A11yTitleDirective, NavigationModule, I18nPipe], |
|
|
|
|
}) |
|
|
|
|
export class TypeFilterComponent { |
|
|
|
|
private restrictedItemTypesService: RestrictedItemTypesService = inject( |
|
|
|
|
@ -22,7 +23,7 @@ export class TypeFilterComponent {
@@ -22,7 +23,7 @@ export class TypeFilterComponent {
|
|
|
|
|
protected readonly cipherTypes = input<TreeNode<CipherTypeFilter>>(); |
|
|
|
|
protected readonly activeFilter = input<VaultFilter>(); |
|
|
|
|
|
|
|
|
|
protected applyFilter(cipherType: TreeNode<CipherTypeFilter>) { |
|
|
|
|
protected applyTypeFilter(cipherType: TreeNode<CipherTypeFilter>) { |
|
|
|
|
const filter = this.activeFilter(); |
|
|
|
|
|
|
|
|
|
if (filter) { |
|
|
|
|
@ -30,6 +31,14 @@ export class TypeFilterComponent {
@@ -30,6 +31,14 @@ export class TypeFilterComponent {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected applyAllItemsFilter() { |
|
|
|
|
const filter = this.activeFilter(); |
|
|
|
|
|
|
|
|
|
if (filter) { |
|
|
|
|
filter.selectedCipherTypeNode = this.cipherTypes(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected typeFilters$ = this.restrictedItemTypesService.restricted$.pipe( |
|
|
|
|
map((restrictedItemTypes) => |
|
|
|
|
// Filter out restricted item types from the typeFilters array
|
|
|
|
|
|