diff --git a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_agent_form.vue b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_agent_form.vue index 492e59ca6501e37574938c89d6636c0927bcc9a4..447ea712164140ea286cf6498f2b883e22cd9e05 100644 --- a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_agent_form.vue +++ b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_agent_form.vue @@ -1,10 +1,20 @@ + + + + + diff --git a/ee/app/assets/javascripts/ai/catalog/components/form_project_dropdown.vue b/ee/app/assets/javascripts/ai/catalog/components/form_project_dropdown.vue index 3a4bdb7836bbe955510c18e9b4d949c4cf8a137d..836e47f21d0fe78d629f84c0d226ffe415a5acde 100644 --- a/ee/app/assets/javascripts/ai/catalog/components/form_project_dropdown.vue +++ b/ee/app/assets/javascripts/ai/catalog/components/form_project_dropdown.vue @@ -28,6 +28,10 @@ export default { required: false, default: null, }, + disabled: { + type: Boolean, + required: true, + }, }, data() { return { @@ -157,6 +161,7 @@ export default { is-check-centered :infinite-scroll="hasNextPage" :infinite-scroll-loading="isLoadingMore" + :disabled="disabled" data-testid="project-select" @bottom-reached="onBottomReached" @search="onSearch" diff --git a/ee/app/assets/javascripts/ai/catalog/components/form_section.vue b/ee/app/assets/javascripts/ai/catalog/components/form_section.vue new file mode 100644 index 0000000000000000000000000000000000000000..d3711f5f5415b3b364f730e9ad76b3208d26fedd --- /dev/null +++ b/ee/app/assets/javascripts/ai/catalog/components/form_section.vue @@ -0,0 +1,5 @@ + + + + + diff --git a/ee/app/assets/javascripts/ai/catalog/components/visibility_level_radio_group.vue b/ee/app/assets/javascripts/ai/catalog/components/visibility_level_radio_group.vue index 5e6b7a80e981c0219d6255e99d925dd1ce99efd1..cfe6ec858f85756e044eede8470a9d999a58c84c 100644 --- a/ee/app/assets/javascripts/ai/catalog/components/visibility_level_radio_group.vue +++ b/ee/app/assets/javascripts/ai/catalog/components/visibility_level_radio_group.vue @@ -45,6 +45,10 @@ export default { type: Number, required: true, }, + disabled: { + type: Boolean, + required: true, + }, }, computed: { @@ -84,6 +88,7 @@ export default { :id="id" :state="validationState" :checked="value" + :disabled="disabled" @input="(value) => $emit('input', value)" > +import { GlLoadingIcon } from '@gitlab/ui'; +import { convertToGraphQLId } from '~/graphql_shared/utils'; +import aiCatalogAgentQuery from 'ee/ai/catalog/graphql/queries/ai_catalog_agent.query.graphql'; +import { TYPENAME_AI_CATALOG_ITEM } from 'ee/graphql_shared/constants'; +import AiAgentEditWrapper from './ai_agent_edit_wrapper.vue'; + +export default { + name: 'AiCatalogAgentsEdit', + components: { + AiAgentEditWrapper, + GlLoadingIcon, + }, + data() { + return { + aiCatalogAgent: null, + }; + }, + apollo: { + aiCatalogAgent: { + query: aiCatalogAgentQuery, + variables() { + return { + id: convertToGraphQLId(TYPENAME_AI_CATALOG_ITEM, this.$route.params.id), + }; + }, + update(data) { + return data?.aiCatalogItem || {}; + }, + error() { + // todo + }, + }, + }, + computed: { + isLoading() { + return this.$apollo.queries.aiCatalogAgent.loading; + }, + }, +}; + + + + + + + + diff --git a/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_edit_wrapper.vue b/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_edit_wrapper.vue new file mode 100644 index 0000000000000000000000000000000000000000..8056b77f4e0cdbbe7fb806c27e981c83008bfc3f --- /dev/null +++ b/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_edit_wrapper.vue @@ -0,0 +1,91 @@ + + + + + + + diff --git a/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_view.vue b/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_view.vue new file mode 100644 index 0000000000000000000000000000000000000000..fc1944f56d14867f5d6215ba9e122f8fb408c176 --- /dev/null +++ b/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_view.vue @@ -0,0 +1,48 @@ + + + + + + + + diff --git a/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_view_wrapper.vue b/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_view_wrapper.vue new file mode 100644 index 0000000000000000000000000000000000000000..b178d824cc90ee9b8256803970835587f9ecdd41 --- /dev/null +++ b/ee/app/assets/javascripts/ai/catalog/pages/agents/ai_agent_view_wrapper.vue @@ -0,0 +1,86 @@ + + + + + + + diff --git a/ee/app/assets/javascripts/ai/catalog/pages/ai_catalog_agents_new.vue b/ee/app/assets/javascripts/ai/catalog/pages/ai_catalog_agents_new.vue index 4f7adc516c966f586c5e36ca6abac792267695d8..929833c53d3640729f65e3d95dd245207d9f6756 100644 --- a/ee/app/assets/javascripts/ai/catalog/pages/ai_catalog_agents_new.vue +++ b/ee/app/assets/javascripts/ai/catalog/pages/ai_catalog_agents_new.vue @@ -2,7 +2,6 @@ import { s__, sprintf } from '~/locale'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { helpPagePath } from '~/helpers/help_page_helper'; -import PageHeading from '~/vue_shared/components/page_heading.vue'; import * as Sentry from '~/sentry/sentry_browser_wrapper'; import createAiCatalogAgent from '../graphql/mutations/create_ai_catalog_agent.mutation.graphql'; import { AI_CATALOG_AGENTS_ROUTE, AI_CATALOG_SHOW_QUERY_PARAM } from '../router/constants'; @@ -12,7 +11,6 @@ export default { name: 'AiCatalogAgentsNew', components: { AiCatalogAgentForm, - PageHeading, }, data() { return { @@ -75,14 +73,6 @@ export default { - - - - {{ s__('AICatalog|AI agents complete specialized tasks.') }} - - - - { }, }, // Catch-all route for /agents/:id - redirect to /agents?show=:id + // { + // path: ':id(\\d+)', + // redirect: (to) => ({ + // path: '/agents', + // query: { [AI_CATALOG_SHOW_QUERY_PARAM]: to.params.id }, + // }), + // }, { + name: AI_CATALOG_AGENTS_VIEW_ROUTE, path: ':id(\\d+)', - redirect: (to) => ({ - path: '/agents', - query: { [AI_CATALOG_SHOW_QUERY_PARAM]: to.params.id }, - }), + component: AgentView, }, { - path: ':id(\\d+)', - component: AiCatalogAgent, - children: [ - { - name: AI_CATALOG_AGENTS_EDIT_ROUTE, - path: 'edit', - component: AiCatalogAgentsEdit, - beforeEnter: requireAuth, - meta: { - text: s__('AICatalog|Edit agent'), - }, - }, - { - name: AI_CATALOG_AGENTS_RUN_ROUTE, - path: 'run', - component: AiCatalogAgentsRun, - beforeEnter: requireAuth, - meta: { - text: s__('AICatalog|Run agent'), - }, - }, - { - name: AI_CATALOG_AGENTS_DUPLICATE_ROUTE, - path: 'duplicate', - component: AiCatalogAgentsDuplicate, - beforeEnter: requireAuth, - meta: { - text: s__('AICatalog|Duplicate agent'), - }, - }, - ], + name: AI_CATALOG_AGENTS_EDIT_ROUTE, + path: ':id(\\d+)/edit', + component: AgentEdit, + beforeEnter: requireAuth, + meta: { + text: s__('AICatalog|Edit agent'), + }, + }, + { + name: AI_CATALOG_AGENTS_RUN_ROUTE, + path: ':id(\\d+)/run', + component: AiCatalogAgentsRun, + beforeEnter: requireAuth, + meta: { + text: s__('AICatalog|Run agent'), + }, + }, + { + name: AI_CATALOG_AGENTS_DUPLICATE_ROUTE, + path: ':id(\\d+)/duplicate', + component: AiCatalogAgentsDuplicate, + beforeEnter: requireAuth, + meta: { + text: s__('AICatalog|Duplicate agent'), + }, }, ], }, diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 2744e5762cf80a920b8b82ae85e16d0f888782d2..f89e22049b62facde2e8a1c0a3484f19f2275be4 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -2453,9 +2453,6 @@ msgstr "" msgid "AICatalog|AI Catalog" msgstr "" -msgid "AICatalog|AI agents complete specialized tasks." -msgstr "" - msgid "AICatalog|Add this %{itemType} to a project" msgstr "" @@ -2489,6 +2486,9 @@ msgstr "" msgid "AICatalog|Agents" msgstr "" +msgid "AICatalog|Agents can be used in chat or flows" +msgstr "" + msgid "AICatalog|Always use latest version" msgstr "" @@ -2645,6 +2645,9 @@ msgstr "" msgid "AICatalog|Input cannot exceed %{value} characters. Please shorten your input." msgstr "" +msgid "AICatalog|Let us open the Duo Chat and test run the agent!" +msgstr "" + msgid "AICatalog|Modify the agent settings and configuration." msgstr "" @@ -2705,6 +2708,9 @@ msgstr "" msgid "AICatalog|Save changes" msgstr "" +msgid "AICatalog|Save your configuration changes before running tests. The Test Run button will be enabled after saving." +msgstr "" + msgid "AICatalog|Search and select tools for this agent." msgstr "" @@ -2732,6 +2738,9 @@ msgstr "" msgid "AICatalog|System prompt is required." msgstr "" +msgid "AICatalog|Test" +msgstr "" + msgid "AICatalog|Test run" msgstr "" @@ -2762,6 +2771,9 @@ msgstr "" msgid "AICatalog|The test run failed. %{error}" msgstr "" +msgid "AICatalog|These settings will be applied when you click \"Test Run\" to deploy and test your agent" +msgstr "" + msgid "AICatalog|This %{itemType} is private and can only be added to the project it was created in. Duplicate the agent to use the same configuration in other projects." msgstr ""