Skip to content

Commit

Permalink
Merge pull request #5430 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 6, 2023
2 parents 91918e9 + 75ba9db commit 1928a4e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ export default {
this.suggestionsPages = response.data.suggestions;
this.loadingSuggestions = false;
}).catch((error) => {
const errorMsg = error.response?.data?.message || error.message;
window.ProcessMaker.alert(errorMsg, "danger");
if (error.response.status !== 404) {
const errorMsg = error.response?.data?.message || error.message;
window.ProcessMaker.alert(errorMsg, "danger");
}
this.loadingSuggestions = false;
});
},
},
};
</script>
</script>
22 changes: 21 additions & 1 deletion resources/js/processes/scripts/components/ScriptEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ export default {
this.progress.progress = 0;
window.ProcessMaker.alert(response.data.message, "danger");
} else {
this.newCode = response.data.diff;
this.getScriptVersion(response.data.scriptVersionId);
this.progress.progress = 100;
setTimeout(() => {
this.loading = false;
Expand All @@ -655,7 +655,27 @@ export default {
},
);
},
getScriptVersion(scriptVersionId) {
const url = "/package-ai/getScriptVersion";
const params = {
server: window.location.host,
scriptVersionId,
};
ProcessMaker.apiClient
.post(url, params)
.then((response) => {
this.newCode = response.data.version.diff;
})
.catch((error) => {
const errorMsg = error.response?.data?.message || error.message;
if (error.response.status !== 404) {
window.ProcessMaker.alert(errorMsg, "danger");
}
});
},
diffEditorMounted() {
},
resizeEditor() {
Expand Down

0 comments on commit 1928a4e

Please sign in to comment.