diff --git a/src/components/SaveThresholdModal.vue b/src/components/SaveThresholdModal.vue new file mode 100644 index 00000000..f4e7399f --- /dev/null +++ b/src/components/SaveThresholdModal.vue @@ -0,0 +1,204 @@ + + + \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 7611b6af..ef26a2ce 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -14,6 +14,7 @@ "Don't skip": "Don't skip", "Download": "Download", "Download data in csv": "Download data in csv", + "Enter threshold value": "Enter threshold value", "Every 5 minutes": "Every 5 minutes", "Every 15 minutes": "Every 15 minutes", "Every 30 minutes": "Every 30 minutes", @@ -35,19 +36,23 @@ "No previous occurrence": "No previous occurrence", "Only show selected products": "Only show selected products", "Pending": "Pending", + "Please enter a threshold value to set for these products before proceeding.": "Please enter a threshold value to set for these products before proceeding.", "Product list": "Product list", "Product SKU column": "Product SKU column", "Products not found": "Products not found", "products selected": "products selected", + "Ok": "Ok", "OMS": "OMS", "Ready to create an app?": "Ready to create an app?", "reset": "reset", "retry": "retry", + "rule name": "rule name", "Running": "Running", "Run time": "Run time", "Save changes": "Save changes", "Schedule": "Schedule", "Results": "Results", + "Rule name": "Rule name", "Safety stock": "Safety stock", "Save": "Save", "Save threshold rule": "Save threshold rule", @@ -61,9 +66,11 @@ "Select locations": "Select locations", "Select the column index for the following information in the uploaded CSV": "Select the column index for the following information in the uploaded CSV", "Select run time": "Select run time", + "Service has been scheduled": "Service has been scheduled", "Set safety stock": "Set safety stock", "Settings": "Settings", "Shop": "Shop", + "SKUs": "SKUs", "Size": "Size", "Skip": "Skip", "Skip job": "Skip job", @@ -81,6 +88,7 @@ "There are no jobs pending right now": "There are no jobs pending right now", "There are no jobs running right now": "There are no jobs running right now", "Tags": "Tags", + "threshold": "threshold", "Threshold": "Threshold", "Threshold management": "Threshold management", "Threshold Management": "Threshold Management", diff --git a/src/services/ProductService.ts b/src/services/ProductService.ts index 8f5af63b..7dab171b 100644 --- a/src/services/ProductService.ts +++ b/src/services/ProductService.ts @@ -26,7 +26,16 @@ const fetchProductFacets = async (payload: any): Promise => { }) } +const createSearchPreference = async (payload: any): Promise => { + return api({ + url: "service/createSearchPreference", + method: "post", + data: payload + }); +} + export const ProductService = { + createSearchPreference, fetchProducts, fetchProductFacets, getProducts diff --git a/src/services/UtilService.ts b/src/services/UtilService.ts index 224f0033..dc53e676 100644 --- a/src/services/UtilService.ts +++ b/src/services/UtilService.ts @@ -9,6 +9,15 @@ const getServiceStatusDesc = async (payload: any): Promise => { }); } +const getShopifyConfig = async (payload: any): Promise => { + return api({ + url: "performFind", + method: "post", + data: payload + }); +} + export const UtilService = { - getServiceStatusDesc + getServiceStatusDesc, + getShopifyConfig } \ No newline at end of file diff --git a/src/store/modules/job/actions.ts b/src/store/modules/job/actions.ts index bc2e61c6..e11cbd2b 100644 --- a/src/store/modules/job/actions.ts +++ b/src/store/modules/job/actions.ts @@ -229,7 +229,7 @@ const actions: ActionTree = { }, "entityName": "JobSandbox", "noConditionFind": "Y", - "viewSize": (payload.inputFields?.systemJobEnumId?.length * 2) + "viewSize": payload.viewSize ? payload.viewSize : (payload.inputFields?.systemJobEnumId?.length * 2) }) if (resp.status === 200 && !hasError(resp) && resp.data.docs) { const cached = JSON.parse(JSON.stringify(state.cached)); diff --git a/src/store/modules/job/getters.ts b/src/store/modules/job/getters.ts index 5e7659da..f7ea8e46 100644 --- a/src/store/modules/job/getters.ts +++ b/src/store/modules/job/getters.ts @@ -38,6 +38,9 @@ const getters: GetterTree = { getJobHistory (state){ return state.history.list; }, + getJobs: (state) => { + return state.cached; + } } export default getters; \ No newline at end of file diff --git a/src/store/modules/util/UtilState.ts b/src/store/modules/util/UtilState.ts index a43d5b06..e755ad17 100644 --- a/src/store/modules/util/UtilState.ts +++ b/src/store/modules/util/UtilState.ts @@ -1,3 +1,4 @@ export default interface UtilState { statusDesc: any; + shopifyConfig: any; } \ No newline at end of file diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index c052ab72..89662f12 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -28,6 +28,25 @@ const actions: ActionTree = { console.error(err) } }, + + async getShopifyConfig({ commit }, payload) { + // TODO: for now passing view size as 1 by considering that one product store id is associated with only + // one shopify config + const resp = await UtilService.getShopifyConfig({ + "inputFields": { + "productStoreId": payload + }, + "entityName": "ShopifyConfig", + "noConditionFind": "Y", + "fieldList": ["shopifyConfigId", "productStoreId"], + "viewSize": 1 + }) + + if (resp.status === 200 && !hasError(resp)) { + commit(types.UTIL_SHOPIFY_CONFIG_UPDATED, resp.data.docs?.length > 0 ? resp.data.docs[0] : {}); + return resp.data.docs[0]; + } + }, } export default actions; \ No newline at end of file diff --git a/src/store/modules/util/getters.ts b/src/store/modules/util/getters.ts index 7918e532..a7873de5 100644 --- a/src/store/modules/util/getters.ts +++ b/src/store/modules/util/getters.ts @@ -5,6 +5,9 @@ import RootState from '@/store/RootState' const getters: GetterTree = { getStatusDesc: (state) => (statusId: any) => { return state.statusDesc[statusId] ? state.statusDesc[statusId] : "-"; - } + }, + getShopifyConfig(state) { + return state.shopifyConfig +} } export default getters; \ No newline at end of file diff --git a/src/store/modules/util/index.ts b/src/store/modules/util/index.ts index 48861ca1..7471d517 100644 --- a/src/store/modules/util/index.ts +++ b/src/store/modules/util/index.ts @@ -8,7 +8,8 @@ import RootState from '@/store/RootState' const utilModule: Module = { namespaced: true, state: { - statusDesc: {} + statusDesc: {}, + shopifyConfig: {} }, getters, actions, diff --git a/src/store/modules/util/mutation-types.ts b/src/store/modules/util/mutation-types.ts index 88fb7638..449a45cd 100644 --- a/src/store/modules/util/mutation-types.ts +++ b/src/store/modules/util/mutation-types.ts @@ -1,2 +1,3 @@ export const SN_UTIL = 'util' -export const UTIL_SERVICE_STATUS_DESC_UPDATED = SN_UTIL + '/SERVICE_STATUS_DESC_UPDATED' \ No newline at end of file +export const UTIL_SERVICE_STATUS_DESC_UPDATED = SN_UTIL + '/SERVICE_STATUS_DESC_UPDATED' +export const UTIL_SHOPIFY_CONFIG_UPDATED = SN_UTIL + '/SHOPIFY_CONFIG_UPDATED' \ No newline at end of file diff --git a/src/store/modules/util/mutations.ts b/src/store/modules/util/mutations.ts index e3530da4..3bff9058 100644 --- a/src/store/modules/util/mutations.ts +++ b/src/store/modules/util/mutations.ts @@ -7,6 +7,9 @@ const mutations: MutationTree = { payload.map((status: any) => { state.statusDesc[status.statusId] = status.description; }) + }, + [types.UTIL_SHOPIFY_CONFIG_UPDATED] (state, payload) { + state.shopifyConfig[payload.productStoreId] = payload.shopifyConfigId; } } export default mutations; \ No newline at end of file diff --git a/src/views/SelectProduct.vue b/src/views/SelectProduct.vue index 37b71ef8..0df9ad46 100644 --- a/src/views/SelectProduct.vue +++ b/src/views/SelectProduct.vue @@ -22,7 +22,7 @@ {{ $t("Threshold") }} - +

{{ $t("Include") }}

@@ -39,7 +39,7 @@ - + {{ tag }} @@ -57,7 +57,7 @@ - + {{ category }} @@ -81,7 +81,7 @@ - + {{ tag }} @@ -99,7 +99,7 @@ - + {{ category }} @@ -158,7 +158,7 @@
- + {{ $t("Save threshold rule") }} @@ -176,6 +176,7 @@