mirror of
https://github.com/node-red/node-red
synced 2024-11-21 23:48:30 +00:00
Fix node validation if property is not required
This commit is contained in:
parent
1b5b3f7f88
commit
19a8fa09a8
@ -148,12 +148,23 @@ RED.editor = (function() {
|
||||
((typeof definition[property].label) == "string")) {
|
||||
label = definition[property].label;
|
||||
}
|
||||
if ("required" in definition[property] && definition[property].required) {
|
||||
valid = value !== "";
|
||||
if (!valid && label) {
|
||||
return RED._("validator.errors.missing-required-prop", {
|
||||
prop: label
|
||||
});
|
||||
if ("required" in definition[property]) {
|
||||
if (definition[property].required) {
|
||||
valid = value !== "";
|
||||
if (!valid && label) {
|
||||
return RED._("validator.errors.missing-required-prop", {
|
||||
prop: label
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (value === "") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (value === "") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (valid && "validate" in definition[property]) {
|
||||
|
Loading…
Reference in New Issue
Block a user