mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Add displayOptions support for multiOptions property
This commit is contained in:
@@ -277,6 +277,7 @@ export function displayParameter(nodeValues: INodeParameters, parameter: INodePr
|
|||||||
nodeValuesRoot = nodeValuesRoot || nodeValues;
|
nodeValuesRoot = nodeValuesRoot || nodeValues;
|
||||||
|
|
||||||
let value;
|
let value;
|
||||||
|
const values: any[] = []; // tslint:disable-line:no-any
|
||||||
if (parameter.displayOptions.show) {
|
if (parameter.displayOptions.show) {
|
||||||
// All the defined rules have to match to display parameter
|
// All the defined rules have to match to display parameter
|
||||||
for (const propertyName of Object.keys(parameter.displayOptions.show)) {
|
for (const propertyName of Object.keys(parameter.displayOptions.show)) {
|
||||||
@@ -288,7 +289,14 @@ export function displayParameter(nodeValues: INodeParameters, parameter: INodePr
|
|||||||
value = get(nodeValues, propertyName);
|
value = get(nodeValues, propertyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value === undefined || !parameter.displayOptions.show[propertyName].includes(value as string)) {
|
values.length = 0;
|
||||||
|
if (!Array.isArray(value)) {
|
||||||
|
values.push(value);
|
||||||
|
} else {
|
||||||
|
values.push.apply(values, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (values.length === 0 || !parameter.displayOptions.show[propertyName].some(v => values.includes(v))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,7 +312,15 @@ export function displayParameter(nodeValues: INodeParameters, parameter: INodePr
|
|||||||
// Get the value from current level
|
// Get the value from current level
|
||||||
value = get(nodeValues, propertyName);
|
value = get(nodeValues, propertyName);
|
||||||
}
|
}
|
||||||
if (value !== undefined && parameter.displayOptions.hide[propertyName].includes(value as string)) {
|
|
||||||
|
values.length = 0;
|
||||||
|
if (!Array.isArray(value)) {
|
||||||
|
values.push(value);
|
||||||
|
} else {
|
||||||
|
values.push.apply(values, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (values.length !== 0 && parameter.displayOptions.hide[propertyName].some(v => values.includes(v))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user