fix: Add onFormStateChange callback on EventTypeSettings atom [CAL-5856] (#21615)

* Adds onFormStateChange callback on EventTypeSettings atom

* updated docs for event-type

* added watch all form values

---------

Co-authored-by: Morgan <[email protected]>
This commit is contained in:
Sarthak KapilaandMorgan authored and GitHub committed 2025-06-10 12:36:34 +00:00
1 parent 84171928cb
commit ad697365ce
3 files changed
+34 -1

No files matched your search

+5
View File
@@ -131,6 +131,10 @@ export function EventTypeTabs(eventTypeId: number) {
onSuccess={(eventType) => {
console.log("EventType settings updated successfully", eventType);
}}
onFormStateChange={(formState) => {
console.log("Form state changed:", formState);
// Access form data: formState.isDirty, formState.dirtyFields, formState.values
}}
customClassNames={{ atomsWrapper: "!w-[70vw] !m-auto" }}
/>
</>
@@ -175,6 +179,7 @@ Below is a list of props that can be passed to the event type settings atom.
| tabs | No | The tabs you want the event type settings to display |
| onSuccess | No | Callback function that triggers when the event type is successfully updated |
| onError | No | Callback function to handles errors at the time of event type update |
| onFormStateChange | No | Callback function that triggers when the form state changes, providing access to isDirty, dirtyFields, and current form values |
| onDeleteSuccess | No | Callback function that triggers when the event type is successfully deleted |
| onDeleteError | No | Callback function that handles errors at the time of event type deletion | |
| allowDelete | No | Boolean value that determines whether the delete button is displayed or not |