From cf2f6d7f8be28fbc3226e0272b617393183b0907 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Thu, 15 Feb 2024 18:19:41 +0530 Subject: [PATCH] Implemented: support to display the storeName from group level instead of the one selected in current context(#99) --- src/components/RoutingHistoryModal.vue | 7 +++++-- src/store/modules/util/actions.ts | 2 +- src/views/BrokeringRoute.vue | 5 ++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/RoutingHistoryModal.vue b/src/components/RoutingHistoryModal.vue index a054b5e..98c5e80 100644 --- a/src/components/RoutingHistoryModal.vue +++ b/src/components/RoutingHistoryModal.vue @@ -18,7 +18,7 @@

{{ groupName }}

- {{ currentEComStore.productStoreId }} + {{ productStoreName }}
@@ -72,7 +72,10 @@ defineProps({ } }) -const currentEComStore = computed(() => store.getters["user/getCurrentEComStore"]) +const userProfile = computed(() => store.getters["user/getUserProfile"]) +const currentRoutingGroup: any = computed(() => store.getters["orderRouting/getCurrentRoutingGroup"]) + +const productStoreName = computed(() => userProfile.value.stores.find((store: any) => store.productStoreId === currentRoutingGroup.value.productStoreId)?.storeName || currentRoutingGroup.value.productStoreId) function closeModal() { modalController.dismiss(); diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index dede16f..f58b2d9 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -173,7 +173,7 @@ const actions: ActionTree = { commit(types.UTIL_SHIPPING_METHOD_UPDATED, {}) }, - async udpateFacillityGroups({ commit }) { + async updateFacillityGroups({ commit }) { commit(types.UTIL_FACILITY_GROUP_UPDATED, {}) } } diff --git a/src/views/BrokeringRoute.vue b/src/views/BrokeringRoute.vue index ed2e882..4492436 100644 --- a/src/views/BrokeringRoute.vue +++ b/src/views/BrokeringRoute.vue @@ -175,7 +175,6 @@ let orderRoutings = ref([]) as any let groupHistory = ref([]) as any const currentRoutingGroup: any = computed((): Group => store.getters["orderRouting/getCurrentRoutingGroup"]) -const currentEComStore = computed(() => store.getters["user/getCurrentEComStore"]) const isOmsConnectionExist = computed(() => store.getters["util/isOmsConnectionExist"]) const getStatusDesc = computed(() => (id: string) => store.getters["util/getStatusDesc"](id)) const routingHistory = computed(() => store.getters["orderRouting/getRoutingHistory"]) @@ -447,7 +446,7 @@ function getArchivedOrderRoutings() { async function updateGroupDescription() { // Do not update description, if the desc is unchanged, and we do not have routingGroupId, and description is left empty if(props.routingGroupId && currentRoutingGroup.value.description !== description.value) { - const routingGroupId = await updateRoutingGroup({ routingGroupId: props.routingGroupId, productStoreId: currentEComStore.value.productStoreId, description: description.value }) + const routingGroupId = await updateRoutingGroup({ routingGroupId: props.routingGroupId, productStoreId: currentRoutingGroup.value.productStoreId, description: description.value }) if(routingGroupId) { await store.dispatch("orderRouting/setCurrentGroup", { ...currentRoutingGroup.value, description: description.value }) } @@ -576,7 +575,7 @@ async function saveRoutingGroup() { const payload = { routingGroupId: props.routingGroupId, - productStoreId: currentEComStore.value.productStoreId, + productStoreId: currentRoutingGroup.value.productStoreId, routings }