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:
@ -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}
|
||||
|
||||
@ -117,7 +117,7 @@ export const WorkflowEditTriggerCronForm = ({
|
||||
hint="Format: [Minute] [Hour] [Day of Month] [Month] [Day of Week]"
|
||||
readonly={triggerOptions.readonly}
|
||||
defaultValue={trigger.settings.pattern}
|
||||
onPersist={(newPattern: string) => {
|
||||
onChange={(newPattern: string) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
@ -156,7 +156,7 @@ export const WorkflowEditTriggerCronForm = ({
|
||||
error={errorMessagesVisible ? errorMessages.DAYS_day : undefined}
|
||||
onBlur={onBlur}
|
||||
defaultValue={trigger.settings.schedule.day}
|
||||
onPersist={(newDay) => {
|
||||
onChange={(newDay) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
@ -205,7 +205,7 @@ export const WorkflowEditTriggerCronForm = ({
|
||||
error={errorMessagesVisible ? errorMessages.DAYS_hour : undefined}
|
||||
onBlur={onBlur}
|
||||
defaultValue={trigger.settings.schedule.hour}
|
||||
onPersist={(newHour) => {
|
||||
onChange={(newHour) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
@ -256,7 +256,7 @@ export const WorkflowEditTriggerCronForm = ({
|
||||
}
|
||||
onBlur={onBlur}
|
||||
defaultValue={trigger.settings.schedule.minute}
|
||||
onPersist={(newMinute) => {
|
||||
onChange={(newMinute) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
@ -311,7 +311,7 @@ export const WorkflowEditTriggerCronForm = ({
|
||||
}
|
||||
onBlur={onBlur}
|
||||
defaultValue={trigger.settings.schedule.hour}
|
||||
onPersist={(newHour) => {
|
||||
onChange={(newHour) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
@ -358,7 +358,7 @@ export const WorkflowEditTriggerCronForm = ({
|
||||
}
|
||||
onBlur={onBlur}
|
||||
defaultValue={trigger.settings.schedule.minute}
|
||||
onPersist={(newMinute) => {
|
||||
onChange={(newMinute) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
@ -406,7 +406,7 @@ export const WorkflowEditTriggerCronForm = ({
|
||||
error={errorMessagesVisible ? errorMessages.MINUTES : undefined}
|
||||
onBlur={onBlur}
|
||||
defaultValue={trigger.settings.schedule.minute}
|
||||
onPersist={(newMinute) => {
|
||||
onChange={(newMinute) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user