Skip to content

Bugfix/issue 2263 - #2265

Merged
AbhishekPAnil merged 3 commits into
developfrom
bugfix/issue-2263
Jul 30, 2026
Merged

Bugfix/issue 2263#2265
AbhishekPAnil merged 3 commits into
developfrom
bugfix/issue-2263

Conversation

@AbhishekPAnil

@AbhishekPAnil AbhishekPAnil commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This pull request makes several improvements to the AddEvent page, primarily focusing on navigation logic, event state management, and form error handling. The changes ensure that navigation to related entities (like organizations) works more reliably, and that events are properly saved as drafts before navigating away, especially when editing published events.

Navigation and event state management:

  • The organizerPerformerSupporterPlaceNavigationHandler function now checks if the event is published, and if so, updates its state to draft before continuing navigation. This ensures edits are not lost and the event is in the correct state before navigating away.
  • The navigation to the "Add Organization" page is now wrapped in a multi-line call for clarity, and the navigation state is passed more explicitly, improving maintainability and readability.

Form error handling:

  • The error mapping logic now correctly uses the value from errors[fieldName].value instead of the entire data object, ensuring form fields display the correct error values.

Code structure improvements:

  • The navigation handler's logic for saving and navigating has been refactored into a saveAndNavigate function for better readability and reusability.

@aws-amplify-ca-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2265.dla06mbe0wyl7.amplifyapp.com

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the AddEvent page’s behavior when navigating to related entities (organization/person/place) from within the event form, especially for published events, and fixes incorrect form error field mapping so invalid nested entities display correct values.

Changes:

  • Fixes form field error mapping to set each field’s value from errors[fieldName].value (instead of the entire data object).
  • Refactors the related-entity navigation handler by extracting saveAndNavigate, and adds logic to switch published events to draft before navigating away.
Comments suppressed due to low confidence (2)

src/pages/Dashboard/AddEvent/AddEvent.jsx:2004

  • Use strict equality here to avoid unintended type coercion when comparing the normalized type to taxonomy constants.
          else if (type?.toUpperCase() == taxonomyClass.PERSON)

src/pages/Dashboard/AddEvent/AddEvent.jsx:2013

  • Use strict equality here to avoid unintended type coercion when comparing the normalized type to taxonomy constants.
          else if (type?.toUpperCase() == taxonomyClass.PLACE)

Comment thread src/pages/Dashboard/AddEvent/AddEvent.jsx
Comment thread src/pages/Dashboard/AddEvent/AddEvent.jsx
@AbhishekPAnil
AbhishekPAnil merged commit 837efdd into develop Jul 30, 2026
4 of 5 checks passed
@AbhishekPAnil
AbhishekPAnil deleted the bugfix/issue-2263 branch July 30, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editing a linked entity on a published event results in a 409 error and prevents redirection

2 participants