mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
fix(editor): fix mapping bug when val is null (#3942)
This commit is contained in:
parent
dc576939aa
commit
a21dbdc45b
|
@ -45,6 +45,10 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isSimple(data: unkown): boolean {
|
isSimple(data: unkown): boolean {
|
||||||
|
if (data === null || data === undefined) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof data === 'object' && Object.keys(data).length === 0) {
|
if (typeof data === 'object' && Object.keys(data).length === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ export default mixins(externalHooks).extend({
|
||||||
type: Object as () => INodeUi,
|
type: Object as () => INodeUi,
|
||||||
},
|
},
|
||||||
inputData: {
|
inputData: {
|
||||||
type: Object as () => INodeExecutionData[],
|
type: Array as () => INodeExecutionData[],
|
||||||
},
|
},
|
||||||
mappingEnabled: {
|
mappingEnabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
@ -399,7 +399,7 @@ export default mixins(externalHooks).extend({
|
||||||
|
|
||||||
// Go over all keys of entry
|
// Go over all keys of entry
|
||||||
entryRows = [];
|
entryRows = [];
|
||||||
leftEntryColumns = Object.keys(entry);
|
leftEntryColumns = Object.keys(entry || {});
|
||||||
|
|
||||||
// Go over all the already existing column-keys
|
// Go over all the already existing column-keys
|
||||||
tableColumns.forEach((key) => {
|
tableColumns.forEach((key) => {
|
||||||
|
@ -409,7 +409,7 @@ export default mixins(externalHooks).extend({
|
||||||
// Remove key so that we know that it got added
|
// Remove key so that we know that it got added
|
||||||
leftEntryColumns.splice(leftEntryColumns.indexOf(key), 1);
|
leftEntryColumns.splice(leftEntryColumns.indexOf(key), 1);
|
||||||
|
|
||||||
hasJson[key] = typeof entry[key] === 'object' || hasJson[key] || false;
|
hasJson[key] = hasJson[key] || (typeof entry[key] === 'object' && Object.keys(entry[key] || {}).length > 0) || false;
|
||||||
} else {
|
} else {
|
||||||
// Entry does not have key so add null
|
// Entry does not have key so add null
|
||||||
entryRows.push(null);
|
entryRows.push(null);
|
||||||
|
@ -422,7 +422,7 @@ export default mixins(externalHooks).extend({
|
||||||
tableColumns.push(key);
|
tableColumns.push(key);
|
||||||
// Add the value
|
// Add the value
|
||||||
entryRows.push(entry[key]);
|
entryRows.push(entry[key]);
|
||||||
hasJson[key] = hasJson[key] || (entry[key] === 'object' && Object.keys(entry[key] || {}).length > 0);
|
hasJson[key] = hasJson[key] || (typeof entry[key] === 'object' && Object.keys(entry[key] || {}).length > 0) || false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add the data of the entry
|
// Add the data of the entry
|
||||||
|
|
Loading…
Reference in a new issue