diff --git a/client/.env b/client/.env index 649c09c7..ae81a74c 100644 --- a/client/.env +++ b/client/.env @@ -5,6 +5,6 @@ VITE_APP_TAG_LIMIT=3 VITE_DESCRIPTION="Retrieve the scholarly works of your institution" VITE_GIT_REPOSITORY_URL="https://github.com/dataesr/works-magnet" VITE_HEADER_TAG=dev -VITE_HEADER_TAG_COLOR="green-emeraude" -VITE_MINISTER_NAME="Minisère de l'enseignement supérieur et de la recherche" +VITE_HEADER_TAG_COLOR="new" +VITE_MINISTER_NAME="Minisère de
l'enseignement
supérieur
et de la recherche" VITE_VERSION=$npm_package_version \ No newline at end of file diff --git a/client/src/components/spinner/index.jsx b/client/src/components/spinner/index.jsx deleted file mode 100644 index f98c8593..00000000 --- a/client/src/components/spinner/index.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import PropTypes from 'prop-types'; -import React, { useEffect, useId } from 'react'; - -import { Row } from '@dataesr/dsfr-plus'; - -import './index.scss'; - -function Spinner({ size }) { - const id = useId(); - useEffect(() => { - document.getElementById(id).style.setProperty('width', `${size}px`); - document.getElementById(id).style.setProperty('height', `${size}px`); - }, [size, id]); - - return ( - - - - - ); -} -Spinner.propTypes = { - size: PropTypes.number, -}; -Spinner.defaultProps = { - size: 48, -}; - -function PageSpinner({ size }) { - return ; -} -PageSpinner.propTypes = { - size: PropTypes.number, -}; - -PageSpinner.defaultProps = { - size: 48, -}; - -export { PageSpinner }; diff --git a/client/src/components/spinner/index.scss b/client/src/components/spinner/index.scss deleted file mode 100644 index 39df5570..00000000 --- a/client/src/components/spinner/index.scss +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Styled conponents loading spinner. - * credits to jdacosta from https://codepen.io/jdacosta/pen/dobzpM - */ - - .flex--space-around { - justify-content: space-around !important; -} - -.fullwidth { - width: 100%; -} - -.spinner { - @keyframes internal { - 0% { - stroke-dashoffset: 187; - } - - 25% { - stroke-dashoffset: 80; - } - - 100% { - stroke-dashoffset: 187; - transform: rotate(360deg); - } - } - - @keyframes external { - 0% { - stroke-dashoffset: 312; - transform: rotate(70deg); - } - - 60% { - stroke-dashoffset: -312; - } - - 100% { - stroke-dashoffset: -312; - transform: rotate(450deg); - } - } - - width: 64px; - height: 64px; - transform: rotate(-90deg); - stroke-linecap: round; - stroke-width: 4; - fill: none; - justify-self: center; - display: flex; - - .internal-circle, - .external-circle { - stroke-dashoffset: 0; - transform-origin: center; - opacity: 1; - } - - .internal-circle { - stroke: var(--red-marianne-425); - stroke-dasharray: 187; - animation: internal 1s ease-in-out infinite; - } - - .external-circle { - stroke: var(--blue-france-113); - stroke-dasharray: 312; - animation: external 1s linear infinite; - } -} - -.spinner-overlay { - position: fixed; - display: flex; - flex-direction: column; - width: 100%; - height: 100%; - top: 0; - left: 0; - right: 0; - bottom: 0; - z-index: calc(var(--ground) + 1000); - cursor: pointer; - background-color: rgba(#161616, 0.85); - color: var(--text-inverted-grey); -} \ No newline at end of file diff --git a/client/src/layout/Header.jsx b/client/src/layout/Header.jsx index 935334ba..c9566733 100644 --- a/client/src/layout/Header.jsx +++ b/client/src/layout/Header.jsx @@ -1,3 +1,5 @@ +import { Badge } from '@dataesr/dsfr-plus'; + import Beta from '../components/beta'; const { @@ -11,60 +13,35 @@ const { // TODO : all, Link from dsfr-plus export default function Header() { return ( - // eslint-disable-next-line react/jsx-no-useless-fragment - // <> - // - // <> - // - // - // } - // splitCharacter={9} - // > - // {VITE_MINISTER_NAME} - // - // } - // description={VITE_DESCRIPTION} - // title={( - // <> - // {VITE_APP_NAME} - // {VITE_HEADER_TAG && ( - // - // )} - // - // )} - // /> - // - // - // - //
+
-

- Intitulé -
- officiel -

+

- +

- Nom du site / service + {VITE_APP_NAME} + {VITE_HEADER_TAG && ( + + {VITE_HEADER_TAG} + + )}

-

baseline - précisions sur l‘organisation

+

+ {VITE_DESCRIPTION} +

diff --git a/client/src/pages/actions/actionsOpenalexFeedback.jsx b/client/src/pages/actions/actionsOpenalexFeedback.jsx index d99136a2..468bba75 100644 --- a/client/src/pages/actions/actionsOpenalexFeedback.jsx +++ b/client/src/pages/actions/actionsOpenalexFeedback.jsx @@ -31,13 +31,7 @@ export default function ActionsOpenalexFeedback({ allOpenalexCorrections }) { useEffect(() => { const emailRegex = new RegExp(/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i); - const testEmail = (email) => { - if (emailRegex.test(email)) { - setValidEmail(email); - } else { - setValidEmail(null); - } - }; + const testEmail = (email) => setValidEmail(emailRegex.test(email) ? email : null); const timeOutId = setTimeout(() => testEmail(userEmail), 500); return () => clearTimeout(timeOutId); }, [userEmail]); diff --git a/client/src/pages/filters.jsx b/client/src/pages/filters.jsx index 144be0e5..63c1e16d 100644 --- a/client/src/pages/filters.jsx +++ b/client/src/pages/filters.jsx @@ -27,6 +27,7 @@ const START_YEAR = 2010; const years = [...Array(new Date().getFullYear() - START_YEAR + 1).keys()].map((year) => (year + START_YEAR).toString()).map((year) => ({ label: year, value: year })); const normalizeStr = (x) => x.replaceAll(',', ' ').replaceAll(' ', ' '); + export default function Filters({ sendQuery }) { const [searchParams, setSearchParams] = useSearchParams(); const [currentSearchParams, setCurrentSearchParams] = useState({}); diff --git a/client/src/pages/index.jsx b/client/src/pages/index.jsx index 0f325b7b..4795f431 100644 --- a/client/src/pages/index.jsx +++ b/client/src/pages/index.jsx @@ -1,9 +1,7 @@ -/* eslint-disable max-len */ import { useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { Container } from '@dataesr/dsfr-plus'; +import { Container, Spinner } from '@dataesr/dsfr-plus'; import { useQuery } from '@tanstack/react-query'; -import { PageSpinner } from '../components/spinner'; import { status } from '../config'; import Filters from './filters'; import { getData } from '../utils/works'; @@ -95,7 +93,7 @@ export default function Home() { {(isFetching || (isFetched && (allAffiliations?.length ?? 0) === 0)) && ( - + )} {!isFetching && (allAffiliations?.length > 0 || allDatasets?.length > 0 || allPublications?.length > 0)