mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Correct ai template url (#17908)
This commit is contained in:
@@ -57,6 +57,7 @@ import {
|
||||
AI_CODE_TOOL_LANGCHAIN_NODE_TYPE,
|
||||
AI_WORKFLOW_TOOL_LANGCHAIN_NODE_TYPE,
|
||||
HUMAN_IN_THE_LOOP_CATEGORY,
|
||||
TEMPLATE_CATEGORY_AI,
|
||||
} from '@/constants';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
@@ -176,8 +177,10 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView {
|
||||
|
||||
const websiteCategoryURLParams = templatesStore.websiteTemplateRepositoryParameters;
|
||||
websiteCategoryURLParams.append('utm_user_role', 'AdvancedAI');
|
||||
const websiteCategoryURL =
|
||||
templatesStore.constructTemplateRepositoryURL(websiteCategoryURLParams);
|
||||
const aiTemplatesURL = templatesStore.constructTemplateRepositoryURL(
|
||||
websiteCategoryURLParams,
|
||||
TEMPLATE_CATEGORY_AI,
|
||||
);
|
||||
|
||||
const askAiEnabled = useSettingsStore().isAskAiEnabled;
|
||||
const aiTransformNode = nodeTypesStore.getNodeType(AI_TRANSFORM_NODE_TYPE);
|
||||
@@ -196,7 +199,7 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView {
|
||||
icon: 'box-open',
|
||||
description: i18n.baseText('nodeCreator.aiPanel.linkItem.description'),
|
||||
name: 'ai_templates_root',
|
||||
url: websiteCategoryURL,
|
||||
url: aiTemplatesURL,
|
||||
tag: {
|
||||
type: 'info',
|
||||
text: i18n.baseText('nodeCreator.triggerHelperPanel.manualTriggerTag'),
|
||||
|
||||
@@ -223,6 +223,9 @@ export const RESPOND_TO_WEBHOOK_NODE_TYPE = 'n8n-nodes-base.respondToWebhook';
|
||||
export const CREDENTIAL_ONLY_NODE_PREFIX = 'n8n-creds-base';
|
||||
export const CREDENTIAL_ONLY_HTTP_NODE_VERSION = 4.1;
|
||||
|
||||
// template categories
|
||||
export const TEMPLATE_CATEGORY_AI = 'categories/ai';
|
||||
|
||||
export const EXECUTABLE_TRIGGER_NODE_TYPES = [
|
||||
START_NODE_TYPE,
|
||||
MANUAL_TRIGGER_NODE_TYPE,
|
||||
|
||||
@@ -195,8 +195,11 @@ export const useTemplatesStore = defineStore(STORES.TEMPLATES, () => {
|
||||
`${TEMPLATES_URLS.BASE_WEBSITE_URL}${getTemplatePathByRole(userRole.value)}?${websiteTemplateRepositoryParameters.value.toString()}`,
|
||||
);
|
||||
|
||||
const constructTemplateRepositoryURL = (params: URLSearchParams): string => {
|
||||
return `${TEMPLATES_URLS.BASE_WEBSITE_URL}?${params.toString()}`;
|
||||
const constructTemplateRepositoryURL = (params: URLSearchParams, category?: string): string => {
|
||||
const baseUrl = category
|
||||
? `${TEMPLATES_URLS.BASE_WEBSITE_URL}${category}`
|
||||
: TEMPLATES_URLS.BASE_WEBSITE_URL;
|
||||
return `${baseUrl}?${params.toString()}`;
|
||||
};
|
||||
|
||||
const addCategories = (_categories: ITemplatesCategory[]): void => {
|
||||
|
||||
Reference in New Issue
Block a user