From 1a6389ae0942d09fbfafb5e32ceb148f336abc94 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 16 Nov 2022 15:36:12 -0500 Subject: [PATCH] Minor tweak, in the hopes of getting a text box to update correctly. --- .../CallActivityPropertiesProvider.js | 2 +- .../src/components/ProcessSearch.tsx | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 spiffworkflow-frontend/src/components/ProcessSearch.tsx diff --git a/bpmn-js-spiffworkflow/app/spiffworkflow/callActivity/propertiesPanel/CallActivityPropertiesProvider.js b/bpmn-js-spiffworkflow/app/spiffworkflow/callActivity/propertiesPanel/CallActivityPropertiesProvider.js index f5e9616d..259cb899 100644 --- a/bpmn-js-spiffworkflow/app/spiffworkflow/callActivity/propertiesPanel/CallActivityPropertiesProvider.js +++ b/bpmn-js-spiffworkflow/app/spiffworkflow/callActivity/propertiesPanel/CallActivityPropertiesProvider.js @@ -109,7 +109,7 @@ function FindProcessButton(props) { // First, set up the listen, then fire the event, just // in case we are testing and things are happening super fast. eventBus.once('spiff.callactivity.update', (response) => { - commandStack.execute('element.updateModdleProperties', { + commandStack.execute('element.updateProperties', { element, moddleElement: element.businessObject, properties: { diff --git a/spiffworkflow-frontend/src/components/ProcessSearch.tsx b/spiffworkflow-frontend/src/components/ProcessSearch.tsx new file mode 100644 index 00000000..7637760a --- /dev/null +++ b/spiffworkflow-frontend/src/components/ProcessSearch.tsx @@ -0,0 +1,53 @@ +import { + ComboBox, + // @ts-ignore +} from '@carbon/react'; +import { truncateString } from '../helpers'; +import { ProcessReference } from '../interfaces'; + +type OwnProps = { + onChange: (..._args: any[]) => any; + processes: ProcessReference[]; + selectedItem?: ProcessReference | null; + titleText?: string; + height?: string; +}; + +export default function ProcessSearch({ + processes, + selectedItem, + onChange, + titleText = 'Process model', + height = '50px', +}: OwnProps) { + const shouldFilter = (options: any) => { + const process: ProcessReference = options.item; + const { inputValue } = options; + return `${process.identifier} (${process.display_name})`.includes( + inputValue + ); + }; + return ( +
+ { + if (process) { + return `${process.identifier} (${truncateString( + process.display_name, + 20 + )})`; + } + return null; + }} + shouldFilterItem={shouldFilter} + placeholder="Choose a process" + titleText={titleText} + selectedItem={selectedItem} + /> +
+ ); +}