From b22d965b7b63557da16514eee1b56d6072c9e0ad Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Thu, 20 Feb 2025 01:39:25 +0530 Subject: [PATCH 1/6] (fix:chatbots) ui --- frontend/src/locale/en.json | 3 +- frontend/src/locale/es.json | 3 +- frontend/src/locale/jp.json | 3 +- frontend/src/locale/ru.json | 3 +- frontend/src/locale/zh-TW.json | 3 +- frontend/src/locale/zh.json | 3 +- frontend/src/settings/APIKeys.tsx | 148 ++++++++++++++-------------- frontend/src/settings/Documents.tsx | 14 ++- 8 files changed, 97 insertions(+), 83 deletions(-) diff --git a/frontend/src/locale/en.json b/frontend/src/locale/en.json index df7895ed..1081ddf0 100644 --- a/frontend/src/locale/en.json +++ b/frontend/src/locale/en.json @@ -81,7 +81,8 @@ "sourceDoc": "Source Document", "createNew": "Create New", "noData": "No existing Chatbots", - "deleteConfirmation": "Are you sure you want to delete the API key '{{name}}'?" + "deleteConfirmation": "Are you sure you want to delete the API key '{{name}}'?", + "description": "Here you can create and manage your chatbots. Chatbots can be deployed to websites as widgets or used inside your applications." }, "analytics": { "label": "Analytics", diff --git a/frontend/src/locale/es.json b/frontend/src/locale/es.json index 123f9fdd..e699a3c6 100644 --- a/frontend/src/locale/es.json +++ b/frontend/src/locale/es.json @@ -81,7 +81,8 @@ "sourceDoc": "Documento Fuente", "createNew": "Crear Nuevo", "noData": "No hay chatbots existentes", - "deleteConfirmation": "¿Estás seguro de que quieres eliminar la clave API '{{name}}'?" + "deleteConfirmation": "¿Estás seguro de que quieres eliminar la clave API '{{name}}'?", + "description": "Aquí puede crear y gestionar sus chatbots. Los chatbots se pueden implementar en sitios web como widgets o utilizarse dentro de sus aplicaciones." }, "analytics": { "label": "Analítica", diff --git a/frontend/src/locale/jp.json b/frontend/src/locale/jp.json index b4cd1531..7c716135 100644 --- a/frontend/src/locale/jp.json +++ b/frontend/src/locale/jp.json @@ -80,7 +80,8 @@ "sourceDoc": "ソースドキュメント", "createNew": "新規作成", "noData": "既存のチャットボットはありません", - "deleteConfirmation": "APIキー '{{name}}' を削除してもよろしいですか?" + "deleteConfirmation": "APIキー '{{name}}' を削除してもよろしいですか?", + "description": "ここでチャットボットを作成・管理できます。チャットボットはウィジェットとしてウェブサイトに導入したり、アプリケーション内で使用したりすることができます。" }, "analytics": { "label": "分析", diff --git a/frontend/src/locale/ru.json b/frontend/src/locale/ru.json index d6bc2bdf..3ec75bfb 100644 --- a/frontend/src/locale/ru.json +++ b/frontend/src/locale/ru.json @@ -81,7 +81,8 @@ "sourceDoc": "Источник документа", "createNew": "Создать новый", "noData": "Нет существующих чатботов", - "deleteConfirmation": "Вы уверены, что хотите удалить API ключ '{{name}}'?" + "deleteConfirmation": "Вы уверены, что хотите удалить API ключ '{{name}}'?", + "description": "Здесь вы можете создавать и управлять чат-ботами. Чат-боты могут быть развернуты на веб-сайтах в виде виджетов или использоваться внутри ваших приложений." }, "analytics": { "label": "Аналитика", diff --git a/frontend/src/locale/zh-TW.json b/frontend/src/locale/zh-TW.json index 8eef9e56..eb0240a0 100644 --- a/frontend/src/locale/zh-TW.json +++ b/frontend/src/locale/zh-TW.json @@ -81,7 +81,8 @@ "sourceDoc": "來源文件", "createNew": "建立新的", "noData": "沒有現有的聊天機器人", - "deleteConfirmation": "您確定要刪除 API 金鑰 '{{name}}' 嗎?" + "deleteConfirmation": "您確定要刪除 API 金鑰 '{{name}}' 嗎?", + "description": "在這裡,您可以創建和管理您的聊天機器人。聊天機器人可以作為小部件部署到網站上,或在您的應用程序中使用。" }, "analytics": { "label": "分析", diff --git a/frontend/src/locale/zh.json b/frontend/src/locale/zh.json index eb9d1e21..245333c3 100644 --- a/frontend/src/locale/zh.json +++ b/frontend/src/locale/zh.json @@ -81,7 +81,8 @@ "sourceDoc": "源文档", "createNew": "创建新的", "noData": "没有现有的聊天机器人", - "deleteConfirmation": "您确定要删除 API 密钥 '{{name}}' 吗?" + "deleteConfirmation": "您确定要删除 API 密钥 '{{name}}' 吗?", + "description": "在这里,您可以创建和管理您的聊天机器人。聊天机器人可以作为小部件部署到网站上,或在您的应用程序中使用。" }, "analytics": { "label": "分析", diff --git a/frontend/src/settings/APIKeys.tsx b/frontend/src/settings/APIKeys.tsx index 642566f1..a81644fa 100644 --- a/frontend/src/settings/APIKeys.tsx +++ b/frontend/src/settings/APIKeys.tsx @@ -98,9 +98,15 @@ export default function APIKeys() { }, []); return ( -
-
-
+
+
+
+

+ {t('settings.apiKeys.description')} +

+
+ +
+ +
+
+ + + + + + + + + + + {loading ? ( + + ) : !apiKeys?.length ? ( + + + + ) : ( + Array.isArray(apiKeys) && + apiKeys.map((element, index) => ( + + + + + + + )) + )} + +
+ {t('settings.apiKeys.name')} + + {t('settings.apiKeys.sourceDoc')} + + {t('settings.apiKeys.key')} + + Actions +
+ {t('settings.apiKeys.noData')} +
{element.name}{element.source} + {element.key} + + {`Delete + setKeyToDelete({ + id: element.id, + name: element.name, + }) + } + /> +
+
+
+ {isCreateModalOpen && ( setKeyToDelete(null)} /> )} -
-
-
-
-
- - - - - - - - - - - {loading ? ( - - ) : !apiKeys?.length ? ( - - - - ) : ( - Array.isArray(apiKeys) && - apiKeys.map((element, index) => ( - - - - - - - )) - )} - -
- {t('settings.apiKeys.name')} - - {t('settings.apiKeys.sourceDoc')} - - {t('settings.apiKeys.key')} -
- {t('settings.apiKeys.noData')} -
{element.name}{element.source}{element.key} - {`Delete - setKeyToDelete({ - id: element.id, - name: element.name, - }) - } - /> -
-
-
-
-
-
); diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx index e72a6e16..d6b7dd3f 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Documents.tsx @@ -183,7 +183,7 @@ export default function Documents({ {t('settings.documents.title')}
-
+