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

未关闭 适合新手
#7,308 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
bootstrap, javascript, rails, ruby
领域
frontend

调研方向

从 app/views/volunteers/_manage_active.html.erb 中禁用状态的分支开始,其中短信重新激活按钮会获得 id twilio_disabled。然后阅读 app/javascript/src/sms_reactivation_toggle.js 及其在 app/javascript/application.js 中的 require,在把禁用状态移入视图后,你将删除这个 require。当服务器端渲染的按钮带有 button_classes(:secondary)、disabled 和 aria-disabled="true",并且 bundle exec rspec spec/system/volunteers/edit_spec.rb 通过时,即为完成。

由索引模型根据 Issue 内容生成。

描述

🖥️ 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.
主要语言
Ruby
星标
382
派生
547
平均合并
3 天 3 小时
30 天内合并 PR
39

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rubyforgood/casa 的其他 Issue

查看 rubyforgood/casa 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。