Skip to content

Commit

Permalink
fix(core): Fix issue that parameters got lost in some edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
janober committed Jun 11, 2022
1 parent eec12f2 commit 04f0bf5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/workflow/src/NodeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ export function getNodeParameters(
Object.keys(propertyValues || {}).forEach((value) => {
returnValue[value] = {};
});
return { [nodeProperties.name]: returnValue };
nodeParameters[nodeProperties.name] = returnValue;
}

if (Object.keys(collectionValues).length !== 0 || returnDefaults) {
Expand Down
39 changes: 33 additions & 6 deletions packages/workflow/test/NodeHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3010,9 +3010,15 @@ describe('Workflow', () => {
},
{
description:
'complex type "collection" which contains a "fixedCollection" with "multipleValues: false" that has a collection value added but nothing to the fixedCollection',
'complex type "collection" which contains a "fixedCollection" with "multipleValues: false" that has all values set to the default values (by having it as an empty object) in combination with another value',
input: {
nodePropertiesArray: [
{
name: 'mode',
displayName: 'mode',
type: 'string',
default: 'mode1',
},
{
displayName: 'Options',
name: 'options',
Expand Down Expand Up @@ -3065,33 +3071,54 @@ describe('Workflow', () => {
},
],
nodeValues: {
mode: 'changed',
options: {
sort: {},
sort: {
value: {},
},
},
},
},
output: {
noneDisplayedFalse: {
defaultsFalse: {
mode: 'changed',
options: {
sort: {},
sort: {
value: {},
},
},
},
defaultsTrue: {
mode: 'changed',
options: {
sort: {},
sort: {
value: {
descending: true,
ordering: 'date',
},
},
},
},
},
noneDisplayedTrue: {
defaultsFalse: {
mode: 'changed',
options: {
sort: {},
sort: {
value: {},
},
},
},
defaultsTrue: {
mode: 'changed',
options: {
sort: {},
sort: {
value: {
descending: true,
ordering: 'date',
},
},
},
},
},
Expand Down

0 comments on commit 04f0bf5

Please sign in to comment.