Skip to content

Commit

Permalink
feat: variable tab at bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
abdul99ahad authored and philippfromme committed Nov 4, 2024
1 parent f324494 commit e6fa4f0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership.
*
* Camunda licenses this file to you under the MIT; you may not use this file
* except in compliance with the MIT License.
*/

import React from 'react';

import classnames from 'classnames';

import { Fill } from '../../../slot-fill';

export default function VariableOutlineStatusBarItem(props) {
const {
onToggle,
layout
} = props;

const { panel = {} } = layout;

return <Fill slot="status-bar__file" group="9_variables">
<button
className={ classnames(
'btn',
{ 'btn--active': panel.open && panel.tab === 'variable-outline' }
) }
onClick={ onToggle }
> Variables </button>
</Fill>;
}
18 changes: 17 additions & 1 deletion client/src/app/panel/tabs/variable-outline/VariableOutlineTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,26 @@ import './VariableOutlineTab.less';

import { Fill } from '../../../slot-fill';

import VariableOutlineStatusBarItem from './VariableOutlineStatusBarItem';

export default function VariableTab(props) {
const {
layout = {},
injector,
id
id,
onAction
} = props;

const onToggle = () => {
const { panel = {} } = layout;

if (!panel.open || panel.tab !== 'variable-outline') {
onAction('open-panel', { tab: 'variable-outline' });
} else if (panel.tab === 'variable-outline') {
onAction('close-panel');
}
};

return <>
<Fill slot="bottom-panel"
id="variable-outline"
Expand All @@ -34,5 +46,9 @@ export default function VariableTab(props) {
<VariableOutline injector={ injector } key={ id } />
</div>
</Fill>

<VariableOutlineStatusBarItem
layout={ layout }
onToggle={ onToggle } />
</>;
}
5 changes: 3 additions & 2 deletions client/src/app/tabs/cloud-bpmn/BpmnEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ export class BpmnEditor extends CachedComponent {
render() {
const engineProfile = this.engineProfile.getCached();

const { layout } = this.props;
const { layout, onAction } = this.props;

const modeler = this.getModeler();
const imported = modeler.getDefinitions();
Expand Down Expand Up @@ -797,7 +797,8 @@ export class BpmnEditor extends CachedComponent {
<VariableTab
id={ this.props.id }
layout={ layout }
injector={ injector } />
injector={ injector }
onAction={ onAction } />
</div>
);
}
Expand Down

0 comments on commit e6fa4f0

Please sign in to comment.