diff --git a/src/locales/en.json b/src/locales/en.json index afea864..bb50de0 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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", diff --git a/src/views/BrokeringRoute.vue b/src/views/BrokeringRoute.vue index f6cc07d..801b19f 100644 --- a/src/views/BrokeringRoute.vue +++ b/src/views/BrokeringRoute.vue @@ -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`) }