Skip to content

Conversation

@rsmithlal
Copy link
Member

@rsmithlal rsmithlal commented Sep 5, 2025

This pull request introduces several enhancements and refactors to the BetterTogether event management features, focusing on improving event time handling, optimizing database queries, enhancing privacy display consistency, and refining RSVP logic. It also adds new helper methods for UI consistency and performance, and updates documentation and linting rules.

Event Management & RSVP Improvements

  • Refactored RSVP actions in events_controller.rb to ensure only scheduled events allow RSVP, require login for RSVP/cancel actions, and provide user feedback via redirects and alerts. [1] [2]
  • Added preloading of event associations (categories, hosts, attendances, translations, images, location) in set_resource_instance to avoid N+1 queries and improve event page performance.
  • Added AJAX card rendering for event show requests, improving responsiveness for event hover cards.

Event Time Handling

  • Added a new Stimulus controller (event_datetime_controller.js) for dynamic synchronization of event start time, end time, and duration fields, enforcing minimum duration and providing user feedback.
  • Introduced the display_event_time helper to intelligently format event times based on duration and date span for clearer UI display.

Privacy Display Consistency

  • Added privacy_display_value helper for consistent, translated privacy level display across the application, and updated privacy_badge to use this helper. [1] [2] [3]

Performance Optimizations

  • Preloaded calendar associations for people in people_controller.rb to avoid N+1 queries.

UI Consistency & Documentation

  • Added event_relationship_icon helper to display appropriate icons and colors for a person's relationship to an event.
  • Updated view helper documentation to include privacy display best practices.
  • Disabled Rubocop's RSpec/MultipleExpectations cop to allow multiple expectations per test.

- Added validation to prevent RSVPs for draft events in EventAttendance model.
- Updated EventAttendancePolicy to restrict RSVP creation and updates for draft events.
- Modified EventsController to redirect with an alert when attempting to RSVP to a draft event.
- Enhanced show view to display appropriate messages for draft events.
- Added internationalization support for new alert messages.
- Created tests to ensure proper behavior for draft event restrictions.
@rsmithlal rsmithlal marked this pull request as ready for review September 6, 2025 22:18
@rsmithlal rsmithlal merged commit 1bc5a39 into main Sep 6, 2025
12 checks passed
@rsmithlal rsmithlal deleted the enhancements/events branch September 6, 2025 22:19
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