mirror of
https://github.com/bitwarden/browser
synced 2026-02-18 18:33:50 +00:00
Remove FF: pm-22415-tax-id-warnings (#17871)
This commit is contained in:
committed by
jaasen-livefront
parent
ac3d9ce392
commit
f5bc83c5f7
@@ -29,7 +29,7 @@
|
||||
<app-display-billing-address
|
||||
[subscriber]="view.organization"
|
||||
[billingAddress]="view.billingAddress"
|
||||
[taxIdWarning]="enableTaxIdWarning ? view.taxIdWarning : null"
|
||||
[taxIdWarning]="view.taxIdWarning"
|
||||
(updated)="setBillingAddress($event)"
|
||||
></app-display-billing-address>
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ import { OrganizationService } from "@bitwarden/common/admin-console/abstraction
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||
import { getById } from "@bitwarden/common/platform/misc";
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
import { CommandDefinition, MessageListener } from "@bitwarden/messaging";
|
||||
@@ -118,12 +116,9 @@ export class OrganizationPaymentDetailsComponent implements OnInit, OnDestroy {
|
||||
|
||||
private destroy$ = new Subject<void>();
|
||||
|
||||
protected enableTaxIdWarning!: boolean;
|
||||
|
||||
constructor(
|
||||
private accountService: AccountService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private configService: ConfigService,
|
||||
private dialogService: DialogService,
|
||||
private messageListener: MessageListener,
|
||||
private organizationService: OrganizationService,
|
||||
@@ -140,36 +135,30 @@ export class OrganizationPaymentDetailsComponent implements OnInit, OnDestroy {
|
||||
await this.changePaymentMethod();
|
||||
}
|
||||
|
||||
this.enableTaxIdWarning = await this.configService.getFeatureFlag(
|
||||
FeatureFlag.PM22415_TaxIDWarnings,
|
||||
);
|
||||
|
||||
if (this.enableTaxIdWarning) {
|
||||
this.organizationWarningsService.taxIdWarningRefreshed$
|
||||
.pipe(
|
||||
switchMap((warning) =>
|
||||
combineLatest([
|
||||
of(warning),
|
||||
this.organization$.pipe(take(1)).pipe(
|
||||
mapOrganizationToSubscriber,
|
||||
switchMap((organization) =>
|
||||
this.subscriberBillingClient.getBillingAddress(organization),
|
||||
),
|
||||
this.organizationWarningsService.taxIdWarningRefreshed$
|
||||
.pipe(
|
||||
switchMap((warning) =>
|
||||
combineLatest([
|
||||
of(warning),
|
||||
this.organization$.pipe(take(1)).pipe(
|
||||
mapOrganizationToSubscriber,
|
||||
switchMap((organization) =>
|
||||
this.subscriberBillingClient.getBillingAddress(organization),
|
||||
),
|
||||
]),
|
||||
),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe(([taxIdWarning, billingAddress]) => {
|
||||
if (this.viewState$.value) {
|
||||
this.viewState$.next({
|
||||
...this.viewState$.value,
|
||||
taxIdWarning,
|
||||
billingAddress,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
),
|
||||
]),
|
||||
),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe(([taxIdWarning, billingAddress]) => {
|
||||
if (this.viewState$.value) {
|
||||
this.viewState$.next({
|
||||
...this.viewState$.value,
|
||||
taxIdWarning,
|
||||
billingAddress,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.messageListener
|
||||
.messages$(BANK_ACCOUNT_VERIFIED_COMMAND)
|
||||
@@ -216,10 +205,7 @@ export class OrganizationPaymentDetailsComponent implements OnInit, OnDestroy {
|
||||
|
||||
setBillingAddress = (billingAddress: BillingAddress) => {
|
||||
if (this.viewState$.value) {
|
||||
if (
|
||||
this.enableTaxIdWarning &&
|
||||
this.viewState$.value.billingAddress?.taxId !== billingAddress.taxId
|
||||
) {
|
||||
if (this.viewState$.value.billingAddress?.taxId !== billingAddress.taxId) {
|
||||
this.organizationWarningsService.refreshTaxIdWarning();
|
||||
}
|
||||
this.viewState$.next({
|
||||
|
||||
@@ -12,8 +12,6 @@ import {
|
||||
|
||||
import { Account, AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { BannerModule, DialogService } from "@bitwarden/components";
|
||||
import { BILLING_DISK, StateProvider, UserKeyDefinition } from "@bitwarden/state";
|
||||
@@ -88,23 +86,21 @@ type GetWarning$ = () => Observable<TaxIdWarningType | null>;
|
||||
@Component({
|
||||
selector: "app-tax-id-warning",
|
||||
template: `
|
||||
@if (enableTaxIdWarning$ | async) {
|
||||
@let view = view$ | async;
|
||||
@let view = view$ | async;
|
||||
|
||||
@if (view) {
|
||||
<bit-banner id="tax-id-warning-banner" bannerType="warning" (onClose)="trackDismissal()">
|
||||
{{ view.message }}
|
||||
<a
|
||||
bitLink
|
||||
linkType="secondary"
|
||||
(click)="editBillingAddress()"
|
||||
class="tw-cursor-pointer"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
{{ view.callToAction }}
|
||||
</a>
|
||||
</bit-banner>
|
||||
}
|
||||
@if (view) {
|
||||
<bit-banner id="tax-id-warning-banner" bannerType="warning" (onClose)="trackDismissal()">
|
||||
{{ view.message }}
|
||||
<a
|
||||
bitLink
|
||||
linkType="secondary"
|
||||
(click)="editBillingAddress()"
|
||||
class="tw-cursor-pointer"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
{{ view.callToAction }}
|
||||
</a>
|
||||
</bit-banner>
|
||||
}
|
||||
`,
|
||||
imports: [BannerModule, SharedModule],
|
||||
@@ -120,10 +116,6 @@ export class TaxIdWarningComponent implements OnInit {
|
||||
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
|
||||
@Output() billingAddressUpdated = new EventEmitter<void>();
|
||||
|
||||
protected enableTaxIdWarning$ = this.configService.getFeatureFlag$(
|
||||
FeatureFlag.PM22415_TaxIDWarnings,
|
||||
);
|
||||
|
||||
protected userId$ = this.accountService.activeAccount$.pipe(
|
||||
filter((account): account is Account => account !== null),
|
||||
getUserId,
|
||||
@@ -209,7 +201,6 @@ export class TaxIdWarningComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private accountService: AccountService,
|
||||
private configService: ConfigService,
|
||||
private dialogService: DialogService,
|
||||
private i18nService: I18nService,
|
||||
private subscriberBillingClient: SubscriberBillingClient,
|
||||
|
||||
Reference in New Issue
Block a user