Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: Clean up UI for BOPIS inventory lookup (#470) #509

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Choose language": "Choose language",
"City": "City",
"Click the backdrop to dismiss.": "Click the backdrop to dismiss.",
"Closed": "Closed",
"Color:": "Color: {color}",
"Colors": "Colors",
"Confirm Cancelation": "Confirm Cancelation",
Expand Down Expand Up @@ -66,12 +67,14 @@
"Fetching pickers": "Fetching pickers",
"Fetching facilities": "Fetching facilities",
"First name": "First name",
"friday": "Friday",
"Generate packing slips": "Generate packing slips",
"Generate shipping documents": "Generate shipping documents",
"Go to OMS": "Go to OMS",
"Go to Launchpad": "Go to Launchpad",
"Handover": "Handover",
"Handling Instructions": "Handling Instructions",
"Hide facilities without stock": "Hide facilities without stock",
"If you cannot fulfill this order, will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.": "If you cannot fulfill this order, {customerName} will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.",
"Imported from Shopify": "Imported from Shopify",
"Inactive store": "Inactive store",
Expand All @@ -94,8 +97,10 @@
"Logging out": "Logging out",
"Logout": "Logout",
"Method": "Method",
"miles": "miles",
"Mismatch": "Mismatch",
"Mis-Ordered Item": "Mis-Ordered Item",
"monday": "Monday",
"More": "More",
"New notification received.": "New notification received.",
"No facilities found": "No facilities found",
Expand Down Expand Up @@ -190,8 +195,10 @@
"Resend email": "Resend email",
"Reserved": "Reserved",
"Safety stock": "Safety stock",
"saturday": "Saturday",
"Search": "Search",
"Search Orders": "Search Orders",
"Search store name": "Search store name",
"Search time zones": "Search time zones",
"Secondary": "Secondary",
"Select facility": "Select facility",
Expand Down Expand Up @@ -235,6 +242,7 @@
"Street": "Street",
"Store": "Store",
"Summary": "Summary",
"sunday": "Sunday",
"Timezone": "Timezone",
"Timeline": "Timeline",
"Time zone updated successfully": "Time zone updated successfully",
Expand All @@ -243,14 +251,17 @@
"Selected variant not available": "Selected variant not available",
"This order cannot be split. If you cannot fulfill any item, will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.": "This order cannot be split. If you cannot fulfill any item, { customerName } will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.",
"This order will be rejected from this store with the selected reason and shipped to the address that has been inputed.Please make sure the address you have entered is correct.": "This order will be rejected from this store with the selected reason and shipped to the address that has been inputed. { space } Please make sure the address you have entered is correct.",
"thursday": "Thursday",
"Total": "Total",
"Track Pickers": "Track Pickers",
"Track who picked orders by entering picker IDs when packing an order.": "Track who picked orders by entering picker IDs when packing an order.",
"tuesday": "Tuesday",
"Unable to open as browser is blocking pop-ups.": "Unable to open { documentName } as browser is blocking pop-ups.",
"Unfillable Items": "Unfillable Items",
"Update time zone": "Update time zone",
"Username": "Username",
"Warehouse": "Warehouse",
"wednesday": "Wednesday",
"will be removed from your dashboard. This action cannot be undone.": "{ productName } will be removed from your dashboard.{ space } This action cannot be undone.",
"Worn Display": "Worn Display",
"This order will be removed from your dashboard. This action cannot be undone.": "This order will be removed from your dashboard.{ space } This action cannot be undone.",
Expand Down
11 changes: 11 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Choose language": "Elegir idioma",
"City": "Ciudad",
"Click the backdrop to dismiss.": "Haz clic en el fondo para cerrar.",
"Closed": "Closed",
"Colors": "Colores",
"Confirm Cancelation": "Confirm Cancelation",
"Complete": "Completar",
Expand Down Expand Up @@ -65,12 +66,14 @@
"Fetching pickers": "Fetching pickers",
"Fetching facilities": "Fetching facilities",
"First name": "Nombre",
"friday": "Friday",
"Generate packing slips": "Generar documentos de embalaje",
"Generate shipping documents": "Generar documentos de envío",
"Go to OMS": "Ir a OMS",
"Go to Launchpad": "Ir a la plataforma de lanzamiento",
"Handover": "Entregar",
"Handling Instructions": "Instrucciones de manejo",
"Hide facilities without stock": "Hide facilities without stock",
"Imported from Shopify": "Imported from Shopify",
"Inactive store": "Tienda inactiva",
"in stock": "en stock",
Expand All @@ -92,8 +95,10 @@
"Logging out": "Cerrando sesión",
"Logout": "Cerrar sesión",
"Method": "Method",
"miles": "miles",
"Mismatch": "Desajuste",
"Mis-Ordered Item": "Mis-Ordered Item",
"monday": "Monday",
"More": "Más",
"New notification received.": "Nueva notificación recibida.",
"No facilities found": "No facilities found",
Expand Down Expand Up @@ -187,8 +192,10 @@
"Resend email": "Reenviar correo electrónico",
"Reserved": "Reserved",
"Safety stock": "Safety stock",
"saturday": "Saturday",
"Search": "Buscar",
"Search Orders": "Buscar pedidos",
"Search store name": "Search store name",
"Search time zones": "Buscar zonas horarias",
"Secondary": "Secondary",
"Select facility": "Seleccionar instalación",
Expand Down Expand Up @@ -232,6 +239,7 @@
"Street": "Calle",
"Store": "Tienda",
"Summary": "Summary",
"sunday": "Sunday",
"Timeline": "Timeline",
"Timezone": "Zona horaria",
"Time zone updated successfully": "Zona horaria actualizada exitosamente",
Expand All @@ -240,14 +248,17 @@
"Selected variant not available": "Variante seleccionada no disponible",
"This order cannot be split. If you cannot fulfill any item, an email will be sent with alternate fulfillment options, and this order will be removed from your dashboard.": "Este pedido no se puede dividir. Si no puedes cumplir con algún artículo, { customerName } se enviará un correo electrónico con opciones de cumplimiento alternativas y este pedido se eliminará de tu panel de control.",
"This order will be rejected from this store with the selected reason and shipped to the address that has been inputted. Please make sure the address you have entered is correct.": "Este pedido será rechazado en esta tienda con la razón seleccionada y se enviará a la dirección que se ha ingresado.{ space } Por favor, asegúrate de que la dirección que has ingresado sea correcta.",
"thursday": "Thursday",
"Total": "Total",
"Track Pickers": "Seguimiento de recolectores",
"Track who picked orders by entering picker IDs when packing an order.": "Realiza un seguimiento de quién recogió los pedidos ingresando los ID de los recolectores al empacar un pedido.",
"tuesday": "Tuesday",
"Unable to open as browser is blocking pop-ups.": "No se puede abrir {documentName} porque el navegador bloquea las ventanas emergentes.",
"Unfillable Items": "Artículos no disponibles",
"Update time zone": "Actualizar zona horaria",
"Username": "Nombre de usuario",
"Warehouse": "Almacén",
"wednesday": "Wednesday",
"will be removed from your dashboard. This action cannot be undone.": "{ productName } se eliminará de su panel de control.{ space } Esta acción no se puede deshacer.",
"Worn Display": "Pantalla desgastada",
"This order will be removed from your dashboard. This action cannot be undone.": "Este pedido será eliminado de tu panel de control.{ space } Esta acción no se puede deshacer.",
Expand Down
11 changes: 11 additions & 0 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"Choose language": "言語を選択",
"City": "街",
"Click the backdrop to dismiss.": "背景をクリックして閉じます。",
"Closed": "Closed",
"Colors": "色",
"Confirm Cancelation": "Confirm Cancelation",
"Complete": "完了",
Expand Down Expand Up @@ -63,12 +64,14 @@
"Fetching pickers": "Fetching pickers",
"Fetching facilities": "Fetching facilities",
"First name": "名",
"friday": "Friday",
"Generate packing slips": "内容明細票の作成",
"Generate shipping documents": "出荷書類を生成する",
"Go to OMS": "OMSへ",
"Go to Launchpad": "Launchpadへ移動",
"Handover": "引き継ぐ",
"Handling Instructions": "取扱説明",
"Hide facilities without stock": "Hide facilities without stock",
"Imported from Shopify": "Imported from Shopify",
"Inactive store": "休止店舗",
"in stock": "在庫あり",
Expand All @@ -89,8 +92,10 @@
"Logging in": "ログイン中",
"Logging out": "ログアウト中",
"Logout": "ログアウト",
"miles": "miles",
"Mismatch": "不一致",
"Mis-Ordered Item": "Mis-Ordered Item",
"monday": "Monday",
"More": "もっと見る",
"New notification received.": "新しい通知を受信しました。",
"No facilities found": "No facilities found",
Expand Down Expand Up @@ -183,8 +188,10 @@
"Resend email": "メールを再送する",
"Reserved": "Reserved",
"Safety stock": "安全在庫",
"saturday": "Saturday",
"Search": "検索",
"Search Orders": "注文の検索",
"Search store name": "Search store name",
"Search time zones": "タイムゾーンの検索",
"Secondary": "Secondary",
"Select Facility": "Select Facility",
Expand Down Expand Up @@ -225,6 +232,7 @@
"Street": "市区町村",
"Store": "ストア",
"Summary": "Summary",
"sunday": "Sunday",
"Timeline": "Timeline",
"Timezone": "タイムゾーン",
"Time zone updated successfully": "タイムゾーンの更新成功",
Expand All @@ -233,15 +241,18 @@
"Selected variant not available": "選択したバリアントは利用できません",
"This order cannot be split. If you cannot fulfill any item, will be sent an email with alternate fulfillment options and this order will be removed from your dashboard.": "この注文は分割できません。どのアイテムもフィフィルできない場合、{ customerName } に別の発送オプションを記載したメールが送信され、ダッシュボードから注文が削除されます。",
"This order will be rejected from this store with the selected reason and shipped to the address that has been inputed.Please make sure the address you have entered is correct.": "この注文は、選択された理由によりこのストアから拒否され、入力された住所に発送されます。{ space } 入力したアドレスが正しいことを確認してください。",
"thursday": "Thursday",
"Total": "Total",
"Track Pickers": "受取人の追跡",
"Track who picked orders by entering picker IDs when packing an order.": "注文を梱包する際に受取人IDを入力することで、誰が注文を受け取ったかを追跡できます。",
"tuesday": "Tuesday",
"Unable to login. User is not associated with any facility": "Unable to login. User is not associated with any facility",
"Unable to open as browser is blocking pop-ups.": "ブラウザーがポップアップをブロックしているため、{documentName} を開くことができません。",
"Unfillable Items": "記入不可の項目",
"Update time zone": "タイムゾーンを更新する",
"Username": "ユーザーネーム",
"Warehouse": "倉庫",
"wednesday": "Wednesday",
"will be removed from your dashboard. This action cannot be undone.": "{productName} はダッシュボードから削除されます。{space} この操作は元に戻せません。",
"Worn Display": "すり切れたディスプレイ",
"This order will be removed from your dashboard. This action cannot be undone.": "この注文はダッシュボードから削除されます。{ space } この操作は元に戻せません。",
Expand Down
20 changes: 19 additions & 1 deletion src/services/UtilService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ const fetchEnumerations = async (payload: any): Promise<any> => {
});
}

const fetchCurrentFacilityLatLon = async (payload: any): Promise<any> => {
return api({
url: "performFind",
method: "post",
data: payload
});
}

const fetchStoresInformation = async (payload: any): Promise<any> => {
return api({
url: "storeLookup",
method: "post",
data: payload
});
}

export const UtilService = {
createEnumeration,
createProductStoreSetting,
Expand All @@ -163,5 +179,7 @@ export const UtilService = {
isEnumExists,
resetPicker,
updateProductStoreSetting,
fetchReservedQuantity
fetchReservedQuantity,
fetchCurrentFacilityLatLon,
fetchStoresInformation
}
3 changes: 2 additions & 1 deletion src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* Login user and return token
*/
async login ({ commit, dispatch, getters }, payload) {

Check warning on line 36 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'getters' is defined but never used

Check warning on line 36 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'getters' is defined but never used
try {
const {token, oms} = payload;
dispatch("setUserInstanceUrl", oms);
Expand Down Expand Up @@ -156,7 +156,8 @@
this.dispatch('util/updateCancelReasons', [])
this.dispatch("util/clearFacilities", {})
this.dispatch("util/clearEnumerations", {})
this.dispatch('order/clearOrders')
this.dispatch("util/clearCurrentFacilityLatLon", {})
this.dispatch("util/clearStoresInformation", {})
commit(types.USER_END_SESSION)
resetPermissions();
resetConfig();
Expand Down Expand Up @@ -334,7 +335,7 @@
commit(types.USER_ALL_NOTIFICATION_PREFS_UPDATED, allNotificationPrefs)
},

async fetchBopisProductStoreSettings({ commit, dispatch }) {

Check warning on line 338 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 338 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
const productStoreSettings = JSON.parse(process.env.VUE_APP_PRODUCT_STORE_SETTING_ENUMS);
const settingValues = {} as any;

Expand Down Expand Up @@ -368,7 +369,7 @@
commit(types.USER_BOPIS_PRODUCT_STORE_SETTINGS_UPDATED, settingValues)
},

async createProductStoreSetting({ commit }, enumeration) {

Check warning on line 372 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'commit' is defined but never used

Check warning on line 372 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'commit' is defined but never used
const fromDate = Date.now()

try {
Expand Down Expand Up @@ -400,8 +401,8 @@
return fromDate;
},

async setProductStoreSetting({ commit, dispatch, state }, payload) {

Check warning on line 404 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'dispatch' is defined but never used

Check warning on line 404 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'dispatch' is defined but never used
const productStoreSettings = JSON.parse(process.env.VUE_APP_PRODUCT_STORE_SETTING_ENUMS);

Check warning on line 405 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'productStoreSettings' is assigned a value but never used

Check warning on line 405 in src/store/modules/user/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'productStoreSettings' is assigned a value but never used
let prefValue = state.bopisProductStoreSettings[payload.enumId]
const eComStoreId = this.state.user.currentEComStore.productStoreId;

Expand Down
4 changes: 4 additions & 0 deletions src/store/modules/util/UtilState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ export default interface UtilState {
cancelReasons: Array<any>;
facilities: any;
enumerations: any;
facilitiesLatLng: {
[facilityId :string]: { latitude: any , longitude: any }
},
storesInformation: any;
}
60 changes: 60 additions & 0 deletions src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,66 @@ const actions: ActionTree<UtilState, RootState> = {

async clearEnumerations({ commit }) {
commit(types.UTIL_ENUMERATIONS_UPDATED, {})
},

async fetchCurrentFacilityLatLon({ commit }, facilityId) {
const payload = {
inputFields: {
facilityId
},
entityName: "FacilityContactDetailByPurpose",
orderBy: "fromDate DESC",
filterByDate: "Y",
fieldList: ["latitude", "longitude"],
viewSize: 5
}

try {
const resp = await UtilService.fetchCurrentFacilityLatLon(payload)

if (!hasError(resp) && resp.data?.docs.length > 0) {
// Find first doc with non-null coordinates
const validCoords = resp.data.docs.find((doc: any) =>
doc.latitude !== null && doc.longitude !== null
)

if (validCoords) {
commit(types.UTIL_FACILITY_LAT_LON_UPDATED, { facilityId, validCoords })
}
} else {
throw resp.data
}
} catch (err) {
logger.error("Failed to fetch facility lat/long information", err)
}
},

async clearCurrentFacilityLatLon({ commit }) {
commit(types.UTIL_FACILITY_LAT_LON_UPDATED, {})
},

async fetchStoresInformation({ commit }, point) {
const payload = {
viewSize: 250,
filters: ["storeType: RETAIL_STORE"],
point: `${point.latitude},${point.longitude}`
}

try {
const resp = await UtilService.fetchStoresInformation(payload)

if (!hasError(resp) && resp.data?.response?.docs?.length > 0) {
commit(types.UTIL_STORES_INFORMATION_UPDATED, resp.data.response.docs)
} else {
throw resp.data
}
} catch (err) {
logger.error("Failed to fetch stores information by lat/lon", err)
}
},

async clearStoresInformation({ commit }) {
commit(types.UTIL_STORES_INFORMATION_UPDATED, [])
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/store/modules/util/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,11 @@ const getters: GetterTree <UtilState, RootState> = {
getEnumDescription: (state) => (enumId: string) => {
return state.enumerations[enumId] ? state.enumerations[enumId] : enumId
},
getFacilityLatLon: (state) => (facilityId: string) => {
return state.facilitiesLatLng[facilityId] ? state.facilitiesLatLng[facilityId] : {}
},
getStoresInformation: (state) => {
return state.storesInformation ? state.storesInformation : []
}
}
export default getters;
4 changes: 3 additions & 1 deletion src/store/modules/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const utilModule: Module<UtilState, RootState> = {
partyNames: {},
cancelReasons: [],
facilities: {},
enumerations: {}
enumerations: {},
facilitiesLatLng: {},
storesInformation: []
},
getters,
actions,
Expand Down
2 changes: 2 additions & 0 deletions src/store/modules/util/mutation-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ export const UTIL_PARTY_NAMES_UPDATED = SN_UTIL + '/PARTY_NAMES_UPDATED'
export const UTIL_CANCEL_REASONS_UPDATED = SN_UTIL + '/CANCEL_REASONS_UPDATED'
export const UTIL_FACILITIES_UPDATED = SN_UTIL + '/FACILITIES_UPDATED'
export const UTIL_ENUMERATIONS_UPDATED = SN_UTIL + '/ENUMERATIONS_UPDATED'
export const UTIL_FACILITY_LAT_LON_UPDATED = SN_UTIL + '/FACILITY_LAT_LON_UPDATED'
export const UTIL_STORES_INFORMATION_UPDATED = SN_UTIL + '/STORES_INFORMATION_UPDATED'
6 changes: 6 additions & 0 deletions src/store/modules/util/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,11 @@ const mutations: MutationTree <UtilState> = {
[types.UTIL_ENUMERATIONS_UPDATED] (state, payload) {
state.enumerations = payload
},
[types.UTIL_FACILITY_LAT_LON_UPDATED] (state, payload) {
state.facilitiesLatLng[payload.facilityId] = payload.validCoords
},
[types.UTIL_STORES_INFORMATION_UPDATED] (state, payload) {
state.storesInformation = payload
}
}
export default mutations;
Loading
Loading