user form, backup: two gaps the mockup comparison found

Owner, 2026-10-18: "Что ещё из макетов мы также прошляпили?" - every mockup
held against the panel; two small gaps beyond the queues:

- user.html: with All ticked, a list's single domains are disabled
  (mockup user.html:34-36). A panel.js show-when rule with disable: the
  boxes data-single-out / data-single-in follow data-all-out / data-all-in,
  at load and on change; a disabled box is not submitted, which the server
  ignores with All anyway. node test testdata/alldomains_test.js (fails on
  the previous panel.js).
- backup.html: "domain's settings" is a link, to Outbound › Domains (mockup
  backup.html:35 links a domain's settings; a server page has no one domain).

Tests: go test ./internal/web/... pass, TestPanelJS with node 24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mix
2026-10-18 23:30:44 +03:00
co-authored by Claude Opus 5.5
parent 6db3704711
commit 6edf8314bc
8 changed files with 106 additions and 10 deletions
+22
View File
@@ -190,6 +190,24 @@
target: "[data-domain-pick]",
visible: function (el) { return el.value !== el.dataset.globalRole; }
},
// The user form: with "All outbound domains" (or inbound) ticked the
// single domains of that list are ignored, and are shown disabled as the
// mockup user.html draws them. A disabled box is not submitted (HTML
// Living Standard, form-control-infrastructure.html#constructing-entry-list),
// which changes nothing: the server ignores them with All. Without this
// script they stay clickable, and the help line says they are ignored.
{
match: "input[data-all-out]",
target: "input[data-single-out]",
visible: function (el) { return !el.checked; },
disable: true
},
{
match: "input[data-all-in]",
target: "input[data-single-in]",
visible: function (el) { return !el.checked; },
disable: true
},
{
match: "input[data-encrypt-toggle]",
target: "[data-encrypt-fields]",
@@ -222,6 +240,10 @@
// A block can be several elements (the user form's two lists of domains).
var show = rule.visible(control);
form.querySelectorAll(rule.target).forEach(function (target) {
if (rule.disable) {
target.disabled = !show;
return;
}
// hidden alone does not hide an element whose own stylesheet gives it a
// display (Bulma's .box), so Bulma's is-hidden helper goes with it.
// HTML Living Standard, rendering.html#hidden-elements: [hidden] is