Skip to content

Use auto-submit Stimulus for case contacts filters (#7309) - #7356

Open
KoushikSagarr wants to merge 1 commit into
rubyforgood:mainfrom
KoushikSagarr:7309-case-contacts-auto-submit
Open

KoushikSagarr wants to merge 1 commit into
rubyforgood:mainfrom
KoushikSagarr:7309-case-contacts-auto-submit

Conversation

@KoushikSagarr

@KoushikSagarr KoushikSagarr commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What github issue is this PR for, if any?

Resolves [#7309]

What changed, and why?

  • Replaced the legacy jQuery-based case contacts filter auto-submission with the existing auto-submit Stimulus controller.
  • Added change->auto-submit#submit actions to the seven individual filter controls.
  • Preserved the contact-types TomSelect multiselect behavior, allowing multiple selections before submitting the form once when the dropdown closes.
  • Removed the obsolete app/javascript/src/case_contact.js implementation and its corresponding case_contact.test.js test file after confirming the helper had no remaining consumers.
  • Removed the obsolete JavaScript import from app/javascript/application.js.
  • Removed the legacy remote/Turbo Frame form configuration so filter submissions refresh the complete page, keeping the results table, filter count, and Clear filters state synchronized.

This is another small, independently reviewable contribution toward modernizing CASA's frontend with Stimulus.

How is this tested? (please write rspec and jest tests!) 💖💪

  • Jest: 14 test suites passed, 119 tests passed, 0 failures.
  • Asset build: npm run build && npm run build:css completed successfully with 0 errors and 0 warnings.
  • RSpec: spec/system/case_contacts/index_spec.rb — 43 examples, 0 failures.
  • Filter behavior: Verified automatic submission across filter controls, date filtering, draft filtering, sorting, and Clear filters updates.
  • Multiselect behavior: Verified that multiple contact types can be selected in one menu session and the form submits only once when the dropdown closes.
  • Git diff: git diff --check passed with no whitespace errors.
  • Lockfiles: Gemfile.lock and package-lock.json remain unchanged.

Screenshots please :)

Not applicable — this PR updates existing filter behavior without introducing a new UI design.

Feelings gif (optional)

Another step away from legacy jQuery and toward a cleaner Stimulus-powered CASA! 💪

@github-actions github-actions Bot added 🧪 Tests Tests javascript Touches JavaScript code erb Touches ERB templates labels Nov 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

erb Touches ERB templates javascript Touches JavaScript code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant