1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

[PM-329] Detangle SearchService & CipherService (#4838)

* Remove Circular Dependency

* Fix Vault Searching

* Remove Unused cipherServiceOptions

* Add searchService Parameter to CipherService

* Fix instantiation of CipherService in test
This commit is contained in:
Justin Baur
2023-04-07 11:11:20 -04:00
committed by GitHub
parent 36de1c8e32
commit 7263579eaf
20 changed files with 52 additions and 90 deletions

View File

@@ -118,7 +118,7 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
protected i18nService: I18nService,
protected platformUtilsService: PlatformUtilsService,
protected vaultFilterService: VaultFilterService,
protected cipherService: CipherService,
cipherService: CipherService,
protected eventCollectionService: EventCollectionService,
protected totpService: TotpService,
protected stateService: StateService,
@@ -129,7 +129,7 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
private organizationService: OrganizationService,
private tokenService: TokenService
) {
super(searchService);
super(searchService, cipherService);
}
ngOnDestroy() {
@@ -223,6 +223,7 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
}
async doSearch(indexedCiphers?: CipherView[]) {
indexedCiphers = indexedCiphers ?? (await this.cipherService.getAllDecrypted());
this.ciphers = await this.searchService.searchCiphers(
this.searchText,
[this.filter, this.deletedFilter],

View File

@@ -110,7 +110,8 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnDe
(c) => c.organizationId === this.organization?.id
);
}
await this.searchService.indexCiphers(this.organization?.id, this.allCiphers);
this.searchService.indexCiphers(this.allCiphers, this.organization?.id);
}
async refreshCollections(): Promise<void> {