diff --git a/src/components/Charts/orcid/general/get-data.js b/src/components/Charts/orcid/general/get-data.js index 4d6fb451..cabeb254 100644 --- a/src/components/Charts/orcid/general/get-data.js +++ b/src/components/Charts/orcid/general/get-data.js @@ -134,28 +134,6 @@ function useGetData(beforeLastObservationSnap, observationSnap, domain) { color: getCSSValue('--green-light-125'), dataLabels: { style: { textOutline: 'none' } }, }, - { - name: capitalize( - intl.formatMessage({ - id: 'app.orcid.employment-count', - }), - ), - data: employment, - turboThreshold: 0, - color: getCSSValue('--affiliations-etablissements-125'), - dataLabels: { style: { textOutline: 'none' } }, - }, - { - name: capitalize( - intl.formatMessage({ - id: 'app.orcid.thesis-count', - }), - ), - data: thesis, - turboThreshold: 0, - color: getCSSValue('--thesesfr'), - dataLabels: { style: { textOutline: 'none' } }, - }, ]; return { diff --git a/src/components/ProgressionCard/index.js b/src/components/ProgressionCard/index.js index 9b066f3f..66b87e53 100644 --- a/src/components/ProgressionCard/index.js +++ b/src/components/ProgressionCard/index.js @@ -3,27 +3,26 @@ import React, { useEffect, useState } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import { domains } from '../../utils/constants'; -import { getObservationLabel } from '../../utils/helpers'; +import { getObservationLabel, isInProduction } from '../../utils/helpers'; import useGlobals from '../../utils/Hooks/useGetGlobals'; import useGetPublicationRateFrom from '../../utils/Hooks/useGetPublicationRateFrom'; import Icon from '../Icon'; import InfoCard from '../InfoCard'; -const lastObservationSnapIndex = 0; -const previousObservationSnapIndex = 1; - export default function ProgressionCard({ domain }) { const intl = useIntl(); - const { observationSnaps } = useGlobals(); - - const [previousObservationSnap, setPreviousObservationSnap] = useState( - observationSnaps ? observationSnaps[previousObservationSnapIndex] : '', - ); - const [lastObservationSnap, setLastObservationSnap] = useState( - observationSnaps ? observationSnaps[lastObservationSnapIndex] : '', - ); + const { beforeLastObservationSnap, lastObservationSnap, observationSnaps } = useGlobals(); + const [previousObservationSnap, setPreviousObservationSnap] = useState(''); const [progression, setProgression] = useState({}); + useEffect(() => { + setPreviousObservationSnap( + isInProduction() + ? beforeLastObservationSnap + : observationSnaps?.[observationSnaps?.length - 1], + ); + }, [beforeLastObservationSnap, observationSnaps]); + const updateProgression = (res, year) => { const { rate } = res; if ( @@ -68,15 +67,6 @@ export default function ProgressionCard({ domain }) { return progPoints; }; - useEffect(() => { - if (observationSnaps && !previousObservationSnap && !lastObservationSnap) { - setPreviousObservationSnap( - observationSnaps[previousObservationSnapIndex], - ); - setLastObservationSnap(observationSnaps[lastObservationSnapIndex]); - } - }, [lastObservationSnap, observationSnaps, previousObservationSnap]); - return ( { }, { from: 2021, - to: 2024, + to: 2023, color: getCSSValue('--ouvrir-la-science-yellow'), }, ]; @@ -52,7 +52,6 @@ const Policy = () => { { y: 22, y_percent: 120 }, { y: 30, y_percent: 500 }, { y: 32, y_percent: 500 }, - { y: 37, y_percent: 505 }, ], }, ]; diff --git a/src/translations/en.json b/src/translations/en.json index 2828176d..196c2702 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1367,10 +1367,10 @@ "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.nb-cumulated": "Number of cumulated French ORCID accounts", + "app.orcid.count": "French ORCID to-date", + "app.orcid.employment-count": "ORCID with a French employement to-date", + "app.orcid.thesis-count": "ORCIDs who defended a thesis in France", "app.orcid.creation-year": "ORCID account creation year", "app.orcid.these-proportion": "Proportion of French PhD that have an ORCID", "app.orcid.general": "General", @@ -1383,7 +1383,7 @@ "app.national-orcid.general.chart-indicator-these-discipline.title": "Proportion of ORCIDs among PhD in France by field", "app.national-orcid.general.chart-indicator-these-discipline.comments": "This graph estimates, by discipline of thesis defense, the proportion of PhDs with an ORCID (according to ABES, using the data.idref service). The discipline shown is the discipline in which the thesis was defended (the first one in the case of multiple theses).", "app.national-orcid.general.chart-indicator-these-discipline.tooltip": " Person with a PhD in {point.indicator}
{point.y:.1f} % of the PhD in {point.indicator} have an ORCID
({point.y_abs} persons with an ORCID / {point.y_tot} persons that defended in {point.indicator})", - "app.national-orcid.general.chart-evolution.title": "French ORCID accounts evolution", + "app.national-orcid.general.chart-evolution.title": "Cumulative number of French ORCIDs", "app.national-orcid.general.chart-evolution.comments": "This graph shows the evolution of the number of French ORCIDs. An ORCID is considered French on the observation date (last available dump) if at least one of these conditions is met: a French employer on the date, a training course in progress in France on the date, the country indicated on the ORCID account is France, or a (public) email in .fr. Please note that very few emails are actually public in the ORCID dump.", "app.national-orcid.general.chart-evolution.tooltip": "{series.name}
{point.y} ORCID accounts created (cumulated) until {point.creation_date:%Y}", "app.national-orcid.general.creation-by-year.title": "Number of ORCID by creation year among PhD in France", diff --git a/src/translations/fr.json b/src/translations/fr.json index e3919d8d..93079f67 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -1337,11 +1337,11 @@ "app.orcid.employment": "ORCID déclarant être employé actuellement en France", "app.orcid.education": "ORCID déclarant suivre actuellement une formation en France", "app.orcid.address": "ORCID déclarant une adresse en France", - "app.orcid.count": "Total ORCID français à date", - "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.count": "ORCID français à date", + "app.orcid.employment-count": "ORCID avec employeur français à date", + "app.orcid.thesis-count": "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.nb-cumulated": "Nombre de comptes ORCID français cumulés", "app.orcid.perc": "Proportion de comptes ORCID", "app.orcid.creation-year": "Année de création de l'ORCID", "app.orcid.proportion": "Proportion de comptes ORCID français", @@ -1383,7 +1383,7 @@ "app.national-orcid.general.chart-indicator-these-discipline.title": "Proportion d'ORCID parmi les personnes ayant soutenu une thèse en France par discipline", "app.national-orcid.general.chart-indicator-these-discipline.comments": "Ce graphique estime, par discipline de soutenance de thèse, la proportion de docteur ayant un ORCID (d'après l'ABES, en utilisant le service data.idref). La discipline indiquée est la discipline de soutenance de la thèse (la première année en cas de thèses multiples).", "app.national-orcid.general.chart-indicator-these-discipline.tooltip": " Personnes ayant soutenu une thèse en {point.indicator}
{point.y:.1f} % des thésard(e)s en {point.indicator} ont un ORCID
({point.y_abs} personnes avec un ORCID / {point.y_tot} personnes ayant soutenu en {point.indicator})", - "app.national-orcid.general.chart-evolution.title": "Evolution du nombre d'ORCID français", + "app.national-orcid.general.chart-evolution.title": "Evolution du nombre d'ORCID français cumulés", "app.national-orcid.general.chart-evolution.comments": "Ce graphique présente l'évolution du nombre d'ORCID français. Un ORCID est considéré français à la date d'observation (dernier dump disponible) si au moins une de ces conditions est remplie : un employeur français à date, une formation en cours en France à date, le pays indiqué sur le compte ORCID est la France, ou un email (public) en .fr. Il est à noter que dans les faits, très peu d'emails sont publics dans le dump ORCID. ", "app.national-orcid.general.chart-evolution.tooltip": "{series.name}
{point.y} comptes ORCID créés (en cumulé) avant {point.creation_date:%Y}", "app.national-orcid.general.creation-by-year.title": "Nombre d'ORCID français par année de création parmi les personnes ayant soutenu une thèse en France", diff --git a/src/utils/helpers.js b/src/utils/helpers.js index 080bd2eb..6cdf6e69 100644 --- a/src/utils/helpers.js +++ b/src/utils/helpers.js @@ -235,7 +235,12 @@ export function getSource(id, otherSources = []) { if (id.includes('impact-financement')) { sources.push('ANR'); } - if (id.includes('thesis')) { + if ( + id.includes('thesis') + || id.includes('orcid.general.creation-by-year') + || id.includes('orcid.general.chart-indicator-these-year') + || id.includes('orcid.general.chart-indicator-these-discipline') + ) { sources.push('theses.fr'); } if (id.includes('hal')) {