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 0000000000000000000000000000000000000000..5022e00a956a83894b1b8f1d906c20ef56302613 --- /dev/null +++ b/ee/app/assets/javascripts/ai/components/duo_chat_logging_alert.vue @@ -0,0 +1,117 @@ + + + diff --git a/ee/app/assets/javascripts/ai/constants.js b/ee/app/assets/javascripts/ai/constants.js index 18a76efdd622eb7e690663309a0942376af2cb0c..65638302901b0274e1b2ff0352fe3011af814020 100644 --- a/ee/app/assets/javascripts/ai/constants.js +++ b/ee/app/assets/javascripts/ai/constants.js @@ -56,3 +56,6 @@ export const DUO_WORKFLOW_ADDITIONAL_CONTEXT_REPOSITORY = 'repository'; export const DUO_CURRENT_WORKFLOW_STORAGE_KEY = 'agenticChat.currentWorkflow'; export const DUO_AGENTIC_CHAT_SELECTED_MODEL_KEY = 'agentic-chat-user-selected-model'; +export const DUO_AGENTIC_CHAT_LOGGING_ALERT = 'duo_agentic_chat_logging_alert'; +export const DUO_AGENTIC_CHAT_LOGGING_ALERT_DISMISSED_COOKIE = + 'duo_agentic_chat_logging_alert_dismissed'; 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 41572df1334389e4c830e55220e093272f3b164d..67d1fbada2008dc51537378f33f45c261a1b7b8a 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 @@ -8,7 +8,7 @@ import { renderGFM } from '~/behaviors/markdown/render_gfm'; import { getCookie } from '~/lib/utils/common_utils'; import { getStorageValue, saveStorageValue } from '~/lib/utils/local_storage'; import { duoChatGlobalState } from '~/super_sidebar/constants'; -import { clearDuoChatCommands, setAgenticMode } from 'ee/ai/utils'; +import { clearDuoChatCommands, setAgenticMode, shouldShowLoggingAlert } from 'ee/ai/utils'; import { parseGid, convertToGraphQLId } from '~/graphql_shared/utils'; import { TYPENAME_AI_DUO_WORKFLOW } from '~/graphql_shared/constants'; import { @@ -42,6 +42,7 @@ export default { AgenticDuoChat, GlToggle, ModelSelectDropdown, + DuoChatLoggingAlert: () => import('ee/ai/components/duo_chat_logging_alert.vue'), }, provide() { return { @@ -169,6 +170,9 @@ export default { defaultModel() { return this.mockModelSelectionOptions.find((item) => item.value === GITLAB_DEFAULT_MODEL); }, + shouldShowLoggingAlert() { + return shouldShowLoggingAlert(this.metadata); + }, predefinedPrompts() { return this.contextPresets.questions || []; }, @@ -516,7 +520,11 @@ export default { @thread-selected="onThreadSelected" @back-to-list="onBackToList" @delete-thread="onDeleteThread" - >