mirror of
https://github.com/n8n-io/n8n.git
synced 2024-09-11 13:15:28 +03:00
⚡ Adjust to new spec
This commit is contained in:
parent
33db5f64e7
commit
bc75b0fe98
@ -645,6 +645,7 @@ export interface INodeProperties {
|
||||
isNodeSetting?: boolean;
|
||||
noDataExpression?: boolean;
|
||||
required?: boolean;
|
||||
isTopLevel?: boolean;
|
||||
}
|
||||
export interface INodePropertyOptions {
|
||||
name: string;
|
||||
|
@ -800,13 +800,14 @@ export function getNodeParameters(
|
||||
}
|
||||
}
|
||||
|
||||
const isEmptyOptional =
|
||||
Object.keys(collectionValues).length === 0 && !nodeProperties.required;
|
||||
const isNested = !nodeProperties.isTopLevel;
|
||||
|
||||
const isEmpty = Object.keys(collectionValues).length === 0;
|
||||
|
||||
const { values } = nodeProperties.options![0] as INodePropertyCollection;
|
||||
const isFlat = values.every((v) => v.type !== 'fixedCollection');
|
||||
|
||||
if (isEmptyOptional && isFlat) {
|
||||
if (isNested && isEmpty && isFlat) {
|
||||
nodeParameters[nodeProperties.name] = createSectionToAdd(nodeProperties);
|
||||
nodeParametersFull[nodeProperties.name] = nodeParameters[nodeProperties.name];
|
||||
}
|
||||
|
@ -100,9 +100,16 @@ export class Workflow {
|
||||
// throw new Error(`The node type "${node.type}" of node "${node.name}" is not known.`);
|
||||
}
|
||||
|
||||
const nodeProperties = nodeType.description.properties.map((property) => {
|
||||
if (property.type === 'fixedCollection') {
|
||||
property.isTopLevel = true;
|
||||
}
|
||||
return property;
|
||||
});
|
||||
|
||||
// Add default values
|
||||
const nodeParameters = NodeHelpers.getNodeParameters(
|
||||
nodeType.description.properties,
|
||||
nodeProperties,
|
||||
node.parameters,
|
||||
true,
|
||||
false,
|
||||
|
Loading…
Reference in New Issue
Block a user