From 888b0390c436a09b211fc2a264d26bab4b6b213f Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Fri, 27 Sep 2024 11:31:14 +0200 Subject: [PATCH] feat: make FEEL popup links configurable --- src/PropertiesPanel.js | 5 +++- src/assets/properties-panel.css | 6 ++++- src/components/entries/FEEL/FeelPopup.js | 33 ++++++++++++------------ src/components/icons/Launch.svg | 5 ++++ src/components/icons/help.svg | 1 - src/components/icons/index.js | 6 ++--- 6 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 src/components/icons/Launch.svg delete mode 100644 src/components/icons/help.svg diff --git a/src/PropertiesPanel.js b/src/PropertiesPanel.js index f2273059..43b24516 100644 --- a/src/PropertiesPanel.js +++ b/src/PropertiesPanel.js @@ -117,6 +117,7 @@ const DEFAULT_TOOLTIP = {}; * @param {TooltipConfig} [props.tooltipConfig] * @param {Function} [props.tooltipLoaded] * @param {HTMLElement} [props.feelPopupContainer] + * @param {Function} [props.getFeelPopupLinks] * @param {Object} [props.eventBus] */ export default function PropertiesPanel(props) { @@ -132,6 +133,7 @@ export default function PropertiesPanel(props) { tooltipConfig, tooltipLoaded, feelPopupContainer, + getFeelPopupLinks, eventBus } = props; @@ -243,7 +245,8 @@ export default function PropertiesPanel(props) { + popupContainer={ feelPopupContainer } + getPopupLinks={ getFeelPopupLinks }>
[] } = props; const prevElement = usePrevious(element); @@ -121,6 +122,7 @@ export default function FEELPopupRoot(props) { @@ -133,6 +135,7 @@ export default function FEELPopupRoot(props) { function FeelPopupComponent(props) { const { container, + getLinks, id, hostLanguage, onInput, @@ -218,20 +221,18 @@ function FeelPopupComponent(props) { closeButtonTooltip="Save and close" onClose={ onClose } draggable> - {type === 'feel' && ( - - Learn FEEL expressions - - - ) - } - {type === 'feelers' && ( - - Learn templating - - - ) - } + <> + { + getLinks(type).map((link) => { + const { label, url } = link; + + return + { label } + + ; + }) + } +
+ + + diff --git a/src/components/icons/help.svg b/src/components/icons/help.svg deleted file mode 100644 index 2f0ca40d..00000000 --- a/src/components/icons/help.svg +++ /dev/null @@ -1 +0,0 @@ -help \ No newline at end of file diff --git a/src/components/icons/index.js b/src/components/icons/index.js index c64ff131..39c16dbf 100644 --- a/src/components/icons/index.js +++ b/src/components/icons/index.js @@ -1,9 +1,9 @@ export { default as ArrowIcon } from './Arrow.svg'; +export { default as CloseIcon } from './Close.svg'; export { default as CreateIcon } from './Create.svg'; export { default as DeleteIcon } from './Delete.svg'; export { default as DragIcon } from './Drag.svg'; export { default as ExternalLinkIcon } from './ExternalLink.svg'; export { default as FeelIcon } from './Feel.svg'; -export { default as HelpIcon } from './help.svg'; -export { default as PopupIcon } from './Popup.svg'; -export { default as CloseIcon } from './Close.svg'; \ No newline at end of file +export { default as LaunchIcon } from './Launch.svg'; +export { default as PopupIcon } from './Popup.svg'; \ No newline at end of file