-
+
{{ isRuleNameUpdating ? translate("Save") : translate("Rename") }}
@@ -351,6 +351,7 @@ let isRouteNameUpdating = ref(false)
const routeNameRef = ref()
const operatorRef = ref()
const measurementRef = ref()
+const ruleNameRef = ref()
onIonViewWillEnter(async () => {
emitter.emit("presentLoader", { message: "Fetching filters and inventory rules", backdropDismiss: false })
@@ -902,6 +903,13 @@ function updateRuleStatus(event: CustomEvent, routingRuleId: string) {
hasUnsavedChanges.value = true
}
+async function editRuleName() {
+ isRuleNameUpdating.value = !isRuleNameUpdating.value;
+ // Waiting for DOM updations before focus inside the text-area, as it is conditionally rendered in the DOM
+ await nextTick()
+ ruleNameRef.value.$el.setFocus();
+}
+
function updateRuleName(routingRuleId: string) {
// Checking the updated name with the original object, as we have reference to inventoryRules that will also gets updated on updating selectedRoutingRule
currentRouting.value["rules"].map((inventoryRule: any) => {
@@ -909,6 +917,7 @@ function updateRuleName(routingRuleId: string) {
hasUnsavedChanges.value = true
}
})
+ isRuleNameUpdating.value = false;
}
async function cloneRule() {