From 948a3df242d48eba0f2eb3696913b95df3f16424 Mon Sep 17 00:00:00 2001 From: rbisson <remi.bisson@inrae.fr> Date: Fri, 21 Feb 2025 18:20:20 +0100 Subject: [PATCH 1/4] [BasicSearch] corrected typos in how-to text --- public/locales/en/search.json | 12 ++++++------ public/locales/fr/search.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/public/locales/en/search.json b/public/locales/en/search.json index b25f4c6..394a642 100644 --- a/public/locales/en/search.json +++ b/public/locales/en/search.json @@ -22,20 +22,20 @@ "desc": "searches for Cedrus <strong>only</strong>in the species field of the standard." }, { - "query": "Cedr?s Atlanti*", - "desc": "searches for Cedrus Atlantica, Cedris Atlanticus, and all other possibilities." + "query": "Cedr?s atlanti*", + "desc": "searches for Cedrus atlantica, Cedris atlanticus, and all other possibilities." }, { - "query": "\"Cedrus Atlantica\" +(FCBA || INRAE)", - "desc": "searches \"Cedrus Atlantica\" and <strong>necessarily</strong> FCBA or INRAE." + "query": "\"Cedrus atlantica\" +(FCBA || INRAE)", + "desc": "searches \"Cedrus atlantica\" and <strong>necessarily</strong> FCBA or INRAE." }, { "query": "\"Pinus nigra\" +experimental_site.geo_point.altitude:>1200 +experimental_site.start_date:[1970-01-01 TO 1999-01-01]", "desc": "searches for black pine on an experimental site above 1200m high that started between 1970 and 1999." }, { - "query": "\"Cedrus Atlantica\" -biological_material.genetic_level:clone", - "desc": "searches for Cedrus Atlantica while excluding all clones." + "query": "\"Abies alba\" -biological_material.genetic_level:clone", + "desc": "searches for Abies alba while excluding all clones." } ], "sections": [ diff --git a/public/locales/fr/search.json b/public/locales/fr/search.json index b75955b..a93c109 100644 --- a/public/locales/fr/search.json +++ b/public/locales/fr/search.json @@ -22,20 +22,20 @@ "desc": "cherche Cedrus <strong>uniquement</strong> dans le champ espèce du standard." }, { - "query": "Cedr?s Atlanti*", - "desc": "cherche Cedrus Atlantica, Cedris Atlanticus, ainsi que toutes les autres possibilités." + "query": "Cedr?s atlanti*", + "desc": "cherche Cedrus atlantica, Cedris atlanticus, ainsi que toutes les autres possibilités." }, { - "query": "\"Cedrus Atlantica\" +(FCBA || INRAE)", - "desc": "cherche \"Cedrus Atlantica\" et <strong>obligatoirement</strong> un de FCBA ou INRAE." + "query": "\"Cedrus atlantica\" +(FCBA || INRAE)", + "desc": "cherche \"Cedrus atlantica\" et <strong>obligatoirement</strong> un de FCBA ou INRAE." }, { "query": "\"Pinus nigra\" +experimental_site.geo_point.altitude:>1200 +experimental_site.start_date:[1970-01-01 TO 1999-01-01]", "desc": "cherche du pin noir sur un site exp. situé à plus de 1200m d'altitude, ayant débuté entre 1970 et 1999." }, { - "query": "\"Cedrus Atlantica\" -biological_material.genetic_level:clone", - "desc": "cherche du Cedrus Atlantica en excluant tous les clônes." + "query": "\"Abies alba\" -biological_material.genetic_level:clone", + "desc": "cherche du Abies alba en excluant tous les clônes." } ], "sections": [ -- GitLab From 7859a9044bf7c9107fa412618167c2ef7fe8ab9c Mon Sep 17 00:00:00 2001 From: rbisson <remi.bisson@inrae.fr> Date: Mon, 24 Feb 2025 16:56:24 +0100 Subject: [PATCH 2/4] [Home] Updated homepage text --- public/locales/en/home.json | 18 ++++++++-------- public/locales/fr/home.json | 18 ++++++++-------- src/pages/home/Home.js | 42 ++++++++++++++++++++----------------- 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/public/locales/en/home.json b/public/locales/en/home.json index 7442e93..29284c5 100644 --- a/public/locales/en/home.json +++ b/public/locales/en/home.json @@ -1,12 +1,12 @@ { "pageTitle": "Welcome on In-Sylva search module's homepage.", - "searchToolDescription": { - "standardLink": "Follow this link to find a complete documentation of the current INSYLVA standard: ", - "part1": "As a reminder, it should be remembered that the metadata stored in IN-SYLVA IS are structured around the IN-SYLVA standard.", - "part2": "This standard is composed of metadata fields. A metadata record is therefore made up of a series of fields accompanied by their value.", - "part3": "This tool will help you to search for metadata records (previously loaded via the portal), by defining a certain number of criteria.", - "part4": "By default the \"search\" interface opens to a \"plain text\" search, ie the records returned in the result are those which, in one of the field values, contains the supplied character string.", - "part5": "A click on the Advanced search button gives access to a more complete form via which you can do more precise searches on one or more targeted fields.", - "part6": "Click on the \"Search\" tab to access the search interface." - } + "abouts": [ + "Metadata handled in the In-Sylva Information System describe the infrastructure's resources.", + "The resources are, to begin with, experimental systems linked to sylviculture, genetics or biogeochemical cycles.", + "Metadata are structured around a standard established by the In-Sylva community (<0>https://entrepot.recherche.data.gouv.fr/file.xhtml?persistentId=doi:10.15454/ELXRGY/NCVTVR&version=5.1</0>)", + "The query portal allows to search metadata sheets of interests according to different criteria and subject to access rights.", + "Your rights are those of the group(s) to which you belong. To find out more, check your profile <1>here</1> or on the right of the menu banner.", + "The ‘Search’ interface opens a ‘Basic search’ text box. Selecting ‘Advanced search’ mode allows you to build a more elaborate search.", + "Enjoy your research!" + ], } diff --git a/public/locales/fr/home.json b/public/locales/fr/home.json index ced70a3..1e69651 100644 --- a/public/locales/fr/home.json +++ b/public/locales/fr/home.json @@ -1,12 +1,12 @@ { "pageTitle": "Page d'accueil du module de recherche du Système d'Information In-Sylva", - "searchToolDescription": { - "standardLink": "Une documentation complète de ce standard est disponible à cette adresse : ", - "part1": "Il est important de rappeler que les métadonnées stockées dans le SI In-Sylva sont structurées autour du standard établi par In-Sylva.", - "part2": "Il est composé de champs de métadonnées. Une fiche de métadonnées est donc constituée d'une série de champs accompagnés de leur valeur.", - "part3": "Cette interface vous permettra de rechercher des fiches de métadonnées (chargées au préalable par le Portal), en définissant un certain nombre de critères.", - "part4": "L'interface \"Recherche\" ouvre une zone de texte de \"Recherche basique\". Les résultats correspondent aux fiches de métadonnées contenant, dans un de leurs champs, la chaîne de caractère renseignée.", - "part5": "Un click sur le bouton \"Recherche avancée\" vous permets d'accéder à un formulaire plus complet qui vous permettra des recherches plus précises sur un ou plusieurs champs donnés.", - "part6": "Clickez sur l'onglet \"Recherche\" pour accéder à l'interface de recherche." - } + "abouts": [ + "Les métadonnées gérées dans le Système d'Information (SI) In-Sylva décrivent les ressources de l'Infrastructure.", + "Les ressources sont dans un premier temps des dispositifs expérimentaux relatifs à la sylviculture, la génétique ou les cycles biogéochimique.", + "Les métadonnées sont structurées selon un standard établi par la communauté In-Sylva (<0>https://entrepot.recherche.data.gouv.fr/file.xhtml?persistentId=doi:10.15454/ELXRGY/NCVTVR&version=5.1</0>)", + "Le portail d'interrogation permet la recherche des fiches de métadonnées d'intérêt, selon différents critères et conditionnellement aux droits d'accès.", + "Vos droits sont ceux du (des) groupes auxquels vous appartenez. Pour en savoir plus, consultez votre profil <1>ici</1> ou à droite du bandeau de menu.", + "L'interface \"Recherche\" ouvre une zone de texte de \"Recherche basique\". La sélection en mode \"Recherche avancée\" permet de construire une requete plus élaborée.", + "Bonne recherche !" + ] } diff --git a/src/pages/home/Home.js b/src/pages/home/Home.js index 603acf7..bbf663a 100644 --- a/src/pages/home/Home.js +++ b/src/pages/home/Home.js @@ -1,38 +1,42 @@ import React from 'react'; -import { useTranslation } from 'react-i18next'; -import { EuiPanel, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import { Trans, useTranslation } from 'react-i18next'; +import { EuiLink, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import { NavLink } from 'react-router-dom'; const Home = () => { const { t } = useTranslation('home'); + const abouts = t('home:abouts', { returnObjects: true }); + return ( <> <EuiTitle size="m"> <h4>{t('home:pageTitle')}</h4> </EuiTitle> <EuiSpacer size={'l'} /> - <EuiPanel hasBorder={true} hasShadow={false}> - <EuiText> - <p>{t('home:searchToolDescription.part1')}</p> - <p>{t('home:searchToolDescription.part2')}</p> - <p> - {t('home:searchToolDescription.standardLink')} - <a + <EuiText> + <Trans + components={[ + <EuiLink + key={0} href={ 'https://entrepot.recherche.data.gouv.fr/file.xhtml?persistentId=doi:10.15454/ELXRGY/NCVTVR&version=5.1' } target="_blank" rel="noopener noreferrer" - > - https://entrepot.recherche.data.gouv.fr/file.xhtml?persistentId=doi:10.15454/ELXRGY/NCVTVR&version=5.1 - </a> - </p> - <p>{t('home:searchToolDescription.part3')}</p> - <p>{t('home:searchToolDescription.part4')}</p> - <p>{t('home:searchToolDescription.part5')}</p> - <p>{t('home:searchToolDescription.part6')}</p> - </EuiText> - </EuiPanel> + />, + <NavLink key={1} to={'/profile'} />, + ]} + > + <p>{abouts[0]}</p> + <p>{abouts[1]}</p> + <p>{abouts[2]}</p> + <p>{abouts[3]}</p> + <p>{abouts[4]}</p> + <p>{abouts[5]}</p> + <p>{abouts[6]}</p> + </Trans> + </EuiText> </> ); }; -- GitLab From 98ff2c4dd3e5ede1210b490de42b6257ea63f7e6 Mon Sep 17 00:00:00 2001 From: rbisson <remi.bisson@inrae.fr> Date: Wed, 26 Feb 2025 16:07:11 +0100 Subject: [PATCH 3/4] [Home] Renamed to About [Router] Changed homepage, now redirecting directly to search --- public/locales/en/{home.json => about.json} | 4 ++-- public/locales/en/header.json | 2 +- public/locales/en/search.json | 2 +- public/locales/fr/{home.json => about.json} | 2 +- public/locales/fr/header.json | 2 +- src/App.js | 10 ++++++---- src/components/Header/Header.js | 8 ++++---- src/pages/{home/Home.js => about/About.js} | 20 ++++++++------------ src/pages/{home => about}/package.json | 4 ++-- 9 files changed, 26 insertions(+), 28 deletions(-) rename public/locales/en/{home.json => about.json} (92%) rename public/locales/fr/{home.json => about.json} (91%) rename src/pages/{home/Home.js => about/About.js} (66%) rename src/pages/{home => about}/package.json (52%) diff --git a/public/locales/en/home.json b/public/locales/en/about.json similarity index 92% rename from public/locales/en/home.json rename to public/locales/en/about.json index 29284c5..7bcb0eb 100644 --- a/public/locales/en/home.json +++ b/public/locales/en/about.json @@ -1,5 +1,5 @@ { - "pageTitle": "Welcome on In-Sylva search module's homepage.", + "pageTitle": "Welcome on In-Sylva search module.", "abouts": [ "Metadata handled in the In-Sylva Information System describe the infrastructure's resources.", "The resources are, to begin with, experimental systems linked to sylviculture, genetics or biogeochemical cycles.", @@ -8,5 +8,5 @@ "Your rights are those of the group(s) to which you belong. To find out more, check your profile <1>here</1> or on the right of the menu banner.", "The ‘Search’ interface opens a ‘Basic search’ text box. Selecting ‘Advanced search’ mode allows you to build a more elaborate search.", "Enjoy your research!" - ], + ] } diff --git a/public/locales/en/header.json b/public/locales/en/header.json index d7672a6..a9ee23d 100644 --- a/public/locales/en/header.json +++ b/public/locales/en/header.json @@ -5,7 +5,7 @@ "tooltip": "Manage your sources with Portal" }, "tabs": { - "home": "Home", + "about": "About", "search": "Search" }, "userMenu": { diff --git a/public/locales/en/search.json b/public/locales/en/search.json index 394a642..fa77079 100644 --- a/public/locales/en/search.json +++ b/public/locales/en/search.json @@ -19,7 +19,7 @@ }, { "query": "biological_material.species:Cedrus", - "desc": "searches for Cedrus <strong>only</strong>in the species field of the standard." + "desc": "searches for Cedrus <strong>only</strong> in the species field of the standard." }, { "query": "Cedr?s atlanti*", diff --git a/public/locales/fr/home.json b/public/locales/fr/about.json similarity index 91% rename from public/locales/fr/home.json rename to public/locales/fr/about.json index 1e69651..5634ad1 100644 --- a/public/locales/fr/home.json +++ b/public/locales/fr/about.json @@ -1,5 +1,5 @@ { - "pageTitle": "Page d'accueil du module de recherche du Système d'Information In-Sylva", + "pageTitle": "Bienvenue sur le module de recherche du Système d'Information In-Sylva", "abouts": [ "Les métadonnées gérées dans le Système d'Information (SI) In-Sylva décrivent les ressources de l'Infrastructure.", "Les ressources sont dans un premier temps des dispositifs expérimentaux relatifs à la sylviculture, la génétique ou les cycles biogéochimique.", diff --git a/public/locales/fr/header.json b/public/locales/fr/header.json index cdd79ec..a1ab91c 100644 --- a/public/locales/fr/header.json +++ b/public/locales/fr/header.json @@ -5,7 +5,7 @@ "tooltip": "Gérez vos sources avec le Portail" }, "tabs": { - "home": "Page d'accueil", + "about": "A propos", "search": "Recherche" }, "userMenu": { diff --git a/src/App.js b/src/App.js index 80aa31b..af68f32 100644 --- a/src/App.js +++ b/src/App.js @@ -1,24 +1,26 @@ import React from 'react'; import { - RouterProvider, createHashRouter, - Route, createRoutesFromElements, + Route, + RouterProvider, } from 'react-router-dom'; -import Home from './pages/home'; import Search from './pages/search'; import Profile from './pages/profile'; import Layout from './components/Layout'; import ErrorBoundary from './pages/error/ErrorBoundary'; +import About from './pages/about'; const App = () => { const router = createHashRouter( createRoutesFromElements( <> <Route errorElement={<ErrorBoundary />} element={<Layout />}> - <Route index path="/" element={<Home />} /> + <Route index path="/" element={<Search />} /> <Route path="/search" element={<Search />} /> <Route path="/profile" element={<Profile />} /> + <Route path="/about" element={<About />} /> + <Route element={<Search />} /> </Route> </> ) diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 7c0f470..700f8fa 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -22,13 +22,13 @@ import { NavLink } from 'react-router-dom'; const routes = [ { id: 0, - label: 'home', - href: '/', + label: 'search', + href: '/search', }, { id: 1, - label: 'search', - href: '/search', + label: 'about', + href: '/about', }, ]; diff --git a/src/pages/home/Home.js b/src/pages/about/About.js similarity index 66% rename from src/pages/home/Home.js rename to src/pages/about/About.js index bbf663a..15a6b8f 100644 --- a/src/pages/home/Home.js +++ b/src/pages/about/About.js @@ -3,15 +3,15 @@ import { Trans, useTranslation } from 'react-i18next'; import { EuiLink, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; import { NavLink } from 'react-router-dom'; -const Home = () => { - const { t } = useTranslation('home'); +const About = () => { + const { t } = useTranslation('about'); - const abouts = t('home:abouts', { returnObjects: true }); + const abouts = t('about:abouts', { returnObjects: true }); return ( <> <EuiTitle size="m"> - <h4>{t('home:pageTitle')}</h4> + <h4>{t('about:pageTitle')}</h4> </EuiTitle> <EuiSpacer size={'l'} /> <EuiText> @@ -28,17 +28,13 @@ const Home = () => { <NavLink key={1} to={'/profile'} />, ]} > - <p>{abouts[0]}</p> - <p>{abouts[1]}</p> - <p>{abouts[2]}</p> - <p>{abouts[3]}</p> - <p>{abouts[4]}</p> - <p>{abouts[5]}</p> - <p>{abouts[6]}</p> + {abouts.map((about, index) => ( + <p key={index}>{about}</p> + ))} </Trans> </EuiText> </> ); }; -export default Home; +export default About; diff --git a/src/pages/home/package.json b/src/pages/about/package.json similarity index 52% rename from src/pages/home/package.json rename to src/pages/about/package.json index ba3c514..2c0afee 100644 --- a/src/pages/home/package.json +++ b/src/pages/about/package.json @@ -1,6 +1,6 @@ { - "name": "Home", + "name": "About", "version": "1.0.0", "private": true, - "main": "Home.js" + "main": "About.js" } -- GitLab From 0dc0cd30ac15a71c48cd9f8495e082e4a5c5e336 Mon Sep 17 00:00:00 2001 From: rbisson <remi.bisson@inrae.fr> Date: Wed, 26 Feb 2025 17:58:53 +0100 Subject: [PATCH 4/4] [AdvancedSearch] Changed icon type for remove field button --- public/locales/fr/search.json | 2 +- .../search/AdvancedSearch/AdvancedSearch.js | 144 ++++++++---------- 2 files changed, 65 insertions(+), 81 deletions(-) diff --git a/public/locales/fr/search.json b/public/locales/fr/search.json index a93c109..9c9f41b 100644 --- a/public/locales/fr/search.json +++ b/public/locales/fr/search.json @@ -85,7 +85,7 @@ "fields": { "title": "Recherche de champ", "loadingFields": "Chargement des champs...", - "removeFieldButton": "Supprimer le champ", + "removeFieldButton": "Retirer le champ", "clearValues": "Vider les valeurs", "addFieldPopover": { "title": "Ajouter un champ", diff --git a/src/pages/search/AdvancedSearch/AdvancedSearch.js b/src/pages/search/AdvancedSearch/AdvancedSearch.js index 65281df..025873b 100644 --- a/src/pages/search/AdvancedSearch/AdvancedSearch.js +++ b/src/pages/search/AdvancedSearch/AdvancedSearch.js @@ -1242,7 +1242,11 @@ const FieldsPanel = ({ }; if (standardFields == []) { - return <h2>{t('search:advancedSearch.fields.loadingFields')}</h2>; + return ( + <EuiTitle size="xs"> + <h2>{t('search:advancedSearch.fields.loadingFields')}</h2> + </EuiTitle> + ); } return ( @@ -1259,92 +1263,72 @@ const FieldsPanel = ({ key={'field' + index} paddingSize="s" > - <EuiFlexGroup direction="row" alignItems="center"> - <EuiFlexItem grow={false}> + <EuiFlexGroup + direction="row" + alignItems="center" + justifyContent={'spaceBetween'} + > + <EuiFlexGroup direction={'row'} alignItems="center" gutterSize={'m'}> + <EuiSpacer size={'s'} /> <EuiButtonIcon - size="s" + iconSize="m" color="danger" onClick={() => handleRemoveField(index)} - iconType="indexClose" + iconType="cross" title={t('search:advancedSearch.fields.removeFieldButton')} aria-label={t('search:advancedSearch.fields.removeFieldButton')} /> - </EuiFlexItem> - <EuiFlexItem> - {field.isValidated ? ( - <> - {field.sources?.length ? ( - <EuiHealth color="danger"> - {fieldValuesToString(field).replace(/_|\./g, ' ')} - </EuiHealth> - ) : ( - <EuiHealth color="primary"> - {fieldValuesToString(field).replace(/_|\./g, ' ')} - </EuiHealth> - )} - </> - ) : ( - <> - {field.sources?.length ? ( - <EuiHealth color="danger"> - {field.name.replace(/_|\./g, ' ')} - </EuiHealth> - ) : ( - <EuiHealth color="primary"> - {field.name.replace(/_|\./g, ' ')} - </EuiHealth> - )} - </> - )} - </EuiFlexItem> - {!isNaN(fieldCount[index]) && ( - <EuiFlexItem grow={false}> - <EuiTextColor color="secondary"> - {t('search:advancedSearch.resultsCount', { - count: fieldCount[index], - })} - </EuiTextColor> - </EuiFlexItem> - )} - {field.isValidated && ( - <EuiFlexItem grow={false}> - <EuiButtonIcon - size="s" - onClick={() => countFieldValues(field, index)} - iconType="number" - title={t('search:advancedSearch.countResultsButton')} - aria-label={t('search:advancedSearch.countResultsButton')} - /> - </EuiFlexItem> - )} - {field.isValidated && ( - <EuiFlexItem grow={false}> - <EuiButtonIcon - size="s" - color="danger" - onClick={() => handleClearValues(index)} - iconType="trash" - title={t('search:advancedSearch.fields.clearValues')} - aria-label={t('search:advancedSearch.fields.clearValues')} - /> - </EuiFlexItem> - )} + <EuiHealth color={field.sources?.length ? 'danger' : 'primary'}> + {field.isValidated + ? fieldValuesToString(field).replace(/_|\./g, ' ') + : field.name.replace(/_|\./g, ' ')} + </EuiHealth> + </EuiFlexGroup> <EuiFlexItem grow={false}> - <PopoverValueButton - index={index} - standardFields={standardFields} - searchFields={searchFields} - setSearchFields={setSearchFields} - setSearch={setSearch} - setSearchCount={setSearchCount} - fieldCount={fieldCount} - setFieldCount={setFieldCount} - selectedOperatorId={selectedOperatorId} - selectedSources={selectedSources} - setSelectedSources={setSelectedSources} - availableSources={availableSources} - setAvailableSources={setAvailableSources} - /> + <EuiFlexGroup direction={'row'} alignItems="center" gutterSize={'m'}> + {!isNaN(fieldCount[index]) && ( + <EuiTextColor color="secondary"> + {t('search:advancedSearch.resultsCount', { + count: fieldCount[index], + })} + </EuiTextColor> + )} + {field.isValidated && ( + <EuiButtonIcon + size="s" + onClick={() => countFieldValues(field, index)} + iconType="number" + title={t('search:advancedSearch.countResultsButton')} + aria-label={t('search:advancedSearch.countResultsButton')} + /> + )} + {field.isValidated && ( + <EuiButtonIcon + size="s" + color="danger" + onClick={() => handleClearValues(index)} + iconType="trash" + title={t('search:advancedSearch.fields.clearValues')} + aria-label={t('search:advancedSearch.fields.clearValues')} + /> + )} + <PopoverValueButton + index={index} + standardFields={standardFields} + searchFields={searchFields} + setSearchFields={setSearchFields} + setSearch={setSearch} + setSearchCount={setSearchCount} + fieldCount={fieldCount} + setFieldCount={setFieldCount} + selectedOperatorId={selectedOperatorId} + selectedSources={selectedSources} + setSelectedSources={setSelectedSources} + availableSources={availableSources} + setAvailableSources={setAvailableSources} + /> + <EuiSpacer size={'s'} /> + </EuiFlexGroup> </EuiFlexItem> </EuiFlexGroup> </EuiPanel> -- GitLab