From e24c918a329fc6dd7166b97d07487ef4b2a25450 Mon Sep 17 00:00:00 2001 From: Tomasz Szymanski Date: Tue, 5 Jan 2021 13:05:54 +0100 Subject: [PATCH] Refactor ZIP Codes to postal codes (UI part) --- locale/defaultMessages.json | 82 +++++------ .../ShippingRateZipCodeRangeRemoveDialog.tsx | 4 +- ...ShippingZoneZipCodeRangeDialog.stories.tsx | 2 +- .../ShippingZoneZipCodeRangeDialog.tsx | 10 +- .../ShippingZoneZipCodes.tsx | 23 ++-- .../PriceRatesUpdate/PriceRatesUpdate.tsx | 4 +- .../WeightRatesUpdate/WeightRatesUpdate.tsx | 4 +- .../__snapshots__/Stories.test.ts.snap | 128 +++++++++--------- 8 files changed, 127 insertions(+), 130 deletions(-) diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index 2f7279e23..60d203bbe 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -5380,12 +5380,12 @@ "src_dot_shipping_dot_components_dot_ShippingMethodProducts_dot_4190792473": { "string": "Actions" }, - "src_dot_shipping_dot_components_dot_ShippingRateZipCodeRangeRemoveDialog_dot_1083561409": { - "string": "Are you sure you want to remove this ZIP-code rule?" + "src_dot_shipping_dot_components_dot_ShippingRateZipCodeRangeRemoveDialog_dot_3640694505": { + "string": "Are you sure you want to remove this postal code rule?" }, - "src_dot_shipping_dot_components_dot_ShippingRateZipCodeRangeRemoveDialog_dot_2944856644": { + "src_dot_shipping_dot_components_dot_ShippingRateZipCodeRangeRemoveDialog_dot_76039652": { "context": "header", - "string": "Remove ZIP-codes from Shipping Rate" + "string": "Remove postal codes from Shipping Rate" }, "src_dot_shipping_dot_components_dot_ShippingWeightUnitForm_dot_2863708228": { "string": "This unit will be used as default shipping weight" @@ -5518,53 +5518,53 @@ "context": "input placeholder", "string": "Select Warehouse" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_1938537617": { - "string": "Please provide range of ZIP codes you want to add to the include/exclude list." + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_3070993206": { + "context": "range input label", + "string": "Postal codes (end)" }, "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_3099331554": { - "context": "add zip code range, button", + "context": "add postal code range, button", "string": "Add" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_3529644799": { + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_3419096551": { "context": "range input label", - "string": "Zip Codes (Start)" + "string": "Postal codes (start)" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_4196919717": { + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_3668595137": { + "string": "Please provide range of postal codes you want to add to the include/exclude list." + }, + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_3849853790": { "context": "dialog header", - "string": "Add ZIP-Codes" + "string": "Add postal codes" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodeRangeDialog_dot_551327109": { - "context": "range input label", - "string": "Zip Codes (End)" + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_1301350004": { + "string": "This shipping rate has no postal codes assigned" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_1462092303": { - "string": "Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate" - }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_1605967697": { + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_1680649143": { "context": "action", - "string": "Exclude ZIP-codes" + "string": "Include postal codes" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_2728850129": { - "string": "Only added ZIP-codes will be able to use this shipping rate" + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_1779803917": { + "string": "Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_2850315665": { - "context": "number of zip code ranges", - "string": "{number} ZIP-Code ranges" - }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_3795380518": { + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_1909179974": { "context": "button", - "string": "Add ZIP-Code range" + "string": "Add postal code range" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_4288715411": { - "string": "This shipping rate has no ZIP-codes assigned" + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_2274108851": { + "context": "number of postal code ranges", + "string": "{number} postal code ranges" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_529495587": { + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_2965119249": { + "string": "Only added postal codes will be able to use this shipping rate" + }, + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_3782353530": { "context": "postal codes, header", - "string": "ZIP-Codes" + "string": "Postal codes" }, - "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_671838332": { + "src_dot_shipping_dot_components_dot_ShippingZoneZipCodes_dot_399764149": { "context": "action", - "string": "Include ZIP-codes" + "string": "Exclude postal codes" }, "src_dot_shipping_dot_components_dot_ShippingZonesListPage_dot_1325966144": { "context": "header", @@ -5622,13 +5622,13 @@ "src_dot_shipping_dot_views_dot_PriceRatesCreate_dot_3823295269": { "string": "Manage Channel Availability" }, - "src_dot_shipping_dot_views_dot_PriceRatesUpdate_dot_2710215007": { - "context": "zip code range add error text", - "string": "Cannot add specified zip codes range." - }, "src_dot_shipping_dot_views_dot_PriceRatesUpdate_dot_3823295269": { "string": "Manage Channel Availability" }, + "src_dot_shipping_dot_views_dot_PriceRatesUpdate_dot_4243341946": { + "context": "postal code range add error text", + "string": "Cannot add specified postal codes range." + }, "src_dot_shipping_dot_views_dot_PriceRatesUpdate_dot_870815507": { "context": "unassign products from shipping method, button", "string": "Unassign" @@ -5648,13 +5648,13 @@ "src_dot_shipping_dot_views_dot_WeightRatesCreate_dot_3014453080": { "string": "Manage Channels Availability" }, - "src_dot_shipping_dot_views_dot_WeightRatesUpdate_dot_2710215007": { - "context": "zip code range add error text", - "string": "Cannot add specified zip codes range." - }, "src_dot_shipping_dot_views_dot_WeightRatesUpdate_dot_3014453080": { "string": "Manage Channels Availability" }, + "src_dot_shipping_dot_views_dot_WeightRatesUpdate_dot_4243341946": { + "context": "postal code range add error text", + "string": "Cannot add specified postal codes range." + }, "src_dot_shipping_dot_views_dot_WeightRatesUpdate_dot_870815507": { "context": "unassign products from shipping method, button", "string": "Unassign" diff --git a/src/shipping/components/ShippingRateZipCodeRangeRemoveDialog/ShippingRateZipCodeRangeRemoveDialog.tsx b/src/shipping/components/ShippingRateZipCodeRangeRemoveDialog/ShippingRateZipCodeRangeRemoveDialog.tsx index be3fe0e48..f04e41163 100644 --- a/src/shipping/components/ShippingRateZipCodeRangeRemoveDialog/ShippingRateZipCodeRangeRemoveDialog.tsx +++ b/src/shipping/components/ShippingRateZipCodeRangeRemoveDialog/ShippingRateZipCodeRangeRemoveDialog.tsx @@ -25,13 +25,13 @@ const ShippingRateZipCodeRangeRemoveDialog: React.FC - + ); diff --git a/src/shipping/components/ShippingZoneZipCodeRangeDialog/ShippingZoneZipCodeRangeDialog.stories.tsx b/src/shipping/components/ShippingZoneZipCodeRangeDialog/ShippingZoneZipCodeRangeDialog.stories.tsx index 3b60e7ce8..84825d06c 100644 --- a/src/shipping/components/ShippingZoneZipCodeRangeDialog/ShippingZoneZipCodeRangeDialog.stories.tsx +++ b/src/shipping/components/ShippingZoneZipCodeRangeDialog/ShippingZoneZipCodeRangeDialog.stories.tsx @@ -4,7 +4,7 @@ import React from "react"; import ShippingZoneZipCodeRangeDialog from "./ShippingZoneZipCodeRangeDialog"; -storiesOf("Shipping / Add zip code range", module) +storiesOf("Shipping / Add postal code range", module) .addDecorator(Decorator) .add("default", () => ( @@ -59,12 +59,12 @@ const ShippingZoneZipCodeRangeDialog: React.FC - + diff --git a/src/shipping/components/ShippingZoneZipCodes/ShippingZoneZipCodes.tsx b/src/shipping/components/ShippingZoneZipCodes/ShippingZoneZipCodes.tsx index b14fb03f4..7fb84cd58 100644 --- a/src/shipping/components/ShippingZoneZipCodes/ShippingZoneZipCodes.tsx +++ b/src/shipping/components/ShippingZoneZipCodes/ShippingZoneZipCodes.tsx @@ -48,9 +48,6 @@ const useStyles = makeStyles( width: 80 }, colCode: {}, - hide: { - display: "none" - }, option: { marginBottom: theme.spacing(2), width: 400 @@ -84,7 +81,7 @@ const ShippingZoneZipCodes: React.FC = ({ = ({ data-test="add-zip-code-range" > } /> - + = ({
- +
), @@ -126,12 +123,12 @@ const ShippingZoneZipCodes: React.FC = ({
- +
), @@ -158,8 +155,8 @@ const ShippingZoneZipCodes: React.FC = ({ ) : ( = ({ - + diff --git a/src/shipping/views/PriceRatesUpdate/PriceRatesUpdate.tsx b/src/shipping/views/PriceRatesUpdate/PriceRatesUpdate.tsx index 1d9c38299..010cbb8bd 100644 --- a/src/shipping/views/PriceRatesUpdate/PriceRatesUpdate.tsx +++ b/src/shipping/views/PriceRatesUpdate/PriceRatesUpdate.tsx @@ -125,8 +125,8 @@ export const PriceRatesUpdate: React.FC = ({ notify({ status: "error", text: intl.formatMessage({ - defaultMessage: "Cannot add specified zip codes range.", - description: "zip code range add error text" + defaultMessage: "Cannot add specified postal codes range.", + description: "postal code range add error text" }) }); } diff --git a/src/shipping/views/WeightRatesUpdate/WeightRatesUpdate.tsx b/src/shipping/views/WeightRatesUpdate/WeightRatesUpdate.tsx index 15153165b..53193e688 100644 --- a/src/shipping/views/WeightRatesUpdate/WeightRatesUpdate.tsx +++ b/src/shipping/views/WeightRatesUpdate/WeightRatesUpdate.tsx @@ -186,8 +186,8 @@ export const WeightRatesUpdate: React.FC = ({ notify({ status: "error", text: intl.formatMessage({ - defaultMessage: "Cannot add specified zip codes range.", - description: "zip code range add error text" + defaultMessage: "Cannot add specified postal codes range.", + description: "postal code range add error text" }) }); } diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 7f790fbf8..a9c60fc1e 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -13620,7 +13620,7 @@ exports[`Storyshots Product types / ProductTypeDeleteDialog default 1`] = ` exports[`Storyshots Products / ProductVariantImageSelectDialog default 1`] = `null`; -exports[`Storyshots Shipping / Add zip code range default 1`] = ` +exports[`Storyshots Shipping / Add postal code range default 1`] = `
@@ -15814,7 +15814,7 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page create price 1`] - ZIP-Codes + Postal codes
- Add ZIP-Code range + Add postal code range
@@ -15840,7 +15840,7 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page create price 1`] class="CardTitle-hr-id" />
- Exclude ZIP-codes + Exclude postal codes
- Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate + Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate
@@ -15969,12 +15969,12 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page create price 1`]
- Include ZIP-codes + Include postal codes
- Only added ZIP-codes will be able to use this shipping rate + Only added postal codes will be able to use this shipping rate
@@ -16007,7 +16007,7 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page create price 1`]
- 2 ZIP-Code ranges + 2 postal code ranges
- ZIP-Codes + Postal codes
- Add ZIP-Code range + Add postal code range
@@ -16663,7 +16663,7 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page create weight 1` class="CardTitle-hr-id" />
- Exclude ZIP-codes + Exclude postal codes
- Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate + Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate
@@ -16792,12 +16792,12 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page create weight 1`
- Include ZIP-codes + Include postal codes
- Only added ZIP-codes will be able to use this shipping rate + Only added postal codes will be able to use this shipping rate
@@ -16830,7 +16830,7 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page create weight 1`
- 2 ZIP-Code ranges + 2 postal code ranges
- ZIP-Codes + Postal codes
- Add ZIP-Code range + Add postal code range
@@ -17528,7 +17528,7 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page loading 1`] = ` class="CardTitle-hr-id" />
- Exclude ZIP-codes + Exclude postal codes
- Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate + Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate
@@ -17657,12 +17657,12 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page loading 1`] = `
- Include ZIP-codes + Include postal codes
- Only added ZIP-codes will be able to use this shipping rate + Only added postal codes will be able to use this shipping rate
@@ -17695,7 +17695,7 @@ exports[`Storyshots Shipping / ShippingZoneRatesCreatePage page loading 1`] = `
- 2 ZIP-Code ranges + 2 postal code ranges
- ZIP-Codes + Postal codes
- Add ZIP-Code range + Add postal code range
@@ -202865,7 +202865,7 @@ exports[`Storyshots Views / Shipping / Shipping rate create price rate 1`] = ` class="CardTitle-hr-id" />
- Exclude ZIP-codes + Exclude postal codes
- Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate + Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate
@@ -202994,12 +202994,12 @@ exports[`Storyshots Views / Shipping / Shipping rate create price rate 1`] = `
- Include ZIP-codes + Include postal codes
- Only added ZIP-codes will be able to use this shipping rate + Only added postal codes will be able to use this shipping rate
@@ -203032,7 +203032,7 @@ exports[`Storyshots Views / Shipping / Shipping rate create price rate 1`] = `
- 3 ZIP-Code ranges + 3 postal code ranges
- ZIP-Codes + Postal codes
- Add ZIP-Code range + Add postal code range
@@ -204043,7 +204043,7 @@ exports[`Storyshots Views / Shipping / Shipping rate create weight rate 1`] = ` class="CardTitle-hr-id" />
- Exclude ZIP-codes + Exclude postal codes
- Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate + Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate
@@ -204172,12 +204172,12 @@ exports[`Storyshots Views / Shipping / Shipping rate create weight rate 1`] = `
- Include ZIP-codes + Include postal codes
- Only added ZIP-codes will be able to use this shipping rate + Only added postal codes will be able to use this shipping rate
@@ -204210,7 +204210,7 @@ exports[`Storyshots Views / Shipping / Shipping rate create weight rate 1`] = `
- 3 ZIP-Code ranges + 3 postal code ranges
- ZIP-Codes + Postal codes
- Add ZIP-Code range + Add postal code range
@@ -205320,7 +205320,7 @@ exports[`Storyshots Views / Shipping / Shipping rate loading 1`] = ` class="CardTitle-hr-id" />
- Exclude ZIP-codes + Exclude postal codes
- Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate + Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate
@@ -205449,12 +205449,12 @@ exports[`Storyshots Views / Shipping / Shipping rate loading 1`] = `
- Include ZIP-codes + Include postal codes
- Only added ZIP-codes will be able to use this shipping rate + Only added postal codes will be able to use this shipping rate
@@ -206456,7 +206456,7 @@ exports[`Storyshots Views / Shipping / Shipping rate update price rate 1`] = ` - ZIP-Codes + Postal codes
- Add ZIP-Code range + Add postal code range
@@ -206482,7 +206482,7 @@ exports[`Storyshots Views / Shipping / Shipping rate update price rate 1`] = ` class="CardTitle-hr-id" />
- Exclude ZIP-codes + Exclude postal codes
- Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate + Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate
@@ -206611,12 +206611,12 @@ exports[`Storyshots Views / Shipping / Shipping rate update price rate 1`] = `
- Include ZIP-codes + Include postal codes
- Only added ZIP-codes will be able to use this shipping rate + Only added postal codes will be able to use this shipping rate
@@ -206649,7 +206649,7 @@ exports[`Storyshots Views / Shipping / Shipping rate update price rate 1`] = `
- 3 ZIP-Code ranges + 3 postal code ranges
- ZIP-Codes + Postal codes
- Add ZIP-Code range + Add postal code range
@@ -207744,7 +207744,7 @@ exports[`Storyshots Views / Shipping / Shipping rate update weight rate 1`] = ` class="CardTitle-hr-id" />
- Exclude ZIP-codes + Exclude postal codes
- Added ZIP-codes will be excluded from using this delivery methods. If none are added all ZIP-Codes will be able to use that shipping rate + Added postal codes will be excluded from using this delivery methods. If none are added all postal codes will be able to use that shipping rate
@@ -207873,12 +207873,12 @@ exports[`Storyshots Views / Shipping / Shipping rate update weight rate 1`] = `
- Include ZIP-codes + Include postal codes
- Only added ZIP-codes will be able to use this shipping rate + Only added postal codes will be able to use this shipping rate
@@ -207911,7 +207911,7 @@ exports[`Storyshots Views / Shipping / Shipping rate update weight rate 1`] = `
- 3 ZIP-Code ranges + 3 postal code ranges