Implement the ux-first-run change: a state-derived setup checklist on /operator/setup with a landing region that recedes once required steps are done, and empty states that distinguish blocked from empty across operator and member surfaces. Also add production deployment and environment reference docs, plus a config-key completeness test.
30 lines
1.2 KiB
Go
30 lines
1.2 KiB
Go
package server
|
|
|
|
import "net/http"
|
|
|
|
// GetSetupPage handles GET /operator/setup — the persistent, revisitable
|
|
// setup checklist (openspec change ux-first-run). Unlike a wizard, this page
|
|
// always renders, complete or not, and never gates or sequences any other
|
|
// operator surface; an operator can leave any step undone and keep using
|
|
// the rest of the console.
|
|
//
|
|
// It shares OperatorHandler with the landing surface (not
|
|
// OperatorPartialsHandler) because both surfaces render from the same
|
|
// SetupState so they can never disagree about what is or is not done.
|
|
func (h *OperatorHandler) GetSetupPage(w http.ResponseWriter, r *http.Request) {
|
|
page := BuildOperatorPageData(r, h.AuthConfig, h.Database, h.Logger)
|
|
page.IAPosition = "runtime:setup"
|
|
// No sidebar entry names "setup" — it is reached from the landing
|
|
// region's link, not the flat capability list — so leaving
|
|
// ActiveCapability unmatched lights nothing up, same as GetPersonPage's
|
|
// sidebar-less person detail page.
|
|
page.ActiveCapability = "setup"
|
|
page.BodyTemplate = "operator_setup.html"
|
|
|
|
state := h.DeriveSetupState(r.Context())
|
|
state.FullPage = true
|
|
page.BodyData = state
|
|
|
|
h.Templates.Render(w, "operator.html", page)
|
|
}
|