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
+8 -3
View File
@@ -59,6 +59,7 @@ func TestBackupHasBothFormsAndTheEncryptionHooks(t *testing.T) {
`name="password"`, `name="password_confirm"`, `minlength="12"`, `placeholder="at least 12 characters"`,
`name="file"`, `accept=".json,.spde,application/json"`, `required data-import-file`,
`data-import-password-fields`, `name="import_password"`, `<div class="box" id="import">`,
`The export itself is made on the <a href="/outbound/domains">domain's settings</a>.`,
)
pageLacks(t, "Backup", out, `notification`)
}
@@ -157,8 +158,8 @@ func TestUserFormShowsWhatIsStoredUnderTheHandlersFieldNames(t *testing.T) {
`name="password" type="password" autocomplete="new-password">`,
`Leave empty to keep the current one.`,
`<select id="role" name="role" data-global-role="global">`, `<option value="domain" selected>`, `<option value="global">`,
`name="all_domains" value="1" checked`, `name="domain_ids" value="1">`, `name="domain_ids" value="3">`,
`name="all_inbound_domains" value="1">`, `name="inbound_domain_ids" value="1">`, `name="inbound_domain_ids" value="2" checked`,
`name="all_domains" value="1" data-all-out checked`, `name="domain_ids" value="1" data-single-out>`, `name="domain_ids" value="3" data-single-out>`,
`name="all_inbound_domains" value="1" data-all-in>`, `name="inbound_domain_ids" value="1" data-single-in>`, `name="inbound_domain_ids" value="2" data-single-in checked`,
`>Save user</button>`, `href="/server/users">Cancel</a>`,
)
pageLacks(t, "User", out, `name="password" type="password" autocomplete="new-password" required`, `disabled`,
@@ -194,7 +195,11 @@ func TestUserFormOfTheOnlyGlobalUser(t *testing.T) {
// domains is marked, so panel.js can hide the lists while the role is Global.
func TestUserFormMarksTheListsTheGlobalRoleHides(t *testing.T) {
out := renderSignedIn(t, "user", userFixture())
pageHas(t, "User", out, `<select id="role" name="role" data-global-role="global">`)
pageHas(t, "User", out, `<select id="role" name="role" data-global-role="global">`,
// panel.js disables a list's single domains while its All is ticked
// (testdata/alldomains_test.js).
`name="all_domains" value="1" data-all-out`, `name="domain_ids" value="`, `data-single-out`,
`name="all_inbound_domains" value="1" data-all-in`, `data-single-in`)
if n := strings.Count(out, `<div class="box" data-domain-pick>`); n != 2 {
t.Errorf("%d boxes are marked data-domain-pick, want the outbound and the inbound list", n)
}