From 51c7f50a65898ee95a4570d455ac90cf1b6fd73f Mon Sep 17 00:00:00 2001 From: Tomas Bulva Date: Fri, 15 Aug 2025 18:11:19 +0200 Subject: [PATCH] feat: Add alert to inform gitlab team members about logging Added alert message to duo chat that all chats are being logged --- .../ai/components/duo_chat_logging_alert.vue | 129 ++++++++++ ee/app/assets/javascripts/ai/constants.js | 1 + .../ai/duo_agentic_chat/components/app.vue | 10 +- .../javascripts/ai/duo_agentic_chat/index.js | 5 +- .../ai/tanuki_bot/components/app.vue | 13 +- .../assets/javascripts/ai/tanuki_bot/index.js | 4 +- .../views/layouts/_tanuki_bot_chat.html.haml | 3 +- .../components/duo_chat_logging_alert_spec.js | 235 ++++++++++++++++++ .../duo_agentic_chat/components/app_spec.js | 95 +++++-- .../ai/tanuki_bot/components/app_spec.js | 41 ++- locale/gitlab.pot | 18 ++ 11 files changed, 525 insertions(+), 29 deletions(-) create mode 100644 ee/app/assets/javascripts/ai/components/duo_chat_logging_alert.vue create mode 100644 ee/spec/frontend/ai/components/duo_chat_logging_alert_spec.js diff --git a/ee/app/assets/javascripts/ai/components/duo_chat_logging_alert.vue b/ee/app/assets/javascripts/ai/components/duo_chat_logging_alert.vue new file mode 100644 index 00000000000000..883252433d05b9 --- /dev/null +++ b/ee/app/assets/javascripts/ai/components/duo_chat_logging_alert.vue @@ -0,0 +1,129 @@ + + + diff --git a/ee/app/assets/javascripts/ai/constants.js b/ee/app/assets/javascripts/ai/constants.js index a4302c1386245e..069d2d10eac00b 100644 --- a/ee/app/assets/javascripts/ai/constants.js +++ b/ee/app/assets/javascripts/ai/constants.js @@ -49,3 +49,4 @@ export const DUO_WORKFLOW_CLIENT_VERSION = '1.0'; export const DUO_WORKFLOW_STATUS_TOOL_CALL_APPROVAL_REQUIRED = 'TOOL_CALL_APPROVAL_REQUIRED'; export const DUO_WORKFLOW_STATUS_INPUT_REQUIRED = 'INPUT_REQUIRED'; export const DUO_WORKFLOW_ADDITIONAL_CONTEXT_REPOSITORY = 'repository'; +export const DUO_AGENTIC_CHAT_LOGGING_ALERT = 'duo_agentic_chat_logging_alert'; diff --git a/ee/app/assets/javascripts/ai/duo_agentic_chat/components/app.vue b/ee/app/assets/javascripts/ai/duo_agentic_chat/components/app.vue index 9c47de226cd3b7..fc27f02a311953 100644 --- a/ee/app/assets/javascripts/ai/duo_agentic_chat/components/app.vue +++ b/ee/app/assets/javascripts/ai/duo_agentic_chat/components/app.vue @@ -9,6 +9,7 @@ import { getCookie } from '~/lib/utils/common_utils'; import { duoChatGlobalState } from '~/super_sidebar/constants'; import { clearDuoChatCommands, setAgenticMode } from 'ee/ai/utils'; import { parseGid } from '~/graphql_shared/utils'; +import DuoChatLoggingAlert from 'ee/ai/components/duo_chat_logging_alert.vue'; import { GENIE_CHAT_RESET_MESSAGE, GENIE_CHAT_CLEAR_MESSAGE, @@ -32,6 +33,7 @@ export default { components: { AgenticDuoChat, GlToggle, + DuoChatLoggingAlert, }, provide() { return { @@ -55,7 +57,7 @@ export default { default: null, }, metadata: { - type: String, + type: Object, required: false, default: null, }, @@ -450,7 +452,11 @@ export default { @thread-selected="onThreadSelected" @back-to-list="onBackToList" @delete-thread="onDeleteThread" - >