Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Feb 6, 2024
2 parents fa980d8 + 025e5fa commit 7c14fed
Show file tree
Hide file tree
Showing 127 changed files with 4,168 additions and 1,419 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ ES_INDEX_ORCID=bso-orcid
ES_INDEX_PUBLICATIONS=bso-publications
ES_INDEX_STUDIES=bso-clinical-trials
REACT_APP_ENV=production
REACT_APP_ES_API_URL_DATACITE=https://cluster-staging.elasticsearch.dataesr.ovh/$ES_INDEX_DATACITE/_search
REACT_APP_ES_API_URL_ORCID=https://cluster-staging.elasticsearch.dataesr.ovh/$ES_INDEX_ORCID/_search
REACT_APP_ES_API_URL_DATACITE=https://cluster-production.elasticsearch.dataesr.ovh/$ES_INDEX_DATACITE/_search
REACT_APP_ES_API_URL_ORCID=https://cluster-production.elasticsearch.dataesr.ovh/$ES_INDEX_ORCID/_search
REACT_APP_ES_API_URL_PUBLICATIONS=https://cluster-production.elasticsearch.dataesr.ovh/$ES_INDEX_PUBLICATIONS/_search
REACT_APP_ES_API_URL_STUDIES=https://cluster-production.elasticsearch.dataesr.ovh/$ES_INDEX_STUDIES/_search
REACT_APP_LAST_OBSERVATION=2022Q4
REACT_APP_LAST_OBSERVATION_THESIS=2022Q4
REACT_APP_LAST_OBSERVATION_THESIS=2023Q4
REACT_APP_PIWIK_SITE=34
REACT_APP_PIWIK_URL=https://piwik.enseignementsup-recherche.pro
REACT_APP_VERSION=$npm_package_version
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ ES_INDEX_ORCID=bso-orcid-staging
ES_INDEX_PUBLICATIONS=bso-publications-staging
ES_INDEX_STUDIES=bso-clinical-trials-staging
REACT_APP_ENV=development
REACT_APP_LAST_OBSERVATION=2023Q1
REACT_APP_LAST_OBSERVATION_THESIS=2022Q4
REACT_APP_LAST_OBSERVATION=2023Q4
REACT_APP_LAST_OBSERVATION_THESIS=2023Q4
REACT_APP_PIWIK_SITE=44
6 changes: 3 additions & 3 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ES_INDEX_ORCID=bso-orcid-staging
ES_INDEX_PUBLICATIONS=bso-publications-staging
ES_INDEX_STUDIES=bso-clinical-trials-staging
REACT_APP_ENV=staging
REACT_APP_LAST_OBSERVATION=2023Q2
REACT_APP_LAST_OBSERVATION_THESIS=2022Q4
REACT_APP_LAST_OBSERVATION=2023Q4
REACT_APP_LAST_OBSERVATION_THESIS=2023Q4
REACT_APP_PIWIK_SITE=2
REACT_APP_PIWIK_URL=https://matomo.staging.dataesr.ovh/
REACT_APP_PIWIK_URL=https://matomo.staging.dataesr.ovh/
64 changes: 33 additions & 31 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import NationalThesis from './pages/BaroNational/NationalThesis';
import BaroSante from './pages/BaroSante';
import EssaisCliniques from './pages/BaroSante/EssaisCliniques';
import Etudes from './pages/BaroSante/Etudes';
import SantePublications from './pages/BaroSante/SantePublications';
import DataCode from './pages/DataCode';
import HowTo from './pages/Declinaisons/HowTo';
import Variations from './pages/Declinaisons/Variations';
import Error404 from './pages/Error404';
Expand All @@ -40,6 +40,23 @@ const messages = {
fr: messagesFR,
};

const redirects = {
'/a-propos/notes-flash': '/a-propos/communication',
'/about/notes': '/about/communication',
'/a-propos/declinaisons': '/declinaisons/bso-locaux',
'/about/declinaisons': '/declinaisons/bso-locaux',
'/sante/publications/general': '/publications/general',
'/sante/publications/disciplines': '/publications/general',
'/sante/publications/editeurs': '/publications/general',
'/sante/publications/archives': '/publications/general',
'/sante/publications/affiliations': '/publications/general',
'/health/publications/general': '/publications/general',
'/health/publications/fields': '/publications/general',
'/health/publications/publishers': '/publications/general',
'/health/publications/repositories': '/publications/general',
'/health/publications/affiliations': '/publications/general',
};

function App() {
const { lang, urls } = useLang();

Expand All @@ -51,6 +68,14 @@ function App() {
{isInLocal() && (
<Route path='/translations' element={<TranslationPage />} />
)}
{Object.keys(redirects).map((redirect) => (
<Route
element={<Navigate to={redirects[redirect]} replace />}
exact
key={redirect}
path={redirect}
/>
))}
{Object.keys(urls.national).map((key) => (
<Route
element={(
Expand Down Expand Up @@ -133,32 +158,30 @@ function App() {
path={tab[key]}
/>
)))}
{Object.keys(urls.sante).map((key) => (
{Object.keys(urls.nationalDataCode).map((key) => (
<Route
element={(
<PageTracker>
<BaroSante />
<DataCode />
</PageTracker>
)}
exact
key={key}
path={urls.sante[key]}
path={urls.nationalDataCode[key]}
/>
))}
{urls.santePublications.tabs.map((tab) => Object.keys(tab).map((key) => (
{Object.keys(urls.sante).map((key) => (
<Route
element={(
<PageTracker>
<GraphNavigationContextProvider>
<SantePublications />
</GraphNavigationContextProvider>
<BaroSante />
</PageTracker>
)}
exact
key={key}
path={tab[key]}
path={urls.sante[key]}
/>
)))}
))}
{urls.santeEssais.tabs.map((tab) => Object.keys(tab).map((key) => (
<Route
element={(
Expand Down Expand Up @@ -214,15 +237,6 @@ function App() {
path={urls.glossaire[key]}
/>
))}
{/* Redirect Notes Flash into communication */}
{Object.keys(urls.flash).map((key) => (
<Route
element={<Navigate to={urls.communication[key]} />}
exact
key={key}
path={urls.flash[key]}
/>
))}
{Object.keys(urls.communication).map((key) => (
<Route
element={(
Expand All @@ -235,18 +249,6 @@ function App() {
path={urls.communication[key]}
/>
))}
{Object.keys(urls.variationsOld).map((key) => (
<Route
element={(
<PageTracker>
<Variations />
</PageTracker>
)}
exact
key={key}
path={urls.variationsOld[key]}
/>
))}
{Object.keys(urls.variations).map((key) => (
<Route
element={(
Expand Down
62 changes: 62 additions & 0 deletions src/components/BannerData/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { Col, Row } from '@dataesr/react-dsfr';
import PropTypes from 'prop-types';
import { FormattedMessage, useIntl } from 'react-intl';
import { useLocation } from 'react-router-dom';

import useLang from '../../utils/Hooks/useLang';
import Banner from '../Banner';
import Chip from '../Chip';
import Icon from '../Icon';

function BannerNational({ selected, title, iconId }) {
const intl = useIntl();
const { lang, urls } = useLang();
const { search } = useLocation();

const renderIcons = (
<Row justifyContent='center' alignItems='middle' gutters className='mb-32'>
<Col n='12'>
<Icon name={iconId} color1='blue-soft-125' color2='publication-25' />
</Col>
</Row>
);

return (
<Banner
backgroundColor='blue-soft-150'
homeLink={urls.national[lang] + search}
supTitle={<FormattedMessage id='app.header.title-national' />}
title={<FormattedMessage id={title} />}
chip={<Chip />}
icons={renderIcons}
selectNavigation={{
title: intl.formatMessage({
id: 'app.navigation.objet-recherche',
}),
selected: intl.formatMessage({ id: selected }),
options: [
{
label: intl.formatMessage({
id: 'app.baro-national.data.title.beta',
}),
value: intl.formatMessage({ id: 'url.data.general' }),
},
{
label: intl.formatMessage({
id: 'app.baro-national.software.title.beta',
}),
value: intl.formatMessage({ id: 'url.software.general' }),
},
],
}}
/>
);
}

BannerNational.propTypes = {
iconId: PropTypes.string.isRequired,
selected: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
};

export default BannerNational;
4 changes: 0 additions & 4 deletions src/components/BannerHealth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ function BannerHealth({ selected, title }) {
title: intl.formatMessage({ id: 'app.navigation.objet-recherche' }),
selected: intl.formatMessage({ id: selected }),
options: [
{
label: intl.formatMessage({ id: 'app.baro-sante.title' }),
value: intl.formatMessage({ id: 'url.sante.publications.general' }),
},
{
label: intl.formatMessage({
id: 'app.baro-sante.trials.main-title',
Expand Down
20 changes: 1 addition & 19 deletions src/components/BannerNational/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,16 @@ function BannerNational({ selected, title, iconId }) {
}),
value: intl.formatMessage({ id: 'url.thesis.general' }),
},
{
label: intl.formatMessage({
id: 'app.baro-national.data.title.beta',
}),
value: intl.formatMessage({ id: 'url.data.general' }),
},
{
label: intl.formatMessage({
id: 'app.baro-national.software.title.beta',
}),
value: intl.formatMessage({ id: 'url.software.general' }),
},
// {
// label: intl.formatMessage({
// id: 'app.baro-national.orcid.title',
// }),
// value: intl.formatMessage({ id: 'url.orcid.general' }),
// },
],
}}
/>
);
}

BannerNational.propTypes = {
iconId: PropTypes.string.isRequired,
selected: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
iconId: PropTypes.string.isRequired,
};

export default BannerNational;
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const Chart = ({ domain, hasComments, hasFooter, id }) => {
lastObservationSnap,
domain,
'datastet_details.has_created',
false,
false,
'datastet_details.has_used',
);
const { categories, dataGraph } = allData;
Expand Down
Loading

0 comments on commit 7c14fed

Please sign in to comment.