@processmaker/modeler 1.43.7 → 1.43.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modeler.common.js +98 -57
- package/dist/modeler.common.js.map +1 -1
- package/dist/modeler.umd.js +98 -57
- package/dist/modeler.umd.js.map +1 -1
- package/dist/modeler.umd.min.js +1 -1
- package/dist/modeler.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modeler/Modeler.vue +47 -7
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
@clearSelection="clearSelection"
|
|
26
26
|
:players="filteredPlayers"
|
|
27
27
|
@action="handleToolbarAction"
|
|
28
|
-
@onGenerateAssets="
|
|
28
|
+
@onGenerateAssets="onGenerateAssets()"
|
|
29
29
|
/>
|
|
30
30
|
<b-row class="modeler h-100">
|
|
31
31
|
<b-tooltip
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
<CreateAssetsCard
|
|
61
61
|
ref="createAssetsCard"
|
|
62
62
|
v-if="isAiGenerated"
|
|
63
|
-
@onGenerateAssets="
|
|
63
|
+
@onGenerateAssets="onGenerateAssets()"
|
|
64
64
|
@closeCreateAssets="isAiGenerated = false"
|
|
65
65
|
/>
|
|
66
66
|
|
|
@@ -654,7 +654,7 @@ export default {
|
|
|
654
654
|
async close() {
|
|
655
655
|
this.$emit('close');
|
|
656
656
|
},
|
|
657
|
-
async saveBpmn(redirectTo = null, id = null) {
|
|
657
|
+
async saveBpmn(redirectTo = null, id = null, generatingAssets = false) {
|
|
658
658
|
const svg = document.querySelector('.mini-paper svg');
|
|
659
659
|
const css = 'text { font-family: sans-serif; }';
|
|
660
660
|
const style = document.createElement('style');
|
|
@@ -663,7 +663,7 @@ export default {
|
|
|
663
663
|
svg.appendChild(style);
|
|
664
664
|
const xml = await this.getXmlFromDiagram();
|
|
665
665
|
const svgString = (new XMLSerializer()).serializeToString(svg);
|
|
666
|
-
this.$emit('saveBpmn', { xml, svg: svgString, redirectUrl: redirectTo, nodeId: id });
|
|
666
|
+
this.$emit('saveBpmn', { xml, svg: svgString, redirectUrl: redirectTo, nodeId: id, generatingAssets });
|
|
667
667
|
},
|
|
668
668
|
borderOutline(nodeId) {
|
|
669
669
|
return this.decorations.borderOutline && this.decorations.borderOutline[nodeId];
|
|
@@ -1904,9 +1904,15 @@ export default {
|
|
|
1904
1904
|
}
|
|
1905
1905
|
});
|
|
1906
1906
|
},
|
|
1907
|
+
onGenerateAssets() {
|
|
1908
|
+
this.saveBpmn(null, null, true);
|
|
1909
|
+
},
|
|
1907
1910
|
generateAssets() {
|
|
1908
1911
|
this.getNonce();
|
|
1909
1912
|
|
|
1913
|
+
// Show Generating message
|
|
1914
|
+
this.loadingAI = true;
|
|
1915
|
+
|
|
1910
1916
|
this.fetchHistory();
|
|
1911
1917
|
|
|
1912
1918
|
const params = {
|
|
@@ -1918,8 +1924,12 @@ export default {
|
|
|
1918
1924
|
const url = '/package-ai/generateProcessArtifacts';
|
|
1919
1925
|
|
|
1920
1926
|
window.ProcessMaker.apiClient.post(url, params)
|
|
1921
|
-
.then(() => {
|
|
1922
|
-
|
|
1927
|
+
.then((response) => {
|
|
1928
|
+
if (response.data) {
|
|
1929
|
+
if (response.data?.error) {
|
|
1930
|
+
this.assetFail = true;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1923
1933
|
})
|
|
1924
1934
|
.catch((error) => {
|
|
1925
1935
|
const errorMsg = error.response?.data?.message || error.message;
|
|
@@ -1994,6 +2004,31 @@ export default {
|
|
|
1994
2004
|
},
|
|
1995
2005
|
);
|
|
1996
2006
|
},
|
|
2007
|
+
subscribeToGenerationCompleted() {
|
|
2008
|
+
const channel = `ProcessMaker.Models.User.${window.ProcessMaker?.modeler?.process?.user_id}`;
|
|
2009
|
+
const streamCompletedEvent = '.ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsCompletedEvent';
|
|
2010
|
+
window.Echo.private(channel).listen(
|
|
2011
|
+
streamCompletedEvent,
|
|
2012
|
+
(response) => {
|
|
2013
|
+
if (response.data) {
|
|
2014
|
+
setTimeout(() => {
|
|
2015
|
+
window.location.replace(window.location.href.split('?')[0]);
|
|
2016
|
+
}, 1500);
|
|
2017
|
+
}
|
|
2018
|
+
},
|
|
2019
|
+
);
|
|
2020
|
+
},
|
|
2021
|
+
subscribeToErrors() {
|
|
2022
|
+
const channel = `ProcessMaker.Models.User.${window.ProcessMaker?.modeler?.process?.user_id}`;
|
|
2023
|
+
const streamProgressEvent = '.ProcessMaker\\Package\\PackageAi\\Events\\GenerateArtifactsErrorEvent';
|
|
2024
|
+
window.Echo.private(channel).listen(
|
|
2025
|
+
streamProgressEvent,
|
|
2026
|
+
() => {
|
|
2027
|
+
// Output error
|
|
2028
|
+
this.assetFail = true;
|
|
2029
|
+
},
|
|
2030
|
+
);
|
|
2031
|
+
},
|
|
1997
2032
|
onStopAssetGeneration() {
|
|
1998
2033
|
if (this.currentNonce) {
|
|
1999
2034
|
this.cancelledJobs.push(this.currentNonce);
|
|
@@ -2184,10 +2219,13 @@ export default {
|
|
|
2184
2219
|
this.replaceAiNode(data);
|
|
2185
2220
|
});
|
|
2186
2221
|
|
|
2187
|
-
window.ProcessMaker.EventBus.$on('save-changes', (redirectUrl) => {
|
|
2222
|
+
window.ProcessMaker.EventBus.$on('save-changes', (redirectUrl, nodeId, generatingAssets) => {
|
|
2188
2223
|
if (redirectUrl) {
|
|
2189
2224
|
this.redirect(redirectUrl);
|
|
2190
2225
|
}
|
|
2226
|
+
if (generatingAssets) {
|
|
2227
|
+
this.generateAssets();
|
|
2228
|
+
}
|
|
2191
2229
|
});
|
|
2192
2230
|
|
|
2193
2231
|
// AI Setup
|
|
@@ -2203,6 +2241,8 @@ export default {
|
|
|
2203
2241
|
this.promptSessionId = this.getPromptSessionForUser();
|
|
2204
2242
|
this.fetchHistory();
|
|
2205
2243
|
this.subscribeToProgress();
|
|
2244
|
+
this.subscribeToGenerationCompleted();
|
|
2245
|
+
this.subscribeToErrors();
|
|
2206
2246
|
},
|
|
2207
2247
|
};
|
|
2208
2248
|
</script>
|