From 6e24b140a8c3924f31e9b7723404732b96cfe28b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 13 Sep 2021 18:01:05 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 7 +++++-- ayanova/src/components/pm-item-tasks.vue | 15 +++++++++++++++ ayanova/src/components/quote-item-tasks.vue | 14 ++++++++++++++ ayanova/src/components/work-order-item-tasks.vue | 15 +++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index d3c813a5..5e223696 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -10,8 +10,8 @@ ## ROUGH SCHEDULE new testing cases - - + 3964 redux +todo: Alert / popup notes should not be red, that is reserved for ayanova errors and confusing, so make it orangey instead warning color Schedule form Dashboard / widgets Installer INNO @@ -735,6 +735,9 @@ BUILD 130 CHANGES OF NOTE - case 3954 Tags not available in data list for Users (or Contacts) added - Migrate: added code to set Tags on Contact type users created from v7 Client contacts (use same tags as Customer) - case 3955 back to you for recommendations +- case 3956 implemented +- case 3958 fixed + diff --git a/ayanova/src/components/pm-item-tasks.vue b/ayanova/src/components/pm-item-tasks.vue index 4482d4d1..ea6ec15d 100644 --- a/ayanova/src/components/pm-item-tasks.vue +++ b/ayanova/src/components/pm-item-tasks.vue @@ -375,6 +375,21 @@ export default { `task-group/${this.selectedTaskGroup}` ); if (res.data && res.data.items) { + //If there is one empty task line only then they likely just want to append the group and ditch the default empty item so remove it here + if ( + this.value.items[this.activeWoItemIndex].tasks.length == 1 && + this.value.items[this.activeWoItemIndex].tasks[0].task == null && + this.value.items[this.activeWoItemIndex].tasks[0].id == 0 + ) { + //but first need to unbreak rule from initial add empty in case it's the only broken validation rule preventing saving + this.value.items[this.activeWoItemIndex].tasks[0].task = ".."; + this.fieldValueChanged( + `Items[${this.activeWoItemIndex}].tasks[${this.activeItemIndex}].task` + ); + //Now we can remove it + this.value.items[this.activeWoItemIndex].tasks.splice(0, 1); + } + let newIndex = this.value.items[this.activeWoItemIndex].tasks.length; let incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find( s => s.id == 1 //incomplete diff --git a/ayanova/src/components/quote-item-tasks.vue b/ayanova/src/components/quote-item-tasks.vue index 2731ff86..46806eb6 100644 --- a/ayanova/src/components/quote-item-tasks.vue +++ b/ayanova/src/components/quote-item-tasks.vue @@ -375,6 +375,20 @@ export default { `task-group/${this.selectedTaskGroup}` ); if (res.data && res.data.items) { + //If there is one empty task line only then they likely just want to append the group and ditch the default empty item so remove it here + if ( + this.value.items[this.activeWoItemIndex].tasks.length == 1 && + this.value.items[this.activeWoItemIndex].tasks[0].task == null && + this.value.items[this.activeWoItemIndex].tasks[0].id == 0 + ) { + //but first need to unbreak rule from initial add empty in case it's the only broken validation rule preventing saving + this.value.items[this.activeWoItemIndex].tasks[0].task = ".."; + this.fieldValueChanged( + `Items[${this.activeWoItemIndex}].tasks[${this.activeItemIndex}].task` + ); + //Now we can remove it + this.value.items[this.activeWoItemIndex].tasks.splice(0, 1); + } let newIndex = this.value.items[this.activeWoItemIndex].tasks.length; let incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find( s => s.id == 1 //incomplete diff --git a/ayanova/src/components/work-order-item-tasks.vue b/ayanova/src/components/work-order-item-tasks.vue index 12fdac11..1978a9c0 100644 --- a/ayanova/src/components/work-order-item-tasks.vue +++ b/ayanova/src/components/work-order-item-tasks.vue @@ -375,6 +375,21 @@ export default { `task-group/${this.selectedTaskGroup}` ); if (res.data && res.data.items) { + //If there is one empty task line only then they likely just want to append the group and ditch the default empty item so remove it here + if ( + this.value.items[this.activeWoItemIndex].tasks.length == 1 && + this.value.items[this.activeWoItemIndex].tasks[0].task == null && + this.value.items[this.activeWoItemIndex].tasks[0].id == 0 + ) { + //but first need to unbreak rule from initial add empty in case it's the only broken validation rule preventing saving + this.value.items[this.activeWoItemIndex].tasks[0].task = ".."; + this.fieldValueChanged( + `Items[${this.activeWoItemIndex}].tasks[${this.activeItemIndex}].task` + ); + //Now we can remove it + this.value.items[this.activeWoItemIndex].tasks.splice(0, 1); + } + let newIndex = this.value.items[this.activeWoItemIndex].tasks.length; let incompleteViz = this.pvm.selectLists.woItemTaskCompletionTypes.find( s => s.id == 1 //incomplete