Fix(web): allow user to save event without making changes#1006
Merged
tyler-dane merged 11 commits intomainfrom Sep 26, 2025
Merged
Fix(web): allow user to save event without making changes#1006tyler-dane merged 11 commits intomainfrom
tyler-dane merged 11 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where users were unable to save events without making changes by removing the "dirty check" logic that previously disabled the save button when no modifications were detected.
- Removes the
disableSaveBtnprop and related logic throughout the EventForm component hierarchy - Refactors the event dirty checking logic into a dedicated parser module with comprehensive testing
- Updates the submit logic to handle unchanged events by discarding them locally instead of preventing submission
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web/src/views/Forms/EventForm/types.ts | Removes disableSaveBtn prop from FormProps interface |
| packages/web/src/views/Forms/EventForm/SaveSection/SaveSection.tsx | Removes disabled state logic and always enables save button |
| packages/web/src/views/Forms/EventForm/SaveSection/SaveSection.test.tsx | Removes test for disabled save button behavior |
| packages/web/src/views/Forms/EventForm/EventForm.tsx | Removes disableSaveBtn prop usage |
| packages/web/src/views/Calendar/components/Draft/sidebar/hooks/useSidebarActions.ts | Removes unused draft conversion functions |
| packages/web/src/views/Calendar/components/Draft/hooks/state/useDraftConfirmation.ts | Removes dirty check logic from confirmation flow |
| packages/web/src/views/Calendar/components/Draft/hooks/actions/useDraftActions.ts | Refactors submit logic to use new event parser and handle unchanged events |
| packages/web/src/views/Calendar/components/Draft/hooks/actions/useDraftActions.test.ts | Removes old test file for event dirty checking logic |
| packages/web/src/views/Calendar/components/Draft/grid/GridDraft.tsx | Removes dirty check and disableSaveBtn prop usage |
| packages/web/src/common/utils/event.util.ts | Adds error logging to error handler |
| packages/web/src/common/parsers/event.parser.ts | Adds new WebEventParser class for determining if events have been modified |
| packages/web/src/common/parsers/event.parser.test.ts | Adds comprehensive tests for the new event parser |
| packages/web/src/tests/utils/event.util/test.event.util.ts | Adds utility for creating test web events |
packages/web/src/views/Calendar/components/Draft/hooks/actions/useDraftActions.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
packages/web/src/views/Calendar/components/Draft/hooks/actions/useDraftActions.ts
Show resolved
Hide resolved
packages/web/src/views/Calendar/components/Draft/hooks/actions/useDraftActions.ts
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #991, minus the Draft schema changes
Closes #990
This pull request refactors and improves the event "dirty check" logic in the web calendar application. It introduces a dedicated parser for determining if an event has been modified, adds comprehensive tests for this logic, and updates the event draft submission flow to use the new implementation. The changes also remove legacy or duplicated dirty-checking code, resulting in a cleaner and more robust codebase.
Event Dirty Check Refactor and Testing
WebEventParserclass inevent.parser.tsto encapsulate the logic for determining if a web event draft has been modified ("dirty"), including nuanced handling of recurrence and date changes. Also exported a standaloneisEventDirtyfunction for convenience.event.parser.test.ts, covering all relevant event fields, recurrence scenarios, and edge cases.createWebEventfor generating test events intest.event.util.tsto support the new tests.Integration and Cleanup in Calendar Draft Actions
useDraftActions.tsto use the newisEventDirtyparser, removing the previous inline implementation and ensuring all dirty checks are consistent and robust. The draft submission logic now uses a newdetermineSubmitActionhelper to decide whether to submit, discard, or just open the form based on event state. [1] [2] [3] [4]useDraftActions.test.ts.UI and Miscellaneous
GridDraftcomponent by removing unused code related to the old dirty check and save button disabling. [1] [2]