diff --git a/packages/admin-ui/src/lib/order/src/components/order-table/order-table-mixin.scss b/packages/admin-ui/src/lib/order/src/components/order-table/order-table-mixin.scss index 9f33ea2ea7..0d9ab98157 100644 --- a/packages/admin-ui/src/lib/order/src/components/order-table/order-table-mixin.scss +++ b/packages/admin-ui/src/lib/order/src/components/order-table/order-table-mixin.scss @@ -1,6 +1,4 @@ - @mixin order-table { - .is-cancelled td { text-decoration: line-through; background-color: var(--color-component-bg-200); @@ -15,6 +13,25 @@ border-top: 1px dashed var(--color-component-border-200); } + td.custom-fields-row { + border-top-style: dashed; + border-top-color: var(--color-grey-200); + } + + .order-line-custom-fields { + display: flex; + flex-wrap: wrap; + + .custom-field { + text-align: start; + max-width: 200px; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 6px; + margin-right: 18px; + } + } + .order-line-custom-field { background-color: var(--color-component-bg-100); diff --git a/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.html b/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.html index 7460d4ec24..a46fa2bfa6 100644 --- a/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.html +++ b/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.html @@ -6,109 +6,89 @@ {{ 'order.product-sku' | translate }} {{ 'order.unit-price' | translate }} {{ 'order.quantity' | translate }} - - - - - - - - - - {{ 'order.total' | translate }} - - - - - {{ line.productVariant.name }} - {{ line.productVariant.sku }} - - {{ line.unitPriceWithTax | localeCurrency: order.currencyCode }} -
- {{ line.unitPrice | localeCurrency: order.currencyCode }} -
- - - {{ line.quantity }} - - - - - - - - {{ - line.customFields[customField.name] | localeDate: 'short' - }} - - - - - - - - - - - {{ line.customFields[customField.name] }} - - + + + + - - - - - {{ line.linePriceWithTax | localeCurrency: order.currencyCode }} -
- {{ line.linePrice | localeCurrency: order.currencyCode }} -
+ {{ line.productVariant.name }} + {{ line.productVariant.sku }} + + {{ line.unitPriceWithTax | localeCurrency: order.currencyCode }} +
+ {{ line.unitPrice | localeCurrency: order.currencyCode }} +
+ + + {{ line.quantity }} + + + + + {{ line.linePriceWithTax | localeCurrency: order.currencyCode }} +
+ {{ line.linePrice | localeCurrency: order.currencyCode }} +
- - -
- {{ 'order.promotions-applied' | translate }} -
- -
- {{ - discount.description + + +
+ {{ 'order.promotions-applied' | translate }} +
+ +
+ {{ + discount.description }} -
- {{ discount.amountWithTax | localeCurrency: order.currencyCode }} -
- {{ discount.amount | localeCurrency: order.currencyCode }} +
+ {{ discount.amountWithTax | localeCurrency: order.currencyCode }} +
+ {{ discount.amount | localeCurrency: order.currencyCode }} +
+ + + + + + + + +
+
+ +
+ + {{ field.value }} + + + + + + + + + + + {{ field.value }} + +
+
- - - - - +
+ + +
+ {{ surcharge.description }} {{ surcharge.sku }} - - - + {{ surcharge.priceWithTax | localeCurrency: order.currencyCode }}
@@ -117,13 +97,12 @@ - + {{ discount.description }} {{ couponCode }} - {{ discount.amountWithTax | localeCurrency: order.currencyCode }}
@@ -133,9 +112,7 @@ {{ 'order.sub-total' | translate }} - - - + {{ order.subTotalWithTax | localeCurrency: order.currencyCode }}
@@ -146,8 +123,7 @@ {{ 'order.shipping' | translate }} {{ order.shippingLines[0]?.shippingMethod?.name }} - - + {{ order.shippingWithTax | localeCurrency: order.currencyCode }}
@@ -157,9 +133,7 @@ {{ 'order.total' | translate }} - - - + {{ order.totalWithTax | localeCurrency: order.currencyCode }}
diff --git a/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.scss b/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.scss index b631af1e34..312923114a 100644 --- a/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.scss +++ b/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.scss @@ -1,25 +1,16 @@ -@import "order-table-mixin"; +@import 'order-table-mixin'; .order-table { @include order-table; } -.custom-field-header-button { - background: none; - margin: 0; - padding: 0; - border: none; - cursor: pointer; - color: var(--color-primary-600); -} - ::ng-deep .line-promotion { - display: flex; - justify-content: space-between; - padding: 6px 12px; - .promotion-amount { - margin-left: 12px; - } + display: flex; + justify-content: space-between; + padding: 6px 12px; + .promotion-amount { + margin-left: 12px; + } .net-price { font-size: 11px; color: var(--color-text-300); diff --git a/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.ts b/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.ts index d96a3da8d4..acf40c63d3 100644 --- a/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.ts +++ b/packages/admin-ui/src/lib/order/src/components/order-table/order-table.component.ts @@ -32,6 +32,20 @@ export class OrderTableComponent implements OnInit { return line.discounts.filter(a => a.type === AdjustmentType.PROMOTION); } + getLineCustomFields(line: OrderDetail.Lines): Array<{ config: CustomFieldConfig; value: any }> { + return this.orderLineCustomFields + .map(config => { + const value = (line as any).customFields[config.name]; + return { + config, + value, + }; + }) + .filter(field => { + return this.orderLineCustomFieldsVisible ? true : field.value != null; + }); + } + getPromotionLink(promotion: OrderDetail.Discounts): any[] { const id = promotion.adjustmentSource.split(':')[1]; return ['/marketing', 'promotions', id];