From f4254ba9202acb5fbfb75bdbfeae8439d57fc04c Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:26:19 -0500 Subject: [PATCH] [PM-21821] Provider portal takeover states (#15725) * Updates: - Update simple dialog to disallow user to close the dialog on acceptance - Split payment components to provide a "require" component that cannot be closed out of - Add provider warning service to manage the various provider warnings * Fix test * Will's feedback and sync on payment method success --- .../change-payment-method-dialog.component.ts | 80 ++------ .../app/billing/payment/components/index.ts | 2 + ...require-payment-method-dialog.component.ts | 77 ++++++++ .../submit-payment-method-dialog.component.ts | 75 +++++++ apps/web/src/locales/en/messages.json | 30 +++ .../providers/providers-layout.component.ts | 21 +- .../provider-warnings.service.spec.ts | 187 ++++++++++++++++++ .../services/provider-warnings.service.ts | 104 ++++++++++ libs/common/src/enums/feature-flag.enum.ts | 2 + .../simple-configurable-dialog.component.ts | 4 +- 10 files changed, 518 insertions(+), 64 deletions(-) create mode 100644 apps/web/src/app/billing/payment/components/require-payment-method-dialog.component.ts create mode 100644 apps/web/src/app/billing/payment/components/submit-payment-method-dialog.component.ts create mode 100644 bitwarden_license/bit-web/src/app/billing/providers/services/provider-warnings.service.spec.ts create mode 100644 bitwarden_license/bit-web/src/app/billing/providers/services/provider-warnings.service.ts diff --git a/apps/web/src/app/billing/payment/components/change-payment-method-dialog.component.ts b/apps/web/src/app/billing/payment/components/change-payment-method-dialog.component.ts index ff5156ba636..15c63d8f99f 100644 --- a/apps/web/src/app/billing/payment/components/change-payment-method-dialog.component.ts +++ b/apps/web/src/app/billing/payment/components/change-payment-method-dialog.component.ts @@ -1,5 +1,5 @@ import { DIALOG_DATA } from "@angular/cdk/dialog"; -import { Component, Inject, ViewChild } from "@angular/core"; +import { Component, Inject } from "@angular/core"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { DialogConfig, DialogRef, DialogService, ToastService } from "@bitwarden/components"; @@ -7,19 +7,17 @@ import { DialogConfig, DialogRef, DialogService, ToastService } from "@bitwarden import { SharedModule } from "../../../shared"; import { BillingClient } from "../../services"; import { BillableEntity } from "../../types"; -import { MaskedPaymentMethod } from "../types"; import { EnterPaymentMethodComponent } from "./enter-payment-method.component"; +import { + SubmitPaymentMethodDialogComponent, + SubmitPaymentMethodDialogResult, +} from "./submit-payment-method-dialog.component"; type DialogParams = { owner: BillableEntity; }; -type DialogResult = - | { type: "cancelled" } - | { type: "error" } - | { type: "success"; paymentMethod: MaskedPaymentMethod }; - @Component({ template: `