Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(AI Transform Node): Data Transformation > Other section should not contain node (no-changelog) #10519

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ import { useI18n } from '@/composables/useI18n';
import { useKeyboardNavigation } from './useKeyboardNavigation';

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 { usePostHog } from '../../../../stores/posthog.store';

interface ViewStack {
uuid?: string;
Expand Down Expand Up @@ -350,7 +356,14 @@ export const useViewStacks = defineStore('nodeCreatorViewStacks', () => {

if (!stack?.items) {
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;

if (sections) {
Expand Down
13 changes: 6 additions & 7 deletions packages/editor-ui/src/components/Node/NodeCreator/viewsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,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;
Expand Down Expand Up @@ -431,12 +430,12 @@ 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 popularItemsSubcategory = [
SET_NODE_TYPE,
CODE_NODE_TYPE,
DATETIME_NODE_TYPE,
AI_TRANSFORM_NODE_TYPE,
];

const view: NodeView = {
value: REGULAR_NODE_CREATOR_VIEW,
Expand Down
Loading