mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Fix displaying of some trigger nodes in the creator panel (#5040)
This commit is contained in:
parent
18140e059b
commit
4daf905ce2
|
@ -306,8 +306,16 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, {
|
||||||
return nodesWithActions;
|
return nodesWithActions;
|
||||||
},
|
},
|
||||||
mergedAppNodes(): INodeTypeDescription[] {
|
mergedAppNodes(): INodeTypeDescription[] {
|
||||||
const mergedNodes = this.visibleNodesWithActions.reduce(
|
const mergedNodes = [...this.visibleNodesWithActions]
|
||||||
(acc: Record<string, INodeTypeDescription>, node: INodeTypeDescription) => {
|
// Sort triggers so they are always on top and when later get merged
|
||||||
|
// they won't be discarded if they have the same name as a core node which doesn't contain actions
|
||||||
|
.sort((a, b) => {
|
||||||
|
if (a.group.includes('trigger')) return -1;
|
||||||
|
if (b.group.includes('trigger')) return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
})
|
||||||
|
.reduce((acc: Record<string, INodeTypeDescription>, node: INodeTypeDescription) => {
|
||||||
const clonedNode = deepCopy(node);
|
const clonedNode = deepCopy(node);
|
||||||
const isCoreNode = node.codex?.categories?.includes(CORE_NODES_CATEGORY);
|
const isCoreNode = node.codex?.categories?.includes(CORE_NODES_CATEGORY);
|
||||||
const actions = node.actions || [];
|
const actions = node.actions || [];
|
||||||
|
@ -324,14 +332,15 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, {
|
||||||
acc[normalizedName].displayName = node.displayName.replace('Trigger', '');
|
acc[normalizedName].displayName = node.displayName.replace('Trigger', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
acc[normalizedName].actions = filterSinglePlaceholderAction(
|
|
||||||
acc[normalizedName].actions || [],
|
|
||||||
);
|
|
||||||
return acc;
|
return acc;
|
||||||
},
|
}, {});
|
||||||
{},
|
|
||||||
);
|
const filteredNodes = Object.values(mergedNodes).map((node) => ({
|
||||||
return Object.values(mergedNodes);
|
...node,
|
||||||
|
actions: filterSinglePlaceholderAction(node.actions || []),
|
||||||
|
}));
|
||||||
|
|
||||||
|
return filteredNodes;
|
||||||
},
|
},
|
||||||
getNodeTypesWithManualTrigger:
|
getNodeTypesWithManualTrigger:
|
||||||
() =>
|
() =>
|
||||||
|
|
Loading…
Reference in a new issue