Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't create new Binding and Version tag components on every render #1076

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/provider/zeebe/properties/CalledDecisionProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import { FeelEntryWithVariableContext } from '../../../entries/FeelEntryWithCont

import { withProps } from '../../HOCs/withProps.js';

const CalledDecisionBinding = withProps(Binding, { type: 'zeebe:CalledDecision' }),
CalledDecisionVersionTag = withProps(VersionTag, { type: 'zeebe:CalledDecision' });


export function CalledDecisionProps(props) {
const {
Expand All @@ -45,15 +48,15 @@ export function CalledDecisionProps(props) {
},
{
id: 'bindingType',
component: withProps(Binding, { type: 'zeebe:CalledDecision' }),
component: CalledDecisionBinding,
isEdited: isSelectEntryEdited
}
];

if (getBindingType(element, 'zeebe:CalledDecision') === 'versionTag') {
entries.push({
id: 'versionTag',
component: withProps(VersionTag, { type: 'zeebe:CalledDecision' }),
component: CalledDecisionVersionTag,
isEdited: isTextFieldEntryEdited
});
}
Expand Down
7 changes: 5 additions & 2 deletions src/provider/zeebe/properties/FormProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ import {

import { withProps } from '../../HOCs';

const FormDefinitionBinding = withProps(Binding, { type: 'zeebe:FormDefinition' }),
FormDefinitionVersionTag = withProps(VersionTag, { type: 'zeebe:FormDefinition' });

const NONE_VALUE = 'none';


Expand Down Expand Up @@ -87,14 +90,14 @@ export function FormProps(props) {
if (formType === FORM_TYPES.CAMUNDA_FORM_LINKED) {
entries.push({
id: 'bindingType',
component: withProps(Binding, { type: 'zeebe:FormDefinition' }),
component: FormDefinitionBinding,
isEdited: isSelectEntryEdited
});

if (getBindingType(element, 'zeebe:FormDefinition') === 'versionTag') {
entries.push({
id: 'versionTag',
component: withProps(VersionTag, { type: 'zeebe:FormDefinition' }),
component: FormDefinitionVersionTag,
isEdited: isTextFieldEntryEdited
});
}
Expand Down
7 changes: 5 additions & 2 deletions src/provider/zeebe/properties/TargetProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import { FeelEntryWithVariableContext } from '../../../entries/FeelEntryWithCont

import { withProps } from '../../HOCs/withProps.js';

const CalledElementBinding = withProps(Binding, { type: 'zeebe:CalledElement' }),
CalledElementVersionTag = withProps(VersionTag, { type: 'zeebe:CalledElement' });


export function TargetProps(props) {
const {
Expand All @@ -45,15 +48,15 @@ export function TargetProps(props) {
},
{
id: 'bindingType',
component: withProps(Binding, { type: 'zeebe:CalledElement' }),
component: CalledElementBinding,
isEdited: isSelectEntryEdited
}
];

if (getBindingType(element, 'zeebe:CalledElement') === 'versionTag') {
entries.push({
id: 'versionTag',
component: withProps(VersionTag, { type: 'zeebe:CalledElement' }),
component: CalledElementVersionTag,
isEdited: isTextFieldEntryEdited
});
}
Expand Down