mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 04:47:29 -08:00
🐛 Fix error when opening ftp/sftp credentials (#2298)
* n8n-2513 fix error when opening credentials * clean up validation logic
This commit is contained in:
parent
d72d6b4b41
commit
d1824b9dd0
|
@ -208,14 +208,16 @@ export default mixins(showMessage, nodeHelpers).extend({
|
||||||
activeNode: this.$store.getters.activeNode,
|
activeNode: this.$store.getters.activeNode,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.credentialId) {
|
setTimeout(() => {
|
||||||
if (!this.requiredPropertiesFilled) {
|
if (this.credentialId) {
|
||||||
this.showValidationWarning = true;
|
if (!this.requiredPropertiesFilled) {
|
||||||
|
this.showValidationWarning = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.retestCredential();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
}, 0);
|
||||||
this.retestCredential();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
@ -329,7 +331,11 @@ export default mixins(showMessage, nodeHelpers).extend({
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.credentialData[property.name]) {
|
if (property.type === 'string' && !this.credentialData[property.name]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (property.type === 'number' && typeof this.credentialData[property.name] !== 'number') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,21 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
showRequiredErrors(): boolean {
|
showRequiredErrors(): boolean {
|
||||||
return this.$props.parameter.type !== 'boolean' && !this.value && this.$props.parameter.required && (this.blurred || this.showValidationWarnings);
|
if (!this.$props.parameter.required) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.blurred || this.showValidationWarnings) {
|
||||||
|
if (this.$props.parameter.type === 'string') {
|
||||||
|
return !this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$props.parameter.type === 'number') {
|
||||||
|
return typeof this.value !== 'number';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
Loading…
Reference in a new issue