Skip to content

refactor(js): remove dead Chosen code from invitations.js - #2822

Merged
mroderick merged 2 commits into
masterfrom
feature/remove-dead-invitations-js
Aug 30, 2026
Merged

refactor(js): remove dead Chosen code from invitations.js#2822
mroderick merged 2 commits into
masterfrom
feature/remove-dead-invitations-js

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

What

Prunes dead Chosen-related code from app/assets/javascripts/invitations.js.

Why

The ajax:success handler had two branches:

  1. verify_attendance — still used for targeted row replacement after attendance verify/unverify clicks
  2. else — replaced entire #invitations container and re-initialised Chosen on any <select> inside it

The else branch is dead code: no <select> elements exist in any #invitations container anymore:

  • admin/workshops/_invitation_management — no selects
  • admin/meetings/_invitation_management — uses TomSelect (class: 'tom-select')
  • admin/events/_invitation_management — select is commented out

Also removed the dead change handler for #workshop_invitations, which has no matching element in the DOM.

What stays

The verify_attendance row replacement and tooltip re-initialisation is still needed and untouched.

Testing

  • bundle exec rspec spec/features/admin/manage_workshop_attendances_spec.rb — 7 scenarios, 0 failures
  • bundle exec rspec spec/features/managing_workshop_attendance_spec.rb — 28 scenarios, 0 failures

@mroderick
mroderick force-pushed the feature/remove-dead-invitations-js branch from ba13a4f to b101562 Compare August 30, 2026 05:53
The ajax:success handler had two branches:
- verify_attendance: still used for row replacement after attendance clicks
- else: replaced entire #invitations and re-initialised Chosen on selects

The else branch is dead: no <select> elements exist in #invitations
anymore (workshops have no selects, meetings use TomSelect, events
have a commented-out select).

Also removed the dead change handler for #workshop_invitations,
which was a Chosen dropdown removed from the view in commits
bd9752b7 and 9d0eb97 (replaced with an RSVP page link).
@mroderick
mroderick force-pushed the feature/remove-dead-invitations-js branch from b101562 to c9076c2 Compare August 30, 2026 05:55
@mroderick
mroderick marked this pull request as ready for review August 30, 2026 06:03
@mroderick
mroderick merged commit ccfd2d0 into master Aug 30, 2026
10 checks passed
@mroderick
mroderick deleted the feature/remove-dead-invitations-js branch August 30, 2026 06:03
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.

1 participant