ljmotta commented on code in PR #3555:
URL:
https://github.com/apache/incubator-kie-tools/pull/3555#discussion_r3327325672
##########
packages/bpmn-editor/src/propertiesPanel/itemDefinitionRefSelector/ItemDefinitionRefSelector.tsx:
##########
@@ -132,15 +134,25 @@ export function ItemDefinitionRefSelector({
const v = selectedDataType ?
itemDefinitionsByDataType.get(selectedDataType)?.itemDefinitionRef : undefined;
return (
- <TypeaheadSelect
- isMultiple={false}
- isDisabled={isReadOnly}
- id={`kie-bpmn-editor--item-definition-ref-selector--${id}`}
- selected={v}
- setSelected={_onChange}
- options={options}
- onCreateNewOption={(newOptionLabel) => addOrGetItemDefinitionId({
newDataType: newOptionLabel })}
- createNewOptionLabel={i18n.propertiesPanel.createDataType as string}
- />
+ <div
+ style={{
+ ...(isDisabled && {
+ backgroundColor: "var(--pf-global--disabled-color--300)",
+ borderRadius: "3px",
+ opacity: 0.6,
+ }),
+ }}
+ >
Review Comment:
This could be moved to the `css` file.
##########
packages/bpmn-editor/src/propertiesPanel/propertiesManager/PropertiesManager.tsx:
##########
@@ -303,6 +311,73 @@ export function PropertiesManager({ p }: { p: undefined |
WithVariables }) {
}}
/>
</GridItem>
+ <GridItem span={5}>
+ <ItemDefinitionRefSelector
+ value={entry["@_itemRef"]}
+ onChange={(newItemDefinitionRef) => {
+ bpmnEditorStoreApi.setState((s) => {
Review Comment:
As my previous comments, this should be on a mutation
##########
packages/bpmn-editor/src/mutations/addOrGetItemDefinitions.ts:
##########
@@ -34,16 +35,20 @@ export const DEFAULT_DATA_TYPES = {
export function addOrGetItemDefinitions({
definitions,
dataType,
+ id,
Review Comment:
I believe this is a leftover. I couldn't see where it is used.
##########
packages/bpmn-editor/src/propertiesPanel/GlobalProperties.tsx:
##########
@@ -259,7 +259,19 @@ export function GlobalProperties() {
const { process } = addOrGetProcessAndDiagramElements({
definitions: state.bpmn.model.definitions,
});
+ const oldProcessId = process["@_id"];
process["@_id"] = newId;
+ const collaboration =
state.bpmn.model.definitions.rootElement?.find(
+ (e) => e.__$$element === "collaboration"
+ );
+ if (collaboration && collaboration.__$$element ===
"collaboration") {
+ const participant = collaboration.participant?.find(
+ (p) => p["@_processRef"] === oldProcessId
+ );
+ if (participant) {
+ participant["@_processRef"] = newId;
+ }
+ }
Review Comment:
This entire change should be on a mutation, including the `process["@_id"] =
newId;`
##########
packages/bpmn-editor/src/propertiesPanel/correlations/Correlations.tsx:
##########
Review Comment:
This file contain many changes to correlation elements outside of a
mutation. We should refactor some methods, as changes to the definitions should
happen on a mutation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]