Skip to content

Commit

Permalink
Merge pull request #1449 from ProcessMaker/epic/FOUR-9674
Browse files Browse the repository at this point in the history
Epic/FOUR-9674: AI in modeler
  • Loading branch information
ryancooley authored Oct 4, 2023
2 parents 256be4b + fdf3dab commit 6077ad9
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/components/editor/loop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,18 @@ export default {
data() {
return {
items: [],
cancelledJobs: []
};
},
mounted() {
if (
!localStorage.getItem("cancelledJobs") ||
localStorage.getItem("cancelledJobs") === "null"
) {
this.cancelledJobs = [];
} else {
this.cancelledJobs = JSON.parse(localStorage.getItem("cancelledJobs"));
}
this.$root.$on("ai-form-generated", (formItems, nonce) => {
this.previewAiChanges(formItems, nonce);
});
Expand Down Expand Up @@ -202,6 +211,9 @@ export default {
item.component === "AiSection" &&
nonce === item.config.aiConfig.nonce
) {
if (this.cancelledJobs.some((element) => element === nonce)) {
return;
}
this.$set(item.config.aiConfig, "progress", progress);
}
});
Expand Down
13 changes: 13 additions & 0 deletions src/components/editor/multi-column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,19 @@ export default {
data() {
return {
items: [],
cancelledJobs: []
};
},
mounted() {
if (
!localStorage.getItem("cancelledJobs") ||
localStorage.getItem("cancelledJobs") === "null"
) {
this.cancelledJobs = [];
} else {
this.cancelledJobs = JSON.parse(localStorage.getItem("cancelledJobs"));
}
this.$root.$on("ai-form-generated", (formItems, nonce) => {
this.previewAiChanges(formItems, nonce);
});
Expand Down Expand Up @@ -241,6 +251,9 @@ export default {
item.component === "AiSection" &&
nonce === item.config.aiConfig.nonce
) {
if (this.cancelledJobs.some((element) => element === nonce)) {
return;
}
this.$set(item.config.aiConfig, "progress", progress);
}
});
Expand Down
16 changes: 15 additions & 1 deletion src/components/vue-form-builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ export default {
variablesTree: [],
language: "en",
collator: null,
editorContentKey: 0
editorContentKey: 0,
cancelledJobs: []
};
},
computed: {
Expand Down Expand Up @@ -658,7 +659,17 @@ export default {
this.initiateLanguageSupport();
},
mounted() {
if (
!localStorage.getItem("cancelledJobs") ||
localStorage.getItem("cancelledJobs") === "null"
) {
this.cancelledJobs = [];
} else {
this.cancelledJobs = JSON.parse(localStorage.getItem("cancelledJobs"));
}
this.checkForCaptchaInLoops();
this.$root.$on("nested-screen-updated", () => {
this.checkForCaptchaInLoops();
});
Expand Down Expand Up @@ -1142,6 +1153,9 @@ export default {
item.component === "AiSection" &&
nonce === item.config.aiConfig.nonce
) {
if (this.cancelledJobs.some((element) => element === nonce)) {
return;
}
this.$set(item.config.aiConfig, "progress", progress);
}
});
Expand Down

0 comments on commit 6077ad9

Please sign in to comment.