|
28 | 28 | :screen-type="type" |
29 | 29 | :screen="screen" |
30 | 30 | :render-controls="displayBuilder" |
| 31 | + :process-id="processId" |
31 | 32 | @change="updateConfig" |
32 | 33 | > |
33 | 34 | <data-loading-basic |
@@ -373,6 +374,9 @@ export default { |
373 | 374 | type: Boolean, |
374 | 375 | default: false, |
375 | 376 | }, |
| 377 | + processId: { |
| 378 | + default: 0, |
| 379 | + }, |
376 | 380 | }, |
377 | 381 | data() { |
378 | 382 | const defaultConfig = [ |
@@ -486,7 +490,7 @@ export default { |
486 | 490 | variant: "secondary", |
487 | 491 | icon: "fas fa-save", |
488 | 492 | action: () => { |
489 | | - ProcessMaker.EventBus.$emit("save-screen", false); |
| 493 | + ProcessMaker.EventBus.$emit("save-screen", false, this.processId); |
490 | 494 | }, |
491 | 495 | }, |
492 | 496 | ]; |
@@ -783,8 +787,8 @@ export default { |
783 | 787 | that.previewInput = "{}"; |
784 | 788 | that.preview.custom_css = that.customCSS; |
785 | 789 | ProcessMaker.EventBus.$emit("screen-builder-start", that); |
786 | | - ProcessMaker.EventBus.$on("save-screen", (value, onSuccess, onError) => { |
787 | | - that.saveScreen(value, onSuccess, onError); |
| 790 | + ProcessMaker.EventBus.$on("save-screen", (value, processId, onSuccess, onError) => { |
| 791 | + that.saveScreen(value, processId, onSuccess, onError); |
788 | 792 | }); |
789 | 793 | ProcessMaker.EventBus.$on("screen-change", () => { |
790 | 794 | this.handleAutosave(); |
@@ -1025,7 +1029,7 @@ export default { |
1025 | 1029 | window.location.reload(); |
1026 | 1030 | }); |
1027 | 1031 | }, |
1028 | | - saveScreen(exportScreen, onSuccess, onError) { |
| 1032 | + saveScreen(exportScreen, processId, onSuccess, onError) { |
1029 | 1033 | if (this.allErrors !== 0) { |
1030 | 1034 | ProcessMaker.alert( |
1031 | 1035 | this.$t("This screen has validation errors."), |
@@ -1054,6 +1058,9 @@ export default { |
1054 | 1058 | if (typeof onSuccess === "function") { |
1055 | 1059 | onSuccess(response); |
1056 | 1060 | } |
| 1061 | + if (processId !== 0 && processId !== undefined) { |
| 1062 | + window.location = `/modeler/${this.processId}`; |
| 1063 | + } |
1057 | 1064 | }) |
1058 | 1065 | .catch((err) => { |
1059 | 1066 | if (typeof onError === "function") { |
|
0 commit comments