hub: merge the customer edit page into the Edit tab (v0.48.0 edit-a, part 2)

- Settings tab renamed Edit; embeds config_form_body (.ConfigForm via the
  builder) + Controller Update + Geo + a new Danger zone card holding the
  relocated Block/Unblock/Delete forms (endpoints + confirm() unchanged).
  All cards are SIBLINGS after </form> — never nested in the config form.
- Customer Info header loses the Edit link and Block/Delete forms; only the
  config-less Create Config action stays.
- GET /configs/{id}/edit is a 302 to /customers/{id}#tab=edit; tabs JS gains
  the settings→edit legacy-hash alias.
- Post-action redirects land back on their tab: update/block/unblock/
  offsite-reissue/offsite-freeze/pbsdr-reissue → #tab=edit, regen-password
  → #tab=setup; delete unchanged (/configs).
- handleConfigUpdate gains the server-side twin of the form's required
  fields; the error path re-renders the STANDALONE page with the SUBMITTED
  overrides (B3 red-proof: nil overrides → typed values reset → test FAILS;
  header red-proof: restored header buttons → count=2 → test FAILS; both run).
- Tests: Group A (panel surface, sibling forms, header cleaned by COUNT),
  Group B (B1 302, B2 create unchanged, B3 typed-values, B4/B5 anchor table).
  Amended pins: customer_tabs_test settings→edit; pbsdr_test postUpdate now
  supplies the required fields + FormRendersState asserts the embedded render.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZc5w5jDhFLv6qDC32KN5v
This commit is contained in:
2026-07-12 17:33:07 +02:00
parent e74014730a
commit 2e03de1e0c
6 changed files with 384 additions and 40 deletions
+2 -1
View File
@@ -51,8 +51,9 @@ func TestTemplates_CustomerTabs(t *testing.T) {
html := renderCustomerPage(t, s, "acme")
// The tab nav renders all 8 tabs (hash links — plain anchors without JS).
// v0.48.0 edit-a: "settings" became "edit" (the standalone config form merged in).
for _, tab := range []string{
"overview", "applications", "setup", "settings", "backup", "events", "notifications", "host",
"overview", "applications", "setup", "edit", "backup", "events", "notifications", "host",
} {
if !strings.Contains(html, `href="#tab=`+tab+`"`) {
t.Errorf("tab nav missing tab %q", tab)