Profile edit: Stimulus password-confirmation check with an inline error

Đang mở
#7,312 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
66/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, rails, ruby
Lĩnh vực
frontend

Hướng nghiên cứu

Start with the jQuery logic in app/javascript/src/password_confirmation.js and the markup it targets in app/views/users/edit.html.erb, then look at existing controllers in app/javascript/controllers/ for the Stimulus pattern. Build the new password_confirmation_controller.js with data-target attributes, show the mismatch inline, and update spec/system/users/edit_spec.rb. Done when the old file and its require are removed, bundle exec rspec spec/system/users/edit_spec.rb and npm run test pass, and bin/lint is clean.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

🖥️ Frontend Difficulty: Intermediate Help Wanted javascript

What

On the profile edit page (app/views/users/edit.html.erb), app/javascript/src/password_confirmation.js (jQuery) disables "Update password" until the password and the confirmation match, and shows a SweetAlert popup when they don't. Convert it to a Stimulus controller, and show the mismatch inline under the field (rose text, like other form errors in design.md) instead of a popup.

Checklist

  • Add app/javascript/controllers/password_confirmation_controller.js and register it
  • Replace the submit-password / password-new / password-confirmation class hooks in users/edit.html.erb with data-*-target attributes
  • Delete app/javascript/src/password_confirmation.js and its require. Move or rewrite __tests__/password_confirmation.test.js for the controller
  • bundle exec rspec spec/system/users/edit_spec.rb passes (update any spec that expected the SweetAlert)

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.
Ngôn ngữ chính
Ruby
Star
384
Fork
558
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
63

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rubyforgood/casa

Tất cả issue của rubyforgood/casa

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.