From 7cf50d09dbdff8c28d3d5603a8144b063bcd62fc Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Wed, 11 May 2022 11:51:33 +1000 Subject: [PATCH] Move org vault into organization-vault module --- src/app/modules/loose-components.module.ts | 3 --- .../organization-vault}/add-edit.component.ts | 4 ++-- .../organization-vault}/attachments.component.ts | 4 ++-- .../organization-vault}/ciphers.component.ts | 4 ++-- .../organization-vault}/collections.component.ts | 4 ++-- .../organization-vault.component.ts | 9 +++++---- .../organization-vault.module.ts | 12 +++++++++++- .../layouts}/organization-switcher.component.html | 0 .../layouts}/organization-switcher.component.ts | 2 +- src/app/organizations/organization.module.ts | 14 ++------------ src/app/reports/cipher-report.component.ts | 2 +- 11 files changed, 28 insertions(+), 30 deletions(-) rename src/app/{organizations/vault => modules/vault/modules/organization-vault}/add-edit.component.ts (98%) rename src/app/{organizations/vault => modules/vault/modules/organization-vault}/attachments.component.ts (96%) rename src/app/{organizations/vault => modules/vault/modules/organization-vault}/ciphers.component.ts (97%) rename src/app/{organizations/vault => modules/vault/modules/organization-vault}/collections.component.ts (95%) rename src/app/{components => organizations/layouts}/organization-switcher.component.html (100%) rename src/app/{components => organizations/layouts}/organization-switcher.component.ts (90%) diff --git a/src/app/modules/loose-components.module.ts b/src/app/modules/loose-components.module.ts index b2d4b15d..3a230736 100644 --- a/src/app/modules/loose-components.module.ts +++ b/src/app/modules/loose-components.module.ts @@ -20,7 +20,6 @@ import { UpdateTempPasswordComponent } from "../accounts/update-temp-password.co import { VerifyEmailTokenComponent } from "../accounts/verify-email-token.component"; import { VerifyRecoverDeleteComponent } from "../accounts/verify-recover-delete.component"; import { NestedCheckboxComponent } from "../components/nested-checkbox.component"; -import { OrganizationSwitcherComponent } from "../components/organization-switcher.component"; import { PasswordRepromptComponent } from "../components/password-reprompt.component"; import { PremiumBadgeComponent } from "../components/premium-badge.component"; import { FooterComponent } from "../layouts/footer.component"; @@ -165,7 +164,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga LoginComponent, NavbarComponent, NestedCheckboxComponent, - OrganizationSwitcherComponent, GeneratorComponent, PasswordGeneratorHistoryComponent, PasswordRepromptComponent, @@ -272,7 +270,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga LoginComponent, NavbarComponent, NestedCheckboxComponent, - OrganizationSwitcherComponent, GeneratorComponent, PasswordGeneratorHistoryComponent, PasswordRepromptComponent, diff --git a/src/app/organizations/vault/add-edit.component.ts b/src/app/modules/vault/modules/organization-vault/add-edit.component.ts similarity index 98% rename from src/app/organizations/vault/add-edit.component.ts rename to src/app/modules/vault/modules/organization-vault/add-edit.component.ts index 2f86ce4e..dd4f9db9 100644 --- a/src/app/organizations/vault/add-edit.component.ts +++ b/src/app/modules/vault/modules/organization-vault/add-edit.component.ts @@ -22,11 +22,11 @@ import { Organization } from "jslib-common/models/domain/organization"; import { CipherCreateRequest } from "jslib-common/models/request/cipherCreateRequest"; import { CipherRequest } from "jslib-common/models/request/cipherRequest"; -import { AddEditComponent as BaseAddEditComponent } from "../../vault/add-edit.component"; +import { AddEditComponent as BaseAddEditComponent } from "../../../../vault/add-edit.component"; @Component({ selector: "app-org-vault-add-edit", - templateUrl: "../../vault/add-edit.component.html", + templateUrl: "../../../../vault/add-edit.component.html", }) export class AddEditComponent extends BaseAddEditComponent { organization: Organization; diff --git a/src/app/organizations/vault/attachments.component.ts b/src/app/modules/vault/modules/organization-vault/attachments.component.ts similarity index 96% rename from src/app/organizations/vault/attachments.component.ts rename to src/app/modules/vault/modules/organization-vault/attachments.component.ts index fb4b46c7..a8e040be 100644 --- a/src/app/organizations/vault/attachments.component.ts +++ b/src/app/modules/vault/modules/organization-vault/attachments.component.ts @@ -12,11 +12,11 @@ import { Cipher } from "jslib-common/models/domain/cipher"; import { Organization } from "jslib-common/models/domain/organization"; import { AttachmentView } from "jslib-common/models/view/attachmentView"; -import { AttachmentsComponent as BaseAttachmentsComponent } from "../../vault/attachments.component"; +import { AttachmentsComponent as BaseAttachmentsComponent } from "../../../../vault/attachments.component"; @Component({ selector: "app-org-vault-attachments", - templateUrl: "../../vault/attachments.component.html", + templateUrl: "../../../../vault/attachments.component.html", }) export class AttachmentsComponent extends BaseAttachmentsComponent { viewOnly = false; diff --git a/src/app/organizations/vault/ciphers.component.ts b/src/app/modules/vault/modules/organization-vault/ciphers.component.ts similarity index 97% rename from src/app/organizations/vault/ciphers.component.ts rename to src/app/modules/vault/modules/organization-vault/ciphers.component.ts index 2960b9ae..381ea260 100644 --- a/src/app/organizations/vault/ciphers.component.ts +++ b/src/app/modules/vault/modules/organization-vault/ciphers.component.ts @@ -15,11 +15,11 @@ import { TotpService } from "jslib-common/abstractions/totp.service"; import { Organization } from "jslib-common/models/domain/organization"; import { CipherView } from "jslib-common/models/view/cipherView"; -import { CiphersComponent as BaseCiphersComponent } from "../../vault/ciphers.component"; +import { CiphersComponent as BaseCiphersComponent } from "../../../../vault/ciphers.component"; @Component({ selector: "app-org-vault-ciphers", - templateUrl: "../../vault/ciphers.component.html", + templateUrl: "../../../../vault/ciphers.component.html", }) export class CiphersComponent extends BaseCiphersComponent { @Output() onEventsClicked = new EventEmitter(); diff --git a/src/app/organizations/vault/collections.component.ts b/src/app/modules/vault/modules/organization-vault/collections.component.ts similarity index 95% rename from src/app/organizations/vault/collections.component.ts rename to src/app/modules/vault/modules/organization-vault/collections.component.ts index deeaa7c7..0d4e5c34 100644 --- a/src/app/organizations/vault/collections.component.ts +++ b/src/app/modules/vault/modules/organization-vault/collections.component.ts @@ -11,11 +11,11 @@ import { Cipher } from "jslib-common/models/domain/cipher"; import { Organization } from "jslib-common/models/domain/organization"; import { CipherCollectionsRequest } from "jslib-common/models/request/cipherCollectionsRequest"; -import { CollectionsComponent as BaseCollectionsComponent } from "../../vault/collections.component"; +import { CollectionsComponent as BaseCollectionsComponent } from "../../../../vault/collections.component"; @Component({ selector: "app-org-vault-collections", - templateUrl: "../../vault/collections.component.html", + templateUrl: "../../../../vault/collections.component.html", }) export class CollectionsComponent extends BaseCollectionsComponent { organization: Organization; diff --git a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts index 318be6bc..44b4d0f2 100644 --- a/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts +++ b/src/app/modules/vault/modules/organization-vault/organization-vault.component.ts @@ -25,13 +25,14 @@ import { Organization } from "jslib-common/models/domain/organization"; import { CipherView } from "jslib-common/models/view/cipherView"; import { EntityEventsComponent } from "../../../../organizations/manage/entity-events.component"; -import { AddEditComponent } from "../../../../organizations/vault/add-edit.component"; -import { AttachmentsComponent } from "../../../../organizations/vault/attachments.component"; -import { CiphersComponent } from "../../../../organizations/vault/ciphers.component"; -import { CollectionsComponent } from "../../../../organizations/vault/collections.component"; import { VaultFilterComponent } from "../../../vault-filter/vault-filter.component"; import { VaultService } from "../../vault.service"; +import { AddEditComponent } from "./add-edit.component"; +import { AttachmentsComponent } from "./attachments.component"; +import { CiphersComponent } from "./ciphers.component"; +import { CollectionsComponent } from "./collections.component"; + const BroadcasterSubscriptionId = "OrgVaultComponent"; @Component({ diff --git a/src/app/modules/vault/modules/organization-vault/organization-vault.module.ts b/src/app/modules/vault/modules/organization-vault/organization-vault.module.ts index 4566efa9..f3b9f05f 100644 --- a/src/app/modules/vault/modules/organization-vault/organization-vault.module.ts +++ b/src/app/modules/vault/modules/organization-vault/organization-vault.module.ts @@ -2,12 +2,22 @@ import { NgModule } from "@angular/core"; import { VaultModule } from "../../vault.module"; +import { AddEditComponent } from "./add-edit.component"; +import { AttachmentsComponent } from "./attachments.component"; +import { CiphersComponent } from "./ciphers.component"; +import { CollectionsComponent } from "./collections.component"; import { OrganizationVaultRoutingModule } from "./organization-vault-routing.module"; import { OrganizationVaultComponent } from "./organization-vault.component"; @NgModule({ imports: [VaultModule, OrganizationVaultRoutingModule], - declarations: [OrganizationVaultComponent], + declarations: [ + OrganizationVaultComponent, + AddEditComponent, + AttachmentsComponent, + CiphersComponent, + CollectionsComponent, + ], exports: [OrganizationVaultComponent], }) export class OrganizationVaultModule {} diff --git a/src/app/components/organization-switcher.component.html b/src/app/organizations/layouts/organization-switcher.component.html similarity index 100% rename from src/app/components/organization-switcher.component.html rename to src/app/organizations/layouts/organization-switcher.component.html diff --git a/src/app/components/organization-switcher.component.ts b/src/app/organizations/layouts/organization-switcher.component.ts similarity index 90% rename from src/app/components/organization-switcher.component.ts rename to src/app/organizations/layouts/organization-switcher.component.ts index a71cf176..c4fe9ef8 100644 --- a/src/app/components/organization-switcher.component.ts +++ b/src/app/organizations/layouts/organization-switcher.component.ts @@ -5,7 +5,7 @@ import { OrganizationService } from "jslib-common/abstractions/organization.serv import { Utils } from "jslib-common/misc/utils"; import { Organization } from "jslib-common/models/domain/organization"; -import { NavigationPermissionsService } from "../organizations/services/navigation-permissions.service"; +import { NavigationPermissionsService } from "../services/navigation-permissions.service"; @Component({ selector: "app-organization-switcher", diff --git a/src/app/organizations/organization.module.ts b/src/app/organizations/organization.module.ts index 81453810..e32ae1ea 100644 --- a/src/app/organizations/organization.module.ts +++ b/src/app/organizations/organization.module.ts @@ -7,6 +7,7 @@ import { OrganizationBadgeModule } from "../modules/vault/modules/organization-b import { RequireSsoPolicyComponent } from "../organizations/policies/require-sso.component"; import { OrganizationLayoutComponent } from "./layouts/organization-layout.component"; +import { OrganizationSwitcherComponent } from "./layouts/organization-switcher.component"; import { BulkConfirmComponent } from "./manage/bulk/bulk-confirm.component"; import { BulkRemoveComponent } from "./manage/bulk/bulk-remove.component"; import { BulkStatusComponent } from "./manage/bulk/bulk-status.component"; @@ -55,10 +56,6 @@ import { ReusedPasswordsReportComponent } from "./tools/reused-passwords-report. import { ToolsComponent } from "./tools/tools.component"; import { UnsecuredWebsitesReportComponent } from "./tools/unsecured-websites-report.component"; import { WeakPasswordsReportComponent } from "./tools/weak-passwords-report.component"; -import { AddEditComponent } from "./vault/add-edit.component"; -import { AttachmentsComponent } from "./vault/attachments.component"; -import { CiphersComponent } from "./vault/ciphers.component"; -import { CollectionsComponent } from "./vault/collections.component"; @NgModule({ imports: [ @@ -70,17 +67,13 @@ import { CollectionsComponent } from "./vault/collections.component"; ], declarations: [ AcceptFamilySponsorshipComponent, - AddEditComponent, AdjustSubscription, - AttachmentsComponent, BillingSyncApiKeyComponent, BulkConfirmComponent, BulkRemoveComponent, BulkStatusComponent, ChangePlanComponent, - CiphersComponent, CollectionAddEditComponent, - CollectionsComponent, DeleteOrganizationComponent, DisableSendPolicyComponent, DownloadLicenseComponent, @@ -122,18 +115,15 @@ import { CollectionsComponent } from "./vault/collections.component"; UserConfirmComponent, UserGroupsComponent, WeakPasswordsReportComponent, + OrganizationSwitcherComponent, ], exports: [ - AddEditComponent, AdjustSubscription, - AttachmentsComponent, BulkConfirmComponent, BulkRemoveComponent, BulkStatusComponent, ChangePlanComponent, - CiphersComponent, CollectionAddEditComponent, - CollectionsComponent, DeleteOrganizationComponent, DisableSendPolicyComponent, DownloadLicenseComponent, diff --git a/src/app/reports/cipher-report.component.ts b/src/app/reports/cipher-report.component.ts index ebc7121e..21e32924 100644 --- a/src/app/reports/cipher-report.component.ts +++ b/src/app/reports/cipher-report.component.ts @@ -8,7 +8,7 @@ import { CipherRepromptType } from "jslib-common/enums/cipherRepromptType"; import { Organization } from "jslib-common/models/domain/organization"; import { CipherView } from "jslib-common/models/view/cipherView"; -import { AddEditComponent as OrgAddEditComponent } from "../organizations/vault/add-edit.component"; +import { AddEditComponent as OrgAddEditComponent } from "../modules/vault/modules/organization-vault/add-edit.component"; import { AddEditComponent } from "../vault/add-edit.component"; @Directive()