Skip to content

Commit

Permalink
feat: implement variable suggestions for table cell
Browse files Browse the repository at this point in the history
Related to #785
  • Loading branch information
barmac committed Oct 12, 2023
1 parent e797b09 commit 63841af
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class TableCellEditor extends Component {

this._expressionLanguages = context.injector.get('expressionLanguages');
this._translate = context.injector.get('translate');
this._variableResolver = context.injector.get('variableResolver', false);
}

isDefaultExpressionLanguage(businessObject) {
Expand Down Expand Up @@ -187,6 +188,13 @@ class TableCellEditor extends Component {
this.getDefaultExpressionLanguage(businessObject).value;
}

_getVariables() {
const { businessObject } = this.props;

return this._variableResolver &&
this._variableResolver.getVariables(businessObject);
}

render() {
const {
businessObject,
Expand All @@ -204,6 +212,7 @@ class TableCellEditor extends Component {
const isScript = this.isScript(businessObject);

const Editor = this.getEditor();
const variables = this._getVariables();

return (
<div className="cell-editor">
Expand All @@ -217,6 +226,7 @@ class TableCellEditor extends Component {
onInput={ onChange }
value={ value }
placeholder={ placeholder }
variables={ variables }
/>
{
!isDefaultExpressionLanguage && (
Expand Down

0 comments on commit 63841af

Please sign in to comment.