Skip to content

Commit

Permalink
fix(com-pwa): add a link
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadhonarvar committed May 29, 2023
1 parent 0b454fe commit bd431bf
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions uniquely/com-pwa/src/ui/stuff/user-inc-order-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
property,
} from '@alwatr/element';
import {date, message} from '@alwatr/i18n';
import {url} from '@alwatr/router';

import type {ComUserIncOrder, Order} from '@alwatr/type/customer-order-management.js';
import type {IconBoxContent} from '@alwatr/ui-kit/card/icon-box.js';
Expand Down Expand Up @@ -98,36 +99,36 @@ export class alwatrUserIncOrderBox extends LocalizeMixin(SignalMixin(AlwatrBaseE
protected _renderOrderBox(): unknown {
let orderList;
if (Object.keys(this.userIncOrder!.orderList).length === 0) {
orderList = html`<span class="empty-order">${message('page_admin_order_list_empty_order_list')}<span>`;
orderList = html`<span class="empty-order"
>${message('page_admin_order_list_empty_order_list')}<span></span
></span>`;
}
else {
orderList = mapObject(this, this.userIncOrder!.orderList, (order) => this._renderOrderInfo(order));
}

return html`
<h3>${message('page_admin_order_list_order_list')}:</h3>
<alwatr-surface class="detail-container order-container">
${orderList}
</alwatr-surface>
<alwatr-surface class="detail-container order-container"> ${orderList} </alwatr-surface>
`;
}

protected _renderOrderInfo(order: Order): unknown {
return html`
<div class="order-info">
<a class="order-info" href=${url({sectionList: ['admin-order', this.userIncOrder!.id, order.id]})}>
<div>
<span>${message('page_admin_order_list_order_id')}:</span>
<span>${message('page_admin_order_list_order_id')}:</span>
<span>${order.id}</span>
</div>
<div>
<span>${message('page_admin_order_list_order_date')}:</span>
<span>${message('page_admin_order_list_order_date')}:</span>
<span>${order.meta?.created ? date(order.meta?.created) : ''}</span>
</div>
<div>
<span>${message('page_admin_order_list_order_status')}:</span>
<span>${message('page_admin_order_list_order_status')}:</span>
<span>${message('order_status_' + order.status)}</span>
</div>
</div>
</a>
`;
}
}

0 comments on commit bd431bf

Please sign in to comment.