All-CASA patch notes page: convert patch_notes.js to Stimulus or Turbo Frames

Aperta
#7,316 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, jquery, rails, ruby
Ambito
frontend

Direzione di ricerca

Start with app/javascript/src/all_casa_admin/patch_notes.js and the view app/views/all_casa_admins/patch_notes/index.html.erb, then see how app/javascript/all_casa_admin.js requires the script. The button_classes helper on the server should supply the button classes. Run spec/system/all_casa_admins/patch_notes/index_spec.rb to confirm create, edit, cancel and delete still work. Done means the jQuery file and its require are gone, and that spec passes without the raw Selenium handle. Agree on a Stimulus or Turbo Frames approach in a comment first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Difficulty: Advanced Help Wanted javascript

What

The All-CASA-admin patch notes page (app/views/all_casa_admins/patch_notes/index.html.erb) is driven by app/javascript/src/all_casa_admin/patch_notes.js. It's about 500 lines of jQuery that create, edit and delete patch notes inline with $.ajax, and it hand-copies the button_classes strings into JS. Convert it to Stimulus with fetch. A good alternative is plain Rails forms in Turbo Frames, which could remove most of the JS.

This is the biggest legacy script. Open a short plan comment before you start.

Checklist

  • Create, edit, cancel-edit and delete all still work without a full page reload (or with Turbo Frames)
  • Buttons come from the button_classes helper on the server, not hard-coded class strings in JS
  • Delete patch_notes.js and its require in app/javascript/all_casa_admin.js
  • bundle exec rspec spec/system/all_casa_admins/patch_notes/index_spec.rb passes. That spec also still reads a raw Selenium handle (see design-todo.md), which you can clean up here

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.
Lingua principale
Ruby
Stelle
384
Fork
558
Merge medio
1g 7h
PR unite (30g)
63

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rubyforgood/casa

Tutte le issue di rubyforgood/casa

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.