1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

[PM-5272] Migrate CollapsedGroupings to State Provider (#7954)

This commit is contained in:
SmithThe4th
2024-02-16 12:53:24 -05:00
committed by GitHub
parent b0dd64bab4
commit 5b652092cd
16 changed files with 245 additions and 81 deletions

View File

@@ -607,12 +607,12 @@ export default class MainBackground {
);
this.vaultFilterService = new VaultFilterService(
this.stateService,
this.organizationService,
this.folderService,
this.cipherService,
this.collectionService,
this.policyService,
this.stateProvider,
this.accountService,
);

View File

@@ -427,28 +427,14 @@ function getBgService<T>(service: keyof MainBackground) {
},
{
provide: VaultFilterService,
useFactory: (
stateService: StateServiceAbstraction,
organizationService: OrganizationService,
folderService: FolderServiceAbstraction,
policyService: PolicyService,
accountService: AccountServiceAbstraction,
) => {
return new VaultFilterService(
stateService,
organizationService,
folderService,
getBgService<CipherService>("cipherService")(),
getBgService<CollectionService>("collectionService")(),
policyService,
accountService,
);
},
useClass: VaultFilterService,
deps: [
StateServiceAbstraction,
OrganizationService,
FolderServiceAbstraction,
CipherService,
CollectionService,
PolicyService,
StateProvider,
AccountServiceAbstraction,
],
},

View File

@@ -3,7 +3,7 @@ import { VaultFilterService as BaseVaultFilterService } from "@bitwarden/angular
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
import { StateProvider } from "@bitwarden/common/platform/state";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service";
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
@@ -16,21 +16,21 @@ export class VaultFilterService extends BaseVaultFilterService {
myVault = "myVault";
constructor(
stateService: StateService,
organizationService: OrganizationService,
folderService: FolderService,
cipherService: CipherService,
collectionService: CollectionService,
policyService: PolicyService,
stateProvider: StateProvider,
private accountService: AccountService,
) {
super(
stateService,
organizationService,
folderService,
cipherService,
collectionService,
policyService,
stateProvider,
);
this.vaultFilter.myVaultOnly = false;
this.vaultFilter.selectedOrganizationId = null;