Merge branch 'master' into Add-action-list-Chinese-translation

pull/4470/head
wangyiyi2056 2023-12-07 09:19:46 +08:00 committed by GitHub
commit 17e4bdbff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 20 additions and 18 deletions

View File

@ -56,6 +56,9 @@ RED.validators = {
if (options.allowBlank && v === '') {
return true
}
if (options.allowUndefined && v === undefined) {
return true
}
const result = RED.utils.validateTypedProperty(v, ptype, opt)
if (result === true || opt) {
// Valid, or opt provided - return result as-is

View File

@ -176,14 +176,16 @@
for (var i=0;i<rules.length;i++) {
const opt = { label: RED._('node-red:switch.label.rule')+' '+(i+1) }
const r = rules[i];
if (r.hasOwnProperty('v')) {
if ((msg = RED.utils.validateTypedProperty(r.v,r.vt,opt)) !== true) {
errors.push(msg)
if (r.t !== 'istype') {
if (r.hasOwnProperty('v')) {
if ((msg = RED.utils.validateTypedProperty(r.v,r.vt,opt)) !== true) {
errors.push(msg)
}
}
}
if (r.hasOwnProperty('v2')) {
if ((msg = RED.utils.validateTypedProperty(r.v2,r.v2t,opt)) !== true) {
errors.push(msg)
if (r.hasOwnProperty('v2')) {
if ((msg = RED.utils.validateTypedProperty(r.v2,r.v2t,opt)) !== true) {
errors.push(msg)
}
}
}
}

View File

@ -58,11 +58,8 @@
round: {value:false},
property: {value:"payload",required:true,
label:RED._("node-red:common.label.property"),
validate: RED.validators.typedInput({ type: 'msg' })
validate: RED.validators.typedInput({ type: 'msg', allowBlank: true })
},
// RED.validators.typedInput("propertyType", false)},
name: {value:""}
},
inputs: 1,

View File

@ -57,10 +57,10 @@
septopics: {value:true},
property: {value:"payload", required:true,
label:RED._("node-red:rbe.label.property"),
validate: RED.validators.typedInput({ type: 'msg' })},
validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true })},
topi: {value:"topic", required:true,
label:RED._("node-red:rbe.label.topic"),
validate: RED.validators.typedInput({ type: 'msg' })}
validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true })}
},
inputs:1,
outputs:1,

View File

@ -41,8 +41,8 @@
color:"#DEBD5C",
defaults: {
name: {value:""},
property: {value:"payload", validate: RED.validators.typedInput({ type: 'msg' }) },
outproperty: {value:"payload", validate: RED.validators.typedInput({ type: 'msg' }) },
property: {value:"payload", validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true }) },
outproperty: {value:"payload", validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true }) },
tag: {value:""},
ret: {value:"html"},
as: {value:"single"}

View File

@ -32,7 +32,7 @@
defaults: {
name: {value:""},
property: {value:"payload",required:true,
validate: RED.validators.typedInput({ type: 'msg' }),
validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true}),
label:RED._("node-red:json.label.property")},
action: {value:""},
pretty: {value:false}

View File

@ -28,7 +28,7 @@
name: {value:""},
property: {value:"payload",required:true,
label:RED._("node-red:common.label.property"),
validate: RED.validators.typedInput({ type: 'msg' })},
validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true })},
attr: {value:""},
chr: {value:""}
},

View File

@ -16,7 +16,7 @@
color:"#DEBD5C",
defaults: {
property: {value:"payload",required:true,
validate: RED.validators.typedInput({ type: 'msg' }),
validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true }),
label:RED._("node-red:common.label.property")},
name: {value:""}
},