mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(editor): Tweak nodes panel to update AI category name and highlight AI Transform node (#14608)
This commit is contained in:
@@ -110,12 +110,8 @@ interface NodeView {
|
|||||||
items: NodeViewItem[];
|
items: NodeViewItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAiNodesBySubcategory(nodes: INodeTypeDescription[], subcategory: string) {
|
function getNodeView(node: INodeTypeDescription) {
|
||||||
return nodes
|
return {
|
||||||
.filter(
|
|
||||||
(node) => !node.hidden && node.codex?.subcategories?.[AI_SUBCATEGORY]?.includes(subcategory),
|
|
||||||
)
|
|
||||||
.map((node) => ({
|
|
||||||
key: node.name,
|
key: node.name,
|
||||||
type: 'node',
|
type: 'node',
|
||||||
properties: {
|
properties: {
|
||||||
@@ -128,7 +124,15 @@ function getAiNodesBySubcategory(nodes: INodeTypeDescription[], subcategory: str
|
|||||||
icon: node.icon!,
|
icon: node.icon!,
|
||||||
iconUrl: node.iconUrl,
|
iconUrl: node.iconUrl,
|
||||||
},
|
},
|
||||||
}))
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAiNodesBySubcategory(nodes: INodeTypeDescription[], subcategory: string) {
|
||||||
|
return nodes
|
||||||
|
.filter(
|
||||||
|
(node) => !node.hidden && node.codex?.subcategories?.[AI_SUBCATEGORY]?.includes(subcategory),
|
||||||
|
)
|
||||||
|
.map(getNodeView)
|
||||||
.sort((a, b) => a.properties.displayName.localeCompare(b.properties.displayName));
|
.sort((a, b) => a.properties.displayName.localeCompare(b.properties.displayName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +149,9 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView {
|
|||||||
const websiteCategoryURL =
|
const websiteCategoryURL =
|
||||||
templatesStore.constructTemplateRepositoryURL(websiteCategoryURLParams);
|
templatesStore.constructTemplateRepositoryURL(websiteCategoryURLParams);
|
||||||
|
|
||||||
|
const aiTransformNode = nodeTypesStore.getNodeType(AI_TRANSFORM_NODE_TYPE);
|
||||||
|
const transformNode = aiTransformNode ? [getNodeView(aiTransformNode)] : [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
value: AI_NODE_CREATOR_VIEW,
|
value: AI_NODE_CREATOR_VIEW,
|
||||||
title: i18n.baseText('nodeCreator.aiPanel.aiNodes'),
|
title: i18n.baseText('nodeCreator.aiPanel.aiNodes'),
|
||||||
@@ -167,6 +174,7 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView {
|
|||||||
},
|
},
|
||||||
...agentNodes,
|
...agentNodes,
|
||||||
...chainNodes,
|
...chainNodes,
|
||||||
|
...transformNode,
|
||||||
{
|
{
|
||||||
key: AI_OTHERS_NODE_CREATOR_VIEW,
|
key: AI_OTHERS_NODE_CREATOR_VIEW,
|
||||||
type: 'view',
|
type: 'view',
|
||||||
|
|||||||
@@ -1278,7 +1278,7 @@
|
|||||||
"nodeCreator.aiPanel.selectAiNode": "Select an Al Node to add to your workflow",
|
"nodeCreator.aiPanel.selectAiNode": "Select an Al Node to add to your workflow",
|
||||||
"nodeCreator.aiPanel.nodesForAi": "Build autonomous agents, summarize or search documents, etc.",
|
"nodeCreator.aiPanel.nodesForAi": "Build autonomous agents, summarize or search documents, etc.",
|
||||||
"nodeCreator.aiPanel.newTag": "New",
|
"nodeCreator.aiPanel.newTag": "New",
|
||||||
"nodeCreator.aiPanel.langchainAiNodes": "Advanced AI",
|
"nodeCreator.aiPanel.langchainAiNodes": "AI",
|
||||||
"nodeCreator.aiPanel.title": "When should this workflow run?",
|
"nodeCreator.aiPanel.title": "When should this workflow run?",
|
||||||
"nodeCreator.aiPanel.linkItem.description": "See what's possible and get started 5x faster",
|
"nodeCreator.aiPanel.linkItem.description": "See what's possible and get started 5x faster",
|
||||||
"nodeCreator.aiPanel.linkItem.title": "AI Templates",
|
"nodeCreator.aiPanel.linkItem.title": "AI Templates",
|
||||||
|
|||||||
Reference in New Issue
Block a user