mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
⚡ Support also numbers as values in options and multiOptions
This commit is contained in:
parent
7233f02350
commit
2d409b6535
|
@ -326,11 +326,20 @@ export default mixins(
|
||||||
// and the error is not displayed on the node in the workflow
|
// and the error is not displayed on the node in the workflow
|
||||||
const validOptions = this.parameterOptions!.map((options: INodePropertyOptions) => options.value);
|
const validOptions = this.parameterOptions!.map((options: INodePropertyOptions) => options.value);
|
||||||
|
|
||||||
if (this.displayValue === null || !validOptions.includes(this.displayValue as string)) {
|
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) {
|
if (issues.parameters === undefined) {
|
||||||
issues.parameters = {};
|
issues.parameters = {};
|
||||||
}
|
}
|
||||||
issues.parameters[this.parameter.name] = [`The value "${this.displayValue}" is not supported!`];
|
issues.parameters[this.parameter.name] = [`The value "${checkValue}" is not supported!`];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (this.remoteParameterOptionsLoadingIssues !== null) {
|
} else if (this.remoteParameterOptionsLoadingIssues !== null) {
|
||||||
if (issues.parameters === undefined) {
|
if (issues.parameters === undefined) {
|
||||||
|
|
|
@ -343,7 +343,7 @@ export interface INodeProperties {
|
||||||
|
|
||||||
export interface INodePropertyOptions {
|
export interface INodePropertyOptions {
|
||||||
name: string;
|
name: string;
|
||||||
value: string;
|
value: string | number;
|
||||||
description?: string;
|
description?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue