From 6270059a5a4efad9b5a633aa2ed4b863617d87f8 Mon Sep 17 00:00:00 2001 From: Shane Melton Date: Wed, 13 Jul 2022 16:18:48 -0700 Subject: [PATCH] Refactor organization billing to use a module --- .../app/modules/loose-components.module.ts | 12 -------- .../billing-sync-api-key.component.html | 0 .../billing/billing-sync-api-key.component.ts | 0 ...rganization-billing-history.component.html | 0 .../organization-billing-history.component.ts | 0 .../organization-billing-tab.component.html | 0 .../organization-billing-tab.component.ts | 0 .../billing/organization-billing.module.ts | 29 +++++++++++++++++++ ...organization-payment-method.component.html | 0 .../organization-payment-method.component.ts | 0 .../organization-subscription.component.html | 0 .../organization-subscription.component.ts | 0 .../organization-routing.module.ts | 8 ++--- apps/web/src/app/oss.module.ts | 2 ++ 14 files changed, 35 insertions(+), 16 deletions(-) rename apps/web/src/app/{ => modules}/organizations/billing/billing-sync-api-key.component.html (100%) rename apps/web/src/app/{ => modules}/organizations/billing/billing-sync-api-key.component.ts (100%) rename apps/web/src/app/{ => modules}/organizations/billing/organization-billing-history.component.html (100%) rename apps/web/src/app/{ => modules}/organizations/billing/organization-billing-history.component.ts (100%) rename apps/web/src/app/{ => modules}/organizations/billing/organization-billing-tab.component.html (100%) rename apps/web/src/app/{ => modules}/organizations/billing/organization-billing-tab.component.ts (100%) create mode 100644 apps/web/src/app/modules/organizations/billing/organization-billing.module.ts rename apps/web/src/app/{ => modules}/organizations/billing/organization-payment-method.component.html (100%) rename apps/web/src/app/{ => modules}/organizations/billing/organization-payment-method.component.ts (100%) rename apps/web/src/app/{ => modules}/organizations/billing/organization-subscription.component.html (100%) rename apps/web/src/app/{ => modules}/organizations/billing/organization-subscription.component.ts (100%) diff --git a/apps/web/src/app/modules/loose-components.module.ts b/apps/web/src/app/modules/loose-components.module.ts index f449c0a03ea..443da003a97 100644 --- a/apps/web/src/app/modules/loose-components.module.ts +++ b/apps/web/src/app/modules/loose-components.module.ts @@ -27,11 +27,6 @@ import { FooterComponent } from "../layouts/footer.component"; import { FrontendLayoutComponent } from "../layouts/frontend-layout.component"; import { NavbarComponent } from "../layouts/navbar.component"; import { UserLayoutComponent } from "../layouts/user-layout.component"; -import { BillingSyncApiKeyComponent } from "../organizations/billing/billing-sync-api-key.component"; -import { OrganizationBillingHistoryComponent } from "../organizations/billing/organization-billing-history.component"; -import { OrganizationBillingTabComponent } from "../organizations/billing/organization-billing-tab.component"; -import { OrganizationPaymentMethodComponent } from "../organizations/billing/organization-payment-method.component"; -import { OrganizationSubscriptionComponent } from "../organizations/billing/organization-subscription.component"; import { GroupAddEditComponent as OrgGroupAddEditComponent } from "../organizations/groups/group-add-edit.component"; import { GroupsComponent as OrgGroupsComponent } from "../organizations/groups/groups.component"; import { OrganizationLayoutComponent } from "../organizations/layouts/organization-layout.component"; @@ -194,7 +189,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga AdjustSubscription, ApiKeyComponent, AttachmentsComponent, - BillingSyncApiKeyComponent, BillingSyncKeyComponent, BreachReportComponent, BulkActionsComponent, @@ -237,12 +231,8 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga OrganizationSwitcherComponent, OrgAccountComponent, OrgAddEditComponent, - OrganizationBillingTabComponent, - OrganizationPaymentMethodComponent, - OrganizationBillingHistoryComponent, OrganizationLayoutComponent, OrganizationPlansComponent, - OrganizationSubscriptionComponent, OrgAttachmentsComponent, OrgBulkConfirmComponent, OrgBulkDeactivateomponent, @@ -396,10 +386,8 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga OrganizationSwitcherComponent, OrgAccountComponent, OrgAddEditComponent, - OrganizationPaymentMethodComponent, OrganizationLayoutComponent, OrganizationPlansComponent, - OrganizationSubscriptionComponent, OrgAttachmentsComponent, OrgBulkConfirmComponent, OrgBulkDeactivateomponent, diff --git a/apps/web/src/app/organizations/billing/billing-sync-api-key.component.html b/apps/web/src/app/modules/organizations/billing/billing-sync-api-key.component.html similarity index 100% rename from apps/web/src/app/organizations/billing/billing-sync-api-key.component.html rename to apps/web/src/app/modules/organizations/billing/billing-sync-api-key.component.html diff --git a/apps/web/src/app/organizations/billing/billing-sync-api-key.component.ts b/apps/web/src/app/modules/organizations/billing/billing-sync-api-key.component.ts similarity index 100% rename from apps/web/src/app/organizations/billing/billing-sync-api-key.component.ts rename to apps/web/src/app/modules/organizations/billing/billing-sync-api-key.component.ts diff --git a/apps/web/src/app/organizations/billing/organization-billing-history.component.html b/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.html similarity index 100% rename from apps/web/src/app/organizations/billing/organization-billing-history.component.html rename to apps/web/src/app/modules/organizations/billing/organization-billing-history.component.html diff --git a/apps/web/src/app/organizations/billing/organization-billing-history.component.ts b/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.ts similarity index 100% rename from apps/web/src/app/organizations/billing/organization-billing-history.component.ts rename to apps/web/src/app/modules/organizations/billing/organization-billing-history.component.ts diff --git a/apps/web/src/app/organizations/billing/organization-billing-tab.component.html b/apps/web/src/app/modules/organizations/billing/organization-billing-tab.component.html similarity index 100% rename from apps/web/src/app/organizations/billing/organization-billing-tab.component.html rename to apps/web/src/app/modules/organizations/billing/organization-billing-tab.component.html diff --git a/apps/web/src/app/organizations/billing/organization-billing-tab.component.ts b/apps/web/src/app/modules/organizations/billing/organization-billing-tab.component.ts similarity index 100% rename from apps/web/src/app/organizations/billing/organization-billing-tab.component.ts rename to apps/web/src/app/modules/organizations/billing/organization-billing-tab.component.ts diff --git a/apps/web/src/app/modules/organizations/billing/organization-billing.module.ts b/apps/web/src/app/modules/organizations/billing/organization-billing.module.ts new file mode 100644 index 00000000000..fba14d0b2c3 --- /dev/null +++ b/apps/web/src/app/modules/organizations/billing/organization-billing.module.ts @@ -0,0 +1,29 @@ +import { NgModule } from "@angular/core"; + +import { LooseComponentsModule } from "../../loose-components.module"; +import { SharedModule } from "../../shared.module"; + +import { BillingSyncApiKeyComponent } from "./billing-sync-api-key.component"; +import { OrganizationBillingHistoryComponent } from "./organization-billing-history.component"; +import { OrganizationBillingTabComponent } from "./organization-billing-tab.component"; +import { OrganizationPaymentMethodComponent } from "./organization-payment-method.component"; +import { OrganizationSubscriptionComponent } from "./organization-subscription.component"; + +@NgModule({ + imports: [SharedModule, LooseComponentsModule], + declarations: [ + BillingSyncApiKeyComponent, + OrganizationBillingHistoryComponent, + OrganizationBillingTabComponent, + OrganizationPaymentMethodComponent, + OrganizationSubscriptionComponent, + ], + exports: [ + BillingSyncApiKeyComponent, + OrganizationBillingHistoryComponent, + OrganizationBillingTabComponent, + OrganizationPaymentMethodComponent, + OrganizationSubscriptionComponent, + ], +}) +export class OrganizationBillingModule {} diff --git a/apps/web/src/app/organizations/billing/organization-payment-method.component.html b/apps/web/src/app/modules/organizations/billing/organization-payment-method.component.html similarity index 100% rename from apps/web/src/app/organizations/billing/organization-payment-method.component.html rename to apps/web/src/app/modules/organizations/billing/organization-payment-method.component.html diff --git a/apps/web/src/app/organizations/billing/organization-payment-method.component.ts b/apps/web/src/app/modules/organizations/billing/organization-payment-method.component.ts similarity index 100% rename from apps/web/src/app/organizations/billing/organization-payment-method.component.ts rename to apps/web/src/app/modules/organizations/billing/organization-payment-method.component.ts diff --git a/apps/web/src/app/organizations/billing/organization-subscription.component.html b/apps/web/src/app/modules/organizations/billing/organization-subscription.component.html similarity index 100% rename from apps/web/src/app/organizations/billing/organization-subscription.component.html rename to apps/web/src/app/modules/organizations/billing/organization-subscription.component.html diff --git a/apps/web/src/app/organizations/billing/organization-subscription.component.ts b/apps/web/src/app/modules/organizations/billing/organization-subscription.component.ts similarity index 100% rename from apps/web/src/app/organizations/billing/organization-subscription.component.ts rename to apps/web/src/app/modules/organizations/billing/organization-subscription.component.ts diff --git a/apps/web/src/app/organizations/organization-routing.module.ts b/apps/web/src/app/organizations/organization-routing.module.ts index 102d552dfbf..e4b6962f12b 100644 --- a/apps/web/src/app/organizations/organization-routing.module.ts +++ b/apps/web/src/app/organizations/organization-routing.module.ts @@ -4,12 +4,12 @@ import { RouterModule, Routes } from "@angular/router"; import { AuthGuard } from "@bitwarden/angular/guards/auth.guard"; import { Permissions } from "@bitwarden/common/enums/permissions"; +import { OrganizationBillingHistoryComponent } from "../modules/organizations/billing/organization-billing-history.component"; +import { OrganizationBillingTabComponent } from "../modules/organizations/billing/organization-billing-tab.component"; +import { OrganizationPaymentMethodComponent } from "../modules/organizations/billing/organization-payment-method.component"; +import { OrganizationSubscriptionComponent } from "../modules/organizations/billing/organization-subscription.component"; import { OrganizationVaultModule } from "../modules/vault/modules/organization-vault/organization-vault.module"; -import { OrganizationBillingHistoryComponent } from "./billing/organization-billing-history.component"; -import { OrganizationBillingTabComponent } from "./billing/organization-billing-tab.component"; -import { OrganizationPaymentMethodComponent } from "./billing/organization-payment-method.component"; -import { OrganizationSubscriptionComponent } from "./billing/organization-subscription.component"; import { GroupsComponent } from "./groups/groups.component"; import { PermissionsGuard } from "./guards/permissions.guard"; import { OrganizationLayoutComponent } from "./layouts/organization-layout.component"; diff --git a/apps/web/src/app/oss.module.ts b/apps/web/src/app/oss.module.ts index c43f8a4d5f5..851cbaf4e9f 100644 --- a/apps/web/src/app/oss.module.ts +++ b/apps/web/src/app/oss.module.ts @@ -1,6 +1,7 @@ import { NgModule } from "@angular/core"; import { LooseComponentsModule } from "./modules/loose-components.module"; +import { OrganizationBillingModule } from "./modules/organizations/billing/organization-billing.module"; import { OrganizationCreateModule } from "./modules/organizations/create/organization-create.module"; import { OrganizationManageModule } from "./modules/organizations/manage/organization-manage.module"; import { OrganizationUserModule } from "./modules/organizations/users/organization-user.module"; @@ -21,6 +22,7 @@ import { OrganizationBadgeModule } from "./modules/vault/modules/organization-ba OrganizationManageModule, OrganizationUserModule, OrganizationCreateModule, + OrganizationBillingModule, ], exports: [ SharedModule,