Delete dead sweet-alert-confirm.js (no view uses data-confirm-swal)

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

先在 app/views、app/components 和 app/helpers 上运行检查清单中的 grep,确认没有任何地方使用 data-confirm-swal。然后删除 app/javascript/sweet-alert-confirm.js,并从 app/javascript/application.js 中移除它的导入,保留 sweetalert2 包不动。当删除确认和联系人类型确认仍能在浏览器中显示,npm run test 通过,且 spec/system/volunteers/edit_spec.rb 为绿色时,即完成。

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

描述

Difficulty: Easy Good First Issue Help Wanted javascript

What

app/javascript/sweet-alert-confirm.js hooks Rails UJS so that links with data-confirm-swal show a SweetAlert. No view uses data-confirm-swal any more: confirmations now go through shared/_confirm_button (a native dialog) or plain data-confirm.

Checklist

  • Confirm grep -rn "confirm-swal\|confirm_swal" app/views app/components app/helpers returns nothing
  • Delete app/javascript/sweet-alert-confirm.js and remove its import from app/javascript/application.js
  • Check whether window.Swal is still used (grep -rn "window.Swal\|Swal" app/javascript). Other files import Swal directly, so leave the sweetalert2 package alone in this PR
  • Click a delete button (for example on a contact type) and a deactivate button (on a volunteer's edit page) and confirm both confirmations still appear
  • npm run test passes, and so does bundle exec rspec spec/system/volunteers/edit_spec.rb

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
平均合并
2 天 22 小时
30 天内合并 PR
46

环境准备

在 Codespaces 中打开

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

从这里开始

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

rubyforgood/casa 的其他 Issue

查看 rubyforgood/casa 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

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