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: support to fetch order data on order update and passed order category through routing #330

Merged
merged 11 commits into from
Oct 23, 2023
Merged
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
5 changes: 4 additions & 1 deletion src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default defineComponent({
url: "/open",
iosIcon: mailUnreadOutline,
mdIcon: mailUnreadOutline,
childRoutes: ["/open/"],
meta: {
permissionId: "APP_OPEN_ORDERS_VIEW"
}
Expand All @@ -89,6 +90,7 @@ export default defineComponent({
url: "/in-progress",
iosIcon: mailOpenOutline,
mdIcon: mailOpenOutline,
childRoutes: ["/in-progress/"],
meta: {
permissionId: "APP_IN_PROGRESS_ORDERS_VIEW"
}
Expand All @@ -98,6 +100,7 @@ export default defineComponent({
url: "/completed",
iosIcon: checkmarkDoneOutline,
mdIcon: checkmarkDoneOutline,
childRoutes: ["/completed/"],
meta: {
permissionId: "APP_COMPLETED_ORDERS_VIEW"
}
Expand All @@ -122,7 +125,7 @@ export default defineComponent({

const selectedIndex = computed(() => {
const path = router.currentRoute.value.path
return appPages.findIndex((screen) => screen.url === path || screen.childRoutes?.includes(path))
return appPages.findIndex((screen) => screen.url === path || screen.childRoutes?.includes(path) || screen.childRoutes?.some((route) => path.includes(route)))
})

return {
Expand Down
4 changes: 2 additions & 2 deletions src/components/OrderActionsPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ion-icon slot="end" :icon="copyOutline" />
{{ translate("Copy ID") }}
</ion-item>
<ion-item v-if="category === 'open'" button lines="none" @click="assignPickers">
<ion-item v-if="category === 'open'" button @click="assignPickers">
<ion-icon slot="end" :icon="bagCheckOutline" />
{{ translate("Pick order") }}
</ion-item>
Expand Down Expand Up @@ -70,7 +70,7 @@ export default defineComponent({
async viewOrder() {
this.store.dispatch('order/updateCurrent', this.order).then(() => {
this.closePopover();
this.$router.push({ path: `/order-detail/${this.order.orderId}` })
this.$router.push({ path: `${this.category}/order-detail/${this.order.orderId}/${this.order.shipGroupSeqId}` })
})
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
"Shipping labels": "Shipping labels",
"Some of the mapping fields are missing in the CSV: ": "Some of the mapping fields are missing in the CSV: {missingFields}",
"Something went wrong": "Something went wrong",
"Something went wrong, could not fetch order details.": "Something went wrong, could not fetch order details.",
"Something went wrong, could not edit picker(s)": "Something went wrong, could not edit picker(s)",
"Something went wrong while login. Please contact administrator.": "Something went wrong while login. Please contact administrator.",
"Sorry, your username or password is incorrect. Please try again.": "Sorry, your username or password is incorrect. Please try again.",
Expand Down Expand Up @@ -289,6 +290,7 @@
"Turn on fulfillment": "Turn on fulfillment",
"Turn on fulfillment for ": "Turn on fulfillment for { facilityName }",
"Turn off fulfillment for ": "Turn off fulfillment for { facilityName }",
"Unable to fetch the order details. Either the order has been shipped or something went wrong. Please try again after some time.": "Unable to fetch the order details. Either the order has been shipped or something went wrong. Please try again after some time.",
"Unlimited": "Unlimited",
"Unlimited Capacity": "Unlimited Capacity",
"Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.": "Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
"Shipping labels": "Etiquetas de Envío",
"Some of the mapping fields are missing in the CSV: ": "Some of the mapping fields are missing in the CSV: {missingFields}",
"Something went wrong": "Algo salió mal",
"Something went wrong, could not fetch order details.": "Something went wrong, could not fetch order details.",
"Something went wrong, could not edit picker(s)": "Something went wrong, could not edit picker(s)",
"Something went wrong while login. Please contact administrator.": "Something went wrong while login. Please contact administrator.",
"Sorry, your username or password is incorrect. Please try again.": "Lo siento, tu nombre de usuario o contraseña es incorrecto. Por favor, inténtalo nuevamente.",
Expand Down Expand Up @@ -291,6 +292,7 @@
"Turn on fulfillment": "Activar Cumplimiento",
"Turn on fulfillment for ": "Activar cumplimiento para {facilityName}",
"Turn off fulfillment for ": "Desactivar cumplimiento para {facilityName}",
"Unable to fetch the order details. Either the order has been shipped or something went wrong. Please try again after some time.": "Unable to fetch the order details. Either the order has been shipped or something went wrong. Please try again after some time.",
"Unlimited": "Unlimited",
"Unlimited Capacity": "Unlimited Capacity",
"Unlimited fulfillment capacity": "Unlimited fulfillment capacity",
Expand Down
3 changes: 2 additions & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ const routes: Array<RouteRecordRaw> = [
}
},
{
path: '/order-detail/:orderId',
path: '/:category/order-detail/:orderId/:shipGroupSeqId',
name: 'OrderDetail',
component: OrderDetail,
beforeEnter: authGuard,
props: true,
meta: {
permissionId: "APP_ORDER_DETAIL_VIEW"
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const state: any = {
}

const persistState = createPersistedState({
paths: ['user', 'order.current'],
paths: ['user'],
fetchBeforeUse: true
})

Expand Down
Loading
Loading