diff --git a/apps/web/src/app/modules/billing/billing.component.html b/apps/web/src/app/modules/billing/billing.component.html new file mode 100644 index 00000000000..865c234c006 --- /dev/null +++ b/apps/web/src/app/modules/billing/billing.component.html @@ -0,0 +1,48 @@ +
diff --git a/apps/web/src/app/modules/billing/billing.component.ts b/apps/web/src/app/modules/billing/billing.component.ts new file mode 100644 index 00000000000..ed0eb7892e7 --- /dev/null +++ b/apps/web/src/app/modules/billing/billing.component.ts @@ -0,0 +1,68 @@ +import { Component, EventEmitter, Input, Output } from "@angular/core"; +import { FormBuilder, FormGroup } from "@angular/forms"; +import { Router } from "@angular/router"; + +import { ApiService } from "@bitwarden/common/abstractions/api.service"; +import { CryptoService } from "@bitwarden/common/abstractions/crypto.service"; +import { I18nService } from "@bitwarden/common/abstractions/i18n.service"; +import { LogService } from "@bitwarden/common/abstractions/log.service"; +import { MessagingService } from "@bitwarden/common/abstractions/messaging.service"; +import { OrganizationService } from "@bitwarden/common/abstractions/organization.service"; +import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service"; +import { PolicyService } from "@bitwarden/common/abstractions/policy.service"; +import { SyncService } from "@bitwarden/common/abstractions/sync.service"; + +import { OrganizationPlansComponent } from "src/app/settings/organization-plans.component"; + +@Component({ + selector: "app-billing", + templateUrl: "./billing.component.html", +}) +export class BillingComponent extends OrganizationPlansComponent { + @Input() orgInfoForm: FormGroup; + @Output() previousStep = new EventEmitter(); + + constructor( + apiService: ApiService, + i18nService: I18nService, + platformUtilsService: PlatformUtilsService, + cryptoService: CryptoService, + router: Router, + syncService: SyncService, + policyService: PolicyService, + organizationService: OrganizationService, + logService: LogService, + messagingService: MessagingService, + formBuilder: FormBuilder + ) { + super( + apiService, + i18nService, + platformUtilsService, + cryptoService, + router, + syncService, + policyService, + organizationService, + logService, + messagingService, + formBuilder + ); + } + + async ngOnInit() { + this.formGroup.patchValue({ + name: this.orgInfoForm.get("name")?.value, + billingEmail: this.orgInfoForm.get("email")?.value, + additionalSeats: 1, + plan: this.plan, + product: this.product, + }); + this.isInTrialFlow = true; + await super.ngOnInit(); + } + + stepBack() { + this.previousStep.emit(); + } +} diff --git a/apps/web/src/app/modules/billing/billing.module.ts b/apps/web/src/app/modules/billing/billing.module.ts new file mode 100644 index 00000000000..dc8b9f1f37c --- /dev/null +++ b/apps/web/src/app/modules/billing/billing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from "@angular/core"; + +import { SharedModule } from "../shared.module"; + +import { BillingComponent } from "./billing.component"; + +@NgModule({ + imports: [SharedModule], + declarations: [BillingComponent], + exports: [BillingComponent], +}) +export class BillingModule {} diff --git a/apps/web/src/app/modules/loose-components.module.ts b/apps/web/src/app/modules/loose-components.module.ts index a84ac4fb9a7..37b6d8172ff 100644 --- a/apps/web/src/app/modules/loose-components.module.ts +++ b/apps/web/src/app/modules/loose-components.module.ts @@ -114,7 +114,6 @@ import { EmergencyAccessComponent } from "../settings/emergency-access.component import { EmergencyAddEditComponent } from "../settings/emergency-add-edit.component"; import { OrganizationPlansComponent } from "../settings/organization-plans.component"; import { PaymentMethodComponent } from "../settings/payment-method.component"; -import { PaymentComponent } from "../settings/payment.component"; import { PreferencesComponent } from "../settings/preferences.component"; import { PremiumComponent } from "../settings/premium.component"; import { ProfileComponent } from "../settings/profile.component"; @@ -125,7 +124,6 @@ import { SettingsComponent } from "../settings/settings.component"; import { SponsoredFamiliesComponent } from "../settings/sponsored-families.component"; import { SponsoringOrgRowComponent } from "../settings/sponsoring-org-row.component"; import { SubscriptionComponent } from "../settings/subscription.component"; -import { TaxInfoComponent } from "../settings/tax-info.component"; import { TwoFactorAuthenticatorComponent } from "../settings/two-factor-authenticator.component"; import { TwoFactorDuoComponent } from "../settings/two-factor-duo.component"; import { TwoFactorEmailComponent } from "../settings/two-factor-email.component"; @@ -271,7 +269,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga PasswordGeneratorHistoryComponent, PasswordGeneratorPolicyComponent, PasswordRepromptComponent, - PaymentComponent, PaymentMethodComponent, PersonalOwnershipPolicyComponent, PreferencesComponent, @@ -304,7 +301,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga SponsoringOrgRowComponent, SsoComponent, SubscriptionComponent, - TaxInfoComponent, ToolsComponent, TwoFactorAuthenticationPolicyComponent, TwoFactorAuthenticatorComponent, @@ -425,7 +421,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga PasswordGeneratorHistoryComponent, PasswordGeneratorPolicyComponent, PasswordRepromptComponent, - PaymentComponent, PaymentMethodComponent, PersonalOwnershipPolicyComponent, PreferencesComponent, @@ -458,7 +453,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga SponsoringOrgRowComponent, SsoComponent, SubscriptionComponent, - TaxInfoComponent, ToolsComponent, TwoFactorAuthenticationPolicyComponent, TwoFactorAuthenticatorComponent, diff --git a/apps/web/src/app/modules/shared.module.ts b/apps/web/src/app/modules/shared.module.ts index 1bfbe632918..79f967f23a7 100644 --- a/apps/web/src/app/modules/shared.module.ts +++ b/apps/web/src/app/modules/shared.module.ts @@ -67,6 +67,8 @@ import { } from "@bitwarden/components"; import { PasswordStrengthComponent } from "../components/password-strength.component"; +import { PaymentComponent } from "../settings/payment.component"; +import { TaxInfoComponent } from "../settings/tax-info.component"; registerLocaleData(localeAf, "af"); registerLocaleData(localeAz, "az"); @@ -120,7 +122,7 @@ registerLocaleData(localeZhCn, "zh-CN"); registerLocaleData(localeZhTw, "zh-TW"); @NgModule({ - declarations: [PasswordStrengthComponent], + declarations: [PasswordStrengthComponent, PaymentComponent, TaxInfoComponent], imports: [ CommonModule, DragDropModule, @@ -155,8 +157,10 @@ registerLocaleData(localeZhTw, "zh-TW"); ButtonModule, MenuModule, FormFieldModule, - PasswordStrengthComponent, SubmitButtonModule, + PasswordStrengthComponent, + PaymentComponent, + TaxInfoComponent, ], providers: [DatePipe], bootstrap: [], diff --git a/apps/web/src/app/modules/trial-initiation/trial-initiation.component.html b/apps/web/src/app/modules/trial-initiation/trial-initiation.component.html index 25037ce8550..2c24377e7d0 100644 --- a/apps/web/src/app/modules/trial-initiation/trial-initiation.component.html +++ b/apps/web/src/app/modules/trial-initiation/trial-initiation.component.html @@ -57,11 +57,15 @@ Next -This is content of "Step 3"
- - +