diff --git a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_nav_actions.vue b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_nav_actions.vue index 1b63639467c0eb490c27641e7d64c337dc0ba03d..5f100b3e8481bada35872b3a0c1c785f9078f80b 100644 --- a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_nav_actions.vue +++ b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_nav_actions.vue @@ -10,6 +10,8 @@ import { AI_CATALOG_FLOWS_NEW_ROUTE, } from '../router/constants'; +const nullButton = { route: null, label: '' }; + export default { name: 'AiCatalogNavActions', components: { @@ -25,15 +27,14 @@ export default { label: s__('AICatalog|New agent'), }; case AI_CATALOG_FLOWS_ROUTE: - return { - route: AI_CATALOG_FLOWS_NEW_ROUTE, - label: s__('AICatalog|New flow'), - }; + return gon.features?.aiCatalogFlows + ? { + route: AI_CATALOG_FLOWS_NEW_ROUTE, + label: s__('AICatalog|New flow'), + } + : nullButton; default: - return { - route: null, - label: '', - }; + return nullButton; } }, }, diff --git a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_nav_tabs.vue b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_nav_tabs.vue index faefab8c4c73baa894b4f3977a1308cc5f52edbb..1ca2500b610c6a8576b7ef58b5e9a1511e29a7c1 100644 --- a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_nav_tabs.vue +++ b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_nav_tabs.vue @@ -18,15 +18,13 @@ export default { route: AI_CATALOG_AGENTS_ROUTE, active: !this.$route.path.startsWith(AI_CATALOG_FLOWS_ROUTE), }, - ...(this.glFeatures.aiCatalogFlows - ? [ - { - text: s__('AICatalog|Flows'), - route: AI_CATALOG_FLOWS_ROUTE, - active: this.$route.path.startsWith(AI_CATALOG_FLOWS_ROUTE), - }, - ] - : []), + ...[ + { + text: s__('AICatalog|Flows'), + route: AI_CATALOG_FLOWS_ROUTE, + active: this.$route.path.startsWith(AI_CATALOG_FLOWS_ROUTE), + }, + ], ]; }, }, diff --git a/ee/app/assets/javascripts/ai/catalog/pages/ai_catalog_flows_coming_soon.vue b/ee/app/assets/javascripts/ai/catalog/pages/ai_catalog_flows_coming_soon.vue new file mode 100644 index 0000000000000000000000000000000000000000..ead15557b5d798f7e1b64cda2d9ef943ca5fcf86 --- /dev/null +++ b/ee/app/assets/javascripts/ai/catalog/pages/ai_catalog_flows_coming_soon.vue @@ -0,0 +1,63 @@ + + + diff --git a/ee/app/assets/javascripts/ai/catalog/router/index.js b/ee/app/assets/javascripts/ai/catalog/router/index.js index 391acfbed80c61ec0f5cfcd8492d075a1e738f59..07cad7b252cd681900c76392d7b6b5918b650eb6 100644 --- a/ee/app/assets/javascripts/ai/catalog/router/index.js +++ b/ee/app/assets/javascripts/ai/catalog/router/index.js @@ -11,6 +11,7 @@ import AiCatalogAgentsNew from '../pages/ai_catalog_agents_new.vue'; import AiCatalogAgentsDuplicate from '../pages/ai_catalog_agents_duplicate.vue'; import AiCatalogFlow from '../pages/ai_catalog_flow.vue'; import AiCatalogFlows from '../pages/ai_catalog_flows.vue'; +import AiCatalogFlowsComingSoon from '../pages/ai_catalog_flows_coming_soon.vue'; import AiCatalogFlowsEdit from '../pages/ai_catalog_flows_edit.vue'; import AiCatalogFlowsNew from '../pages/ai_catalog_flows_new.vue'; import { @@ -112,56 +113,54 @@ export const createRouter = (base) => { ], }, // FLOWS - ...(gon.features?.aiCatalogFlows - ? [ + ...[ + { + component: NestedRouteApp, + path: '/flows', + meta: { + text: s__('AICatalog|Flows'), + }, + children: [ + { + name: AI_CATALOG_FLOWS_ROUTE, + path: '', + component: gon.features?.aiCatalogFlows ? AiCatalogFlows : AiCatalogFlowsComingSoon, + }, { - component: NestedRouteApp, - path: '/flows', + name: AI_CATALOG_FLOWS_NEW_ROUTE, + path: 'new', + component: AiCatalogFlowsNew, + beforeEnter: requireAuth, meta: { - text: s__('AICatalog|Flows'), + text: s__('AICatalog|New flow'), }, + }, + // Catch-all route for /flows/:id - redirect to /flows?show=:id + { + path: ':id(\\d+)', + redirect: (to) => ({ + path: '/flows', + query: { [AI_CATALOG_SHOW_QUERY_PARAM]: to.params.id }, + }), + }, + { + path: ':id(\\d+)', + component: AiCatalogFlow, children: [ { - name: AI_CATALOG_FLOWS_ROUTE, - path: '', - component: AiCatalogFlows, - }, - { - name: AI_CATALOG_FLOWS_NEW_ROUTE, - path: 'new', - component: AiCatalogFlowsNew, + name: AI_CATALOG_FLOWS_EDIT_ROUTE, + path: 'edit', + component: AiCatalogFlowsEdit, beforeEnter: requireAuth, meta: { - text: s__('AICatalog|New flow'), + text: s__('AICatalog|Edit flow'), }, }, - // Catch-all route for /flows/:id - redirect to /flows?show=:id - { - path: ':id(\\d+)', - redirect: (to) => ({ - path: '/flows', - query: { [AI_CATALOG_SHOW_QUERY_PARAM]: to.params.id }, - }), - }, - { - path: ':id(\\d+)', - component: AiCatalogFlow, - children: [ - { - name: AI_CATALOG_FLOWS_EDIT_ROUTE, - path: 'edit', - component: AiCatalogFlowsEdit, - beforeEnter: requireAuth, - meta: { - text: s__('AICatalog|Edit flow'), - }, - }, - ], - }, ], }, - ] - : []), + ], + }, + ], { path: '*', redirect: { name: AI_CATALOG_INDEX_ROUTE } }, ], }); diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 33a219117b7f0a7aad7263e95673864485c6174f..e30cf232fd13d9f5db43881500fab8a69f50106a 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -2712,6 +2712,9 @@ msgstr "" msgid "AICatalog|Test run executed successfully, see %{linkStart}Session %{formattedId}%{linkEnd}." msgstr "" +msgid "AICatalog|The Flows feature will be available soon." +msgstr "" + msgid "AICatalog|The agent could not be added to the project. Try again. %{error}" msgstr ""