Skip to content

Commit 6dfeae9

Browse files
authored
Merge pull request #4036 from marcellamaki/immediate-save-all-no-resource
Ensure the saving and validation runs on bulk edit, even if user has not selected all nodes
2 parents 0dfd8c6 + fcb1656 commit 6dfeae9

File tree

1 file changed

+31
-23
lines changed
  • contentcuration/contentcuration/frontend/channelEdit/components/edit

1 file changed

+31
-23
lines changed

contentcuration/contentcuration/frontend/channelEdit/components/edit/EditModal.vue

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
:clipped-right="$isRTL"
3030
app
3131
>
32-
<VBtn data-test="close" icon dark @click="handleClose">
32+
<VBtn data-test="close" icon dark @click="handleClose()">
3333
<Icon>clear</Icon>
3434
</VBtn>
3535
<VToolbarTitle>{{ modalTitle }}</VToolbarTitle>
@@ -116,7 +116,7 @@
116116
</div>
117117
</VFlex>
118118
<VFlex shrink>
119-
<VBtn color="primary" @click="handleClose">
119+
<VBtn color="primary" @click="handleClose()">
120120
{{ $tr('finishButton') }}
121121
</VBtn>
122122
</VFlex>
@@ -421,27 +421,35 @@
421421
/* Button actions */
422422
handleClose() {
423423
// X button action
424-
this.enableValidation(this.nodeIds);
425-
let assessmentItems = this.getAssessmentItems(this.nodeIds);
426-
assessmentItems.forEach(item => (item.question ? (item[DELAYED_VALIDATION] = false) : ''));
427-
this.updateAssessmentItems(assessmentItems);
428-
// reaches into Details Tab to run save of diffTracker
429-
// before the validation pop up is executed
430-
if (this.$refs.editView) {
431-
this.$refs.editView.immediateSaveAll().then(() => {
432-
// Catch uploads in progress and invalid nodes
433-
if (this.invalidNodes.length) {
434-
this.selected = [this.invalidNodes[0]];
435-
this.promptInvalid = true;
436-
} else if (this.contentNodesAreUploading(this.nodeIds)) {
437-
this.promptUploading = true;
438-
} else {
439-
this.closeModal();
440-
}
441-
});
442-
} else {
443-
this.closeModal();
444-
}
424+
this.selected = this.nodeIds;
425+
this.$nextTick(() => {
426+
this.enableValidation(this.nodeIds);
427+
let assessmentItems = this.getAssessmentItems(this.nodeIds);
428+
assessmentItems.forEach(item =>
429+
item.question ? (item[DELAYED_VALIDATION] = false) : ''
430+
);
431+
this.updateAssessmentItems(assessmentItems);
432+
433+
// reaches into Details Tab to run save of diffTracker
434+
// before the validation pop up is executed
435+
if (this.$refs.editView) {
436+
this.$nextTick(() => {
437+
this.$refs.editView.immediateSaveAll().then(() => {
438+
// Catch uploads in progress and invalid nodes
439+
if (this.invalidNodes.length) {
440+
this.selected = [this.invalidNodes[0]];
441+
this.promptInvalid = true;
442+
} else if (this.contentNodesAreUploading(this.nodeIds)) {
443+
this.promptUploading = true;
444+
} else {
445+
this.closeModal();
446+
}
447+
});
448+
});
449+
} else {
450+
this.closeModal();
451+
}
452+
});
445453
},
446454
447455
/* Creation actions */

0 commit comments

Comments
 (0)