mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
fix(AI Transform Node): Data Transformation > Other section should not contain node (no-changelog) (#10519)
This commit is contained in:
parent
9cd7f1ec0d
commit
dd0c098b86
|
@ -36,8 +36,14 @@ import { useI18n } from '@/composables/useI18n';
|
||||||
import { useKeyboardNavigation } from './useKeyboardNavigation';
|
import { useKeyboardNavigation } from './useKeyboardNavigation';
|
||||||
|
|
||||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||||
import type { INodeInputFilter, NodeConnectionType, Themed } from 'n8n-workflow';
|
import {
|
||||||
|
AI_TRANSFORM_NODE_TYPE,
|
||||||
|
type INodeInputFilter,
|
||||||
|
type NodeConnectionType,
|
||||||
|
type Themed,
|
||||||
|
} from 'n8n-workflow';
|
||||||
import { useCanvasStore } from '@/stores/canvas.store';
|
import { useCanvasStore } from '@/stores/canvas.store';
|
||||||
|
import { usePostHog } from '../../../../stores/posthog.store';
|
||||||
|
|
||||||
interface ViewStack {
|
interface ViewStack {
|
||||||
uuid?: string;
|
uuid?: string;
|
||||||
|
@ -350,7 +356,14 @@ export const useViewStacks = defineStore('nodeCreatorViewStacks', () => {
|
||||||
|
|
||||||
if (!stack?.items) {
|
if (!stack?.items) {
|
||||||
const subcategory = stack?.subcategory ?? DEFAULT_SUBCATEGORY;
|
const subcategory = stack?.subcategory ?? DEFAULT_SUBCATEGORY;
|
||||||
const itemsInSubcategory = itemsBySubcategory.value[subcategory];
|
let itemsInSubcategory = itemsBySubcategory.value[subcategory];
|
||||||
|
|
||||||
|
const aiEnabled = usePostHog().isAiEnabled();
|
||||||
|
if (!aiEnabled) {
|
||||||
|
itemsInSubcategory = itemsInSubcategory.filter(
|
||||||
|
(item) => item.key !== AI_TRANSFORM_NODE_TYPE,
|
||||||
|
);
|
||||||
|
}
|
||||||
const sections = stack.sections;
|
const sections = stack.sections;
|
||||||
|
|
||||||
if (sections) {
|
if (sections) {
|
||||||
|
|
|
@ -64,7 +64,6 @@ import { NodeConnectionType } from 'n8n-workflow';
|
||||||
import { useTemplatesStore } from '@/stores/templates.store';
|
import { useTemplatesStore } from '@/stores/templates.store';
|
||||||
import type { BaseTextKey } from '@/plugins/i18n';
|
import type { BaseTextKey } from '@/plugins/i18n';
|
||||||
import { camelCase } from 'lodash-es';
|
import { camelCase } from 'lodash-es';
|
||||||
import { usePostHog } from '@/stores/posthog.store';
|
|
||||||
|
|
||||||
export interface NodeViewItemSection {
|
export interface NodeViewItemSection {
|
||||||
key: string;
|
key: string;
|
||||||
|
@ -431,12 +430,12 @@ export function TriggerView() {
|
||||||
export function RegularView(nodes: SimplifiedNodeType[]) {
|
export function RegularView(nodes: SimplifiedNodeType[]) {
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
|
|
||||||
const popularItemsSubcategory = [SET_NODE_TYPE, CODE_NODE_TYPE, DATETIME_NODE_TYPE];
|
const popularItemsSubcategory = [
|
||||||
const aiEnabled = usePostHog().isAiEnabled();
|
SET_NODE_TYPE,
|
||||||
|
CODE_NODE_TYPE,
|
||||||
if (aiEnabled) {
|
DATETIME_NODE_TYPE,
|
||||||
popularItemsSubcategory.push(AI_TRANSFORM_NODE_TYPE);
|
AI_TRANSFORM_NODE_TYPE,
|
||||||
}
|
];
|
||||||
|
|
||||||
const view: NodeView = {
|
const view: NodeView = {
|
||||||
value: REGULAR_NODE_CREATOR_VIEW,
|
value: REGULAR_NODE_CREATOR_VIEW,
|
||||||
|
|
Loading…
Reference in a new issue