mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[EC-8] Some PR suggestions
This commit is contained in:
@@ -72,14 +72,7 @@
|
|||||||
class="bwi bwi-fw"
|
class="bwi bwi-fw"
|
||||||
*ngIf="t.paymentMethodType"
|
*ngIf="t.paymentMethodType"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
[ngClass]="{
|
[ngClass]="paymentMethodClasses(t.paymentMethodType)"
|
||||||
'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
|
|
||||||
}"
|
|
||||||
></i>
|
></i>
|
||||||
{{ t.details }}
|
{{ t.details }}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -46,4 +46,20 @@ export class OrganizationBillingHistoryComponent implements OnInit {
|
|||||||
get transactions() {
|
get transactions() {
|
||||||
return this.billing != null ? this.billing.transactions : null;
|
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 billingPromise = this.apiService.getOrganizationBilling(this.organizationId);
|
||||||
const orgPromise = this.apiService.getOrganization(this.organizationId);
|
const orgPromise = this.apiService.getOrganization(this.organizationId);
|
||||||
|
|
||||||
const results = await Promise.all([billingPromise, orgPromise]);
|
[this.billing, this.org] = await Promise.all([billingPromise, orgPromise]);
|
||||||
|
|
||||||
this.billing = results[0];
|
|
||||||
this.org = results[1];
|
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user