From fa3a9fe70eaef38ec29bab984322492f5b2f7adc Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Tue, 28 May 2024 21:35:10 +0530 Subject: [PATCH] fix: minor changes --- docs/package-lock.json | 169 ------------------------------ frontend/src/Hero.tsx | 7 +- frontend/src/locale/en.json | 75 ++++++------- frontend/src/locale/es.json | 7 +- frontend/src/modals/index.tsx | 5 +- frontend/src/settings/General.tsx | 4 +- 6 files changed, 54 insertions(+), 213 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 9c3b0b36..448e181a 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -4266,69 +4266,6 @@ "node": ">=4" } }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "optional": true, - "peer": true, - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-select/node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "optional": true, - "peer": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/css-select/node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "optional": true, - "peer": true, - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/css-select/node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "optional": true, - "peer": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, "node_modules/css-to-react-native": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", @@ -4339,20 +4276,6 @@ "postcss-value-parser": "^4.0.2" } }, - "node_modules/css-tree": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", - "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", - "optional": true, - "peer": true, - "dependencies": { - "mdn-data": "2.0.30", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" - } - }, "node_modules/css-what": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", @@ -4364,42 +4287,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/csso": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", - "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", - "optional": true, - "peer": true, - "dependencies": { - "css-tree": "~2.2.0" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/csso/node_modules/css-tree": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", - "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", - "optional": true, - "peer": true, - "dependencies": { - "mdn-data": "2.0.28", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/csso/node_modules/mdn-data": { - "version": "2.0.28", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", - "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", - "optional": true, - "peer": true - }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -7078,13 +6965,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdn-data": { - "version": "2.0.30", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "optional": true, - "peer": true - }, "node_modules/mermaid": { "version": "10.6.1", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.6.1.tgz", @@ -11728,42 +11608,6 @@ "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz", "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==" }, - "node_modules/svgo": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.2.0.tgz", - "integrity": "sha512-4PP6CMW/V7l/GmKRKzsLR8xxjdHTV4IMvhTnpuHwwBazSIlw5W/5SmPjN8Dwyt7lKbSJrRDgp4t9ph0HgChFBQ==", - "optional": true, - "peer": true, - "dependencies": { - "@trysound/sax": "0.2.0", - "commander": "^7.2.0", - "css-select": "^5.1.0", - "css-tree": "^2.3.1", - "css-what": "^6.1.0", - "csso": "^5.0.5", - "picocolors": "^1.0.0" - }, - "bin": { - "svgo": "bin/svgo" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/svgo" - } - }, - "node_modules/svgo/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "optional": true, - "peer": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/term-size": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", @@ -11868,19 +11712,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/unified": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index a58327e5..69bf23ac 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -1,3 +1,4 @@ +import { Fragment } from 'react'; import DocsGPT3 from './assets/cute_docsgpt3.svg'; import { useTranslation } from 'react-i18next'; export default function Hero({ @@ -24,10 +25,10 @@ export default function Hero({
{demos?.map( - (demo: { header: string; query: string }) => + (demo: { header: string; query: string }, key: number) => demo.header && demo.query && ( - <> + - + ), )}
diff --git a/frontend/src/locale/en.json b/frontend/src/locale/en.json index 6d4fe8e2..4a427c68 100644 --- a/frontend/src/locale/en.json +++ b/frontend/src/locale/en.json @@ -7,8 +7,8 @@ "inputPlaceholder": "Type your message here...", "tagline": "DocsGPT uses GenAI, please review critial information using sources.", "sourceDocs": "Source Docs", - "none":"None", - "demo":[ + "none": "None", + "demo": [ { "header": "Learn about DocsGPT", "query": "What is DocsGPT?" @@ -55,45 +55,46 @@ "createNew": "Create New" } }, - "modals":{ - "uploadDoc":{ - "label":"Upload New Documentation", - "file":"From File", - "remote":"Remote", - "name":"Name", - "choose":"Choose Files", - "info":"Please upload .pdf, .txt, .rst, .docx, .md, .zip limited to 25mb", - "uploadedFiles":"Uploaded Files", - "cancel":"Cancel", - "train":"Train", - "link":"Link", - "urlLink":"URL Link", - "reddit":{ - "id":"Client ID", - "secret":"Client Secret", - "agent":"User agent", - "searchQueries":"Search queries", - "numberOfPosts":"Number of posts" + "modals": { + "uploadDoc": { + "label": "Upload New Documentation", + "file": "From File", + "remote": "Remote", + "name": "Name", + "choose": "Choose Files", + "info": "Please upload .pdf, .txt, .rst, .docx, .md, .zip limited to 25mb", + "uploadedFiles": "Uploaded Files", + "cancel": "Cancel", + "train": "Train", + "link": "Link", + "urlLink": "URL Link", + "reddit": { + "id": "Client ID", + "secret": "Client Secret", + "agent": "User agent", + "searchQueries": "Search queries", + "numberOfPosts": "Number of posts" } }, - "createAPIKey":{ - "label":"Create New API Key", - "apiKeyName":"API Key Name", - "chunks":"Chunks processed per query", - "prompt":"Select active prompt", - "sourceDoc":"Source document", - "create":"Create" + "createAPIKey": { + "label": "Create New API Key", + "apiKeyName": "API Key Name", + "chunks": "Chunks processed per query", + "prompt": "Select active prompt", + "sourceDoc": "Source document", + "create": "Create" }, - "saveKey":{ - "note":"Please save your Key", - "disclaimer":"This is the only time your key will be shown.", - "copy":"Copy", - "copied":"Copied", - "confirm":"I saved the Key" + "saveKey": { + "note": "Please save your Key", + "disclaimer": "This is the only time your key will be shown.", + "copy": "Copy", + "copied": "Copied", + "confirm": "I saved the Key" }, - "deleteConv":{ - "confirm":"Are you sure you want to delete all the conversations?", - "delete":"Delete" + "deleteConv": { + "confirm": "Are you sure you want to delete all the conversations?", + "delete": "Delete", + "cancel":"Cancel" } } } diff --git a/frontend/src/locale/es.json b/frontend/src/locale/es.json index f643b1d7..820e8b71 100644 --- a/frontend/src/locale/es.json +++ b/frontend/src/locale/es.json @@ -8,6 +8,7 @@ "tagline": "DocsGPT utiliza GenAI, por favor revisa información crítica utilizando fuentes.", "sourceDocs": "Documentos Fuente", "none": "Nada", + "cancel":"Cancelar", "demo": [ { "header": "Aprende sobre DocsGPT", @@ -90,6 +91,10 @@ "copy": "Copiar", "copied": "Copiado", "confirm": "He guardado la Clave" - } + }, + "deleteConv": { + "confirm": "¿Está seguro de que desea eliminar todas las conversaciones?", + "delete": "Eliminar" + } } } diff --git a/frontend/src/modals/index.tsx b/frontend/src/modals/index.tsx index 235162a9..1dcffd6d 100644 --- a/frontend/src/modals/index.tsx +++ b/frontend/src/modals/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; - +import { useTranslation } from 'react-i18next'; interface ModalProps { handleSubmit: () => void; isCancellable: boolean; @@ -12,6 +12,7 @@ interface ModalProps { } const Modal = (props: ModalProps) => { + const { t } = useTranslation(); return (
{ onClick={() => props.handleCancel && props.handleCancel()} className="cursor-pointer rounded-3xl px-5 py-2 text-sm font-medium hover:bg-gray-100 dark:bg-transparent dark:text-light-gray dark:hover:bg-[#767183]/50" > - Cancel + {t('cancel')} )}
diff --git a/frontend/src/settings/General.tsx b/frontend/src/settings/General.tsx index 82693aa1..155a7fc6 100644 --- a/frontend/src/settings/General.tsx +++ b/frontend/src/settings/General.tsx @@ -43,7 +43,9 @@ const General: React.FC = () => { const dispatch = useDispatch(); const locale = localStorage.getItem('docsgpt-locale'); const [selectedLanguage, setSelectedLanguage] = React.useState( - locale ? languageOptions.find((option) => option.value === locale) : 'en', + locale + ? languageOptions.find((option) => option.value === locale) + : languageOptions[0], ); const selectedPrompt = useSelector(selectPrompt);