Skip to content

Imports page: convert import.js to Stimulus (and fix stored CSV never clearing) #7314

Description

@compwron

What

On /imports, app/javascript/src/import.js (jQuery) does three things for the volunteer and supervisor CSV forms:

  1. Blocks the submit and shows an inline error if no file is chosen.
  2. Saves the chosen file to localStorage.
  3. Puts the file back after the SMS opt-in modal reloads the page.

Convert it to a Stimulus controller. app/javascript/controllers/disable_form_controller.js already does a similar submit guard.

Bug to fix along the way: if ($('#smsOptIn') == null) is never true (jQuery returns an empty object, not null), so the stored CSV is never cleared.

Checklist

  • Add a Stimulus controller for the two forms in app/views/imports/_volunteers.html.erb and _supervisors.html.erb
  • Clear the stored file once it is no longer needed (after a successful import, or when the opt-in modal isn't shown)
  • Delete app/javascript/src/import.js and its require. Add a Jest test
  • bundle exec rspec spec/system/imports/index_spec.rb passes

Before you start

Activity

  1. added
    Help Wanted
    javascript
    Difficulty: Intermediate
    on Nov 1, 2026
  2. costajohnt commented on Nov 4, 2026

    @costajohnt
    Contributor

    Hi! I'd like to pick this one up if it's still open. Plan is to convert import.js to a Stimulus controller modeled on disable_form_controller.js, fix the $('#smsOptIn') == null check so the stored CSV gets cleared, and keep the PR to just this file.

  3. added a commit that references this issue on Nov 20, 2026
    127e641
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: IntermediateHelp Wantedjavascript

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions