Volunteer edit: SMS reactivation button gets old Bootstrap classes when Twilio is off

Open Beginner friendly
#7,308 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
bootstrap, javascript, rails, ruby
Domain
frontend

Research direction

Start with the disabled-state branch in app/views/volunteers/_manage_active.html.erb, where the SMS reactivation button gets the twilio_disabled id. Then read app/javascript/src/sms_reactivation_toggle.js and its require in app/javascript/application.js, which you will remove after moving the disabled state into the view. Done means the button renders with button_classes(:secondary), disabled, and aria-disabled="true" on the server, and bundle exec rspec spec/system/volunteers/edit_spec.rb passes.

Written by the indexing model from the issue text.

Description

🖥️ Frontend Difficulty: Easy Good First Issue Help Wanted javascript

What

On a volunteer's edit page (app/views/volunteers/_manage_active.html.erb), when the org has Twilio turned off, the "Send reactivation alert (SMS)" button gets the id twilio_disabled. Then app/javascript/src/sms_reactivation_toggle.js replaces its classes with old Bootstrap ones (main-btn deactive-btn btn-sm) and adds Bootstrap tooltip attributes. Those styles no longer exist, so the button loses its design-system styling.

Checklist

  • In the view, render the disabled state on the server instead: use button_classes(:secondary) with disabled / aria-disabled="true" and keep the existing title text
  • Delete app/javascript/src/sms_reactivation_toggle.js and its require in app/javascript/application.js
  • Compare screenshots before and after, as [email protected] on a volunteer's edit page with Twilio off for the org (the default in seeds)
  • bundle exec rspec spec/system/volunteers/edit_spec.rb passes

Before you start

  • Comment here to be assigned. Setup is bin/setup, then bin/dev. Logins are in the README.
  • JS tests: npm run test. Lint: bin/lint.
  • Part of #7301 (removing jQuery). Keep this PR to just this file.
Dominant language
Ruby
Stars
382
Forks
547
Avg merge
2d 22h
Merged PRs (30d)
46

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rubyforgood/casa

All issues in rubyforgood/casa

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.