fix: Remove node AI Transform node (no-changelog) (#10400)

This commit is contained in:
Shireen Missi
2024-08-14 12:01:14 +01:00
committed by GitHub
parent c4fcbe40c5
commit bae0116d78
23 changed files with 38 additions and 831 deletions

View File

@@ -9,7 +9,6 @@ import type {
import {
AI_CATEGORY_AGENTS,
AI_SUBCATEGORY,
AI_TRANSFORM_NODE_TYPE,
CORE_NODES_CATEGORY,
DEFAULT_SUBCATEGORY,
} from '@/constants';
@@ -20,8 +19,6 @@ import type { NodeViewItemSection } from './viewsData';
import { i18n } from '@/plugins/i18n';
import { sortBy } from 'lodash-es';
import { usePostHog } from '@/stores/posthog.store';
export function transformNodeType(
node: SimplifiedNodeType,
subcategory?: string,
@@ -77,11 +74,6 @@ export function sortNodeCreateElements(nodes: INodeCreateElement[]) {
}
export function searchNodes(searchFilter: string, items: INodeCreateElement[]) {
const aiEnabled = usePostHog().isAiEnabled();
if (!aiEnabled) {
items = items.filter((item) => item.key !== AI_TRANSFORM_NODE_TYPE);
}
// In order to support the old search we need to remove the 'trigger' part
const trimmedFilter = searchFilter.toLowerCase().replace('trigger', '').trimEnd();

View File

@@ -1,5 +1,4 @@
import {
AI_TRANSFORM_NODE_TYPE,
CORE_NODES_CATEGORY,
WEBHOOK_NODE_TYPE,
OTHER_TRIGGER_NODES_SUBCATEGORY,
@@ -64,7 +63,6 @@ import { NodeConnectionType } from 'n8n-workflow';
import { useTemplatesStore } from '@/stores/templates.store';
import type { BaseTextKey } from '@/plugins/i18n';
import { camelCase } from 'lodash-es';
import { usePostHog } from '@/stores/posthog.store';
export interface NodeViewItemSection {
key: string;
@@ -431,13 +429,6 @@ export function TriggerView() {
export function RegularView(nodes: SimplifiedNodeType[]) {
const i18n = useI18n();
const popularItemsSubcategory = [SET_NODE_TYPE, CODE_NODE_TYPE, DATETIME_NODE_TYPE];
const aiEnabled = usePostHog().isAiEnabled();
if (aiEnabled) {
popularItemsSubcategory.push(AI_TRANSFORM_NODE_TYPE);
}
const view: NodeView = {
value: REGULAR_NODE_CREATOR_VIEW,
title: i18n.baseText('nodeCreator.triggerHelperPanel.whatHappensNext'),
@@ -462,7 +453,7 @@ export function RegularView(nodes: SimplifiedNodeType[]) {
{
key: 'popular',
title: i18n.baseText('nodeCreator.sectionNames.popular'),
items: popularItemsSubcategory,
items: [SET_NODE_TYPE, CODE_NODE_TYPE, DATETIME_NODE_TYPE],
},
{
key: 'addOrRemove',