Skip to content

Conversation

@sxpydo
Copy link

@sxpydo sxpydo commented May 19, 2025

Description:
This pull request refactors the handling of the eventSurvey field within the event meta items to improve accessibility, readability, and maintainability. Instead of displaying the survey as a simple string or array, the new implementation introduces a dedicated EventSurveyMetaPresenter component that presents the survey's Title and URL fields in a clear, editable layout consistent with other resource fields, but without any add, remove, or reorder buttons. The layout uses semantic markup for better accessibility and ensures that both fields are always visible, even if the survey data is empty or null, providing a more predictable and user-friendly editing experience. Additionally, the codebase benefits from improved type safety and maintainability by encapsulating the presenter logic in a reusable function component and updating the empty document template to match the new data structure.

Ticket: #603

Media attachement(s):
Screenshot of the changes in the event survey field in a test event template on the local environment.
Screenshot 2025-06-05 at 11 13 44

sxpydo added 7 commits May 14, 2025 15:49
…ate so that it is better for creating new dates
- Refactored eventSurvey presenter in metaItems.tsx to display a single editable title and URL field using MetaItemPresenter
- Removed add, remove, and reorder buttons to reflect new API model (eventSurvey is now a single ExternalReference, not an array)
- Ensured fields are always visible and editable, even if eventSurvey is null
- Improved type safety and consistency with other meta item presenters
…veyMetaPresenter component

- Created EventSurveyMetaPresenter as a dedicated function component for editing eventSurvey fields
- Ensured eventSurvey fields (title, url) are always visible and editable, with no add/remove/reorder buttons
- Improved type safety and consistency with other meta item presenters
- Updated metaItems.tsx to use the new presenter for eventSurvey
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 5, 2025

@sxpydo sxpydo marked this pull request as ready for review June 5, 2025 10:31
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.

2 participants