This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user