diff --git a/fusion_repairs/__manifest__.py b/fusion_repairs/__manifest__.py index 2b041baa..4666daaf 100644 --- a/fusion_repairs/__manifest__.py +++ b/fusion_repairs/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Fusion Repairs', - 'version': '19.0.2.2.4', + 'version': '19.0.2.2.6', '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 d0d866cb..4967e029 100644 --- a/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.js +++ b/fusion_repairs/static/src/components/flowchart_designer/flowchart_designer.js @@ -114,6 +114,17 @@ export class FlowchartDesigner extends Component { return { content: rawHtml ? markup(rawHtml) : markup(""), Plugins: MAIN_PLUGINS, + // ChatGPTPlugin (and other plugins shipped in MAIN_PLUGINS on + // Enterprise) call config.getRecordInfo() during init AND destroy + // to associate the editor with a record. We're a standalone + // client action, so we return the currently-selected node's + // identity. Without this, ChatGPTPlugin.destroy throws + // "this.config.getRecordInfo is not a function" every time the + // editor unmounts (node switch, view close, navigate away). + getRecordInfo: () => ({ + resModel: "fusion.repair.flowchart.node", + resId: this.state.selectedNodeId || false, + }), // onChange fires after each edit step - read the current HTML // from the editor and persist it to selectedMeta + dirty flag. onChange: () => { @@ -197,7 +208,13 @@ export class FlowchartDesigner extends Component { // Drawflow: addNode(name, inputs, outputs, posx, posy, class, data, html) const outputs = n.node_type === "outcome" ? 0 : 1; const inputs = n.is_start ? 0 : 1; - const cssClass = `fr-node fr-node-${n.node_type} ${n.is_start ? "fr-node-start" : ""}`; + // Build the class string from an array so non-start nodes don't + // emit a trailing space - Drawflow forwards this through + // classList.add(), which throws "The token provided must not be + // empty" on any empty token. + const cssClass = ["fr-node", `fr-node-${n.node_type}`, n.is_start && "fr-node-start"] + .filter(Boolean) + .join(" "); const dfId = this.editor.addNode( clientId, inputs, outputs,