Skip to content

Managing systems (admin)

In the admin: Systems — the screen this page documents (opens in the running app).

What/why: The product catalog — what this screen manages and why it exists.

The Systems screen under /admin/systems is where data editors keep the NanaWall product knowledge base current: creating and retiring systems, editing their core fields, and setting each system's typed attribute values. It is restricted to the data editor capability (edit_data) — a rules-editor is refused. See admin-access.md for how sign-in and roles work.

Everything here is enforced server-side: the UI reflects your capability, but the load and every save re-check it, so a hand-crafted request can't bypass the guard.

The systems list (/admin/systems)

  • Active systems are listed with their key, operation type, and budget tier, each with Edit and Retire actions.
  • New system reveals a create form. Enter a name; the key (the stable kebab-case id, e.g. nw-acoustical-645) defaults to a slug of the name if you leave it blank. Optionally set operation type and budget tier. The key must be unique and kebab-case — you'll get an inline error otherwise, with your entry preserved.
  • The key is immutable once created (attribute values and Drupal imagery lookups reference it), so choose it deliberately.

Retire vs. delete (soft delete)

Retiring a system is a soft delete: it drops the system out of the live selector and comparison immediately, but preserves all its data. Nothing is hard-deleted.

  • Retired systems move to a Retired section at the bottom of the list.
  • Restore returns a retired system to the live selector, with its attribute values intact.

Use retire when a system is discontinued but you may still need its record — which is almost always the right choice over deletion.

Editing a system (/admin/systems/<key>)

The edit screen has two parts:

Core fields

Name, operation type, budget tier, material, interior/exterior, use cases, and tagline. Edit and Save core fields. The name is required.

Tagline provenance (#1046): the tagline is imported from the Drupal product term's field_tagline by the Drupal ingest, and Drupal is the source of truth once imported — a hand-edited tagline persists only until the Drupal source value changes, at which point the next ingest overwrites it. To change a tagline permanently, change it in Drupal.

Attribute values (type-aware editors)

Attribute values are typed — a boolean is not free text, an acoustic rating is a numeric range, a max panel width is a dimension — so each attribute is edited with an editor that matches its type rather than a text box. Pick the Type, fill the typed fields, and Save value:

TypeWhat you enter
Yes / NoA yes/no choice.
Yes / No with a conditionA yes/no choice plus a caveat, e.g. "Yes — with insert".
List of optionsComma- or line-separated labels, e.g. Residential, Commercial.
DimensionAn imperial measure (required) with optional metric and note, e.g. 3 3/8" (86mm).
Numeric rangeA min and/or max (leave one blank for an open-ended bound) and an optional label.
Cost tierOne of Budget / Mid-range / Premium / Ultra Premium.
Free textAnything that doesn't fit a structured type.
No Testing / N/A / NoneExplicit non-value states — see below.

The explicit non-value states matter. "No Testing", "N/A", and "None" are kept distinct from each other and from an empty cell or a "No" — because that distinction is meaningful for a truthful comparison (an untested feature is not the same as an absent one). Choose the state that's accurate rather than leaving a cell blank.

Values are validated against their type on save (a range needs at least one bound and its min can't exceed its max; a dimension needs an imperial measure; a tier must be one of the four) — an invalid entry is rejected with an inline message and nothing is written. Clear removes a value entirely (distinct from setting an explicit N/A).

Saved values persist to the product database and the live comparison reflects them immediately — there is no separate publish step.

What this maps to

  • List / create / retire / restore → src/routes/admin/systems/+page.server.ts
  • Edit + typed value editors → src/routes/admin/systems/[id]/ and src/lib/admin/ValueEditor.svelte
  • Persistence + validation → src/lib/server/admin/systems.ts and src/lib/server/admin/value-input.ts (the typed value scheme itself lives in src/lib/server/values.ts; see data-access.md).