Problem
A section, a place grade, a placement configuration and a pinning each carry a weight that decides what every screen shows first: which section a picker offers, which grade is the best one, which arrangement a house reaches for. Their lists only printed the number.
So reordering twenty sections meant opening each one in turn, working out which number to type, and typing it. That is not a decision anyone can make one record at a time, and it is a decision an operator has to be able to make: the resource Tariffs tab has been draggable for a while and these four had not.
Proposed resolution
Make them draggable, the way the Tariffs tab already is. The draggable table, the renumbering on save and the empty case are one base form, and a list that wants to become orderable is a subclass naming its own columns plus one line in its controller.
The base lives in the engine rather than in the admin UI module, because yoyaku_placement depends on the engine and not on yoyaku_ui: a base class in the admin UI module could not be reached from placement without adding a module dependency, which the boundary test rightly refuses.
The weights are rewritten as a sequence from zero on save rather than stored as the numbers the selects held, so the next record added lands after the last one instead of inside an arrangement somebody chose.
Remaining tasks
None.
User interface changes
The Sections, Place grades, Configurations and Pinnings tabs of a venue are ordered by dragging a row, with a Save order button, and no longer show a weight number column.
Places and pinned places are deliberately left as they are. A venue here holds 1568 places and a pinning 243, which is past what anyone can drag, and a place's weight is house order written by the numbering tool rather than something an operator arranges.
API changes
New base form for a list of weighted records. Nothing existing changes.
Data model changes
None.
AI-Generated: Yes (the code, its test and this summary were written by Claude Opus, reviewed and verified by the maintainer against a running site)
Issue fork yoyaku-3618263
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #5
mably commented