1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

ensure old config work with new fields

This commit is contained in:
Dave Conway-Jones 2020-05-14 16:28:38 +01:00
parent 1d71fb3554
commit a849872c21
No known key found for this signature in database
GPG Key ID: 302A6725C594817F

View File

@ -318,6 +318,12 @@
delete RED._debug; delete RED._debug;
}, },
oneditprepare: function() { oneditprepare: function() {
$("#node-input-typed-status").typedInput({
default: "msg",
types:['msg',"jsonata"],
typeField: $("#node-input-statusType")
});
var that = this;
var none = { var none = {
value: "none", value: "none",
label: RED._("node-red:debug.none"), label: RED._("node-red:debug.none"),
@ -327,6 +333,14 @@
this.tosidebar = true; this.tosidebar = true;
$("#node-input-tosidebar").prop('checked', true); $("#node-input-tosidebar").prop('checked', true);
} }
if (this.statusVal === undefined) {
this.statusVal = (this.complete === "false") ? "payload" : ((this.complete === "true") ? "payload" : this.complete+"");
$("#node-input-typed-status").typedInput('value',this.statusVal || "");
}
if (this.statusType === undefined) {
this.statusType = this.targetType;
$("#node-input-typed-status").typedInput('type',this.statusType || "msg");
}
if (typeof this.console === "string") { if (typeof this.console === "string") {
this.console = (this.console == 'true'); this.console = (this.console == 'true');
$("#node-input-console").prop('checked', this.console); $("#node-input-console").prop('checked', this.console);
@ -363,12 +377,7 @@
} }
}); });
$("#node-input-typed-status").typedInput({
default: "msg",
types:['msg',"jsonata"],
typeField: $("#node-input-statusType")
});
var that = this;
$("#node-input-tostatus").on('change',function() { $("#node-input-tostatus").on('change',function() {
if ($(this).is(":checked")) { if ($(this).is(":checked")) {
if (!that.hasOwnProperty("statusVal") || that.statusVal === "") { if (!that.hasOwnProperty("statusVal") || that.statusVal === "") {