diff --git a/frontend/src/components/features/chat/chat-interface.tsx b/frontend/src/components/features/chat/chat-interface.tsx index 2799adf31f..41dce4a463 100644 --- a/frontend/src/components/features/chat/chat-interface.tsx +++ b/frontend/src/components/features/chat/chat-interface.tsx @@ -34,6 +34,7 @@ import { useUploadFiles } from "#/hooks/mutation/use-upload-files"; import { useConfig } from "#/hooks/query/use-config"; import { validateFiles } from "#/utils/file-validation"; import { setMessageToSend } from "#/state/conversation-slice"; +import ConfirmationModeEnabled from "./confirmation-mode-enabled"; function getEntryPoint( hasRepository: boolean | null, @@ -209,17 +210,20 @@ export function ChatInterface() {
- {events.length > 0 && ( - - onClickShareFeedbackActionButton("positive") - } - onNegativeFeedback={() => - onClickShareFeedbackActionButton("negative") - } - isSaasMode={config?.APP_MODE === "saas"} - /> - )} +
+ + {events.length > 0 && ( + + onClickShareFeedbackActionButton("positive") + } + onNegativeFeedback={() => + onClickShareFeedbackActionButton("negative") + } + isSaasMode={config?.APP_MODE === "saas"} + /> + )} +
{curAgentState === AgentState.RUNNING && } diff --git a/frontend/src/components/features/chat/confirmation-mode-enabled.tsx b/frontend/src/components/features/chat/confirmation-mode-enabled.tsx new file mode 100644 index 0000000000..6094d9a4c3 --- /dev/null +++ b/frontend/src/components/features/chat/confirmation-mode-enabled.tsx @@ -0,0 +1,29 @@ +import { useTranslation } from "react-i18next"; +import { Tooltip } from "@heroui/react"; +import { I18nKey } from "#/i18n/declaration"; +import LockIcon from "#/icons/lock.svg?react"; +import { useSettings } from "#/hooks/query/use-settings"; + +function ConfirmationModeEnabled() { + const { t } = useTranslation(); + + const { data: settings } = useSettings(); + + if (!settings?.CONFIRMATION_MODE) { + return null; + } + + return ( + +
+ +
+
+ ); +} + +export default ConfirmationModeEnabled; diff --git a/frontend/src/i18n/declaration.ts b/frontend/src/i18n/declaration.ts index d8d31f3977..bbbd083662 100644 --- a/frontend/src/i18n/declaration.ts +++ b/frontend/src/i18n/declaration.ts @@ -910,4 +910,5 @@ export enum I18nKey { COMMON$STOP_RUNTIME = "COMMON$STOP_RUNTIME", COMMON$START_RUNTIME = "COMMON$START_RUNTIME", COMMON$JUPYTER_EMPTY_MESSAGE = "COMMON$JUPYTER_EMPTY_MESSAGE", + COMMON$CONFIRMATION_MODE_ENABLED = "COMMON$CONFIRMATION_MODE_ENABLED", } diff --git a/frontend/src/i18n/translation.json b/frontend/src/i18n/translation.json index 04c5d16233..094ee088f2 100644 --- a/frontend/src/i18n/translation.json +++ b/frontend/src/i18n/translation.json @@ -14558,5 +14558,21 @@ "tr": "Jupyter defteriniz boş. Gösterilecek hücre yok.", "de": "Ihr Jupyter-Notebook ist leer. Keine Zellen zum Anzeigen.", "uk": "Ваш Jupyter-ноутбук порожній. Немає клітинок для відображення." + }, + "COMMON$CONFIRMATION_MODE_ENABLED": { + "en": "Confirmation mode enabled", + "ja": "確認モードが有効になっています", + "zh-CN": "已启用确认模式", + "zh-TW": "已啟用確認模式", + "ko-KR": "확인 모드가 활성화되었습니다", + "no": "Bekreftelsesmodus aktivert", + "it": "Modalità di conferma abilitata", + "pt": "Modo de confirmação ativado", + "es": "Modo de confirmación activado", + "ar": "تم تفعيل وضع التأكيد", + "fr": "Mode de confirmation activé", + "tr": "Onay modu etkinleştirildi", + "de": "Bestätigungsmodus aktiviert", + "uk": "Режим підтвердження увімкнено" } } diff --git a/frontend/src/icons/lock.svg b/frontend/src/icons/lock.svg new file mode 100644 index 0000000000..4e1c35b55a --- /dev/null +++ b/frontend/src/icons/lock.svg @@ -0,0 +1,3 @@ + + +