diff --git a/open-bpmn.glsp-client/open-bpmn-properties/src/SelectItemControl.tsx b/open-bpmn.glsp-client/open-bpmn-properties/src/SelectItemControl.tsx index d24134bf..49ad26b7 100644 --- a/open-bpmn.glsp-client/open-bpmn-properties/src/SelectItemControl.tsx +++ b/open-bpmn.glsp-client/open-bpmn-properties/src/SelectItemControl.tsx @@ -14,7 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ import { - and, computeLabel, ControlProps, isDescriptionHidden, isEnumControl, optionIs, OwnPropsOfEnum, RankedTester, rankWith + and, + computeLabel, + ControlProps, + isDescriptionHidden, + isEnumControl, JsonFormsRendererRegistryEntry, optionIs, + OwnPropsOfEnum, rankWith } from '@jsonforms/core'; import { withJsonFormsEnumProps } from '@jsonforms/react'; import { VanillaRendererProps, withVanillaControlProps } from '@jsonforms/vanilla-renderers'; @@ -196,8 +201,10 @@ export const SelectItemGroupControl = (props: ControlProps & VanillaRendererProp return ; }; -export const selectItemControlTester: RankedTester = rankWith( - 3, - and(isEnumControl, optionIs('format', 'selectitem')) -); -export default withVanillaControlProps(withJsonFormsEnumProps(SelectItemGroupControl)); +/** + * Export the Custom Renderer and Tester for SelectItemGroupControl + */ +export const SelectItemRendererEntry: JsonFormsRendererRegistryEntry = { + tester: rankWith(3, and(isEnumControl, optionIs('format', 'selectitem'))), + renderer: withVanillaControlProps(withJsonFormsEnumProps(SelectItemGroupControl)) +}; diff --git a/open-bpmn.glsp-client/open-bpmn-properties/src/bpmn-property-panel.tsx b/open-bpmn.glsp-client/open-bpmn-properties/src/bpmn-property-panel.tsx index 8454b62c..c5e59b1e 100644 --- a/open-bpmn.glsp-client/open-bpmn-properties/src/bpmn-property-panel.tsx +++ b/open-bpmn.glsp-client/open-bpmn-properties/src/bpmn-property-panel.tsx @@ -38,7 +38,8 @@ import { vanillaCells, vanillaRenderers } from '@jsonforms/vanilla-renderers'; import { isBoundaryEvent } from '@open-bpmn/open-bpmn-model'; import * as React from 'react'; import { createRoot } from 'react-dom/client'; -import SelectItemGroupControl, { selectItemControlTester } from './SelectItemControl'; +// import SelectItemGroupControl, { selectItemControlTester } from './SelectItemControl'; +import { SelectItemRendererEntry } from './SelectItemControl'; // eslint-disable-next-line @typescript-eslint/explicit-function-return-type @injectable() export class BPMNPropertyPanel extends AbstractUIExtension implements SelectionListener, IActionHandler { // IActionHandler EditModeListener @@ -301,7 +302,7 @@ export class BPMNPropertyPanel extends AbstractUIExtension implements SelectionL const bpmnRenderers = [ ...vanillaRenderers, // optional register custom renderers... - { tester: selectItemControlTester, renderer: SelectItemGroupControl } + SelectItemRendererEntry ]; // render JSONForm // vanillaRenderers