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 319d3ef + 7970a41 commit af620da
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 32 deletions.
49 changes: 32 additions & 17 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ import EssaisCliniques from './pages/BaroSante/EssaisCliniques';
import Etudes from './pages/BaroSante/Etudes';
import DataCode from './pages/DataCode';
import HowTo from './pages/Declinaisons/HowTo';
import Policy from './pages/Declinaisons/Policy';
import Variations from './pages/Declinaisons/Variations';
import Error404 from './pages/Error404';
import Integration from './pages/Integration';
import Project from './pages/Project';
import messagesEN from './translations/en.json';
import messagesFR from './translations/fr.json';
import TranslationPage from './translations/translations-page';
import { isInLocal } from './utils/helpers';
import { isInLocal, isInProduction } from './utils/helpers';
import { GraphNavigationContextProvider } from './utils/Hooks/useGraphNavigation';
import useLang from './utils/Hooks/useLang';

Expand All @@ -40,22 +41,24 @@ 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',
};
const redirects = isInProduction
? {}
: {
'/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 Down Expand Up @@ -273,6 +276,18 @@ function App() {
path={urls.howto[key]}
/>
))}
{Object.keys(urls.policy).map((key) => (
<Route
element={(
<PageTracker>
<Policy />
</PageTracker>
)}
exact
key={key}
path={urls.policy[key]}
/>
))}
{Object.keys(urls.opendata).map((key) => (
<Route
element={(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Chart = ({ domain, hasComments, hasFooter, id }) => {
'first_these_discipline.discipline.keyword',
'has_orcid',
'app.orcid.active',
getCSSValue('--green-light-125'),
getCSSValue('--thesesfr'),
100,
);
const { categories, dataGraph } = allData;
Expand Down Expand Up @@ -83,7 +83,7 @@ Chart.defaultProps = {
domain: '',
hasComments: true,
hasFooter: true,
id: 'orcid.general.chart-indicator-these-year',
id: 'orcid.general.chart-indicator-these-discipline',
};
Chart.propTypes = {
domain: PropTypes.oneOf(domains),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Chart = ({ domain, hasComments, hasFooter, id }) => {
'first_these_year',
'has_orcid',
'app.orcid.active',
getCSSValue('--green-light-125'),
getCSSValue('--thesesfr'),
100,
);
const { categories, dataGraph } = allData;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Charts/orcid/general/get-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function useGetData(beforeLastObservationSnap, observationSnap, domain) {
'%Y',
new Date(item.key_as_string).getTime(),
),
color: getCSSValue('--green-light-125'),
color: getCSSValue('--thesesfr'),
})),
},
];
Expand Down
2 changes: 1 addition & 1 deletion src/components/GraphNavigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { v4 as uuidv4 } from 'uuid';
import useScroll from '../../utils/Hooks/useScroll';
import useViewport from '../../utils/Hooks/useViewport';

function GraphNavigation({ mobileTitleIntl, children }) {
function GraphNavigation({ children, mobileTitleIntl }) {
const [sticky, setSticky] = useState(false);
const [offsetTop, setOffsetTop] = useState(null);
const [initOffsetTop, setInitOffsetTop] = useState(null);
Expand Down
13 changes: 10 additions & 3 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,7 @@ function Header() {
/>
</NavItem>
<NavItem
current={path.startsWith(
`/${urls.variations[lang].split('/')[1]}`,
)}
current={path === urls.nationalOrcid[lang]}
title={intl.formatMessage({
id: 'app.header.nav.orcid',
defaultMessage: 'ORCID',
Expand Down Expand Up @@ -549,6 +547,15 @@ function Header() {
})}
asLink={<RouterLink to={urls.howto[lang] + search} />}
/>
<NavSubItem
current={path === urls.policy[lang]}
title={intl.formatMessage({
id: 'app.header.nav.declinaisons.policy',
defaultMessage:
'Politique de science ouverte des établissements',
})}
asLink={<RouterLink to={urls.policy[lang] + search} />}
/>
</NavItem>
<NavItem
current={path.startsWith(
Expand Down
4 changes: 4 additions & 0 deletions src/config/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ export default {
fr: '/declinaisons/comment-realiser-bso-local',
en: '/declinaisons/howto',
},
policy: {
fr: '/declinaisons/politique-etablissements',
en: '/declinaisons/institutional-policy',
},
project: {
fr: '/projet-et-equipe',
en: '/project-and-team',
Expand Down
20 changes: 20 additions & 0 deletions src/pages/Declinaisons/Policy/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Col, Container, Row } from '@dataesr/react-dsfr';
import { FormattedMessage } from 'react-intl';

const Policy = () => (
<div className='policy no-arrow-link'>
<Container>
<section className='color-blue-dark-125 content py-48'>
<Row gutters>
<Col n='12'>
<h2>
<FormattedMessage id='app.header.nav.declinaisons.policy' />
</h2>
</Col>
</Row>
</section>
</Container>
</div>
);

export default Policy;
4 changes: 2 additions & 2 deletions src/pages/Declinaisons/Variations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Banner from '../../../components/Banner';
import CardLogo from '../../../components/CardLogo';
import Icon from '../../../components/Icon';

function Variations() {
const Variations = () => {
const renderIcons = (
<Row justifyContent='center' alignItems='middle' gutters>
<Col n='12'>
Expand Down Expand Up @@ -494,6 +494,6 @@ function Variations() {
</Container>
</div>
);
}
};

export default Variations;
4 changes: 3 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@
"app.header.nav.declinaisons.existing": "The institutions monitors",
"app.header.nav.declinaisons": "The local monitors",
"app.header.nav.declinaisons.howto": "Tutorial to create your local monitor",
"app.header.nav.declinaisons.policy": "Institutional open science policy",
"app.header.subtitle": "Measure the evolution of open science in France using reliable, open and controlled data.",
"app.header.title": "French Open Science Monitor",
"app.header.title-bis": "the French Open Science Monitor",
Expand Down Expand Up @@ -1357,10 +1358,11 @@
"url.software.general": "/software/general",
"url.thesis": "/thesis",
"app.orcid.nb": "Number of ORCID accounts",
"app.orcid.nb-cumulated": "Number of cumulated ORCID accounts",
"app.orcid.count": "Total number of French ORCID to-date",
"app.orcid.employment-count": "Total number of ORCID with a French employement to-date",
"app.orcid.thesis-count": "Total ORCIDs who defended a thesis in France",
"app.orcid.creation-date": "ORCID account creation date",
"app.orcid.creation-year": "ORCID account creation year",
"app.orcid.these-proportion": "Proportion of French PhD that have an ORCID",
"app.orcid.general": "General",
"app.orcid.intro": "ORCID - Open Researcher and Contributor ID - is an international non-profit organization backed by a community of research organizations, publishers, funders, professional associations and other players in the research ecosystem. ORCID's mission is to maintain a registry of unique and persistent identifiers dedicated to researchers and authors of scientific publications. The ORCID identifier facilitates reliable and transparent interconnection between researchers, their work and the structures to which they belong. The adoption of the ORCID identifier by researchers consolidates their digital identity and the visibility of their work, and makes it possible to feed data from ORCID into research information systems, thus avoiding double entries.",
Expand Down
4 changes: 3 additions & 1 deletion src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@
"app.header.nav.declinaisons.existing": "Les baromètres des établissements",
"app.header.nav.declinaisons": "Les baromètres locaux",
"app.header.nav.declinaisons.howto": "Tutoriel pour réaliser son BSO local",
"app.header.nav.declinaisons.policy": "Politique de science ouverte des établissements",
"app.header.subtitle": "Mesurer l'évolution de la science ouverte en France à partir de données fiables, ouvertes et maîtrisées.",
"app.header.subsubtitle": "La science ouverte est la diffusion sans entrave des résultats, des méthodes et des produits de la recherche scientifique. Elle s'appuie sur l'opportunité que représente la mutation numérique pour développer l'accès ouvert aux publications et - autant que possible - aux données, au codes sources et aux méthodes de la recherche.",
"app.header.title": "Baromètre français de la Science Ouverte",
Expand Down Expand Up @@ -1331,8 +1332,9 @@
"app.orcid.employment-count": "Total ORCID avec employeur français à date",
"app.orcid.thesis-count": "Total ORCID ayant soutenu une thèse en France",
"app.orcid.nb": "Nombre de comptes ORCID",
"app.orcid.nb-cumulated": "Nombre de comptes ORCID cumulés",
"app.orcid.perc": "Proportion de comptes ORCID",
"app.orcid.creation-date": "Date de création de l'ORCID",
"app.orcid.creation-year": "Année de création de l'ORCID",
"app.orcid.proportion": "Proportion de comptes ORCID français",
"app.orcid.these-proportion": "Proportion de personnes ayant soutenu une thèse en France et disposant d'un ORCID",
"app.orcid.active": "actif",
Expand Down
8 changes: 5 additions & 3 deletions src/utils/chartOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3885,9 +3885,11 @@ export const chartOptions = {
labels: {
rotation: -90,
},
title: { text: intl.formatMessage({ id: 'app.orcid.creation-date' }) },
title: { text: intl.formatMessage({ id: 'app.orcid.creation-year' }) },
};
options.yAxis.title.text = intl.formatMessage({ id: 'app.orcid.nb' });
options.yAxis.title.text = intl.formatMessage({
id: 'app.orcid.nb-cumulated',
});
options.legend.title.text = null;
options.plotOptions = {
column: {
Expand All @@ -3910,7 +3912,7 @@ export const chartOptions = {
options.chart.type = 'column';
options.xAxis = {
categories,
title: { text: intl.formatMessage({ id: 'app.orcid.creation-date' }) },
title: { text: intl.formatMessage({ id: 'app.orcid.creation-year' }) },
};
options.yAxis.title.text = intl.formatMessage({ id: 'app.orcid.nb' });
options.legend.enabled = false;
Expand Down
2 changes: 2 additions & 0 deletions src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const mobileButtonLabel = {
'/donnees-de-la-recherche/disciplines': 'app.data.disciplines',
'/donnees-de-la-recherche/editeurs': 'app.data.editeurs',
'/theses-de-doctorat/general': 'app.thesis.general',
'/orcid/general': 'app.orcid.general',
},
en: {
'/health/publications/fields': 'app.publi.disciplines',
Expand Down Expand Up @@ -63,6 +64,7 @@ export const mobileButtonLabel = {
'/research-data/disciplines': 'app.data.disciplines',
'/research-data/publishers': 'app.data.editeurs',
'/thesis/general': 'app.thesis.general',
'/orcid/general': 'app.orcid.general',
},
};

Expand Down

0 comments on commit af620da

Please sign in to comment.