mirror of
https://github.com/bitwarden/browser
synced 2026-01-05 18:13:26 +00:00
[AC-1758] Show banner when organization requires a payment method (#7088)
* Add billing banner states to account settings * Add billing banner service * Add add-payment-method-banners.component * Use add-payment-method-banners.component in layouts * Clear banner on payment method addition * Ran prettier after CI update * Finalize banners styling/translations * Will's (non-Tailwind) feedback * Review feedback * Review feedback * Review feedback * Replace StateService with StateProvider in BillingBannerService * Remove StateService methods
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component, EventEmitter, Input, Output, ViewChild } from "@angular/core
|
||||
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction";
|
||||
import { BillingBannerServiceAbstraction } from "@bitwarden/common/billing/abstractions/billing-banner.service.abstraction";
|
||||
import { PaymentMethodType } from "@bitwarden/common/billing/enums";
|
||||
import { PaymentRequest } from "@bitwarden/common/billing/models/request/payment.request";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
@@ -33,6 +34,7 @@ export class AdjustPaymentComponent {
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private logService: LogService,
|
||||
private organizationApiService: OrganizationApiServiceAbstraction,
|
||||
private billingBannerService: BillingBannerServiceAbstraction,
|
||||
) {}
|
||||
|
||||
async submit() {
|
||||
@@ -56,6 +58,9 @@ export class AdjustPaymentComponent {
|
||||
}
|
||||
});
|
||||
await this.formPromise;
|
||||
if (this.organizationId) {
|
||||
await this.billingBannerService.setPaymentMethodBannerState(this.organizationId, false);
|
||||
}
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user