Skip to content

Commit

Permalink
remove duplicate section
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashendrickx committed Nov 28, 2024
1 parent 974e070 commit 0bcda6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
18 changes: 0 additions & 18 deletions apps/web/src/app/billing/shared/payment-method.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,5 @@ <h2 bitTypography="h2">{{ "paymentMethod" | i18n }}</h2>
{{ "paymentChargedWithUnpaidSubscription" | i18n }}
</p>
</bit-section>
<bit-section *ngIf="forOrganization">
<h2 bitTypography="h2">{{ "taxInformation" | i18n }}</h2>
<p bitTypography="body1">{{ "taxInformationDesc" | i18n }}</p>
<div *ngIf="!org || loading">
<i
class="bwi bwi-spinner bwi-spin tw-text-muted"
title="{{ 'loading' | i18n }}"
aria-hidden="true"
></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</div>
<form *ngIf="org && !loading" [formGroup]="taxForm" [bitSubmit]="submitTaxInfo">
<app-tax-info></app-tax-info>
<button bitButton bitFormButton buttonType="primary" type="submit">
{{ "save" | i18n }}
</button>
</form>
</bit-section>
</ng-container>
</bit-container>
31 changes: 1 addition & 30 deletions apps/web/src/app/billing/shared/payment-method.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Location } from "@angular/common";
import { Component, OnDestroy, OnInit, ViewChild } from "@angular/core";
import { Component, OnDestroy, OnInit } from "@angular/core";
import { FormBuilder, FormControl, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { lastValueFrom } from "rxjs";
Expand All @@ -14,7 +14,6 @@ import { OrganizationSubscriptionResponse } from "@bitwarden/common/billing/mode
import { SubscriptionResponse } from "@bitwarden/common/billing/models/response/subscription.response";
import { VerifyBankRequest } from "@bitwarden/common/models/request/verify-bank.request";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { SyncService } from "@bitwarden/common/platform/sync";
import { DialogService, ToastService } from "@bitwarden/components";
Expand All @@ -27,15 +26,12 @@ import {
AdjustPaymentDialogResult,
openAdjustPaymentDialog,
} from "./adjust-payment-dialog/adjust-payment-dialog.component";
import { TaxInfoComponent } from "./tax-info.component";

@Component({
templateUrl: "payment-method.component.html",
})
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
export class PaymentMethodComponent implements OnInit, OnDestroy {
@ViewChild(TaxInfoComponent) taxInfo: TaxInfoComponent;

loading = false;
firstLoaded = false;
billing: BillingPaymentResponse;
Expand All @@ -59,7 +55,6 @@ export class PaymentMethodComponent implements OnInit, OnDestroy {
]),
});

taxForm = this.formBuilder.group({});
launchPaymentModalAutomatically = false;
protected freeTrialData: FreeTrial;

Expand All @@ -70,7 +65,6 @@ export class PaymentMethodComponent implements OnInit, OnDestroy {
protected platformUtilsService: PlatformUtilsService,
private router: Router,
private location: Location,
private logService: LogService,
private route: ActivatedRoute,
private formBuilder: FormBuilder,
private dialogService: DialogService,
Expand Down Expand Up @@ -196,25 +190,6 @@ export class PaymentMethodComponent implements OnInit, OnDestroy {
await this.load();
};

submitTaxInfo = async () => {
await this.taxInfo
.submitTaxInfo()
.then(() => {
this.toastService.showToast({
variant: "success",
title: null,
message: this.i18nService.t("taxInfoUpdated"),
});
})
.catch((error) => {
this.toastService.showToast({
variant: "error",
title: null,
message: this.i18nService.t(error.message),
});
});
};

determineOrgsWithUpcomingPaymentIssues() {
this.freeTrialData = this.trialFlowService.checkForOrgsWithUpcomingPaymentIssues(
this.organization,
Expand All @@ -239,10 +214,6 @@ export class PaymentMethodComponent implements OnInit, OnDestroy {
return this.organizationId != null;
}

get headerClass() {
return this.forOrganization ? ["page-header"] : ["tabbed-header"];
}

get paymentSourceClasses() {
if (this.paymentSource == null) {
return [];
Expand Down

0 comments on commit 0bcda6e

Please sign in to comment.