From 3dafeab52bdac189bdadf680d0679a5ead286269 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Mon, 27 Jul 2020 13:44:37 +0200 Subject: [PATCH 1/6] Fix shipping create minimal price bug --- src/shipping/views/ShippingZoneDetails/data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shipping/views/ShippingZoneDetails/data.ts b/src/shipping/views/ShippingZoneDetails/data.ts index 95879b5ed..799e91600 100644 --- a/src/shipping/views/ShippingZoneDetails/data.ts +++ b/src/shipping/views/ShippingZoneDetails/data.ts @@ -28,7 +28,7 @@ export function getCreateShippingRateVariables( minimumOrderPrice: params.type === ShippingMethodTypeEnum.PRICE - ? getValue(data.maxValue, data.noLimits) + ? getValue(data.minValue, data.noLimits) : null, minimumOrderWeight: params.type === ShippingMethodTypeEnum.WEIGHT From 3ce99ff3267201c5c5d4e1e65f4a682c0b6ed02f Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Mon, 27 Jul 2020 13:47:53 +0200 Subject: [PATCH 2/6] Fix label --- .../ProductVariantPrice/ProductVariantPrice.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx b/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx index 1f89122a8..d39a927b0 100644 --- a/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx +++ b/src/products/components/ProductVariantPrice/ProductVariantPrice.tsx @@ -51,16 +51,8 @@ const ProductVariantPrice: React.FC = props => { error={!!formErrors.price} name="price" label={intl.formatMessage({ - defaultMessage: "Selling price override" + defaultMessage: "Price" })} - hint={ - getProductErrorMessage(formErrors.price, intl) || - intl.formatMessage({ - defaultMessage: "Optional", - description: "optional field", - id: "productVariantPriceOptionalPriceField" - }) - } value={price} currencySymbol={currencySymbol} onChange={onChange} @@ -72,7 +64,7 @@ const ProductVariantPrice: React.FC = props => { error={!!formErrors.cost_price} name="costPrice" label={intl.formatMessage({ - defaultMessage: "Cost price override" + defaultMessage: "Cost price" })} hint={ getProductErrorMessage(formErrors.cost_price, intl) || From 8c68903fad50485c6aa7ccb2577d573442168251 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Mon, 27 Jul 2020 13:51:56 +0200 Subject: [PATCH 3/6] Add submit on blur --- .../OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/orders/components/OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx b/src/orders/components/OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx index a007b21d9..9c1b33619 100644 --- a/src/orders/components/OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx +++ b/src/orders/components/OrderDraftDetailsProducts/OrderDraftDetailsProducts.tsx @@ -151,6 +151,7 @@ const OrderDraftDetailsProducts: React.FC = prop type="number" value={data.quantity} onChange={debounce} + onBlur={submit} /> )} From e5304294273414453a8706fa053e2ad981e815cd Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Wed, 29 Jul 2020 16:20:47 +0200 Subject: [PATCH 4/6] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a3e0c321..b23aec6e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable, unreleased changes to this project will be documented in this file. - Add Cypress e2e runner - #584 by @krzysztofwolski - create Apps - #599 by @AlicjaSzu - Refactor authorization - #624 by @dominik-zeglen +- Fix minor bugs - #628 by @dominik-zeglen ## 2.10.1 From 6d78842236d4fb2d53a1e22a474445f7ff3cbb6a Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Wed, 29 Jul 2020 16:31:53 +0200 Subject: [PATCH 5/6] Update messages --- locale/defaultMessages.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index c0e35e3b7..115047cf0 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -250,10 +250,6 @@ "context": "optional field", "string": "Optional" }, - "productVariantPriceOptionalPriceField": { - "context": "optional field", - "string": "Optional" - }, "saleDetailsPageCategoriesQuantity": { "context": "number of categories", "string": "Categories ({quantity})" @@ -4393,11 +4389,11 @@ "context": "product pricing, section header", "string": "Pricing" }, - "src_dot_products_dot_components_dot_ProductVariantPrice_dot_1416480328": { - "string": "Cost price override" + "src_dot_products_dot_components_dot_ProductVariantPrice_dot_1134347598": { + "string": "Price" }, - "src_dot_products_dot_components_dot_ProductVariantPrice_dot_2238565650": { - "string": "Selling price override" + "src_dot_products_dot_components_dot_ProductVariantPrice_dot_819659341": { + "string": "Cost price" }, "src_dot_products_dot_components_dot_ProductVariants_dot_1001303107": { "context": "product variant inventory", From 2bfe1226d5e009709ba62f0d69b095606bcc809b Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Wed, 29 Jul 2020 16:31:59 +0200 Subject: [PATCH 6/6] Update snapshots --- .../__snapshots__/Stories.test.ts.snap | 63 +++++-------------- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 02e94014a..63a1c7fbc 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -117229,7 +117229,7 @@ exports[`Storyshots Views / Products / Create product variant add first variant class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id" data-shrink="false" > - Selling price override + Price
-

- Optional -

@@ -117280,7 +117275,7 @@ exports[`Storyshots Views / Products / Create product variant add first variant class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id" data-shrink="false" > - Cost price override + Cost price
- Selling price override + Price
-

- Optional -

@@ -117952,7 +117942,7 @@ exports[`Storyshots Views / Products / Create product variant default 1`] = ` class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id" data-shrink="false" > - Cost price override + Cost price
- Selling price override + Price
-

- Optional -

@@ -118547,7 +118532,7 @@ exports[`Storyshots Views / Products / Create product variant when loading data class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id MuiFormLabel-disabled-id MuiInputLabel-disabled-id" data-shrink="false" > - Cost price override + Cost price
- Selling price override + Price
-

- Optional -

@@ -119237,7 +119217,7 @@ exports[`Storyshots Views / Products / Create product variant with errors 1`] = class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id" data-shrink="false" > - Cost price override + Cost price
- Selling price override + Price
-

- Optional -

@@ -139340,7 +139315,7 @@ exports[`Storyshots Views / Products / Product variant details attribute errors class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id MuiInputLabel-outlined-id MuiFormLabel-filled-id" data-shrink="true" > - Cost price override + Cost price
- Selling price override + Price
-

- Optional -

@@ -140310,7 +140280,7 @@ exports[`Storyshots Views / Products / Product variant details when loaded data class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-shrink-id MuiInputLabel-outlined-id MuiFormLabel-filled-id" data-shrink="true" > - Cost price override + Cost price
- Selling price override + Price
-

- Optional -

@@ -141053,7 +141018,7 @@ exports[`Storyshots Views / Products / Product variant details when loading data class="MuiFormLabel-root-id MuiInputLabel-root-id MuiInputLabel-formControl-id MuiInputLabel-animated-id MuiInputLabel-outlined-id MuiFormLabel-disabled-id MuiInputLabel-disabled-id" data-shrink="false" > - Cost price override + Cost price