TestFormsHTML renders each declaration in every binding the library renders it in and compares the text, through golden.Compare, with a file under internal/server/testdata/forms. A form that is not a rows form is rendered unbound, on the edit side and on the create side, unbound with values, and as a record (every field bound to a value its rules accept, three cells per field, an instance and a message); a search is then rendered boosted and with a target, a select and an out-of-band select, and any other form is rendered refused (an empty POST parsed through the declaration) with the refusals of a 600-character value in every field. A rows form is rendered unbound, then with an open row, a staged delta and the tray (or the row's own commit), each row field and one row action. Runtime options are a fixed "Choose one", Alpha and Beta. The subtests are grouped in three. registered/<name> holds the 19 forms forms.All returns in the internal/server test binary; the files number 26 in all. per-request/<case> holds the declarations built per request: the settings form, the org type card's two copies, the rules form, and the list search embedded (one sibling parameter) and standalone. library-defaults holds a table's "Field" and "Value" headings, a textarea's three rows and the htmx verb of GET, PUT, PATCH, DELETE and POST on a form that is not a search. TestFormsGoldenFilesAreAllRendered fails for any file under testdata/forms that TestFormsHTML does not write, so a form that leaves the registry leaves no stale file. TestPerRequestFormsSatisfyTheInvariants runs CheckInvariants over the org type card's two copies and the rules form's copy; the settings form has its own test, and the list search builds its declaration inside listSearchForm and never returns it, so no test can pass it to CheckInvariants and it stays unchecked. Shown to change no output: only a test file and its goldens are added. The names and results of ./internal/forms ./internal/server ./internal/integrations/... (2113 at the parent, 2144 here, none failing, one skip on each side), taken with the test database reset and the app down at the parent and at this commit, are equal apart from the new tests and their 28 subtests. The registered forms' files in name order followed by the defaults' file are byte-equal to the output of a standalone program that renders the same bindings, run at 0abbfac7; no file under internal/forms, internal/server or internal/embeds that is not a test or a golden has changed since. A separate render of the per-request declarations, unbound only, equals the unbound section of the org type card's files and of the rules form's file apart from the runtime options it did not bind, and equals the list search's two files exactly. The other bindings and the settings file were read against their declarations, not compared with another render. Three runs in a row produce the same files, with no -update. 22 breaks in the form library's render.go and the three server files of the per-request cases, each edited once and each caught by the new tests. The old side has no counterpart: every break is a new-side record, since no old test names these. None dropped. Pinned defects, so a later fix flips them by name: the list search's hidden sibling inputs come out in map order with two or more siblings (rendered here with one, so the file does not vary from run to run); the library defaults no registered form reaches, which every earlier test missed. Not probed: the templates' own markup, because the files hold it for a later template change to show while the breaks probe the view the library builds; fieldAttrs, buildRows, RowField and resolveRowsFocus, whose output is in the files; the list search's per-request declaration against the invariants, for the reason above; the stale-file check, which guards the test's own files. A dense checkbox's label position is the one render break this net misses, since no registered form has a dense checkbox; TestFormPartCheckboxLabelSitsAboveTheBox catches it.
681 lines
36 KiB
HTML
681 lines
36 KiB
HTML
|
|
===== operator.product unbound
|
|
|
|
|
|
<div class="card app-form-box mb-3"><div class="card-body">
|
|
<form id="form-operator.product" data-form="operator.product" data-form-kind="create" class="app-form" novalidate hx-post="/partials/operator/products" hx-target="#operator-body" hx-swap="innerHTML" hx-disable="find button[type=submit]" hx-indicator="find .htmx-indicator">
|
|
<div id="form-operator.product-error" class="app-form-error" role="alert"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="app-form-fields">
|
|
<div id="form-operator.product-name" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-name-control">Name</label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-name-control" name="name" value="" required maxlength="200" autocomplete="off" aria-describedby="form-operator.product-name-warning" hx-get="/partials/operator/products/name-check" hx-include="closest form" hx-swap="innerHTML" hx-target="#form-operator\.product-name-warning" hx-trigger="input changed delay:300ms">
|
|
|
|
<div id="form-operator.product-name-warning"></div>
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-display_category" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-display_category-control">Display category <span class="text-muted">(optional)</span></label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Display category" data-bs-content="Grouping for the storefront and operator lists; never drives behavior. Blank is fine." aria-label="Help: Display category"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-display_category-control" name="display_category" value="" placeholder="e.g. addon" maxlength="100" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-entitlement_set_id" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-entitlement_set_id-control">Entitlement set</label>
|
|
|
|
<select class="form-select" id="form-operator.product-entitlement_set_id-control" name="entitlement_set_id" required aria-describedby="form-operator.product-entitlement_set_id-hint">
|
|
<option value="" disabled selected>Choose one</option>
|
|
<option value="a">Alpha</option>
|
|
<option value="b">Beta</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<div id="form-operator.product-entitlement_set_id-hint" class="form-text">The set is what the product delivers; a product with none delivers no capabilities.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-visibility" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-visibility-control">Listed</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Listed" data-bs-content="Shown in the member catalog." aria-label="Help: Listed"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-visibility-control" name="visibility" value="public" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-description" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-description-control">Description <span class="text-muted">(optional)</span></label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-description-control" name="description" value="" maxlength="500" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-features" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-features-control">Additional features <span class="text-muted">(optional)</span></label>
|
|
|
|
<textarea class="form-control" id="form-operator.product-features-control" name="features" rows="3" maxlength="2000" aria-describedby="form-operator.product-features-hint"></textarea>
|
|
|
|
|
|
|
|
<div id="form-operator.product-features-hint" class="form-text">Shown on the Products page, one per line; supplements entitlement-derived limits.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-is_active" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-is_active-control">Active</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Active" data-bs-content="An inactive product is not offered when new grants are created. Grants that already reference it keep working." aria-label="Help: Active"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-is_active-control" name="is_active" value="true" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><input type="hidden" name="exclude" value="" >
|
|
</div>
|
|
<div class="d-flex flex-wrap gap-2 app-form-commit">
|
|
|
|
<button type="submit" class="btn btn-primary"><span class="spinner-border spinner-border-sm htmx-indicator me-1" aria-hidden="true"></span>Create product</button>
|
|
|
|
|
|
<a href="/operator/products" class="btn btn-outline-secondary">Cancel</a>
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
</div></div>
|
|
|
|
|
|
===== operator.product unbound edit side
|
|
|
|
|
|
<div class="card app-form-box mb-3"><div class="card-body">
|
|
<form id="form-operator.product" data-form="operator.product" data-form-kind="edit" class="app-form" novalidate hx-put="/partials/operator/products/{productID}" hx-target="#operator-body" hx-swap="innerHTML" hx-disable="find button[type=submit]" hx-indicator="find .htmx-indicator">
|
|
<div id="form-operator.product-error" class="app-form-error" role="alert"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="app-form-fields">
|
|
<div id="form-operator.product-name" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-name-control">Name</label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-name-control" name="name" value="" required maxlength="200" autocomplete="off" aria-describedby="form-operator.product-name-warning" hx-get="/partials/operator/products/name-check" hx-include="closest form" hx-swap="innerHTML" hx-target="#form-operator\.product-name-warning" hx-trigger="input changed delay:300ms">
|
|
|
|
<div id="form-operator.product-name-warning"></div>
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-display_category" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-display_category-control">Display category <span class="text-muted">(optional)</span></label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Display category" data-bs-content="Grouping for the storefront and operator lists; never drives behavior. Blank is fine." aria-label="Help: Display category"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-display_category-control" name="display_category" value="" placeholder="e.g. addon" maxlength="100" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-entitlement_set_id" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-entitlement_set_id-control">Entitlement set</label>
|
|
|
|
<select class="form-select" id="form-operator.product-entitlement_set_id-control" name="entitlement_set_id" required aria-describedby="form-operator.product-entitlement_set_id-hint">
|
|
<option value="" disabled selected>Choose one</option>
|
|
<option value="a">Alpha</option>
|
|
<option value="b">Beta</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<div id="form-operator.product-entitlement_set_id-hint" class="form-text">The set is what the product delivers; a product with none delivers no capabilities.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-visibility" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-visibility-control">Listed</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Listed" data-bs-content="Shown in the member catalog." aria-label="Help: Listed"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-visibility-control" name="visibility" value="public" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-description" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-description-control">Description <span class="text-muted">(optional)</span></label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-description-control" name="description" value="" maxlength="500" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-features" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-features-control">Additional features <span class="text-muted">(optional)</span></label>
|
|
|
|
<textarea class="form-control" id="form-operator.product-features-control" name="features" rows="3" maxlength="2000" aria-describedby="form-operator.product-features-hint"></textarea>
|
|
|
|
|
|
|
|
<div id="form-operator.product-features-hint" class="form-text">Shown on the Products page, one per line; supplements entitlement-derived limits.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-is_active" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-is_active-control">Active</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Active" data-bs-content="An inactive product is not offered when new grants are created. Grants that already reference it keep working." aria-label="Help: Active"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-is_active-control" name="is_active" value="true" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><input type="hidden" name="exclude" value="" >
|
|
</div>
|
|
<div class="d-flex flex-wrap gap-2 app-form-commit">
|
|
|
|
<button type="submit" class="btn btn-primary"><span class="spinner-border spinner-border-sm htmx-indicator me-1" aria-hidden="true"></span>Save changes</button>
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
</div></div>
|
|
|
|
|
|
===== operator.product create side
|
|
|
|
|
|
<div class="card app-form-box mb-3"><div class="card-body">
|
|
<form id="form-operator.product" data-form="operator.product" data-form-kind="create" class="app-form" novalidate hx-post="/partials/operator/products" hx-target="#operator-body" hx-swap="innerHTML" hx-disable="find button[type=submit]" hx-indicator="find .htmx-indicator">
|
|
<div id="form-operator.product-error" class="app-form-error" role="alert"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="app-form-fields">
|
|
<div id="form-operator.product-name" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-name-control">Name</label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-name-control" name="name" value="" required maxlength="200" autocomplete="off" aria-describedby="form-operator.product-name-warning" hx-get="/partials/operator/products/name-check" hx-include="closest form" hx-swap="innerHTML" hx-target="#form-operator\.product-name-warning" hx-trigger="input changed delay:300ms">
|
|
|
|
<div id="form-operator.product-name-warning"></div>
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-display_category" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-display_category-control">Display category <span class="text-muted">(optional)</span></label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Display category" data-bs-content="Grouping for the storefront and operator lists; never drives behavior. Blank is fine." aria-label="Help: Display category"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-display_category-control" name="display_category" value="" placeholder="e.g. addon" maxlength="100" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-entitlement_set_id" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-entitlement_set_id-control">Entitlement set</label>
|
|
|
|
<select class="form-select" id="form-operator.product-entitlement_set_id-control" name="entitlement_set_id" required aria-describedby="form-operator.product-entitlement_set_id-hint">
|
|
<option value="" disabled selected>Choose one</option>
|
|
<option value="a">Alpha</option>
|
|
<option value="b">Beta</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<div id="form-operator.product-entitlement_set_id-hint" class="form-text">The set is what the product delivers; a product with none delivers no capabilities.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-visibility" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-visibility-control">Listed</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Listed" data-bs-content="Shown in the member catalog." aria-label="Help: Listed"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-visibility-control" name="visibility" value="public" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="d-flex flex-wrap gap-2 app-form-commit">
|
|
|
|
<button type="submit" class="btn btn-primary"><span class="spinner-border spinner-border-sm htmx-indicator me-1" aria-hidden="true"></span>Create product</button>
|
|
|
|
|
|
<a href="/operator/products" class="btn btn-outline-secondary">Cancel</a>
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
</div></div>
|
|
|
|
|
|
===== operator.product unbound with values
|
|
|
|
|
|
<div class="card app-form-box mb-3"><div class="card-body">
|
|
<form id="form-operator.product" data-form="operator.product" data-form-kind="create" class="app-form" novalidate hx-post="/partials/operator/products" hx-target="#operator-body" hx-swap="innerHTML" hx-disable="find button[type=submit]" hx-indicator="find .htmx-indicator">
|
|
<div id="form-operator.product-error" class="app-form-error" role="alert"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="app-form-fields">
|
|
<div id="form-operator.product-name" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-name-control">Name</label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-name-control" name="name" value="" required maxlength="200" autocomplete="off" aria-describedby="form-operator.product-name-warning" hx-get="/partials/operator/products/name-check" hx-include="closest form" hx-swap="innerHTML" hx-target="#form-operator\.product-name-warning" hx-trigger="input changed delay:300ms">
|
|
|
|
<div id="form-operator.product-name-warning"></div>
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-display_category" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-display_category-control">Display category <span class="text-muted">(optional)</span></label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Display category" data-bs-content="Grouping for the storefront and operator lists; never drives behavior. Blank is fine." aria-label="Help: Display category"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-display_category-control" name="display_category" value="" placeholder="e.g. addon" maxlength="100" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-entitlement_set_id" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-entitlement_set_id-control">Entitlement set</label>
|
|
|
|
<select class="form-select" id="form-operator.product-entitlement_set_id-control" name="entitlement_set_id" required aria-describedby="form-operator.product-entitlement_set_id-hint">
|
|
<option value="" disabled selected>Choose one</option>
|
|
<option value="a">Alpha</option>
|
|
<option value="b">Beta</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<div id="form-operator.product-entitlement_set_id-hint" class="form-text">The set is what the product delivers; a product with none delivers no capabilities.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-visibility" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-visibility-control">Listed</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Listed" data-bs-content="Shown in the member catalog." aria-label="Help: Listed"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-visibility-control" name="visibility" value="public" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-description" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-description-control">Description <span class="text-muted">(optional)</span></label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-description-control" name="description" value="" maxlength="500" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-features" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-features-control">Additional features <span class="text-muted">(optional)</span></label>
|
|
|
|
<textarea class="form-control" id="form-operator.product-features-control" name="features" rows="3" maxlength="2000" aria-describedby="form-operator.product-features-hint"></textarea>
|
|
|
|
|
|
|
|
<div id="form-operator.product-features-hint" class="form-text">Shown on the Products page, one per line; supplements entitlement-derived limits.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-is_active" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-is_active-control">Active</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Active" data-bs-content="An inactive product is not offered when new grants are created. Grants that already reference it keep working." aria-label="Help: Active"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-is_active-control" name="is_active" value="true" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><input type="hidden" name="exclude" value="sample" >
|
|
</div>
|
|
<div class="d-flex flex-wrap gap-2 app-form-commit">
|
|
|
|
<button type="submit" class="btn btn-primary"><span class="spinner-border spinner-border-sm htmx-indicator me-1" aria-hidden="true"></span>Create product</button>
|
|
|
|
|
|
<a href="/operator/products" class="btn btn-outline-secondary">Cancel</a>
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
</div></div>
|
|
|
|
|
|
===== operator.product record
|
|
|
|
|
|
<div class="card app-form-box mb-3"><div class="card-body">
|
|
<form id="form-operator.product-i1" data-form="operator.product" data-form-kind="create" class="app-form" novalidate hx-post="/partials/operator/products" hx-target="#operator-body" hx-swap="innerHTML" hx-disable="find button[type=submit]" hx-indicator="find .htmx-indicator">
|
|
<div id="form-operator.product-i1-error" class="app-form-error" role="alert"></div>
|
|
|
|
<div class="app-form-message mb-2"><p>msg</p></div>
|
|
|
|
|
|
|
|
<div class="app-form-fields">
|
|
<div id="form-operator.product-i1-name" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-i1-name-control">Name</label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-i1-name-control" name="name" value="sample" required maxlength="200" autocomplete="off" aria-describedby="form-operator.product-i1-name-warning" hx-get="/partials/operator/products/name-check" hx-include="closest form" hx-swap="innerHTML" hx-target="#form-operator\.product-name-warning" hx-trigger="input changed delay:300ms">
|
|
|
|
<div id="form-operator.product-i1-name-warning"></div>
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-i1-display_category" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-i1-display_category-control">Display category <span class="text-muted">(optional)</span></label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Display category" data-bs-content="Grouping for the storefront and operator lists; never drives behavior. Blank is fine." aria-label="Help: Display category"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-i1-display_category-control" name="display_category" value="sample" placeholder="e.g. addon" maxlength="100" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-i1-entitlement_set_id" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-i1-entitlement_set_id-control">Entitlement set</label>
|
|
|
|
<select class="form-select" id="form-operator.product-i1-entitlement_set_id-control" name="entitlement_set_id" required aria-describedby="form-operator.product-i1-entitlement_set_id-hint">
|
|
<option value="" disabled>Choose one</option>
|
|
<option value="a" selected>Alpha</option>
|
|
<option value="b">Beta</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<div id="form-operator.product-i1-entitlement_set_id-hint" class="form-text">The set is what the product delivers; a product with none delivers no capabilities.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-i1-visibility" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-i1-visibility-control">Listed</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Listed" data-bs-content="Shown in the member catalog." aria-label="Help: Listed"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-i1-visibility-control" name="visibility" value="public" checked ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-i1-description" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-i1-description-control">Description <span class="text-muted">(optional)</span></label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-i1-description-control" name="description" value="sample" maxlength="500" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-i1-features" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-i1-features-control">Additional features <span class="text-muted">(optional)</span></label>
|
|
|
|
<textarea class="form-control" id="form-operator.product-i1-features-control" name="features" rows="3" maxlength="2000" aria-describedby="form-operator.product-i1-features-hint">sample</textarea>
|
|
|
|
|
|
|
|
<div id="form-operator.product-i1-features-hint" class="form-text">Shown on the Products page, one per line; supplements entitlement-derived limits.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-i1-is_active" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-i1-is_active-control">Active</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Active" data-bs-content="An inactive product is not offered when new grants are created. Grants that already reference it keep working." aria-label="Help: Active"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-i1-is_active-control" name="is_active" value="true" checked ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><input type="hidden" name="exclude" value="sample" >
|
|
</div>
|
|
<div class="d-flex flex-wrap gap-2 app-form-commit">
|
|
|
|
<button type="submit" class="btn btn-primary"><span class="spinner-border spinner-border-sm htmx-indicator me-1" aria-hidden="true"></span>Create product</button>
|
|
|
|
|
|
<a href="/operator/products" class="btn btn-outline-secondary">Cancel</a>
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
</div></div>
|
|
|
|
|
|
===== operator.product refused [entitlement_set_id name]
|
|
|
|
|
|
<div class="card app-form-box mb-3"><div class="card-body">
|
|
<form id="form-operator.product" data-form="operator.product" data-form-kind="create" class="app-form" novalidate hx-post="/partials/operator/products" hx-target="#operator-body" hx-swap="innerHTML" hx-disable="find button[type=submit]" hx-indicator="find .htmx-indicator">
|
|
<div id="form-operator.product-error" class="app-form-error" role="alert"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="app-form-fields">
|
|
<div id="form-operator.product-name" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-name-control">Name</label>
|
|
|
|
<input type="text" class="form-control is-invalid" id="form-operator.product-name-control" name="name" value="" required maxlength="200" autocomplete="off" aria-describedby="form-operator.product-name-error form-operator.product-name-warning" aria-invalid="true" hx-get="/partials/operator/products/name-check" hx-include="closest form" hx-swap="innerHTML" hx-target="#form-operator\.product-name-warning" hx-trigger="input changed delay:300ms" autofocus>
|
|
|
|
<div id="form-operator.product-name-warning"></div>
|
|
|
|
|
|
|
|
<div id="form-operator.product-name-error" class="invalid-feedback d-block">Enter a name.</div>
|
|
</div><div id="form-operator.product-display_category" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-display_category-control">Display category <span class="text-muted">(optional)</span></label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Display category" data-bs-content="Grouping for the storefront and operator lists; never drives behavior. Blank is fine." aria-label="Help: Display category"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-display_category-control" name="display_category" value="" placeholder="e.g. addon" maxlength="100" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-entitlement_set_id" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-entitlement_set_id-control">Entitlement set</label>
|
|
|
|
<select class="form-select is-invalid" id="form-operator.product-entitlement_set_id-control" name="entitlement_set_id" required aria-describedby="form-operator.product-entitlement_set_id-hint form-operator.product-entitlement_set_id-error" aria-invalid="true">
|
|
<option value="" disabled selected>Choose one</option>
|
|
<option value="a">Alpha</option>
|
|
<option value="b">Beta</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<div id="form-operator.product-entitlement_set_id-hint" class="form-text">The set is what the product delivers; a product with none delivers no capabilities.</div>
|
|
|
|
<div id="form-operator.product-entitlement_set_id-error" class="invalid-feedback d-block">Choose an entitlement set.</div>
|
|
</div><div id="form-operator.product-visibility" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-visibility-control">Listed</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Listed" data-bs-content="Shown in the member catalog." aria-label="Help: Listed"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-visibility-control" name="visibility" value="public" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-description" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-description-control">Description <span class="text-muted">(optional)</span></label>
|
|
|
|
<input type="text" class="form-control" id="form-operator.product-description-control" name="description" value="" maxlength="500" autocomplete="off">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div id="form-operator.product-features" class="mb-3 app-form-field">
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-features-control">Additional features <span class="text-muted">(optional)</span></label>
|
|
|
|
<textarea class="form-control" id="form-operator.product-features-control" name="features" rows="3" maxlength="2000" aria-describedby="form-operator.product-features-hint"></textarea>
|
|
|
|
|
|
|
|
<div id="form-operator.product-features-hint" class="form-text">Shown on the Products page, one per line; supplements entitlement-derived limits.</div>
|
|
|
|
|
|
</div><div id="form-operator.product-is_active" class="mb-3 app-form-field">
|
|
|
|
|
|
|
|
<label class="form-label" for="form-operator.product-is_active-control">Active</label> <button type="button" class="btn btn-link p-0 border-0 align-baseline app-help-icon" data-bs-toggle="popover" data-bs-trigger="click" data-bs-title="Active" data-bs-content="An inactive product is not offered when new grants are created. Grants that already reference it keep working." aria-label="Help: Active"><svg class="form-help-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
|
|
|
|
<div class="app-form-check-control"><input class="form-check-input" type="checkbox" id="form-operator.product-is_active-control" name="is_active" value="true" ></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><input type="hidden" name="exclude" value="" >
|
|
</div>
|
|
<div class="d-flex flex-wrap gap-2 app-form-commit">
|
|
|
|
<button type="submit" class="btn btn-primary"><span class="spinner-border spinner-border-sm htmx-indicator me-1" aria-hidden="true"></span>Create product</button>
|
|
|
|
|
|
<a href="/operator/products" class="btn btn-outline-secondary">Cancel</a>
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
</div></div>
|
|
|
|
|
|
===== operator.product bad-values refusals
|
|
description: Description must be 500 characters or fewer.
|
|
display_category: Display category must be 100 characters or fewer.
|
|
entitlement_set_id: Choose an entitlement set from the list.
|
|
name: Name must be 200 characters or fewer.
|