From 4551e8abeadcb7bddf717f641fc5df156e6b14e2 Mon Sep 17 00:00:00 2001 From: tfhuhtal Date: Thu, 24 Oct 2024 14:09:55 +0300 Subject: [PATCH] fixed comparison page --- .../ComparisonPage/CompareByFaculty.js | 29 ++++++++++++------- .../ComparisonPage/CompareByYear.js | 12 ++++---- .../components/ComparisonPage/FilterTray.js | 15 +++++++--- client/components/ComparisonPage/index.js | 17 +++++------ client/components/Generic/FormFilter.js | 23 +++++++++++++-- client/components/Generic/Generic.scss | 19 ++++++------ 6 files changed, 74 insertions(+), 41 deletions(-) diff --git a/client/components/ComparisonPage/CompareByFaculty.js b/client/components/ComparisonPage/CompareByFaculty.js index 4e4e75fe..14608c6b 100644 --- a/client/components/ComparisonPage/CompareByFaculty.js +++ b/client/components/ComparisonPage/CompareByFaculty.js @@ -77,15 +77,21 @@ const CompareByFaculty = ({ questionsList, usersProgrammes, allAnswers }) => {
- - + + + + - + +
+ +
+
-
+
{
- {filters.form !== formKeys.EVALUATION_FACULTIES && ( - - )} - {t('comparison:noAccessToAll')} - {faculty[0] !== 'allFaculties' && (level === 'doctoral' || level === 'master' || level === 'bachelor') && ( - - )} +
+ {filters.form !== formKeys.EVALUATION_FACULTIES && ( + + )} + {t('comparison:noAccessToAll')} + {faculty[0] !== 'allFaculties' && + (level === 'doctoral' || level === 'master' || level === 'bachelor') && } +
+
+ - - + - - + +
+ +
{data.length > 0 ? ( diff --git a/client/components/ComparisonPage/FilterTray.js b/client/components/ComparisonPage/FilterTray.js index 7ba97155..da5ab488 100644 --- a/client/components/ComparisonPage/FilterTray.js +++ b/client/components/ComparisonPage/FilterTray.js @@ -1,5 +1,6 @@ import React from 'react' import { useSelector } from 'react-redux' +import { Menu } from 'semantic-ui-react' import { useTranslation } from 'react-i18next' import YearSelector from 'Components/Generic/YearSelector' @@ -67,16 +68,22 @@ const FilterTray = ({ filter, setFilter }) => { } return ( <> - - + + + + + + + + {usersProgrammes && ( - <> +
{getFacultyFilter({ form, t })} {getLevelFilter({ form })} {getCompanionFilter({ faculty, level })} {getDoctoralSchoolFilter({ faculty, level })} {getProgrammeFilter({ form, filter, t, handleSearch, setFilter })} - +
)} ) diff --git a/client/components/ComparisonPage/index.js b/client/components/ComparisonPage/index.js index e38c43f6..88807190 100644 --- a/client/components/ComparisonPage/index.js +++ b/client/components/ComparisonPage/index.js @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useHistory } from 'react-router' import { Link } from 'react-router-dom' -import { Button, Icon, Grid, Tab } from 'semantic-ui-react' +import { Button, Menu, Tab } from 'semantic-ui-react' import { useTranslation } from 'react-i18next' import NoPermissions from 'Components/Generic/NoPermissions' import { formKeys } from '@root/config/data' @@ -195,15 +195,14 @@ export default () => { return (
- - - + + +
) diff --git a/client/components/Generic/FormFilter.js b/client/components/Generic/FormFilter.js index 8b73be86..bcd61ade 100644 --- a/client/components/Generic/FormFilter.js +++ b/client/components/Generic/FormFilter.js @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import { setForm } from 'Utilities/redux/filterReducer' import './Generic.scss' -const FormFilter = ({ version = null }) => { +const FormFilter = ({ version = null, comparison = false }) => { const dispatch = useDispatch() const { t } = useTranslation() const [options, setOptions] = useState([ @@ -31,9 +31,26 @@ const FormFilter = ({ version = null }) => { dispatch(setForm(value)) } + if (comparison) + return ( +
+ + label { - // font-size: 1.05em; - // margin-bottom: 0.5em; - display: flex; - align-items: center; - // } + margin: 2em 0em 0.5em 0em; + > label { + font-size: 1.05em; + margin-bottom: 0.5em; + display: block; + } } @mixin filter-no-margin-top { @@ -137,10 +136,12 @@ width: 300px; } &-small { - @include filter-basics; - width: 300px; + display: flex; + align-items: center; } &-large { + @include filter-basics; + width: 100%; } }