diff --git a/client/src/pages/openalex-affiliations/components/ror-badge.jsx b/client/src/pages/openalex-affiliations/components/ror-badge.jsx index e30bdb6..e9d7653 100644 --- a/client/src/pages/openalex-affiliations/components/ror-badge.jsx +++ b/client/src/pages/openalex-affiliations/components/ror-badge.jsx @@ -3,16 +3,11 @@ import PropTypes from 'prop-types'; import useCopyToClipboard from '../../../hooks/useCopyToClipboard'; -export default function RorBadge({ isRemoved, removeRor, ror, rorColor, setFilteredAffiliationName }) { - const [copyStatus, copy] = useCopyToClipboard(); - - const iconsType = { - CopiƩ: 'ri-checkbox-circle-fill', - Erreur: 'ri-settings-6-fill', - }; +export default function RorBadge({ className, isRemoved, removeRor, ror, rorColor, setFilteredAffiliationName }) { + const [_, copy] = useCopyToClipboard(); return ( -
+
{ removeRor(); }} + onClick={() => removeRor()} title="Undo remove" type="button" /> @@ -60,7 +55,7 @@ export default function RorBadge({ isRemoved, removeRor, ror, rorColor, setFilte
diff --git a/client/src/pages/openalex-affiliations/results/list-view.jsx b/client/src/pages/openalex-affiliations/results/list-view.jsx index 8b45b14..bb24424 100644 --- a/client/src/pages/openalex-affiliations/results/list-view.jsx +++ b/client/src/pages/openalex-affiliations/results/list-view.jsx @@ -8,6 +8,7 @@ import { Spinner, Text, } from '@dataesr/dsfr-plus'; +import { Steps } from 'intro.js-react'; import PropTypes from 'prop-types'; import { useEffect, useState } from 'react'; @@ -16,12 +17,15 @@ import RorBadge from '../components/ror-badge'; import RorName from '../components/ror-name'; import WorksList from '../components/works-list'; +import 'intro.js/introjs.css'; export default function ListView({ affiliationsCount, filteredAffiliations, removeRorFromAddList, setFilteredAffiliationName, setSelectAffiliations, + setStepsEnabledList, + stepsEnabledList, toggleRemovedRor, }) { const [isLoading, setIsLoading] = useState(false); @@ -53,6 +57,51 @@ 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 @@ -81,12 +130,19 @@ export default function ListView({ return ( <> + localStorage.setItem('works-magnet-tour-results', 'done')} + onExit={() => setStepsEnabledList(false)} + steps={steps} + />
- + !affiliation.selected) === undefined} onChange={() => { @@ -102,7 +158,7 @@ export default function ListView({ - + setSearch(e.target.value)} @@ -143,10 +199,10 @@ export default function ListView({ title="Clear search" /> - +