diff --git a/fusion_repairs/__manifest__.py b/fusion_repairs/__manifest__.py index bf802654..cc9c2f3c 100644 --- a/fusion_repairs/__manifest__.py +++ b/fusion_repairs/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Fusion Repairs', - 'version': '19.0.2.2.1', + 'version': '19.0.2.2.3', 'category': 'Inventory/Repairs', 'summary': 'Guided medical equipment repair intake, dispatch, maintenance, and self-service portal', 'description': """ diff --git a/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.js b/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.js index 07777bc9..800f2240 100644 --- a/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.js +++ b/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.js @@ -78,6 +78,21 @@ export class FlowchartDesigner extends Component { // Per-selected-node Wysiwyg editor instance captured via onLoad. // Keyed by dfId so switching nodes correctly reads the right editor. this.wysiwygEditors = {}; + + // Drawflow init + chart load happen on mount; cleanup on unmount. + // These onMounted / onWillUnmount hooks MUST stay inside setup() - + // they are not class methods. Leaving them outside throws + // "Unexpected token (" because JS parses bare function calls in a + // class body as malformed method declarations. + onMounted(async () => { + await Promise.all([loadJS(DRAWFLOW_JS), loadCSS(DRAWFLOW_CSS)]); + this._initDrawflow(); + await this._loadChart(); + }); + + onWillUnmount(() => { + try { this.editor?.clear(); } catch {} + }); } // ------------------------------------------------------------------ @@ -124,17 +139,6 @@ export class FlowchartDesigner extends Component { this.state.sourceMode = !this.state.sourceMode; } - onMounted(async () => { - await Promise.all([loadJS(DRAWFLOW_JS), loadCSS(DRAWFLOW_CSS)]); - this._initDrawflow(); - await this._loadChart(); - }); - - onWillUnmount(() => { - try { this.editor?.clear(); } catch {} - }); - } - _initDrawflow() { // eslint-disable-next-line no-undef this.editor = new Drawflow(this.canvasRef.el); diff --git a/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.xml b/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.xml index 2af756d0..4d2f9356 100644 --- a/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.xml +++ b/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.xml @@ -91,7 +91,7 @@