Skip to content

Commit

Permalink
Merge pull request #144 from ymaheshwari1/#141
Browse files Browse the repository at this point in the history
Improved: check for rule and route name fields(#141)
  • Loading branch information
ymaheshwari1 authored Apr 1, 2024
2 parents 1d9c861 + 8d57a26 commit ee8f630
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ import { onBeforeRouteLeave, useRouter } from "vue-router";
import { computed, defineProps, ref } from "vue";
import store from "@/store";
import AddInventoryFilterOptionsModal from "@/components/AddInventoryFilterOptionsModal.vue";
import { getDateAndTimeShort, sortSequence } from "@/utils";
import { getDateAndTimeShort, showToast, sortSequence } from "@/utils";
import { Rule } from "@/types";
import AddOrderRouteFilterOptions from "@/components/AddOrderRouteFilterOptions.vue"
import PromiseFilterPopover from "@/components/PromiseFilterPopover.vue"
Expand Down Expand Up @@ -497,7 +497,13 @@ async function addInventoryRule() {
text: translate("Cancel"),
role: "cancel"
}, {
text: translate("Save")
text: translate("Save"),
handler: (data) => {
if(!data.ruleName?.trim().length) {
showToast(translate("Please enter a valid name"))
return false;
}
}
}],
inputs: [{
name: "ruleName",
Expand Down
8 changes: 7 additions & 1 deletion src/views/BrokeringRoute.vue
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,13 @@ async function createOrderRoute() {
text: translate("Cancel"),
role: "cancel"
}, {
text: translate("Save")
text: translate("Save"),
handler: (data) => {
if(!data.routingName?.trim().length) {
showToast(translate("Please enter a valid name"))
return false;
}
}
}],
inputs: [{
name: "routingName",
Expand Down

0 comments on commit ee8f630

Please sign in to comment.