Skip to content

Commit

Permalink
feat: add payment method name for recurring order
Browse files Browse the repository at this point in the history
  • Loading branch information
suschneider committed Sep 6, 2024
1 parent 49f1da8 commit 2a0d219
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface RecurringOrderData extends Omit<RecurringOrderLinkData, 'totalN
];

payments?: [{ name: string; id: string }];
paymentMethods?: [{ displayName: string }];
}

export interface RecurringOrderLinkData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class RecurringOrderMapper {
invoiceToAddress: data.invoiceToAddress,
commonShipToAddress: data.shippingBuckets?.[0]?.shipToAddress,
commonShippingMethod: data.shippingBuckets?.[0]?.shippingMethod,
payment: { id: data.payments?.[0].id, displayName: data.payments?.[0].name } as Payment,
payment: { id: data.payments?.[0].id, displayName: data.paymentMethods?.[0].displayName } as Payment,

Check warning on line 85 in src/app/core/models/recurring-order/recurring-order.mapper.ts

View workflow job for this annotation

GitHub Actions / CommandLine

Type assertion on object literals is forbidden, use a type annotation instead

Check warning on line 85 in src/app/core/models/recurring-order/recurring-order.mapper.ts

View workflow job for this annotation

GitHub Actions / GitBash

Type assertion on object literals is forbidden, use a type annotation instead

Check warning on line 85 in src/app/core/models/recurring-order/recurring-order.mapper.ts

View workflow job for this annotation

GitHub Actions / Powershell

Type assertion on object literals is forbidden, use a type annotation instead

lineItems: data.shippingBuckets?.[0]?.lineItems,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,7 @@ <h1>{{ 'account.recurring_order.heading' | translate }}</h1>
<!-- Payment -->
<ish-info-box heading="account.recurring_order.details.payment_method.heading" class="infobox-wrapper col-md-6">
<ng-container *ngIf="recurringOrder.payment">
<div class="float-right">
<p class="badge badge-info">{{ recurringOrder.payment.status }}</p>
</div>
<p>
{{ recurringOrder.payment.displayName }}
</p>
{{ recurringOrder.payment.displayName }}
</ng-container>
</ish-info-box>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<ng-container cdkColumnDef="actions">
<th cdk-header-cell *cdkHeaderCellDef data-testing-id="th-order-actions"></th>
<td cdk-cell *cdkCellDef="let recurringOrder" class="column-price text-nowrap">
<span *ngIf="recurringOrder.expired; else switch">{{
<span *ngIf="recurringOrder.expired; else switch" class="mr-2">{{
'account.recurring_orders.expired.text' | translate
}}</span>
<ng-template #switch>
Expand Down

0 comments on commit 2a0d219

Please sign in to comment.