diff --git a/packages/editor-ui/src/components/Node/NodeCreator/viewsData.ts b/packages/editor-ui/src/components/Node/NodeCreator/viewsData.ts index 14d19307c3..321a8a0adb 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/viewsData.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/viewsData.ts @@ -141,9 +141,10 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView { const chainNodes = getAiNodesBySubcategory(nodeTypesStore.allLatestNodeTypes, AI_CATEGORY_CHAINS); const agentNodes = getAiNodesBySubcategory(nodeTypesStore.allLatestNodeTypes, AI_CATEGORY_AGENTS); - const websiteCategoryURL = templatesStore.websiteTemplateRepositoryParameters; - - websiteCategoryURL.append('utm_user_role', 'AdvancedAI'); + const websiteCategoryURLParams = templatesStore.websiteTemplateRepositoryParameters; + websiteCategoryURLParams.append('utm_user_role', 'AdvancedAI'); + const websiteCategoryURL = + templatesStore.constructTemplateRepositoryURL(websiteCategoryURLParams); return { value: AI_NODE_CREATOR_VIEW, @@ -158,7 +159,7 @@ export function AIView(_nodes: SimplifiedNodeType[]): NodeView { icon: 'box-open', description: i18n.baseText('nodeCreator.aiPanel.linkItem.description'), name: 'ai_templates_root', - url: websiteCategoryURL.toString(), + url: websiteCategoryURL, tag: { type: 'info', text: i18n.baseText('nodeCreator.triggerHelperPanel.manualTriggerTag'), diff --git a/packages/editor-ui/src/stores/templates.store.ts b/packages/editor-ui/src/stores/templates.store.ts index f96202c273..be00083d99 100644 --- a/packages/editor-ui/src/stores/templates.store.ts +++ b/packages/editor-ui/src/stores/templates.store.ts @@ -167,6 +167,10 @@ export const useTemplatesStore = defineStore(STORES.TEMPLATES, () => { `${TEMPLATES_URLS.BASE_WEBSITE_URL}?${websiteTemplateRepositoryParameters.value.toString()}`, ); + const constructTemplateRepositoryURL = (params: URLSearchParams): string => { + return `${TEMPLATES_URLS.BASE_WEBSITE_URL}?${params.toString()}`; + }; + const addCategories = (_categories: ITemplatesCategory[]): void => { categories.value = _categories; }; @@ -427,6 +431,7 @@ export const useTemplatesStore = defineStore(STORES.TEMPLATES, () => { isSearchFinished, hasCustomTemplatesHost, websiteTemplateRepositoryURL, + constructTemplateRepositoryURL, websiteTemplateRepositoryParameters, addCategories, addCollections,