mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-25 12:15:18 +01:00
[EC-8] Some PR suggestions
This commit is contained in:
parent
bda63c87a3
commit
8fcc4f394d
@ -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)"
|
||||
></i>
|
||||
{{ t.details }}
|
||||
</td>
|
||||
|
@ -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 [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user