mirror of https://github.com/node-red/node-red.git
Fix node validation if property is not required
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