From 432a51aee5ef4078df37007ba99d555a7176a826 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Mon, 8 Feb 2021 11:29:10 +0100 Subject: [PATCH] fix(admin-ui): Make order modification note not required Relates to #688 --- .../order-editor/order-editor.component.html | 35 ++++++++++--------- .../order-editor/order-editor.component.ts | 13 ++++--- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/packages/admin-ui/src/lib/order/src/components/order-editor/order-editor.component.html b/packages/admin-ui/src/lib/order/src/components/order-editor/order-editor.component.html index ffdb5c3587..e6b8b7f624 100644 --- a/packages/admin-ui/src/lib/order/src/components/order-editor/order-editor.component.html +++ b/packages/admin-ui/src/lib/order/src/components/order-editor/order-editor.component.html @@ -108,10 +108,7 @@ - + {{ 'order.modifications' | translate }}
- +
{{ addItemSelectedVariant.productVariantName }} {{ addItemSelectedVariant.sku }} -
{{ getSelectedItemPrice(addItemSelectedVariant) | localeCurrency: order.currencyCode }}
+
+ {{ + getSelectedItemPrice(addItemSelectedVariant) + | localeCurrency: order.currencyCode + }} +
-
{{ 'order.modifications' | translate }}
{{ 'order.modifications' | translate }} formControlName="taxRate" /> diff --git a/packages/admin-ui/src/lib/order/src/components/order-editor/order-editor.component.ts b/packages/admin-ui/src/lib/order/src/components/order-editor/order-editor.component.ts index 045bf7e9a5..c25cd502f8 100644 --- a/packages/admin-ui/src/lib/order/src/components/order-editor/order-editor.component.ts +++ b/packages/admin-ui/src/lib/order/src/components/order-editor/order-editor.component.ts @@ -212,12 +212,11 @@ export class OrderEditorComponent canPreviewChanges(): boolean { const { addItems, adjustOrderLines, surcharges } = this.modifyOrderInput; return ( - (!!addItems?.length || - !!surcharges?.length || - !!adjustOrderLines?.length || - (this.shippingAddressForm.dirty && this.shippingAddressForm.valid) || - (this.billingAddressForm.dirty && this.billingAddressForm.valid)) && - this.note !== '' + !!addItems?.length || + !!surcharges?.length || + !!adjustOrderLines?.length || + (this.shippingAddressForm.dirty && this.shippingAddressForm.valid) || + (this.billingAddressForm.dirty && this.billingAddressForm.valid) ); } @@ -350,7 +349,7 @@ export class OrderEditorComponent ? { updateShippingAddress: this.shippingAddressForm.value } : {}), dryRun: true, - note: this.note, + note: this.note ?? '', options: { recalculateShipping: this.recalculateShipping, },