mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PS-1092] Organization Service Observables (#3462)
* Update imports * Implement observables in a few places * Add tests * Get all clients working * Use _destroy * Address PR feedback * Address PR feedback * Address feedback
This commit is contained in:
@@ -30,8 +30,8 @@ import { ImportService } from "@bitwarden/common/services/import.service";
|
||||
import { KeyConnectorService } from "@bitwarden/common/services/keyConnector.service";
|
||||
import { MemoryStorageService } from "@bitwarden/common/services/memoryStorage.service";
|
||||
import { NoopMessagingService } from "@bitwarden/common/services/noopMessaging.service";
|
||||
import { OrganizationService } from "@bitwarden/common/services/organization.service";
|
||||
import { OrganizationApiService } from "@bitwarden/common/services/organization/organization-api.service";
|
||||
import { OrganizationService } from "@bitwarden/common/services/organization/organization.service";
|
||||
import { PasswordGenerationService } from "@bitwarden/common/services/passwordGeneration.service";
|
||||
import { PolicyService } from "@bitwarden/common/services/policy/policy.service";
|
||||
import { ProviderService } from "@bitwarden/common/services/provider.service";
|
||||
@@ -41,6 +41,7 @@ import { SettingsService } from "@bitwarden/common/services/settings.service";
|
||||
import { StateService } from "@bitwarden/common/services/state.service";
|
||||
import { StateMigrationService } from "@bitwarden/common/services/stateMigration.service";
|
||||
import { SyncService } from "@bitwarden/common/services/sync/sync.service";
|
||||
import { SyncNotifierService } from "@bitwarden/common/services/sync/syncNotifier.service";
|
||||
import { TokenService } from "@bitwarden/common/services/token.service";
|
||||
import { TotpService } from "@bitwarden/common/services/totp.service";
|
||||
import { TwoFactorService } from "@bitwarden/common/services/twoFactor.service";
|
||||
@@ -113,6 +114,7 @@ export class Main {
|
||||
folderApiService: FolderApiService;
|
||||
userVerificationApiService: UserVerificationApiService;
|
||||
organizationApiService: OrganizationApiServiceAbstraction;
|
||||
syncNotifierService: SyncNotifierService;
|
||||
|
||||
constructor() {
|
||||
let p = null;
|
||||
@@ -191,7 +193,9 @@ export class Main {
|
||||
customUserAgent
|
||||
);
|
||||
|
||||
this.organizationApiService = new OrganizationApiService(this.apiService);
|
||||
this.syncNotifierService = new SyncNotifierService();
|
||||
|
||||
this.organizationApiService = new OrganizationApiService(this.apiService, this.syncService);
|
||||
|
||||
this.containerService = new ContainerService(this.cryptoService, this.encryptService);
|
||||
|
||||
@@ -231,7 +235,7 @@ export class Main {
|
||||
|
||||
this.providerService = new ProviderService(this.stateService);
|
||||
|
||||
this.organizationService = new OrganizationService(this.stateService);
|
||||
this.organizationService = new OrganizationService(this.stateService, this.syncNotifierService);
|
||||
|
||||
this.policyService = new PolicyService(this.stateService, this.organizationService);
|
||||
|
||||
@@ -311,9 +315,9 @@ export class Main {
|
||||
this.logService,
|
||||
this.keyConnectorService,
|
||||
this.stateService,
|
||||
this.organizationService,
|
||||
this.providerService,
|
||||
this.folderApiService,
|
||||
this.syncNotifierService,
|
||||
async (expired: boolean) => await this.logout()
|
||||
);
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ export class ConvertToKeyConnectorCommand {
|
||||
} else if (answer.convert === "leave") {
|
||||
await this.organizationApiService.leave(organization.id);
|
||||
await this.keyConnectorService.removeConvertAccountRequired();
|
||||
await this.syncService.fullSync(true);
|
||||
return Response.success();
|
||||
} else {
|
||||
await this.logout();
|
||||
|
||||
@@ -4,7 +4,7 @@ import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
|
||||
import { CollectionService } from "@bitwarden/common/abstractions/collection.service";
|
||||
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
|
||||
import { FolderService } from "@bitwarden/common/abstractions/folder/folder.service.abstraction";
|
||||
import { OrganizationService } from "@bitwarden/common/abstractions/organization.service";
|
||||
import { OrganizationService } from "@bitwarden/common/abstractions/organization/organization.service.abstraction";
|
||||
import { SearchService } from "@bitwarden/common/abstractions/search.service";
|
||||
import { StateService } from "@bitwarden/common/abstractions/state.service";
|
||||
import { TotpService } from "@bitwarden/common/abstractions/totp.service";
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as program from "commander";
|
||||
import * as inquirer from "inquirer";
|
||||
|
||||
import { ImportService } from "@bitwarden/common/abstractions/import.service";
|
||||
import { OrganizationService } from "@bitwarden/common/abstractions/organization.service";
|
||||
import { OrganizationService } from "@bitwarden/common/abstractions/organization/organization.service.abstraction";
|
||||
import { ImportType } from "@bitwarden/common/enums/importOptions";
|
||||
import { Importer } from "@bitwarden/common/importers/importer";
|
||||
import { Response } from "@bitwarden/node/cli/models/response";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
|
||||
import { CollectionService } from "@bitwarden/common/abstractions/collection.service";
|
||||
import { FolderService } from "@bitwarden/common/abstractions/folder/folder.service.abstraction";
|
||||
import { OrganizationService } from "@bitwarden/common/abstractions/organization.service";
|
||||
import { OrganizationService } from "@bitwarden/common/abstractions/organization/organization.service.abstraction";
|
||||
import { SearchService } from "@bitwarden/common/abstractions/search.service";
|
||||
import { Utils } from "@bitwarden/common/misc/utils";
|
||||
import { CollectionData } from "@bitwarden/common/models/data/collectionData";
|
||||
|
||||
Reference in New Issue
Block a user