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:
parent
36cf58fe6c
commit
44b2ccd257
1 changed files with 29 additions and 1 deletions
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue