[PM-5021] billing history component migration (#8042)

* billing history component migration

* billing history component migration

* billing history component migration

* billing history component migration

* billing history component migration

---------

Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
This commit is contained in:
vinith-kovan 2024-04-17 01:09:53 +05:30 committed by GitHub
parent 5d3541dd63
commit cf2fefaead
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 76 additions and 70 deletions

View File

@ -1,13 +1,12 @@
<div class="d-flex tabbed-header"> <div class="tw-flex tw-justify-between tw-mb-2 tw-pb-2 tw-mt-6">
<h1> <h2 bitTypography="h2">
{{ "billingHistory" | i18n }} {{ "billingHistory" | i18n }}
</h1> </h2>
<button <button
type="button" type="button"
bitButton bitButton
buttonType="secondary" buttonType="secondary"
(click)="load()" (click)="load()"
class="tw-ml-auto"
*ngIf="firstLoaded" *ngIf="firstLoaded"
[disabled]="loading" [disabled]="loading"
> >
@ -17,11 +16,11 @@
</div> </div>
<ng-container *ngIf="!firstLoaded && loading"> <ng-container *ngIf="!firstLoaded && loading">
<i <i
class="bwi bwi-spinner bwi-spin text-muted" class="bwi bwi-spinner bwi-spin tw-text-muted"
title="{{ 'loading' | i18n }}" title="{{ 'loading' | i18n }}"
aria-hidden="true" aria-hidden="true"
></i> ></i>
<span class="sr-only">{{ "loading" | i18n }}</span> <span class="tw-sr-only">{{ "loading" | i18n }}</span>
</ng-container> </ng-container>
<ng-container *ngIf="billing"> <ng-container *ngIf="billing">
<app-billing-history [billing]="billing"></app-billing-history> <app-billing-history [billing]="billing"></app-billing-history>

View File

@ -1,15 +1,16 @@
<h2 class="mt-3">{{ "invoices" | i18n }}</h2> <bit-section>
<p *ngIf="!invoices || !invoices.length">{{ "noInvoices" | i18n }}</p> <h3 bitTypography="h3">{{ "invoices" | i18n }}</h3>
<table class="table mb-2" *ngIf="invoices && invoices.length"> <p bitTypography="body1" *ngIf="!invoices || !invoices.length">{{ "noInvoices" | i18n }}</p>
<tbody> <bit-table>
<tr *ngFor="let i of invoices"> <ng-template body>
<td>{{ i.date | date: "mediumDate" }}</td> <tr bitRow *ngFor="let i of invoices">
<td> <td bitCell>{{ i.date | date: "mediumDate" }}</td>
<td bitCell>
<a <a
href="{{ i.pdfUrl }}" href="{{ i.pdfUrl }}"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
class="mr-2" class="tw-mr-2"
appA11yTitle="{{ 'downloadInvoice' | i18n }}" appA11yTitle="{{ 'downloadInvoice' | i18n }}"
> >
<i class="bwi bwi-file-pdf" aria-hidden="true"></i <i class="bwi bwi-file-pdf" aria-hidden="true"></i
@ -18,33 +19,37 @@
{{ "invoiceNumber" | i18n: i.number }}</a {{ "invoiceNumber" | i18n: i.number }}</a
> >
</td> </td>
<td>{{ i.amount | currency: "$" }}</td> <td bitCell>{{ i.amount | currency: "$" }}</td>
<td> <td bitCell>
<span *ngIf="i.paid"> <span *ngIf="i.paid">
<i class="bwi bwi-check text-success" aria-hidden="true"></i> <i class="bwi bwi-check tw-text-success" aria-hidden="true"></i>
{{ "paid" | i18n }} {{ "paid" | i18n }}
</span> </span>
<span *ngIf="!i.paid"> <span *ngIf="!i.paid">
<i class="bwi bwi-exclamation-circle text-muted" aria-hidden="true"></i> <i class="bwi bwi-exclamation-circle tw-text-muted" aria-hidden="true"></i>
{{ "unpaid" | i18n }} {{ "unpaid" | i18n }}
</span> </span>
</td> </td>
</tr> </tr>
</tbody> </ng-template>
</table> </bit-table>
<h2 class="spaced-header">{{ "transactions" | i18n }}</h2> </bit-section>
<p *ngIf="!transactions || !transactions.length">{{ "noTransactions" | i18n }}</p> <bit-section>
<table class="table mb-2" *ngIf="transactions && transactions.length"> <h3 bitTypography="h3">{{ "transactions" | i18n }}</h3>
<tbody> <p bitTypography="body1" *ngIf="!transactions || !transactions.length">
<tr *ngFor="let t of transactions"> {{ "noTransactions" | i18n }}
<td>{{ t.createdDate | date: "mediumDate" }}</td> </p>
<td> <bit-table *ngIf="transactions && transactions.length">
<ng-template body>
<tr bitRow *ngFor="let t of transactions">
<td bitCell>{{ t.createdDate | date: "mediumDate" }}</td>
<td bitCell>
<span *ngIf="t.type === transactionType.Charge || t.type === transactionType.Credit"> <span *ngIf="t.type === transactionType.Charge || t.type === transactionType.Credit">
{{ "chargeNoun" | i18n }} {{ "chargeNoun" | i18n }}
</span> </span>
<span *ngIf="t.type === transactionType.Refund">{{ "refundNoun" | i18n }}</span> <span *ngIf="t.type === transactionType.Refund">{{ "refundNoun" | i18n }}</span>
</td> </td>
<td> <td bitCell>
<i <i
class="bwi bwi-fw" class="bwi bwi-fw"
*ngIf="t.paymentMethodType" *ngIf="t.paymentMethodType"
@ -56,10 +61,12 @@
<td <td
[ngClass]="{ 'text-strike': t.refunded }" [ngClass]="{ 'text-strike': t.refunded }"
title="{{ (t.refunded ? 'refunded' : '') | i18n }}" title="{{ (t.refunded ? 'refunded' : '') | i18n }}"
bitCell
> >
{{ t.amount | currency: "$" }} {{ t.amount | currency: "$" }}
</td> </td>
</tr> </tr>
</tbody> </ng-template>
</table> </bit-table>
<small class="text-muted">* {{ "chargesStatement" | i18n: "BITWARDEN" }}</small> <small class="tw-text-muted">* {{ "chargesStatement" | i18n: "BITWARDEN" }}</small>
</bit-section>