From 092a2ba984342caa7c507c295bf61f1f25d27b31 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Mon, 27 Mar 2023 14:38:57 -0500 Subject: [PATCH] refactor: move organization service and organization-user response to admin-console, refs AC-1202 (#5055) --- .../service-factories/organization-service.factory.ts | 2 +- .../services/browser-organization.service.ts | 2 +- apps/browser/src/background/main.background.ts | 2 +- apps/browser/src/popup/services/services.module.ts | 2 +- .../models/response/organization-user.response.ts | 2 +- apps/cli/src/commands/list.command.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename apps/browser/src/{ => admin-console}/services/browser-organization.service.ts (84%) rename apps/cli/src/{ => admin-console}/models/response/organization-user.response.ts (87%) diff --git a/apps/browser/src/admin-console/background/service-factories/organization-service.factory.ts b/apps/browser/src/admin-console/background/service-factories/organization-service.factory.ts index 95204e8d5a..454b1ce9cd 100644 --- a/apps/browser/src/admin-console/background/service-factories/organization-service.factory.ts +++ b/apps/browser/src/admin-console/background/service-factories/organization-service.factory.ts @@ -9,7 +9,7 @@ import { stateServiceFactory, StateServiceInitOptions, } from "../../../background/service_factories/state-service.factory"; -import { BrowserOrganizationService } from "../../../services/browser-organization.service"; +import { BrowserOrganizationService } from "../../services/browser-organization.service"; type OrganizationServiceFactoryOptions = FactoryOptions; diff --git a/apps/browser/src/services/browser-organization.service.ts b/apps/browser/src/admin-console/services/browser-organization.service.ts similarity index 84% rename from apps/browser/src/services/browser-organization.service.ts rename to apps/browser/src/admin-console/services/browser-organization.service.ts index bff4e18b10..3b0ae245a6 100644 --- a/apps/browser/src/services/browser-organization.service.ts +++ b/apps/browser/src/admin-console/services/browser-organization.service.ts @@ -3,7 +3,7 @@ import { BehaviorSubject } from "rxjs"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { OrganizationService } from "@bitwarden/common/admin-console/services/organization/organization.service"; -import { browserSession, sessionSync } from "../decorators/session-sync-observable"; +import { browserSession, sessionSync } from "../../decorators/session-sync-observable"; @browserSession export class BrowserOrganizationService extends OrganizationService { diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 52bd993725..3687bcf006 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -87,6 +87,7 @@ import { FolderApiService } from "@bitwarden/common/vault/services/folder/folder import { SyncNotifierService } from "@bitwarden/common/vault/services/sync/sync-notifier.service"; import { SyncService } from "@bitwarden/common/vault/services/sync/sync.service"; +import { BrowserOrganizationService } from "../admin-console/services/browser-organization.service"; import { BrowserPolicyService } from "../admin-console/services/browser-policy.service"; import ContextMenusBackground from "../autofill/background/context-menus.background"; import NotificationBackground from "../autofill/background/notification.background"; @@ -104,7 +105,6 @@ import { Account } from "../models/account"; import { BrowserStateService as StateServiceAbstraction } from "../services/abstractions/browser-state.service"; import { BrowserEnvironmentService } from "../services/browser-environment.service"; import { BrowserI18nService } from "../services/browser-i18n.service"; -import { BrowserOrganizationService } from "../services/browser-organization.service"; import { BrowserSettingsService } from "../services/browser-settings.service"; import { BrowserStateService } from "../services/browser-state.service"; import { BrowserCryptoService } from "../services/browserCrypto.service"; diff --git a/apps/browser/src/popup/services/services.module.ts b/apps/browser/src/popup/services/services.module.ts index 81d7644777..ad23d4d2a2 100644 --- a/apps/browser/src/popup/services/services.module.ts +++ b/apps/browser/src/popup/services/services.module.ts @@ -74,6 +74,7 @@ import { PasswordRepromptService as PasswordRepromptServiceAbstraction } from "@ import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { FolderApiService } from "@bitwarden/common/vault/services/folder/folder-api.service"; +import { BrowserOrganizationService } from "../../admin-console/services/browser-organization.service"; import { BrowserPolicyService } from "../../admin-console/services/browser-policy.service"; import { LockGuardService, UnauthGuardService } from "../../auth/popup/services"; import { AutofillService } from "../../autofill/services/abstractions/autofill.service"; @@ -84,7 +85,6 @@ import { BrowserStateService as StateServiceAbstraction } from "../../services/a import { BrowserConfigService } from "../../services/browser-config.service"; import { BrowserEnvironmentService } from "../../services/browser-environment.service"; import { BrowserI18nService } from "../../services/browser-i18n.service"; -import { BrowserOrganizationService } from "../../services/browser-organization.service"; import { BrowserSettingsService } from "../../services/browser-settings.service"; import { BrowserStateService } from "../../services/browser-state.service"; import { BrowserFileDownloadService } from "../../services/browserFileDownloadService"; diff --git a/apps/cli/src/models/response/organization-user.response.ts b/apps/cli/src/admin-console/models/response/organization-user.response.ts similarity index 87% rename from apps/cli/src/models/response/organization-user.response.ts rename to apps/cli/src/admin-console/models/response/organization-user.response.ts index 1a45deca24..72fd42d432 100644 --- a/apps/cli/src/models/response/organization-user.response.ts +++ b/apps/cli/src/admin-console/models/response/organization-user.response.ts @@ -1,7 +1,7 @@ import { OrganizationUserStatusType } from "@bitwarden/common/admin-console/enums/organization-user-status-type"; import { OrganizationUserType } from "@bitwarden/common/admin-console/enums/organization-user-type"; -import { BaseResponse } from "./base.response"; +import { BaseResponse } from "../../../models/response/base.response"; export class OrganizationUserResponse implements BaseResponse { object: string; diff --git a/apps/cli/src/commands/list.command.ts b/apps/cli/src/commands/list.command.ts index 005cac721d..ade81aac02 100644 --- a/apps/cli/src/commands/list.command.ts +++ b/apps/cli/src/commands/list.command.ts @@ -16,10 +16,10 @@ import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folde import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { CollectionResponse } from "../admin-console/models/response/collection.response"; +import { OrganizationUserResponse } from "../admin-console/models/response/organization-user.response"; import { OrganizationResponse } from "../admin-console/models/response/organization.response"; import { Response } from "../models/response"; import { ListResponse } from "../models/response/list.response"; -import { OrganizationUserResponse } from "../models/response/organization-user.response"; import { CliUtils } from "../utils"; import { CipherResponse } from "../vault/models/cipher.response"; import { FolderResponse } from "../vault/models/folder.response";