From 387d3b6c35a506573d8fcef75f42df81e071a979 Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Thu, 12 Dec 2024 20:08:01 +0100 Subject: [PATCH] save Config --- client/src/app/tabs/rpa/RPAEditor.js | 56 +++++++++++++++++++--------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/client/src/app/tabs/rpa/RPAEditor.js b/client/src/app/tabs/rpa/RPAEditor.js index 26e05961f..9726ce721 100644 --- a/client/src/app/tabs/rpa/RPAEditor.js +++ b/client/src/app/tabs/rpa/RPAEditor.js @@ -39,18 +39,16 @@ import { getRPAEditMenu } from './getRobotEditMenu'; import { Fill } from '../../slot-fill'; import RunButton from './RunButton'; import StatusButton from './StatusButton'; +import { Loader } from '../../primitives'; export class RPAEditor extends CachedComponent { constructor(props) { super(props); - console.log('props', props); - - console.log('config', props.getConfig('rpa', {})); - this.state = { - save: true + save: true, + loaded: false }; this.modelerRef = React.createRef(); @@ -69,18 +67,29 @@ export class RPAEditor extends CachedComponent { // editor.attachTo(this.modelerRef.current); + this.createEditor(); + + // this.checkImport(); + } + + + async createEditor() { + const rpaConfig = await this.props.getConfig('rpa', {}); this._editor = coolRpaEditor({ container: this.modelerRef.current, propertiesPanel: { container: this.propertiesPanelRef.current }, + runnerConfig: rpaConfig.runnerConfig, value: this.props.xml }); - this.handleChanged(); + this._editor.eventBus.on('config.updated', (config) => { + this.props.setConfig('rpa', { runnerConfig: config }); + }); - // this.checkImport(); + this.handleChanged(); } // componentWillUnmount() { @@ -164,6 +173,7 @@ export class RPAEditor extends CachedComponent { const dirty = this.isDirty(); const newState = { + loaded: true, canExport: false, dirty, save: true, @@ -218,8 +228,15 @@ export class RPAEditor extends CachedComponent { } render() { + + const loading = !this.state.loaded; + + console.log('loading', loading, this.state) ; + return ( <> +