Repository navigation
refactor(admin): dashboard change forms share one change-plus-reason wrapper - #688
Draft
PiquelChips wants to merge 1 commit into
Draft
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Administered<C> moves from the settings pages to the dashboard's module, and every form there with a reason takes it: ReasonForm is Administered<()>, and submit_reason hands the change and its parsed Reason on.
PiquelChips
force-pushed
the
refactor/544-decision-administered-form
branch
from
November 22, 2026 13:57
042b98e to
f6f6adc
Compare
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.
Part of #544 (NEW-7, second half). Stacked on #683: review and merge that first; this PR's base is its branch.
Each dashboard form declared its own
reason: String, so each had its own chance to forget#[serde(default)], which #683 fixes. The settings pages already had anAdministered<C>wrapper (a change plus its reason), and #593 gave changes that ask only why one sharedReasonFormpage. Now there is one wrapper for both:Administered<C>moves fromsettings.rsto the dashboard'smod.rs. Itsreasondefaults to empty there, once.ReasonFormisAdministered<()>. Its pages (ReasonPage,App::reason_change) are unchanged.App::submit_reasontakes anyAdministered<C>, parses the reason, then hands on the change and itsReason. The settings tabs, the display name page and the signing key rotation use it, since they already checked the reason first.App::subjectnow takes a parsedReason.Refused::reasonworks for everyAdministered<C>, so pages stop reaching intorefused.form.reason.Administered<SecretsChange>, so itsRotationstruct goes.Administered's doc comment says thatC's fields must decode from text. Serde'sflattenbuffers them as strings, past topcoat's own parsing of numbers and of empty values asNone. Every wrapped field is a string, an ID, aCheckboxor a text enum.SecretsChangewas already flattened onmain.No behavior changes. Each form checks its fields in the same order as before: the reservation and the new handle still check the handle before the reason. The rendered pages get the same values. No test was merged or removed.
Left as they are:
GrantFormhas a numericpageand an optionaluser_id. Flattened,?q=…&page=2(the pager's own link) would answer400, and so would an emptyuser_id, which today gets the page's "no account" refusal. It keeps its own defaultedreason, with a comment saying why.rights_are_granted_from_a_searchnow also visits?q=…&page=2.CreateInvitationandApproveOrigin(common::admin) andOperatorDraft(ui/admin/clients.rs) keep their own defaultedreason. Another cleanup lane is editing those files, so folding them in is a follow-up once it lands.note, so it stays as it is.Outside the area:
apps/auth-service/src/web/admin/clients.rsloses itsRotationstruct forAdministered<SecretsChange>.Docs:
docs/dev/extending/admin-operation.mddescribesAdministered<C>, the text-only rule for its fields and the forms that keep their own reason,submit_reasonandReasonForm. Its example page now checksApp::confirmed, as the real pages do, instead ofApp::adminthenApp::confirm.Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)