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

Aberta
#7,312 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
66/100
Tipo de issue
Refatoração
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
javascript, rails, ruby
Domínio
frontend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

🖥️ 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.
Linguagem predominante
Ruby
Estrelas
384
Forks
558
Merge médio
1d 7h
PRs com merge (30d)
63

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de rubyforgood/casa

Todas as issues de rubyforgood/casa

Issues semelhantes

Mais issues de Ruby

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.