mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Tweak nodes panel to update AI category name and highlight AI Transform node (#14608)
This commit is contained in:
@@ -110,25 +110,29 @@ interface NodeView {
|
||||
items: NodeViewItem[];
|
||||
}
|
||||
|
||||
function getNodeView(node: INodeTypeDescription) {
|
||||
return {
|
||||
key: node.name,
|
||||
type: 'node',
|
||||
properties: {
|
||||
group: [],
|
||||
name: node.name,
|
||||
displayName: node.displayName,
|
||||
title: node.displayName,
|
||||
description: node.description,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
icon: node.icon!,
|
||||
iconUrl: node.iconUrl,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function getAiNodesBySubcategory(nodes: INodeTypeDescription[], subcategory: string) {
|
||||
return nodes
|
||||
.filter(
|
||||
(node) => !node.hidden && node.codex?.subcategories?.[AI_SUBCATEGORY]?.includes(subcategory),
|
||||
)
|
||||
.map((node) => ({
|
||||
key: node.name,
|
||||
type: 'node',
|
||||
properties: {
|
||||
group: [],
|
||||
name: node.name,
|
||||
displayName: node.displayName,
|
||||
title: node.displayName,
|
||||
description: node.description,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
icon: node.icon!,
|
||||
iconUrl: node.iconUrl,
|
||||
},
|
||||
}))
|
||||
.map(getNodeView)
|
||||
.sort((a, b) => a.properties.displayName.localeCompare(b.properties.displayName));
|
||||
}
|
||||
|
||||
@@ -145,6 +149,9 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView {
|
||||
const websiteCategoryURL =
|
||||
templatesStore.constructTemplateRepositoryURL(websiteCategoryURLParams);
|
||||
|
||||
const aiTransformNode = nodeTypesStore.getNodeType(AI_TRANSFORM_NODE_TYPE);
|
||||
const transformNode = aiTransformNode ? [getNodeView(aiTransformNode)] : [];
|
||||
|
||||
return {
|
||||
value: AI_NODE_CREATOR_VIEW,
|
||||
title: i18n.baseText('nodeCreator.aiPanel.aiNodes'),
|
||||
@@ -167,6 +174,7 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView {
|
||||
},
|
||||
...agentNodes,
|
||||
...chainNodes,
|
||||
...transformNode,
|
||||
{
|
||||
key: AI_OTHERS_NODE_CREATOR_VIEW,
|
||||
type: 'view',
|
||||
|
||||
Reference in New Issue
Block a user