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:
+1
-1
@@ -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}
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ export const WorkflowEditActionFindRecords = ({
|
||||
label="Limit"
|
||||
defaultValue={formData.limit}
|
||||
placeholder="Enter limit"
|
||||
onPersist={() => {}}
|
||||
onChange={() => {}}
|
||||
readonly
|
||||
/>
|
||||
</WorkflowStepBody>
|
||||
|
||||
+3
-3
@@ -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}
|
||||
|
||||
+1
-1
@@ -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}
|
||||
/>
|
||||
);
|
||||
|
||||
+2
-2
@@ -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}
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ export const WorkflowEditActionFormFieldSettings = ({
|
||||
icon: IllustrationIconNumbers,
|
||||
},
|
||||
]}
|
||||
onPersist={(newType: string | null) => {
|
||||
onChange={(newType: string | null) => {
|
||||
if (newType === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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'}
|
||||
|
||||
+2
-2
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user