refactor(board): a board is edited in one place, not two - #969
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
The board used to be edited in two places.
/management/boardsasked for an asset file name —board9/Emma.jpg, a path into the frontend's own source tree — so adding a portrait was a pull request, a rebuild and a deploy./boardnow does everything that screen did, from the page a visitor reads, with real uploads. This removes the second place, so there is exactly one.Gone: the page, its route, its navigation entry, and the five adapter wrappers only it called.
Where each of the manager's guarantees lives now
The six
/management/boardsblocks intests/e2e/boards.spec.tstested capabilities that still exist. Each one, and where it is asserted today:boards.spec.ts— "carries every board on the timeline, named and dated" lists every board with its name and academic year, including one with no name of its own;board-edit.spec.ts— "every board is reachable, and every one of them can be corrected" is the editor's half. The seat count was a table column rather than a capability: the page shows the seats themselves (boards.spec.ts"reads the seats chair first…"), and the empty case isboard-no-seats.board-edit.spec.ts— "corrects a board's number, name, cheer, colour, description and dates", which asserts the same request body and three more fields besides.board-seat-edit.spec.ts— "adds a seat to a board, in the board's own words for the role" (body.nickname), and "opens a seat on what it says, and corrects it" for the round trip.boards.spec.ts"reads the seats chair first…". The unlinked marking moved into the seat dialog, where it is asserted both ways:board-seat-edit.spec.ts"links a seat to an account…" assertsseat-dialog-attachedis absent for the unlinked seat, and "detaches an account…" asserts it names the account for the linked one.board-seat-edit.spec.ts— "adds a seat to a board…". This one needed a new assertion: the page-side test checked the name, nickname, role and blurb but not that no account is sent, which was the whole point of the manager's block.expect(body.userId).toBeUndefined()is now on it.board-seat-edit.spec.ts— "detaches an account and leaves the seat standing under its own name", which also asserts the seat still reads under its own name afterwards.The manager's own two guarantees are the ones that had to invert, so they are asserted rather than deleted, in a new
what the management editor used to do, where it happens nowblock:/management/boardsany more, so the/:pathMatch(.*)*catch-all does andNotFound.vuerenders. Asserted as a board member, who is the reader who used to get the page.data-testid="nav-management"so the menu can actually be opened, and the emails entry beside it is asserted visible: the absence is that one entry's rather than a menu that never appeared.App.navbar.test.tsalso now asserts[to="/management/boards"]does not exist in the desktop management links, alongside the existing/management/jobscheck.The adapter, and why five rather than six
addSeat,saveSeat,linkSeatMember,dropSeatandsaveBoardwere thin wrappers kept by #933 soBoardManagerneeded no edit while it still existed. With it gone they had no callers and are removed; the page uses the*OrReasonvariants, which report the api's own words for a refusal.dropBoardstays, and the asymmetry is deliberate. There is nodropBoardOrReason: #928 converteddropBoardin place to return{ok: true} | Refusedrather than adding a second function beside it.BoardDialog.vueimports it directly andtests/unit/domains/boards/refusals.test.tscovers it, so it is live code, not a leftover.Knock-on dead code
boardTitle, the digits-rather-than-numerals helper The board page reads as a timeline #930 moved intoBoardManagerprecisely so it would die here, went with the file.ManagerCard,UserPickerandTopBannerall still have other consumers. Nothing dangles.$requirefor board assets was left behind insrc.src/assets/board*and theimage/ asset-file-name fields are untouched — those are The asset file names go #935, which this unblocks.Removing the entry left no empty section: the management menu is one list and still carries addresses, account recovery, committees, users, jobs, emails and cohorts.
Out of scope
services/api/**, the committed OpenAPI spec and the generated SDK are untouched. This is a frontend removal.Verification
From
services/frontend, all by exit code:yarn typecheck— 0yarn lint --max-warnings=0— 0yarn test:unit— 0, 1017 tests in 138 filesyarn test:e2e --grep "board"— 0, 122 passedyarn test:e2e(full) — 693 passed with two failures, both re-run to green in isolation and neither in touched code: a lonepage.goto5000ms timeout inemail-manager.spec.ts(runner starvation, 8 workers on 4 vCPUs), and a 0.36px stacking assertion in the pre-existingboards.spec.ts"stacks the timeline… on a phone".Closes #934
Diff breakdown —
█added░removed, scaled to the largest row.