diff --git a/src/locales/en.json b/src/locales/en.json index e8626db..9660c8d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -36,6 +36,7 @@ "Display current physical quantity expected at locations while inventory counting.": "Display current physical quantity expected at locations while inventory counting.", "Edit": "Edit", "facilities": "{count} facilities", + "facility": "{count} facility", "Failed to create product store.": "Failed to create product store.", "Failed to remove tag.": "Failed to remove tag.", "Failed to update product store name.": "Failed to update product store name.", @@ -46,7 +47,7 @@ "Go to OMS": "Go to OMS", "Hold pre-order physical inventory": "Hold pre-order physical inventory", "ID": "ID", - "Id prefix": "Id prefix", + "ID prefix": "ID prefix", "Identifier": "Identifier", "Import": "Import", "Inventory": "Inventory", @@ -85,6 +86,7 @@ "Product store created successfully.": "Product store created successfully.", "Product store configurations updated successfully.": "Product store configurations updated successfully.", "Product store ID cannot be more than 20 characters.": "Product store ID cannot be more than 20 characters.", + "Product store ID represents an unique ID for your product store": "Product store ID represents an unique ID for your product store", "Product store name": "Product store name", "Product store name can't be empty.": "Product store name can't be empty.", "Product store name updated successfully.": "Product store name updated successfully.", @@ -99,11 +101,13 @@ "Search time zones": "Search time zones", "Soft Allocation": "Soft Allocation", "Secondary identifier": "Secondary identifier", + "Select": "Select", "Select operating countries": "Select operating countries", "Select time zone": "Select time zone", "Send notification to Shopify": "Send notification to Shopify", "Settings": "Settings", "Setup product store": "Setup product store", + "shipping method": "{count} shipping method", "shipping methods": "{count} shipping methods", "Shipment method": "Shipment method", "Shipping facility tag": "Shipping facility tag", diff --git a/src/router/index.ts b/src/router/index.ts index 1b8b936..110cd5b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -57,7 +57,11 @@ const routes: Array = [ { path: "/add-configurations/:productStoreId", name: "AddConfigurations", - component: AddConfigurations + component: AddConfigurations, + beforeEnter: (to, from, next) => { + if(from.path === "/create-product-store") next() + else router.push(from.path) + } }, { path: "/product-store-details/:productStoreId", diff --git a/src/services/UserService.ts b/src/services/UserService.ts index e136c77..009e637 100644 --- a/src/services/UserService.ts +++ b/src/services/UserService.ts @@ -49,9 +49,12 @@ const getUserProfile = async (token: any): Promise => { } const getAvailableTimeZones = async (): Promise => { - return api({ + const url = store.getters["user/getBaseUrl"] + const baseURL = url.startsWith('http') ? url.includes('/rest/s1/admin') ? url.replace("admin", "available-to-promise") : `${url}/rest/s1/available-to-promise/` : `https://${url}.hotwax.io/rest/s1/available-to-promise/`; + return client({ url: "user/getAvailableTimeZones", method: "get", + baseURL, cache: true }); } diff --git a/src/views/AddConfigurations.vue b/src/views/AddConfigurations.vue index a1dd035..acb7405 100644 --- a/src/views/AddConfigurations.vue +++ b/src/views/AddConfigurations.vue @@ -2,7 +2,7 @@ - + {{ translate("Add configurations") }} @@ -105,7 +105,7 @@ async function setupProductStore() { const resp = await ProductStoreService.updateProductStore(payload); if(!hasError(resp)) { showToast(translate("Product store configurations updated successfully.")) - router.push(`/product-store-details/${productStore.value.productStoreId}`); + router.replace(`/product-store-details/${productStore.value.productStoreId}`); } else { throw resp.data; } @@ -113,7 +113,6 @@ async function setupProductStore() { logger.error(error) showToast(translate("Failed to add configurations to the product store.")) } - } diff --git a/src/views/CreateProductStore.vue b/src/views/CreateProductStore.vue index 465a92d..bedc347 100644 --- a/src/views/CreateProductStore.vue +++ b/src/views/CreateProductStore.vue @@ -21,7 +21,7 @@ - + @@ -126,12 +126,12 @@ async function manageConfigurations() { } showToast(translate("Product store created successfully.")) - router.push(`add-configurations/${productStoreId}`); + router.replace(`add-configurations/${productStoreId}`); } else { throw resp.data; } } catch(error: any) { - showToast(translate("Failed to create product store.")) + showToast(translate(error.response?.data?.errors ? error.response.data.errors : "Failed to create product store.")) logger.error(error); } } diff --git a/src/views/ProductStore.vue b/src/views/ProductStore.vue index 25bc92e..2865ced 100644 --- a/src/views/ProductStore.vue +++ b/src/views/ProductStore.vue @@ -19,14 +19,14 @@
- {{ translate("facilities", { count: store.facilityCount }) }} + {{ translate(store.facilityCount > 1 ? "facilities" : "facility", { count: store.facilityCount }) }}
- {{ translate("shipping methods", { count: store.shipmentMethodCount }) }} + {{ translate(store.shipmentMethodCount > 1 ? "shipping methods" : "shipping method", { count: store.shipmentMethodCount }) }}
diff --git a/src/views/ProductStoreDetails.vue b/src/views/ProductStoreDetails.vue index 23bcc13..fbce0e8 100644 --- a/src/views/ProductStoreDetails.vue +++ b/src/views/ProductStoreDetails.vue @@ -28,7 +28,7 @@
- + {{ translate("Order brokering") }} @@ -52,7 +52,7 @@ - + @@ -245,7 +245,7 @@ - + {{ group.facilityGroupName }} @@ -268,7 +268,7 @@ - + {{ identifier.description }} @@ -283,13 +283,13 @@ - + {{ option }} - + {{ option }} @@ -316,7 +316,7 @@ - + {{ shipmentMethod.description ? shipmentMethod.description : shipmentMethod.shipmentMethodTypeId }} @@ -347,7 +347,7 @@