diff --git a/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.html b/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.html index 1b5a38bf29..bbead2c74c 100644 --- a/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.html +++ b/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.html @@ -72,14 +72,7 @@ class="bwi bwi-fw" *ngIf="t.paymentMethodType" aria-hidden="true" - [ngClass]="{ - 'bwi-credit-card': t.paymentMethodType === paymentMethodType.Card, - 'bwi-bank': - t.paymentMethodType === paymentMethodType.BankAccount || - t.paymentMethodType === paymentMethodType.WireTransfer, - 'bwi-bitcoin text-warning': t.paymentMethodType === paymentMethodType.BitPay, - 'bwi-paypal text-primary': t.paymentMethodType === paymentMethodType.PayPal - }" + [ngClass]="paymentMethodClasses(t.paymentMethodType)" > {{ t.details }} diff --git a/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.ts b/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.ts index 4197e94269..9f993ec1c1 100644 --- a/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.ts +++ b/apps/web/src/app/modules/organizations/billing/organization-billing-history.component.ts @@ -46,4 +46,20 @@ export class OrganizationBillingHistoryComponent implements OnInit { get transactions() { return this.billing != null ? this.billing.transactions : null; } + + paymentMethodClasses(type: PaymentMethodType) { + switch (type) { + case PaymentMethodType.Card: + return ["bwi-credit-card"]; + case PaymentMethodType.BankAccount: + case PaymentMethodType.WireTransfer: + return ["bwi-bank"]; + case PaymentMethodType.BitPay: + return ["bwi-bitcoin text-warning"]; + case PaymentMethodType.PayPal: + return ["bwi-paypal text-primary"]; + default: + return []; + } + } } diff --git a/apps/web/src/app/modules/organizations/billing/organization-payment-method.component.ts b/apps/web/src/app/modules/organizations/billing/organization-payment-method.component.ts index 00ff7beb23..b199b25bbb 100644 --- a/apps/web/src/app/modules/organizations/billing/organization-payment-method.component.ts +++ b/apps/web/src/app/modules/organizations/billing/organization-payment-method.component.ts @@ -58,10 +58,7 @@ export class OrganizationPaymentMethodComponent implements OnInit { const billingPromise = this.apiService.getOrganizationBilling(this.organizationId); const orgPromise = this.apiService.getOrganization(this.organizationId); - const results = await Promise.all([billingPromise, orgPromise]); - - this.billing = results[0]; - this.org = results[1]; + [this.billing, this.org] = await Promise.all([billingPromise, orgPromise]); } this.loading = false; }