From 4ec7ba9dae5fe1999c15e1ad876117126cd39924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 24 Aug 2022 17:19:45 +0200 Subject: [PATCH] Introduce node deprecation (#3930) :sparkles: Introduce node deprecation --- .../editor-ui/src/components/NodeCreator/NodeCreator.vue | 3 +-- packages/editor-ui/src/constants.ts | 1 - packages/nodes-base/nodes/Start/Start.node.ts | 1 + packages/workflow/src/Interfaces.ts | 6 ++++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/editor-ui/src/components/NodeCreator/NodeCreator.vue b/packages/editor-ui/src/components/NodeCreator/NodeCreator.vue index bd534eb205d4b..eae41d3c4ac67 100644 --- a/packages/editor-ui/src/components/NodeCreator/NodeCreator.vue +++ b/packages/editor-ui/src/components/NodeCreator/NodeCreator.vue @@ -27,7 +27,6 @@ import Vue from 'vue'; import { ICategoriesWithNodes, INodeCreateElement } from '@/Interface'; import { INodeTypeDescription } from 'n8n-workflow'; import SlideTransition from '../transitions/SlideTransition.vue'; -import { HIDDEN_NODES } from '@/constants'; import MainPanel from './MainPanel.vue'; import { getCategoriesWithNodes, getCategorizedList } from './helpers'; @@ -53,7 +52,7 @@ export default Vue.extend({ return this.$store.getters['nodeTypes/allLatestNodeTypes']; }, visibleNodeTypes(): INodeTypeDescription[] { - return this.allLatestNodeTypes.filter((nodeType) => !HIDDEN_NODES.includes(nodeType.name)); + return this.allLatestNodeTypes.filter((nodeType) => !nodeType.hidden); }, categoriesWithNodes(): ICategoriesWithNodes { return getCategoriesWithNodes(this.visibleNodeTypes, this.personalizedNodeTypes as string[]); diff --git a/packages/editor-ui/src/constants.ts b/packages/editor-ui/src/constants.ts index 423c6e18e6109..207090ab827d0 100644 --- a/packages/editor-ui/src/constants.ts +++ b/packages/editor-ui/src/constants.ts @@ -140,7 +140,6 @@ export const ALL_NODE_FILTER = 'All'; export const UNCATEGORIZED_CATEGORY = 'Miscellaneous'; export const UNCATEGORIZED_SUBCATEGORY = 'Helpers'; export const PERSONALIZED_CATEGORY = 'Suggested Nodes'; -export const HIDDEN_NODES = [START_NODE_TYPE]; export const REQUEST_NODE_FORM_URL = 'https://n8n-community.typeform.com/to/K1fBVTZ3'; diff --git a/packages/nodes-base/nodes/Start/Start.node.ts b/packages/nodes-base/nodes/Start/Start.node.ts index ba1924178b4f1..73593925ca4b3 100644 --- a/packages/nodes-base/nodes/Start/Start.node.ts +++ b/packages/nodes-base/nodes/Start/Start.node.ts @@ -10,6 +10,7 @@ export class Start implements INodeType { version: 1, description: 'Starts the workflow execution from this node', maxNodes: 1, + hidden: true, defaults: { name: 'Start', color: '#00e000', diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index 964f6cd72c917..13eccc67daf91 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -1095,6 +1095,12 @@ export interface INodeTypeBaseDescription { subtitle?: string; defaultVersion?: number; codex?: CodexData; + + /** + * Whether the node must not be shown in the node creator panel, + * due to deprecation or as a special case (e.g. Start node) + */ + hidden?: true; } export interface INodePropertyRouting {