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.
39 lines
2.0 KiB
HTML
39 lines
2.0 KiB
HTML
<!-- Shared empty-state define for operator list/creation surfaces
|
|
(ux-first-run 3.1). Every caller passes an EmptyStateParams value
|
|
(internal/server/operator_products.go) so the branch is computed in Go,
|
|
not guessed in the template.
|
|
|
|
Filename note: this lives in templates/partials/ but is NOT parsed by
|
|
the generic "*.html" glob some other packages use -- the operator
|
|
template set (NewOperatorPartialsHandler, and every operator render
|
|
test) parses this directory with the pattern "operator_*.html". A file
|
|
named "empty_state.html" would silently never be parsed into that set.
|
|
Hence the "operator_" prefix here, matching the same convention
|
|
member_*.html and workspace_*.html already follow for their own sets.
|
|
|
|
Renders one of two shapes:
|
|
- Blocked: a prerequisite is missing. Named in plain language, with
|
|
a link to the operator surface that creates it. Styled as a
|
|
warning alert (matches operator_plan_topology.html's structural-
|
|
issues banner) so it reads as distinct from a plain empty list.
|
|
- Not blocked: prerequisites are satisfied; nothing has been created
|
|
yet. States that plainly, adds an optional dependency note, and
|
|
(when the caller supplies one) presents the screen's own primary
|
|
creation action. Styled like the existing text-center empty rows.
|
|
|
|
Neither branch is a bare "No X found." -- spec ux-first-run. -->
|
|
{{ define "emptyState" }}
|
|
{{ if .Blocked }}
|
|
<div class="alert alert-warning" role="alert">
|
|
<p class="mb-2">{{ .BlockerCopy }}</p>
|
|
<a href="{{ .PrerequisiteURL }}" class="btn btn-outline-secondary btn-sm">{{ .PrerequisiteLabel }}</a>
|
|
</div>
|
|
{{ else }}
|
|
<div class="text-center py-4">
|
|
<p class="text-muted mb-2">{{ .Headline }}</p>
|
|
{{ if .Note }}<p class="text-muted small mb-2">{{ .Note }}</p>{{ end }}
|
|
{{ if .ActionURL }}<a href="{{ .ActionURL }}" class="btn btn-primary btn-sm">{{ .ActionLabel }}</a>{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
{{ end }}
|