From 592fafd6877477edfabab9aa71693cd562ad31e4 Mon Sep 17 00:00:00 2001 From: vmonakhov Date: Fri, 17 Nov 2023 17:14:38 +0300 Subject: [PATCH] Category 2 --- src/Layout/Routes.js | 4 ++- .../CreatePerspectiveModal/index.js | 2 +- .../DictionaryPropertiesModal/index.js | 6 ++-- .../Home/components/LangsNav/index.js | 2 ++ src/pages/Dashboard/index.js | 34 ++++++++++++++++++- src/pages/DashboardRoute/index.js | 12 ++++--- src/pages/DictionariesAll/index.js | 15 ++++++-- src/pages/LanguagesDatabasesRoute/index.js | 4 +++ 8 files changed, 66 insertions(+), 13 deletions(-) diff --git a/src/Layout/Routes.js b/src/Layout/Routes.js index c2634f6f..524c58b1 100644 --- a/src/Layout/Routes.js +++ b/src/Layout/Routes.js @@ -5,7 +5,7 @@ import { Route, Routes } from "react-router-dom"; import config from "config"; import AuthorsRoute from "pages/AuthorsRoute"; import { CreateCorpus, CreateDictionary } from "pages/CreateDictionary"; -import { CorpusDashboard, DictionaryDashboard } from "pages/Dashboard"; +import { CorpusDashboard, DictionaryDashboard, ParallelCorporaDashboard } from "pages/Dashboard"; import DashboardRoute from "pages/DashboardRoute"; import Desktop from "pages/Desktop"; import DialeqtImport from "pages/DialeqtImport"; @@ -44,10 +44,12 @@ const AppRoutes = () => ( } /> } /> } /> + } /> } /> } /> } /> } /> + } /> } /> } /> } /> diff --git a/src/components/CreatePerspectiveModal/index.js b/src/components/CreatePerspectiveModal/index.js index 44752d7a..e126d172 100644 --- a/src/components/CreatePerspectiveModal/index.js +++ b/src/components/CreatePerspectiveModal/index.js @@ -119,7 +119,7 @@ class CreatePerspectiveModal extends React.Component { this.setState({ diff --git a/src/components/DictionaryPropertiesModal/index.js b/src/components/DictionaryPropertiesModal/index.js index 8cfb5a66..1ed682a7 100644 --- a/src/components/DictionaryPropertiesModal/index.js +++ b/src/components/DictionaryPropertiesModal/index.js @@ -396,10 +396,10 @@ class Properties extends React.Component {
{this.context("Translations")}
- {category === 0 ? ( - - ) : ( + {category === 1 ? ( + ) : ( + )} diff --git a/src/components/Home/components/LangsNav/index.js b/src/components/Home/components/LangsNav/index.js index fc50f206..a7621241 100644 --- a/src/components/Home/components/LangsNav/index.js +++ b/src/components/Home/components/LangsNav/index.js @@ -24,6 +24,8 @@ const prepareData = (resultData, language) => { resultDictsCount.dicts += 1; } else if (item.category === 1) { resultDictsCount.corps += 1; + } else if (item.category === 2) { + resultDictsCount.dicts += 1; } } else if (item.type === "language") { const itemDictsCount = prepareData(resultData, item); diff --git a/src/pages/Dashboard/index.js b/src/pages/Dashboard/index.js index 6f454838..a83d02d9 100644 --- a/src/pages/Dashboard/index.js +++ b/src/pages/Dashboard/index.js @@ -541,6 +541,27 @@ const CORPORA_TABS = getTranslation => { ]; }; +const PARALLEL_CORPORA_TABS = getTranslation => { + return [ + { + menuItem: getTranslation("My dictionaries"), + render: () => ( + + + + ) + }, + { + menuItem: getTranslation("Available dictionaries"), + render: () => ( + + + + ) + } + ]; +}; + const DictionaryDashboard = () => { const getTranslation = useContext(TranslationContext); return ( @@ -561,4 +582,15 @@ const CorpusDashboard = () => { ); }; -export { DictionaryDashboard, CorpusDashboard }; +const ParallelCorporaDashboard = () => { + const getTranslation = useContext(TranslationContext); + return ( +
+ + +
+ ); +}; + + +export { DictionaryDashboard, CorpusDashboard, ParallelCorporaDashboard }; diff --git a/src/pages/DashboardRoute/index.js b/src/pages/DashboardRoute/index.js index 1b9503f1..00a27a73 100644 --- a/src/pages/DashboardRoute/index.js +++ b/src/pages/DashboardRoute/index.js @@ -39,6 +39,14 @@ function DashboardRoute() { + + + + + + + + @@ -47,10 +55,6 @@ function DashboardRoute() { - - - - diff --git a/src/pages/DictionariesAll/index.js b/src/pages/DictionariesAll/index.js index 4d296775..51dfb1c6 100644 --- a/src/pages/DictionariesAll/index.js +++ b/src/pages/DictionariesAll/index.js @@ -184,7 +184,7 @@ const Wrapper = ({ tree, ...rest }) => { }; /** Dashboard dictionaries page */ -const DictionariesAll = ({ forCorpora = false }) => { +const DictionariesAll = ({ forCorpora = false, forParallelCorpora = false }) => { const { getTranslation } = useTranslations(); const [searchParams, setSearchParams] = useSearchParams(); @@ -227,7 +227,12 @@ const DictionariesAll = ({ forCorpora = false }) => { return [mode, tab, id]; }, [searchParams]); - const category = forCorpora ? 1 : 0; + const category = ( + forCorpora + ? 1 + : forParallelCorpora + ? 2 + : 0); const entityIdValue = useMemo(() => { let entityIdValue = null; @@ -521,7 +526,11 @@ const DictionariesAll = ({ forCorpora = false }) => { ) }, { - menuItem: getTranslation(forCorpora ? "Corpora" : "Dictionaries"), + menuItem: getTranslation(forCorpora + ? "Corpora" + : forParallelCorpora + ? "Parallel corpora" + : "Dictionaries"), render: () => ( diff --git a/src/pages/LanguagesDatabasesRoute/index.js b/src/pages/LanguagesDatabasesRoute/index.js index 8554fe53..c257faa6 100644 --- a/src/pages/LanguagesDatabasesRoute/index.js +++ b/src/pages/LanguagesDatabasesRoute/index.js @@ -27,6 +27,10 @@ function TreeRoute() { + + + +