From 25558bc801d61603ca7fd0d9f3a8705caf399d9b Mon Sep 17 00:00:00 2001 From: dlohvinov Date: Mon, 25 Mar 2024 14:15:26 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=C2=A0=C2=A0fix:=20trying=20to=20fix=20cors?= =?UTF-8?q?=20on=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/modules/diagram/components/opened-flow-diagram.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue b/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue index 8ee98eac4..c8f99d45f 100644 --- a/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue +++ b/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue @@ -52,7 +52,9 @@ export default { async initDiagram() { const flowDiagramUrl = import.meta.env.VITE_FLOW_DIAGRAM_URL; const script = document.createElement('script'); - script.src = `${flowDiagramUrl}/WtFlowDiagram.umd.min.js`; + // script.type = 'module'; + script.src = `${flowDiagramUrl}/WtFlowDiagram.umd.cjs`; + script.onload = () => { const params = { // if edit, restore diagram @@ -82,7 +84,7 @@ export default { }, }, }; - const WtFlowDiagram = window.WtFlowDiagram.default; + const WtFlowDiagram = window.WtFlowDiagram; this.diagram = new WtFlowDiagram('#flow-diagram', params); const onSave = async ({ From 3b75b03f98d0637bd156e23429fd0561fdb3c606 Mon Sep 17 00:00:00 2001 From: dlohvinov Date: Mon, 25 Mar 2024 14:15:26 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=C2=A0=C2=A0fix:=20trying=20to=20fix=20cors?= =?UTF-8?q?=20on=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + .../flow/modules/diagram/components/opened-flow-diagram.vue | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3addb9da3..2a81b0a87 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "preview": "vite preview", "lint:fix": "eslint --fix --ext .js,.vue src" }, + "type": "module", "dependencies": { "@vue/compat": "^3.2.47", "@vuelidate/core": "^2.0.0", diff --git a/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue b/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue index 8ee98eac4..746eb15d5 100644 --- a/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue +++ b/src/modules/routing/modules/flow/modules/diagram/components/opened-flow-diagram.vue @@ -52,7 +52,9 @@ export default { async initDiagram() { const flowDiagramUrl = import.meta.env.VITE_FLOW_DIAGRAM_URL; const script = document.createElement('script'); - script.src = `${flowDiagramUrl}/WtFlowDiagram.umd.min.js`; + // script.type = 'module'; + script.src = `${flowDiagramUrl}/WtFlowDiagram.js`; + script.onload = () => { const params = { // if edit, restore diagram @@ -82,7 +84,7 @@ export default { }, }, }; - const WtFlowDiagram = window.WtFlowDiagram.default; + const WtFlowDiagram = window.WtFlowDiagram; this.diagram = new WtFlowDiagram('#flow-diagram', params); const onSave = async ({ From 889cb7abe25942a70a96e669b9b3e0936b798dc8 Mon Sep 17 00:00:00 2001 From: Lera24 Date: Mon, 25 Mar 2024 16:05:48 +0200 Subject: [PATCH 3/3] fix: clean up vite[WTEL-4379] --- .eslintrc.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1bbf4e72f..1beb4dc6e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,9 +25,6 @@ module.exports = { '**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)', ], - env: { - jest: true, - }, }, ], };