mirror of
https://github.com/bitwarden/browser
synced 2026-03-02 19:41:26 +00:00
PR followup:
- removed `DesktopRoutedVaultFilterBridgeService` - added 'baseRoute' injectable in `RoutedVaultFilterService` - removed `folderAddEditModalRef` from `VaultComponent`
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
import { Injectable, OnDestroy } from "@angular/core";
|
||||
import { Injectable, OnDestroy, inject } from "@angular/core";
|
||||
import { ActivatedRoute, NavigationExtras } from "@angular/router";
|
||||
import { combineLatest, map, Observable, Subject, takeUntil } from "rxjs";
|
||||
|
||||
import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid";
|
||||
import { SafeInjectionToken } from "@bitwarden/ui-common";
|
||||
|
||||
import {
|
||||
isRoutedVaultFilterItemType,
|
||||
RoutedVaultFilterModel,
|
||||
} from "../models/routed-vault-filter.model";
|
||||
|
||||
/**
|
||||
* Injection token for the base route path used in vault filter navigation.
|
||||
*/
|
||||
export const VAULT_FILTER_BASE_ROUTE = new SafeInjectionToken<string>("VaultFilterBaseRoute");
|
||||
|
||||
/**
|
||||
* This service is an abstraction layer on top of ActivatedRoute that
|
||||
* encapsulates the logic of how filters are stored in the URL.
|
||||
@@ -19,6 +25,7 @@ import {
|
||||
@Injectable()
|
||||
export class RoutedVaultFilterService implements OnDestroy {
|
||||
private onDestroy = new Subject<void>();
|
||||
private baseRoute: string = inject(VAULT_FILTER_BASE_ROUTE, { optional: true }) ?? "";
|
||||
|
||||
/**
|
||||
* Filter values extracted from the URL.
|
||||
@@ -64,7 +71,7 @@ export class RoutedVaultFilterService implements OnDestroy {
|
||||
* @returns route that can be used with Router or RouterLink
|
||||
*/
|
||||
createRoute(filter: RoutedVaultFilterModel): [commands: any[], extras?: NavigationExtras] {
|
||||
const commands: string[] = [];
|
||||
const commands: string[] = this.baseRoute ? [this.baseRoute] : [];
|
||||
const extras: NavigationExtras = {
|
||||
queryParams: {
|
||||
collectionId: filter.collectionId ?? null,
|
||||
|
||||
Reference in New Issue
Block a user