fix: address Copilot review round 19 — empty-string const in the web required gate

hasMissingRequiredFields treated every empty string as missing, so a required
field the schema pins to `""` — rendered read-only, and seeded with the only
value it accepts — left Execute and Open App permanently disabled. It now
matches the TUI check: an empty string counts as supplied when the property's
own `const` pins it there, and an ordinary blank required string still does
not.

Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-08-26 07:10:42 -04:00
commit 44b2ccd257

View file

@ -292,7 +292,13 @@ function hasMissingIn(
const fieldSchema = properties[field];
return fieldSchema === undefined ? true : !admitsNull(fieldSchema);
}
return value === undefined || value === "";
if (value === "") {
// A schema may pin a field to the empty string, and the form renders such
// a field read-only — so reporting the seeded value as missing would
// disable submit on a value the user cannot change (#2123).
return properties[field]?.const !== "";
}
return value === undefined;
});
}