From 2316d51d6a18650b21536ff4519a5b2efdf305f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Fri, 3 Jan 2025 12:14:09 +0100 Subject: [PATCH] fix(openalex): Switch from Intro.js-react to Intro.js --- client/package.json | 2 +- .../openalex-affiliations/results/index.jsx | 388 ++++++++++-------- .../results/list-view.jsx | 53 --- .../pages/openalex-affiliations/search.jsx | 73 ++-- client/src/styles/index.scss | 155 ++++--- client/src/utils/works.jsx | 2 +- package-lock.json | 15 +- 7 files changed, 320 insertions(+), 368 deletions(-) diff --git a/client/package.json b/client/package.json index d086e56..66539bc 100644 --- a/client/package.json +++ b/client/package.json @@ -17,7 +17,7 @@ "classnames": "^2.3.2", "highcharts": "^11.4.8", "highcharts-react-official": "^3.2.1", - "intro.js-react": "^1.0.0", + "intro.js": "^7.2.0", "papaparse": "^5.4.1", "primereact": "^9.6.0", "prop-types": "^15.8.1", diff --git a/client/src/pages/openalex-affiliations/results/index.jsx b/client/src/pages/openalex-affiliations/results/index.jsx index 6997468..9f6a244 100644 --- a/client/src/pages/openalex-affiliations/results/index.jsx +++ b/client/src/pages/openalex-affiliations/results/index.jsx @@ -14,7 +14,7 @@ import { TextInput, } from '@dataesr/dsfr-plus'; import { useQuery } from '@tanstack/react-query'; -import { Steps } from 'intro.js-react'; +import introJs from 'intro.js'; import { useEffect, useState } from 'react'; import { useLocation, useNavigate, useSearchParams } from 'react-router-dom'; @@ -32,6 +32,7 @@ import ListView from './list-view'; import 'intro.js/introjs.css'; import 'primereact/resources/primereact.min.css'; import 'primereact/resources/themes/lara-light-indigo/theme.css'; +import '../../../styles/index.scss'; const { VITE_APP_TAG_LIMIT } = import.meta.env; @@ -55,32 +56,138 @@ export default function Affiliations() { const [rorMessage, setRorMessage] = useState(''); const [rorMessageType, setRorMessageType] = useState(''); const [rorsToRemove, setRorsToRemove] = useState([]); - const [stepsEnabled, setStepsEnabled] = useState(false); const [stepsEnabledList, setStepsEnabledList] = useState(false); const [uniqueRors, setUniqueRors] = useState({}); - const steps = [ - { - element: '.step-search-summary', - intro: 'Here is your search', - }, - { - element: '.step-search-go-back', - intro: 'Click here to modify your search', - }, - { - element: '.step-action-add-remove-ror', - intro: 'Click here to add or remove ROR from selected affiliations', - }, - { - element: '.step-action-export', - intro: 'Click here to export corrections, choose between CSV and JSONL format', - }, - { - element: '.step-action-feedback', - intro: 'Click here to send feedback to OpenAlex', - }, - ]; + const toggleRemovedRor = (affiliationId, rorId) => { + const updatedAffiliations = affiliations.map((affiliation) => { + if (affiliation.id === affiliationId) { + return { + ...affiliation, + removeList: affiliation.removeList.includes(rorId) + ? affiliation.removeList.filter((item) => item !== rorId) + : [...affiliation.removeList, rorId], + }; + } + return affiliation; + }); + setAffiliations(updatedAffiliations); + }; + + const removeRorMultiple = () => { + const selectedRorIds = rorsToRemove.filter((_ror) => _ror.removed).map((_ror) => _ror.rorId); + const affiliationsTmp = affiliations.map((affiliation) => { + if (affiliation.selected) { + return { + ...affiliation, + addList: affiliation.addList.filter((item) => !selectedRorIds.includes(item.rorId)), + removeList: [...new Set([...affiliation.removeList, ...selectedRorIds])].filter((item) => affiliation.rors.map((_ror) => _ror.rorId).includes(item)), + selected: false, + }; + } + return affiliation; + }); + setAffiliations(affiliationsTmp); + setRorsToRemove([]); + setIsRemoveModalOpen(false); + }; + + const removeRorFromAddList = (affiliationId, rorId) => { + const updatedAffiliations = affiliations.map((affiliation) => { + if (affiliation.id === affiliationId) { + if (affiliation.addList.find((item) => item.rorId === rorId)) { + return { ...affiliation, addList: affiliation.addList.filter((item) => item.rorId !== rorId) }; + } + } + return affiliation; + }); + setAffiliations(updatedAffiliations); + }; + + const addRor = () => { + const updatedAffiliations = affiliations.map((affiliation) => { + if (affiliation.selected + && !affiliation.addList.some((item) => item.rorId === cleanRor.rorId) + && !affiliation.rors.some((item) => item.rorId === cleanRor.rorId) + ) { + return { + ...affiliation, + addList: [...affiliation.addList, cleanRor], + selected: false, + }; + } + return { + ...affiliation, + selected: false, + }; + }); + setAffiliations(updatedAffiliations); + setRor(''); + setCleanRor({}); + setIsAddModalOpen(false); + }; + + const getCleanRor = async () => { + setIsLoadingRor(true); + const cleanRorData = await getRorData(ror); + setCleanRor(cleanRorData[0]); + setIsLoadingRor(false); + }; + + const setSelectAffiliations = (affiliationIds) => { + const updatedAffiliations = affiliations.map((affiliation) => { + if (affiliationIds.includes(affiliation.id)) { + return { ...affiliation, selected: !affiliation.selected }; + } + return affiliation; + }); + setAffiliations(updatedAffiliations); + }; + + const getUniqueRors = () => { + const selectedRors = {}; + const selectedAffiliations = filteredAffiliations.filter((affiliation) => affiliation.selected); + + // initial RORs + selectedAffiliations.forEach((affiliation) => { + affiliation.rors.forEach((_ror) => { + if (affiliation.removeList.includes(_ror.rorId)) return; + if (!selectedRors[_ror.rorId]) { + selectedRors[_ror.rorId] = { ..._ror, count: 0 }; + } + selectedRors[_ror.rorId].count += 1; + }); + }); + + // added RORs + selectedAffiliations.forEach((affiliation) => { + affiliation.addList.forEach((_ror) => { + if (!selectedRors[_ror.rorId]) { + selectedRors[_ror.rorId] = { ..._ror, count: 0 }; + } + selectedRors[_ror.rorId].count += 1; + }); + }); + + const rorArray = Object.keys(selectedRors).map((rorId) => ({ + rorId, + rorName: selectedRors[rorId].rorName, + rorCountry: selectedRors[rorId].rorCountry, + count: selectedRors[rorId].count, + removed: false, + })); + return rorArray; + }; + + const resetCorrections = () => { + const affiliationsTmp = affiliations.map((affiliation) => ({ + ...affiliation, + addList: [], + removeList: [], + rorToCorrect: affiliation.rors, + })); + setAffiliations(affiliationsTmp); + }; const { data, error, isFetched, isFetching, refetch } = useQuery({ queryKey: ['openalex-affiliations', JSON.stringify(options)], @@ -100,11 +207,6 @@ export default function Affiliations() { enabled: false, }); - useEffect(() => { - // Enable guided tour only for the first visit - if (localStorage.getItem('works-magnet-tour-results') !== 'done') setStepsEnabled(true); - }, [setStepsEnabled]); - useEffect(() => { const get = async () => { const addedRors = await Promise.all( @@ -185,9 +287,7 @@ export default function Affiliations() { }, [options, refetch]); useEffect(() => { - setAffiliations(data?.affiliations?.filter( - (affiliation) => affiliation.source === 'OpenAlex', - ).map((affiliation) => ({ + setAffiliations(data?.affiliations?.map((affiliation) => ({ ...affiliation, addList: [], removeList: [], @@ -197,13 +297,17 @@ export default function Affiliations() { useEffect(() => { setIsLoading(true); - const regex = new RegExp(removeDiacritics(filteredAffiliationName)); - const filteredAffiliationsTmp = affiliations.filter( - (affiliation) => regex.test( - `${affiliation.key.replace('[ source: ', '').replace(' ]', '')} ${affiliation.rors.map((_ror) => _ror.rorId).join(' ')}`, - ), - ); - setFilteredAffiliations(filteredAffiliationsTmp); + if (filteredAffiliationName !== '') { + const regex = new RegExp(removeDiacritics(filteredAffiliationName)); + const filteredAffiliationsTmp = affiliations.filter( + (affiliation) => regex.test( + `${affiliation.key.replace('[ source: ', '').replace(' ]', '')} ${affiliation.rors.map((_ror) => _ror.rorId).join(' ')}`, + ), + ); + setFilteredAffiliations(filteredAffiliationsTmp); + } else { + setFilteredAffiliations(affiliations); + } setIsLoading(false); }, [affiliations, filteredAffiliationName]); @@ -224,142 +328,79 @@ export default function Affiliations() { // eslint-disable-next-line react-hooks/exhaustive-deps }, [ror]); - const toggleRemovedRor = (affiliationId, rorId) => { - const updatedAffiliations = affiliations.map((affiliation) => { - if (affiliation.id === affiliationId) { - return { - ...affiliation, - removeList: affiliation.removeList.includes(rorId) - ? affiliation.removeList.filter((item) => item !== rorId) - : [...affiliation.removeList, rorId], - }; - } - return affiliation; - }); - setAffiliations(updatedAffiliations); - }; - - const removeRorMultiple = () => { - const selectedRorIds = rorsToRemove.filter((_ror) => _ror.removed).map((_ror) => _ror.rorId); - const affiliationsTmp = affiliations.map((affiliation) => { - if (affiliation.selected) { - return { - ...affiliation, - addList: affiliation.addList.filter((item) => !selectedRorIds.includes(item.rorId)), - removeList: [...new Set([...affiliation.removeList, ...selectedRorIds])].filter((item) => affiliation.rors.map((_ror) => _ror.rorId).includes(item)), - selected: false, - }; - } - return affiliation; - }); - setAffiliations(affiliationsTmp); - setRorsToRemove([]); - setIsRemoveModalOpen(false); - }; - - const removeRorFromAddList = (affiliationId, rorId) => { - const updatedAffiliations = affiliations.map((affiliation) => { - if (affiliation.id === affiliationId) { - if (affiliation.addList.find((item) => item.rorId === rorId)) { - return { ...affiliation, addList: affiliation.addList.filter((item) => item.rorId !== rorId) }; - } - } - return affiliation; - }); - - setAffiliations(updatedAffiliations); - }; - useEffect(() => { if (rorMessageType !== 'valid') { setCleanRor({}); } }, [rorMessageType]); - const addRor = () => { - const updatedAffiliations = affiliations.map((affiliation) => { - if (affiliation.selected - && !affiliation.addList.some((item) => item.rorId === cleanRor.rorId) - && !affiliation.rors.some((item) => item.rorId === cleanRor.rorId) - ) { - return { - ...affiliation, - addList: [...affiliation.addList, cleanRor], - selected: false, - }; - } - return { - ...affiliation, - selected: false, - }; - }); - setAffiliations(updatedAffiliations); - setRor(''); - setCleanRor({}); - setIsAddModalOpen(false); - }; - - const getCleanRor = async () => { - setIsLoadingRor(true); - const cleanRorData = await getRorData(ror); - setCleanRor(cleanRorData[0]); - setIsLoadingRor(false); - }; - - const setSelectAffiliations = (affiliationIds) => { - const updatedAffiliations = affiliations.map((affiliation) => { - if (affiliationIds.includes(affiliation.id)) { - return { ...affiliation, selected: !affiliation.selected }; - } - return affiliation; - }); - setAffiliations(updatedAffiliations); - }; - - const getUniqueRors = () => { - const selectedRors = {}; - const selectedAffiliations = filteredAffiliations.filter((affiliation) => affiliation.selected); - - // initial RORs - selectedAffiliations.forEach((affiliation) => { - affiliation.rors.forEach((_ror) => { - if (affiliation.removeList.includes(_ror.rorId)) return; - if (!selectedRors[_ror.rorId]) { - selectedRors[_ror.rorId] = { ..._ror, count: 0 }; - } - selectedRors[_ror.rorId].count += 1; - }); - }); - - // added RORs - selectedAffiliations.forEach((affiliation) => { - affiliation.addList.forEach((_ror) => { - if (!selectedRors[_ror.rorId]) { - selectedRors[_ror.rorId] = { ..._ror, count: 0 }; - } - selectedRors[_ror.rorId].count += 1; - }); - }); - - const rorArray = Object.keys(selectedRors).map((rorId) => ({ - rorId, - rorName: selectedRors[rorId].rorName, - rorCountry: selectedRors[rorId].rorCountry, - count: selectedRors[rorId].count, - removed: false, - })); - return rorArray; - }; - - const resetCorrections = () => { - const affiliationsTmp = affiliations.map((affiliation) => ({ - ...affiliation, - addList: [], - removeList: [], - rorToCorrect: affiliation.rors, - })); - setAffiliations(affiliationsTmp); - }; + useEffect(() => { + if (filteredAffiliations.length > 0) { + introJs().setOptions({ + dontShowAgain: true, + dontShowAgainCookie: 'introjs-dontShowAgain-results', + showStepNumbers: true, + steps: [ + { + element: document.querySelector('.step-search-summary'), + intro: 'Here is your search', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-search-go-back'), + intro: 'Click here to modify your search', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-action-add-remove-ror'), + intro: 'Click here to add or remove ROR from selected affiliations', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-action-export'), + intro: 'Click here to export corrections, choose between CSV and JSONL format', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-action-feedback'), + intro: 'Click here to send feedback to OpenAlex', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-affiliations-select'), + intro: 'Select all affiliations', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-affiliations-search'), + intro: 'Search through affiliations names', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-affiliations-sort'), + intro: 'Open menu to filter affiliations by country and sort them', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-affiliations-colors'), + intro: 'Explanation about the colors of ROR', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-affiliation-checkbox'), + intro: 'Select affiliation one by one', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-affiliation-badge'), + intro: '', + title: 'Tutorial', + }, + ], + }).start(); + document.getElementById('introjs-dontShowAgain')?.click(); + } + }, [filteredAffiliations]); return ( <> @@ -401,15 +442,6 @@ export default function Affiliations() { {!isFetching && isFetched && ( <> - { - setStepsEnabled(false); - setStepsEnabledList(true); - }} - steps={steps} - /> diff --git a/client/src/pages/openalex-affiliations/results/list-view.jsx b/client/src/pages/openalex-affiliations/results/list-view.jsx index 10d76de..95628c9 100644 --- a/client/src/pages/openalex-affiliations/results/list-view.jsx +++ b/client/src/pages/openalex-affiliations/results/list-view.jsx @@ -7,7 +7,6 @@ import { Row, Text, } from '@dataesr/dsfr-plus'; -import { Steps } from 'intro.js-react'; import PropTypes from 'prop-types'; import { useEffect, useState } from 'react'; @@ -56,51 +55,6 @@ export default function ListView({ const sortedRor = Object.keys(rorCount).sort((a, b) => rorCount[b] - rorCount[a]); defineRorColor.push(...sortedRor.slice(0, 5).map((ror, index) => ({ ror, color: dsColors[index % dsColors.length] }))); - const steps = [ - { - element: '.step-affiliations-select', - intro: 'Select all affiliations', - }, - { - element: '.step-affiliations-search', - intro: 'Search through affiliations names', - }, - { - element: '.step-affiliations-sort', - intro: 'Open menu to filter affiliations by country and sort them', - }, - { - element: '.step-affiliations-colors', - intro: 'Explanation about the colors of ROR', - }, - { - element: '.step-affiliation-checkbox', - intro: 'Select affiliation one by one', - }, - { - element: '.step-affiliation-badge', - intro:
    -
  • Colors are given to the most 5 frequent ROR
  • -
  • Click here to see the ROR matched
  • -
  • - - {' '} - Filter on this ROR -
  • -
  • - - {' '} - Copy ROR -
  • -
  • - - {' '} - Delete this ROR from this affiliation -
  • -
, - }, - ]; - useEffect(() => { setIsLoading(true); // Deep copy of filteredAffiliations object @@ -126,13 +80,6 @@ export default function ListView({ return ( <> - localStorage.setItem('works-magnet-tour-results', 'done')} - onExit={() => setStepsEnabledList(false)} - steps={steps} - />
-
  • Searched affiliations
  • -
  • Can be either ROR or string
  • -
  • Press ENTER to validate each seizure
  • -
  • OR boolean will be applied during the search
  • - , - }, - { - element: '.step-ror-to-exclude', - intro:
      -
    • ROR to exclude
    • -
    • ROR only
    • -
    • Separate multiple ROR by space
    • -
    , - }, - { - element: '.step-year-start', - intro: 'Filter on publication year between start and end', - }, - { - element: '.step-search-works', - intro: 'Click here to run the search. ⏳ It can take a while', - }, - ]; - useEffect(() => { if (searchParams.size < 4) { // Set default params values @@ -192,9 +163,35 @@ export default function Search() { }, [currentSearchParams.getRorChildren, deletedAffiliations, searchedAffiliations]); useEffect(() => { - // Enable guided tour only for the first visit - if (localStorage.getItem('works-magnet-tour-search') !== 'done') setStepsEnabled(true); - }, [setStepsEnabled]); + introJs().setOptions({ + dontShowAgain: true, + dontShowAgainCookie: 'introjs-dontShowAgain-search', + showStepNumbers: true, + steps: [ + { + element: document.querySelector('.step-ror-to-add'), + intro: '
    • Searched affiliations
    • Can be either ROR or string
    • Press ENTER to validate each seizure
    • OR boolean will be applied during the search
    ', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-ror-to-exclude'), + intro: '
    • ROR to exclude
    • ROR only
    • Separate multiple ROR by space
    ', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-year-start'), + intro: 'Filter on publication year between start and end', + title: 'Tutorial', + }, + { + element: document.querySelector('.step-search-works'), + intro: 'Click here to run the search. ⏳ It can take a while', + title: 'Tutorial', + }, + ], + }).start(); + document.getElementById('introjs-dontShowAgain')?.click(); + }, []); const checkAndSendQuery = () => { if (onInputAffiliationsHandler) { @@ -257,16 +254,6 @@ export default function Search() { return ( <>
    - localStorage.setItem('works-magnet-tour-search', 'done')} - onExit={() => { - setStepsEnabled(false); - localStorage.setItem('works-magnet-tour-search', 'done'); - }} - steps={steps} - /> setIsOpen(false)} size="xl"> diff --git a/client/src/styles/index.scss b/client/src/styles/index.scss index 08231c3..3fb2107 100644 --- a/client/src/styles/index.scss +++ b/client/src/styles/index.scss @@ -1,5 +1,4 @@ /* Common */ - .cursor-pointer { cursor: pointer; } @@ -37,7 +36,8 @@ /* General */ -html, body { +html, +body { height: 100%; } @@ -57,16 +57,8 @@ html, body { } } -// Reduce margin width -// @media (min-width: 100em) { -// .fr-container, .fr-container-sm, .fr-container-md, .fr-container-lg { -// max-width: 100rem; -// } -// } - /* DataTable - PaginatorLeft */ - .p-paginator-left-content { width: 60%; @@ -82,7 +74,9 @@ html, body { } } -.fr-toggle input[type=checkbox]:checked~.fr-toggle__label[data-fr-unchecked-label][data-fr-checked-label]:before { +.fr-toggle + input[type="checkbox"]:checked + ~ .fr-toggle__label[data-fr-unchecked-label][data-fr-checked-label]:before { content: ""; margin-right: 5px; } @@ -92,11 +86,11 @@ html, body { } -/* Pge Mentions */ +/* Page Mentions */ .mentions { .hint { color: grey; - font-size: .8em; + font-size: 0.8em; font-style: italic; text-align: end; } @@ -108,7 +102,6 @@ html, body { } } - .box-info { background-color: #eee; border: 1px solid #000; @@ -118,15 +111,14 @@ html, body { } .wm-font { - font-family: 'Courier New', Courier, monospace; + font-family: "Courier New", Courier, monospace; } .wm-bg { - // background: linear-gradient(to right, #0e0e31, #1a1add); background-color: #fff; } -.wm-message{ +.wm-message { background-color: #eee; padding: 15px; border: 1px solid #000; @@ -134,17 +126,17 @@ html, body { box-shadow: 5px 5px 15px 0px rgba(50, 50, 50, 0.3); } -.wm-fit-content{ +.wm-fit-content { min-height: 100%; /* real browsers */ height: auto !important; /* real browsers */ - height: 100%; + height: 100%; } -.wm-menu{ +.wm-menu { min-height: fit-content; padding-top: 10px; - - .wm-title{ + + .wm-title { background-color: #eeeeee; color: #222; padding: 5px; @@ -155,19 +147,19 @@ html, body { border: #777 1px solid; } - .wm-content{ + .wm-content { min-height: 80px; } - .wm-text{ + .wm-text { color: white; padding: 5px; - & span{ - font-size: 1.5em; + & span { + font-size: 1.5em; font-weight: bold; } } - + .wm-button { width: 90%; border-top-right-radius: 15px; @@ -187,11 +179,11 @@ html, body { padding: 10px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px; - + .wm-external-actions { border: #777 1px solid; background-color: #eee; - padding: 10px 0 0 10px; + padding: 10px 0 0 10px; border-top-right-radius: 15px; border-top-left-radius: 15px; border-bottom: 1px solid #ddd; @@ -204,7 +196,7 @@ html, body { margin-bottom: 5px; background-color: #eee; } - + .wm-list { background-color: #eee; list-style: none; @@ -215,27 +207,26 @@ html, body { padding: 10px; border-bottom: 1px solid #ddd; font-size: 0.9rem; - } .selected { background-color: #eae2e2; } } - .wm-ror-badge{ + .wm-ror-badge { display: inline-flex; align-items: center; background-color: #fff; border-radius: 10px; border-top-left-radius: 10px; - span{ + span { border-radius: 10px; display: inline-block; width: 15px; height: 15px; - margin-left: 5px; - } - div{ + margin-left: 5px; + } + div { margin-left: 5px; display: inline-block; background-color: #fff; @@ -252,46 +243,52 @@ html, body { --beige-gris-galet: #d3d3d3; } -.loader{ - display: inline-block; - text-align: center; - line-height: 86px; - text-align: center; - position: relative; - padding: 0 48px; - font-size: 28px; - font-family: 'Courier New', Courier, monospace; - color: #222; - } - .loader:before, .loader:after { - content: ""; - display: block; - width: 15px; - height: 15px; - background: currentColor; - position: absolute; - animation: load .7s infinite alternate ease-in-out; - top: 0; - } - .loader:after { - top: auto; - bottom: 0; - } - @keyframes load { - 0% { - left: 0; - height: 43px; - width: 15px; - transform: translateX(0) - } - 50% { - height: 10px; - width: 40px - } - 100% { - left: 100%; - height: 43px; - width: 15px; - transform: translateX(-100%) - } - } \ No newline at end of file +.loader { + display: inline-block; + text-align: center; + line-height: 86px; + text-align: center; + position: relative; + padding: 0 48px; + font-size: 28px; + font-family: "Courier New", Courier, monospace; + color: #222; +} +.loader:before, +.loader:after { + content: ""; + display: block; + width: 15px; + height: 15px; + background: currentColor; + position: absolute; + animation: load 0.7s infinite alternate ease-in-out; + top: 0; +} +.loader:after { + top: auto; + bottom: 0; +} +@keyframes load { + 0% { + left: 0; + height: 43px; + width: 15px; + transform: translateX(0); + } + 50% { + height: 10px; + width: 40px; + } + 100% { + left: 100%; + height: 43px; + width: 15px; + transform: translateX(-100%); + } +} + +// Intro.js tooltips +.introjs-tooltip .introjs-dontShowAgain { + display: none; +} \ No newline at end of file diff --git a/client/src/utils/works.jsx b/client/src/utils/works.jsx index 2f58f17..7463f84 100644 --- a/client/src/utils/works.jsx +++ b/client/src/utils/works.jsx @@ -84,7 +84,7 @@ const getOpenAlexAffiliations = async (body, toast) => { signal: timeout(1200).signal, // 20 minutes }); if (!response.ok) { - throw new Error('Oops... FOSM API request did not work for works !'); + throw new Error('Oops... Error while computing OpenAlex affiliations !'); } const { affiliations, warnings } = await response.json(); const resAffiliations = await unzipAll(affiliations); diff --git a/package-lock.json b/package-lock.json index b8498f4..e236db4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "classnames": "^2.3.2", "highcharts": "^11.4.8", "highcharts-react-official": "^3.2.1", - "intro.js-react": "^1.0.0", + "intro.js": "^7.2.0", "papaparse": "^5.4.1", "primereact": "^9.6.0", "prop-types": "^15.8.1", @@ -5647,18 +5647,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/intro.js/-/intro.js-7.2.0.tgz", "integrity": "sha512-qbMfaB70rOXVBceIWNYnYTpVTiZsvQh/MIkfdQbpA9di9VBfj1GigUPfcCv3aOfsbrtPcri8vTLTA4FcEDcHSQ==", - "license": "AGPL-3.0", - "peer": true - }, - "node_modules/intro.js-react": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/intro.js-react/-/intro.js-react-1.0.0.tgz", - "integrity": "sha512-zR8pbTyX20RnCZpJMc0nuHBpsjcr1wFkj3ZookV6Ly4eE/LGpFTQwPsaA61Cryzwiy/tTFsusf4hPU9NpI9UOg==", - "license": "MIT", - "peerDependencies": { - "intro.js": ">=2.5.0", - "react": ">=0.14.0" - } + "license": "AGPL-3.0" }, "node_modules/ipaddr.js": { "version": "1.9.1",