feat: pre-fill the admin config form on Edit, separate from "Create" #54
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/admin-config-edit-prefill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Previously the only way to "update" a config was to type its slug into
the bottom form again with all the values you wanted, since there was
no edit affordance — the form was always blank, and any field you
forgot to re-enter got silently wiped on save.
Each config card now has an Edit button that links to
/admin/configs?edit=#config-form. The handler reads that query
parameter, finds the matching row, and threads it into the template
as EditTarget. The form switches its heading to "Editing ",
pre-fills every field with the current value, marks the slug as
read-only (it's the natural key for upsert; renaming it makes things
weird), and offers a Cancel link back to the unfiltered list.
When EditTarget is nil (the default), the form keeps its old "Create
a new configuration" framing with a blank slug and the
"Enable immediately" checkbox pre-checked.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Automated review by pr-reviewer v0.22.0 | Safety Check | Claude Sonnet 4 | tracking id
r-f4915a-ef784aThis is an AI-generated review and may contain mistakes.
Status: ✅ Completed
✅ Verdict: LGTM — The changes implement a straightforward edit form pre-population feature with proper query parameter handling and no obvious security or logic issues.
Complexity: moderate
Safety Check Review
Overview
This PR adds edit functionality to admin config forms by pre-filling form fields when an
?edit=<slug>query parameter is present.Key Changes Reviewed
EditTargetSafety Assessment
strings.TrimSpace()and simple string comparisonMinor Notes
{{with .EditTarget}}No alarming issues found.