1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-11-10 12:35:46 +03:00

Support also numbers as values in options and multiOptions

This commit is contained in:
Jan Oberhauser 2019-11-22 00:07:38 +01:00
parent 7233f02350
commit 2d409b6535
2 changed files with 14 additions and 5 deletions

View File

@ -326,11 +326,20 @@ export default mixins(
// and the error is not displayed on the node in the workflow
const validOptions = this.parameterOptions!.map((options: INodePropertyOptions) => options.value);
if (this.displayValue === null || !validOptions.includes(this.displayValue as string)) {
if (issues.parameters === undefined) {
issues.parameters = {};
const checkValues: string[] = [];
if (Array.isArray(this.displayValue)) {
checkValues.push.apply(checkValues, this.displayValue);
} else {
checkValues.push(this.displayValue as string);
}
for (const checkValue of checkValues) {
if (checkValue === null || !validOptions.includes(checkValue)) {
if (issues.parameters === undefined) {
issues.parameters = {};
}
issues.parameters[this.parameter.name] = [`The value "${checkValue}" is not supported!`];
}
issues.parameters[this.parameter.name] = [`The value "${this.displayValue}" is not supported!`];
}
} else if (this.remoteParameterOptionsLoadingIssues !== null) {
if (issues.parameters === undefined) {

View File

@ -343,7 +343,7 @@ export interface INodeProperties {
export interface INodePropertyOptions {
name: string;
value: string;
value: string | number;
description?: string;
}