Skip to content

Commit

Permalink
save Config
Browse files Browse the repository at this point in the history
  • Loading branch information
marstamm committed Dec 12, 2024
1 parent bc92a31 commit 387d3b6
Showing 1 changed file with 39 additions and 17 deletions.
56 changes: 39 additions & 17 deletions client/src/app/tabs/rpa/RPAEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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() {
Expand Down Expand Up @@ -164,6 +173,7 @@ export class RPAEditor extends CachedComponent {
const dirty = this.isDirty();

const newState = {
loaded: true,
canExport: false,
dirty,
save: true,
Expand Down Expand Up @@ -218,8 +228,15 @@ export class RPAEditor extends CachedComponent {
}

render() {

const loading = !this.state.loaded;

console.log('loading', loading, this.state) ;

return (
<>
<Loader hidden={ !loading } />

<div className={ css.RPAEditor }>
<div className="editor">
<div
Expand All @@ -234,17 +251,22 @@ export class RPAEditor extends CachedComponent {
onLayoutChanged={ this.handleLayoutChange } />
</div>
</div>
<Fill slot="bottom-panel"
id="RPA-output"
label="Testing"
priority={ 15 }
{ ...this.props }
>
<DebugInfo editor={ this._editor } />
</Fill>

<RunButton editor={ this._editor } />
<StatusButton editor={ this._editor } />
{ !loading && <>
<Fill
{ ...this.props }
slot="bottom-panel"
id="RPA-output"
label="Testing"
priority={ 15 }
>
<DebugInfo editor={ this._editor } />
</Fill>

<RunButton editor={ this._editor } />
<StatusButton getConfig={ this.props.getConfig } setConfig={ this.props.getConfig } editor={ this._editor } />
</>
}

<Fill slot="status-bar__file" group="1_engine">
<div>Camunda 8</div>
Expand Down

0 comments on commit 387d3b6

Please sign in to comment.