Skip to content

Commit

Permalink
Fixed: support to not open the details page for unarchived route(#145)
Browse files Browse the repository at this point in the history
When finding the index number for routes we honor the active and draft routes, but as the route is unarchived but not saved in the state, then the index for the route is not found resulting in displaying NaN.
Added toast message to not redirect the user to the details page in the above case
  • Loading branch information
ymaheshwari1 committed Apr 4, 2024
1 parent 176df7a commit be2ef43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"Sales Channel": "Sales Channel",
"Save": "Save",
"Save changes": "Save changes",
"Save changes before moving to the details page of unarchived route": "Save changes before moving to the details page of unarchived route",
"Schedule": "Schedule",
"Scheduler": "Scheduler",
"Search groups": "Search groups",
Expand Down
7 changes: 7 additions & 0 deletions src/views/BrokeringRoute.vue
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@ async function runNow() {
}
async function redirect(orderRouting: Route) {
let isRoutingArchived = currentRoutingGroup.value["routings"].some((routing: any) => routing.orderRoutingId === orderRouting.orderRoutingId && routing.statusId === "ROUTING_ARCHIVED" )
if(isRoutingArchived) {
showToast(translate("Save changes before moving to the details page of unarchived route"))
return;
}
await store.dispatch("orderRouting/setCurrentOrderRouting", orderRouting)
router.push(`${orderRouting.orderRoutingId}/rules`)
}
Expand Down

0 comments on commit be2ef43

Please sign in to comment.