From d0b7526204eb06bfc10e6ee957113858c69f99c2 Mon Sep 17 00:00:00 2001
From: Allison Villa
Date: Thu, 11 Dec 2025 17:47:23 -0500
Subject: [PATCH 1/5] Update option descriptions in delete modal
Resolve conflicts
---
.../components/ai_catalog_item_actions.vue | 25 ++++++++++++-----
.../javascripts/ai/catalog/constants.js | 10 +++----
.../ai_catalog_item_actions_spec.js | 14 ++++++++++
locale/gitlab.pot | 27 ++++++++++---------
4 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
index a2292fef01426b..ac8cca71d7d494 100644
--- a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
+++ b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
@@ -207,11 +207,16 @@ export default {
page: TRACK_EVENT_PAGE_SHOW,
});
},
+ openDeleteModal() {
+ this.forceHardDelete = this.canHardDelete;
+ this.showDeleteModal = true;
+ },
},
DELETE_OPTIONS,
adminModeDocsLink: helpPagePath('/administration/settings/sign_in_restrictions', {
anchor: 'admin-mode',
}),
+ graphqlApiDocsLink: helpPagePath('/api/graphql/_index.md'),
};
@@ -308,7 +313,7 @@ export default {
v-if="canAdmin"
variant="danger"
data-testid="delete-button"
- @action="showDeleteModal = true"
+ @action="openDeleteModal"
>
@@ -339,7 +344,17 @@ export default {
{{ s__('AICatalog|Deletion method') }}
- {{ s__('AICatalog|You can also use the GraphQL API to delete items.') }}
+
+
+ {{ content }}
+
+
{{ option.text }}
-
-
- {{ content }}
-
-
+
diff --git a/ee/app/assets/javascripts/ai/catalog/constants.js b/ee/app/assets/javascripts/ai/catalog/constants.js
index 6ecad310b2b0f5..f6963fb2cfed72 100644
--- a/ee/app/assets/javascripts/ai/catalog/constants.js
+++ b/ee/app/assets/javascripts/ai/catalog/constants.js
@@ -151,16 +151,14 @@ export const AI_CATALOG_ITEM_TYPE_APOLLO_CONFIG = {
export const DELETE_OPTIONS = [
{
value: true,
- text: s__('AICatalog|Hard delete (Recommended)'),
- help: s__(
- 'AICatalog|Permanently deletes the item from the catalog. This action cannot be undone. You must be in %{linkStart}Admin Mode%{linkEnd}.',
- ),
+ text: s__('AICatalog|Delete permanently'),
+ help: s__('AICatalog|This action cannot be undone.'),
},
{
value: false,
- text: s__('AICatalog|Soft delete'),
+ text: s__('AICatalog|Hide from the AI Catalog'),
help: s__(
- 'AICatalog|The item will be hidden from the catalog but remain functional for projects and groups already using it.',
+ 'AICatalog|Users can continue to use the item in the groups and projects it is enabled in.',
),
},
];
diff --git a/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js b/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
index 225a529a6bdf0d..8307e1ca357b8b 100644
--- a/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
+++ b/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
@@ -393,6 +393,20 @@ describe('AiCatalogItemActions', () => {
expect(findDeleteModal().findComponent(GlFormRadioGroup).exists()).toBe(false);
});
+
+ it('calls deleteFn with forceHardDelete set to false', async () => {
+ findDeleteButton().vm.$emit('action');
+
+ await nextTick();
+
+ const deleteModal = findDeleteModal();
+ const actionFn = deleteModal.props('actionFn');
+ await actionFn();
+
+ await nextTick();
+
+ expect(defaultProps.deleteFn).toHaveBeenCalledWith(false);
+ });
});
});
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 27ff1c676bb919..087093ec5a2c3e 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -2622,6 +2622,9 @@ msgstr ""
msgid "AICatalog|Choose what events in this project trigger the %{itemType}. You can change this later."
msgstr ""
+msgid "AICatalog|Choose whether to delete or hide this item. You can also use the %{linkStart}GraphQL API%{linkEnd} to delete an item."
+msgstr ""
+
msgid "AICatalog|Choose who can view and interact with this agent."
msgstr ""
@@ -2712,6 +2715,9 @@ msgstr ""
msgid "AICatalog|Delete %{itemType}"
msgstr ""
+msgid "AICatalog|Delete permanently"
+msgstr ""
+
msgid "AICatalog|Deletion method"
msgstr ""
@@ -2892,7 +2898,7 @@ msgstr ""
msgid "AICatalog|Group is required."
msgstr ""
-msgid "AICatalog|Hard delete (Recommended)"
+msgid "AICatalog|Hide from the AI Catalog"
msgstr ""
msgid "AICatalog|Hypothetical or low risk security flaws that could be exploited."
@@ -2973,9 +2979,6 @@ msgstr ""
msgid "AICatalog|Other"
msgstr ""
-msgid "AICatalog|Permanently deletes the item from the catalog. This action cannot be undone. You must be in %{linkStart}Admin Mode%{linkEnd}."
-msgstr ""
-
msgid "AICatalog|Please describe below."
msgstr ""
@@ -3054,9 +3057,6 @@ msgstr ""
msgid "AICatalog|Shared resources."
msgstr ""
-msgid "AICatalog|Soft delete"
-msgstr ""
-
msgid "AICatalog|Spam or low quality"
msgstr ""
@@ -3075,9 +3075,6 @@ msgstr ""
msgid "AICatalog|The item consumer must belong to only one organization, group, or project"
msgstr ""
-msgid "AICatalog|The item will be hidden from the catalog but remain functional for projects and groups already using it."
-msgstr ""
-
msgid "AICatalog|The service account is part of a composite identity that runs the agent. This identity combines the user's role with the service account's role and uses the more restrictive of the two."
msgstr ""
@@ -3105,6 +3102,9 @@ msgstr ""
msgid "AICatalog|This YAML configuration file determines the prompts, tools, and capabilities of your flow. Required properties: version, environment, components, prompts, routers, flow."
msgstr ""
+msgid "AICatalog|This action cannot be undone."
+msgstr ""
+
msgid "AICatalog|This agent can be viewed only by members of this project, or by users with the Owner role for the top-level group. This agent can't be shared with other projects."
msgstr ""
@@ -3177,7 +3177,11 @@ msgstr ""
msgid "AICatalog|Use flows in your %{namespaceType}."
msgstr ""
+<<<<<<< HEAD
msgid "AICatalog|Use flows to automate complex, multi-step tasks."
+=======
+msgid "AICatalog|Users can continue to use the item in the groups and projects it is enabled in."
+>>>>>>> f2276f5a21e1 (Update option descriptions in delete modal)
msgstr ""
msgid "AICatalog|View enabled version"
@@ -3216,9 +3220,6 @@ msgstr ""
msgid "AICatalog|You are an expert in [domain]. Your communication style is [style]. When helping users, you should always... Your key strengths include... You approach problems by..."
msgstr ""
-msgid "AICatalog|You can also use the GraphQL API to delete items."
-msgstr ""
-
msgid "AICatalog|You must have the Owner role to add a flow to a group. Only top-level groups are shown."
msgstr ""
--
GitLab
From b24db36c7265d231f1010df05d4f6eadb2ecf858 Mon Sep 17 00:00:00 2001
From: Allison Villa
Date: Mon, 15 Dec 2025 12:04:18 -0500
Subject: [PATCH 2/5] Remove reference to GraphQL API option
---
.../catalog/components/ai_catalog_item_actions.vue | 12 +-----------
locale/gitlab.pot | 2 +-
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
index ac8cca71d7d494..25d9110b822385 100644
--- a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
+++ b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
@@ -344,17 +344,7 @@ export default {
{{ s__('AICatalog|Deletion method') }}
-
-
- {{ content }}
-
-
+
Date: Mon, 15 Dec 2025 13:25:04 -0500
Subject: [PATCH 3/5] Add test for default radio button
---
.../catalog/components/ai_catalog_item_actions_spec.js | 9 +++++++++
locale/gitlab.pot | 5 ++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js b/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
index 8307e1ca357b8b..cb8d622bb01ace 100644
--- a/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
+++ b/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
@@ -369,6 +369,15 @@ describe('AiCatalogItemActions', () => {
expect(findDeleteModal().exists()).toBe(true);
expect(findDeleteModal().findComponent(GlFormRadioGroup).exists()).toBe(true);
});
+
+ it('displays deletion method radio buttons with hard delete option selected', async () => {
+ wrapper.vm.openDeleteModal();
+
+ await nextTick();
+
+ const radioGroup = findDeleteModal().findComponent(GlFormRadioGroup);
+ expect(radioGroup.attributes('checked')).toBe('true');
+ });
});
describe('when user cannot hard delete', () => {
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index e99c2bb8a7e1d2..6ef39e0d431c4d 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -3177,11 +3177,10 @@ msgstr ""
msgid "AICatalog|Use flows in your %{namespaceType}."
msgstr ""
-<<<<<<< HEAD
msgid "AICatalog|Use flows to automate complex, multi-step tasks."
-=======
+msgstr ""
+
msgid "AICatalog|Users can continue to use the item in the groups and projects it is enabled in."
->>>>>>> f2276f5a21e1 (Update option descriptions in delete modal)
msgstr ""
msgid "AICatalog|View enabled version"
--
GitLab
From 5e25c781306e5c45a31e2f57c6d5e24a9309261a Mon Sep 17 00:00:00 2001
From: Allison Villa
Date: Tue, 16 Dec 2025 16:57:29 -0500
Subject: [PATCH 4/5] Clean up options text and tests
---
.../components/ai_catalog_item_actions.vue | 9 ++--
.../ai_catalog_item_actions_spec.js | 53 ++++++++++++++-----
locale/gitlab.pot | 2 +-
3 files changed, 46 insertions(+), 18 deletions(-)
diff --git a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
index 25d9110b822385..41eefb3dddc6f2 100644
--- a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
+++ b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
@@ -216,7 +216,6 @@ export default {
adminModeDocsLink: helpPagePath('/administration/settings/sign_in_restrictions', {
anchor: 'admin-mode',
}),
- graphqlApiDocsLink: helpPagePath('/api/graphql/_index.md'),
};
@@ -344,7 +343,11 @@ export default {
{{ s__('AICatalog|Deletion method') }}
-
+
+ {{ itemTypeLabel }}
+
{{ option.text }}
-
+ {{ option.help }}
diff --git a/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js b/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
index cb8d622bb01ace..48d6a73859d781 100644
--- a/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
+++ b/ee/spec/frontend/ai/catalog/components/ai_catalog_item_actions_spec.js
@@ -66,6 +66,11 @@ describe('AiCatalogItemActions', () => {
const findDeleteButton = () => wrapper.findByTestId('delete-button');
const findDeleteModal = () => wrapper.findByTestId('delete-item-modal');
+ const openDeleteModal = async () => {
+ findDeleteButton().vm.$emit('action');
+ await nextTick();
+ };
+
describe('when user can report item', () => {
beforeEach(() => {
createComponent({
@@ -362,22 +367,48 @@ describe('AiCatalogItemActions', () => {
});
it('displays deletion method radio buttons', async () => {
- findDeleteButton().vm.$emit('action');
-
- await nextTick();
+ await openDeleteModal();
expect(findDeleteModal().exists()).toBe(true);
expect(findDeleteModal().findComponent(GlFormRadioGroup).exists()).toBe(true);
});
it('displays deletion method radio buttons with hard delete option selected', async () => {
- wrapper.vm.openDeleteModal();
-
- await nextTick();
+ await openDeleteModal();
const radioGroup = findDeleteModal().findComponent(GlFormRadioGroup);
expect(radioGroup.attributes('checked')).toBe('true');
});
+
+ it('calls deleteFn with forceHardDelete set to true if hard delete is selected', async () => {
+ await openDeleteModal();
+
+ const deleteModal = findDeleteModal();
+ const radioGroup = deleteModal.findComponent(GlFormRadioGroup);
+ radioGroup.vm.$emit('input', true);
+
+ await nextTick();
+
+ const actionFn = deleteModal.props('actionFn');
+ await actionFn();
+
+ expect(defaultProps.deleteFn).toHaveBeenCalledWith(true);
+ });
+
+ it('calls deleteFn with forceHardDelete set to false if soft delete is selected', async () => {
+ await openDeleteModal();
+
+ const deleteModal = findDeleteModal();
+ const radioGroup = deleteModal.findComponent(GlFormRadioGroup);
+ radioGroup.vm.$emit('input', false);
+
+ await nextTick();
+
+ const actionFn = deleteModal.props('actionFn');
+ await actionFn();
+
+ expect(defaultProps.deleteFn).toHaveBeenCalledWith(false);
+ });
});
describe('when user cannot hard delete', () => {
@@ -396,24 +427,18 @@ describe('AiCatalogItemActions', () => {
});
it('does not display deletion method radio buttons', async () => {
- findDeleteButton().vm.$emit('action');
-
- await nextTick();
+ await openDeleteModal();
expect(findDeleteModal().findComponent(GlFormRadioGroup).exists()).toBe(false);
});
it('calls deleteFn with forceHardDelete set to false', async () => {
- findDeleteButton().vm.$emit('action');
-
- await nextTick();
+ await openDeleteModal();
const deleteModal = findDeleteModal();
const actionFn = deleteModal.props('actionFn');
await actionFn();
- await nextTick();
-
expect(defaultProps.deleteFn).toHaveBeenCalledWith(false);
});
});
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 6ef39e0d431c4d..e0166f5fc8fa1c 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -2622,7 +2622,7 @@ msgstr ""
msgid "AICatalog|Choose what events in this project trigger the %{itemType}. You can change this later."
msgstr ""
-msgid "AICatalog|Choose whether to delete or hide this item."
+msgid "AICatalog|Choose whether to delete or hide this %{itemType}."
msgstr ""
msgid "AICatalog|Choose who can view and interact with this agent."
--
GitLab
From a068f6197b159045c1f45f01267b5afbd074cc29 Mon Sep 17 00:00:00 2001
From: Allison Villa
Date: Wed, 17 Dec 2025 10:50:05 -0500
Subject: [PATCH 5/5] Show dynamic item type in help text
---
.../catalog/components/ai_catalog_item_actions.vue | 10 ++++------
ee/app/assets/javascripts/ai/catalog/constants.js | 12 +++++++-----
locale/gitlab.pot | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
index 41eefb3dddc6f2..95dd0aabb723e1 100644
--- a/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
+++ b/ee/app/assets/javascripts/ai/catalog/components/ai_catalog_item_actions.vue
@@ -198,6 +198,9 @@ export default {
}
: { isProjectNamespace: this.showEnable };
},
+ deleteOptions() {
+ return DELETE_OPTIONS(this.itemTypeLabel);
+ },
},
methods: {
onClickEnable() {
@@ -212,7 +215,6 @@ export default {
this.showDeleteModal = true;
},
},
- DELETE_OPTIONS,
adminModeDocsLink: helpPagePath('/administration/settings/sign_in_restrictions', {
anchor: 'admin-mode',
}),
@@ -350,11 +352,7 @@ export default {
-
+
{{ option.text }}
{{ option.help }}
diff --git a/ee/app/assets/javascripts/ai/catalog/constants.js b/ee/app/assets/javascripts/ai/catalog/constants.js
index f6963fb2cfed72..e037f3fe2e27ee 100644
--- a/ee/app/assets/javascripts/ai/catalog/constants.js
+++ b/ee/app/assets/javascripts/ai/catalog/constants.js
@@ -1,5 +1,4 @@
-import { __, s__ } from '~/locale';
-
+import { __, s__, sprintf } from '~/locale';
import {
VISIBILITY_LEVEL_PUBLIC_STRING,
VISIBILITY_LEVEL_PRIVATE_STRING,
@@ -148,7 +147,7 @@ export const AI_CATALOG_ITEM_TYPE_APOLLO_CONFIG = {
},
};
-export const DELETE_OPTIONS = [
+export const DELETE_OPTIONS = (itemTypeLabel) => [
{
value: true,
text: s__('AICatalog|Delete permanently'),
@@ -157,8 +156,11 @@ export const DELETE_OPTIONS = [
{
value: false,
text: s__('AICatalog|Hide from the AI Catalog'),
- help: s__(
- 'AICatalog|Users can continue to use the item in the groups and projects it is enabled in.',
+ help: sprintf(
+ s__(
+ 'AICatalog|Users can continue to use the %{itemType} in the groups and projects it is enabled in.',
+ ),
+ { itemType: itemTypeLabel },
),
},
];
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index e0166f5fc8fa1c..551c7cffa9f33e 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -3180,7 +3180,7 @@ msgstr ""
msgid "AICatalog|Use flows to automate complex, multi-step tasks."
msgstr ""
-msgid "AICatalog|Users can continue to use the item in the groups and projects it is enabled in."
+msgid "AICatalog|Users can continue to use the %{itemType} in the groups and projects it is enabled in."
msgstr ""
msgid "AICatalog|View enabled version"
--
GitLab