Rename onPersist to onChange for form fields (#11047)

We are about to build forms where fields will not be persisted
immediately. It will have to be submitted.
Renaming the prop to reflect it.
This commit is contained in:
Thomas Trompette
2025-03-20 10:58:02 +01:00
committed by GitHub
parent e666506ea3
commit 369abfe424
39 changed files with 238 additions and 238 deletions
@@ -210,7 +210,7 @@ export const WorkflowEditActionCreateRecord = ({
key={field.metadata.fieldName}
defaultValue={currentValue}
field={field}
onPersist={(value) => {
onChange={(value) => {
handleFieldChange(field.metadata.fieldName, value);
}}
VariablePicker={WorkflowVariablePicker}
@@ -138,7 +138,7 @@ export const WorkflowEditActionFindRecords = ({
label="Limit"
defaultValue={formData.limit}
placeholder="Enter limit"
onPersist={() => {}}
onChange={() => {}}
readonly
/>
</WorkflowStepBody>
@@ -240,7 +240,7 @@ export const WorkflowEditActionSendEmail = ({
placeholder="Enter receiver email"
readonly={actionOptions.readonly}
defaultValue={formData.email}
onPersist={(email) => {
onChange={(email) => {
handleFieldChange('email', email);
}}
VariablePicker={WorkflowVariablePicker}
@@ -250,7 +250,7 @@ export const WorkflowEditActionSendEmail = ({
placeholder="Enter email subject"
readonly={actionOptions.readonly}
defaultValue={formData.subject}
onPersist={(subject) => {
onChange={(subject) => {
handleFieldChange('subject', subject);
}}
VariablePicker={WorkflowVariablePicker}
@@ -260,7 +260,7 @@ export const WorkflowEditActionSendEmail = ({
placeholder="Enter email body"
readonly={actionOptions.readonly}
defaultValue={formData.body}
onPersist={(body) => {
onChange={(body) => {
handleFieldChange('body', body);
}}
VariablePicker={WorkflowVariablePicker}
@@ -56,7 +56,7 @@ export const WorkflowEditActionServerlessFunctionFields = ({
placeholder="Enter value"
defaultValue={inputValue ? `${inputValue}` : ''}
readonly={readonly}
onPersist={(value) => onInputChange?.(value, currentPath)}
onChange={(value) => onInputChange?.(value, currentPath)}
VariablePicker={VariablePicker}
/>
);
@@ -227,7 +227,7 @@ export const WorkflowEditActionUpdateRecord = ({
icon: getIcon(field.iconName),
color: 'gray',
}))}
onPersist={(fieldsToUpdate) =>
onChange={(fieldsToUpdate) =>
handleFieldChange('fieldsToUpdate', fieldsToUpdate)
}
placeholder="Select fields to update"
@@ -254,7 +254,7 @@ export const WorkflowEditActionUpdateRecord = ({
key={fieldDefinition.metadata.fieldName}
defaultValue={currentValue}
field={fieldDefinition}
onPersist={(value) => {
onChange={(value) => {
handleFieldChange(fieldDefinition.metadata.fieldName, value);
}}
VariablePicker={WorkflowVariablePicker}
@@ -109,7 +109,7 @@ export const WorkflowEditActionFormFieldSettings = ({
icon: IllustrationIconNumbers,
},
]}
onPersist={(newType: string | null) => {
onChange={(newType: string | null) => {
if (newType === null) {
return;
}
@@ -26,7 +26,7 @@ export const WorkflowFormFieldSettingsNumber = ({
<FormFieldInputContainer>
<InputLabel>Label</InputLabel>
<FormTextFieldInput
onPersist={(newLabel: string | null) => {
onChange={(newLabel: string | null) => {
onChange('label', newLabel);
}}
defaultValue={label ?? t`Number`}
@@ -36,7 +36,7 @@ export const WorkflowFormFieldSettingsNumber = ({
<FormFieldInputContainer>
<InputLabel>Placeholder</InputLabel>
<FormTextFieldInput
onPersist={(newPlaceholder: string | null) => {
onChange={(newPlaceholder: string | null) => {
onChange('placeholder', newPlaceholder);
}}
defaultValue={placeholder ?? '1000'}
@@ -25,7 +25,7 @@ export const WorkflowFormFieldSettingsText = ({
<FormFieldInputContainer>
<InputLabel>Label</InputLabel>
<FormTextFieldInput
onPersist={(newLabel: string | null) => {
onChange={(newLabel: string | null) => {
onChange('label', newLabel);
}}
defaultValue={label}
@@ -35,7 +35,7 @@ export const WorkflowFormFieldSettingsText = ({
<FormFieldInputContainer>
<InputLabel>Placeholder</InputLabel>
<FormTextFieldInput
onPersist={(newPlaceholder: string | null) => {
onChange={(newPlaceholder: string | null) => {
onChange('placeholder', newPlaceholder);
}}
defaultValue={placeholder}