From 4042afeb8db620ab8925b55e9073bc7ed33852d9 Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Thu, 17 Oct 2024 11:39:10 +0200 Subject: [PATCH] WIP --- src/render/BpmnPropertiesPanel.js | 6 +++++- src/render/BpmnPropertiesPanelRenderer.js | 5 ++++- test/spec/BpmnPropertiesPanelRenderer.spec.js | 21 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/render/BpmnPropertiesPanel.js b/src/render/BpmnPropertiesPanel.js index 1a753a195..2f2d97f78 100644 --- a/src/render/BpmnPropertiesPanel.js +++ b/src/render/BpmnPropertiesPanel.js @@ -28,6 +28,8 @@ import { PanelPlaceholderProvider } from './PanelPlaceholderProvider'; * @param {Object} props.layoutConfig * @param {Object} props.descriptionConfig * @param {Object} props.tooltipConfig + * @param {HTMLElement} props.feelPopupContainer + * @param {Function} props.getFeelPopupLinks */ export default function BpmnPropertiesPanel(props) { const { @@ -37,7 +39,8 @@ export default function BpmnPropertiesPanel(props) { layoutConfig: initialLayoutConfig, descriptionConfig, tooltipConfig, - feelPopupContainer + feelPopupContainer, + getFeelPopupLinks } = props; const canvas = injector.get('canvas'); @@ -238,6 +241,7 @@ export default function BpmnPropertiesPanel(props) { tooltipConfig={ tooltipConfig } tooltipLoaded={ onTooltipLoaded } feelPopupContainer={ feelPopupContainer } + getFeelPopupLinks={ getFeelPopupLinks } eventBus={ eventBus } /> ; } diff --git a/src/render/BpmnPropertiesPanelRenderer.js b/src/render/BpmnPropertiesPanelRenderer.js index f829588ae..db74f6c06 100644 --- a/src/render/BpmnPropertiesPanelRenderer.js +++ b/src/render/BpmnPropertiesPanelRenderer.js @@ -31,7 +31,8 @@ export default class BpmnPropertiesPanelRenderer { layout: layoutConfig, description: descriptionConfig, tooltip: tooltipConfig, - feelPopupContainer + feelPopupContainer, + getFeelPopupLinks } = config || {}; this._eventBus = eventBus; @@ -40,6 +41,7 @@ export default class BpmnPropertiesPanelRenderer { this._descriptionConfig = descriptionConfig; this._tooltipConfig = tooltipConfig; this._feelPopupContainer = feelPopupContainer; + this._getFeelPopupLinks = getFeelPopupLinks; this._container = domify( '
' @@ -176,6 +178,7 @@ export default class BpmnPropertiesPanelRenderer { descriptionConfig={ this._descriptionConfig } tooltipConfig={ this._tooltipConfig } feelPopupContainer={ this._feelPopupContainer } + getFeelPopupLinks={ this._getFeelPopupLinks } />, this._container ); diff --git a/test/spec/BpmnPropertiesPanelRenderer.spec.js b/test/spec/BpmnPropertiesPanelRenderer.spec.js index 1edaae993..6434330b4 100644 --- a/test/spec/BpmnPropertiesPanelRenderer.spec.js +++ b/test/spec/BpmnPropertiesPanelRenderer.spec.js @@ -111,6 +111,27 @@ describe('', function() { propertiesPanel: { parent: propertiesContainer, feelTooltipContainer: container, + getFeelPopupLinks: (type) => { + if (type === 'feel') { + return [ + { + label: 'Learn FEEL expressions', + url: 'https://docs.camunda.io/docs/components/modeler/feel/what-is-feel/' + }, + { + label: 'Try FEEL Copilot', + url: 'https://feel-copilot.camunda.com/' + } + ]; + } else if (type === 'feelers') { + return [ + { + label: 'Learn templating', + url: 'https://docs.camunda.io/docs/components/modeler/forms/configuration/forms-config-templating-syntax/' + } + ]; + } + }, description, tooltip, layout