From 086f40dc4c27ad3c712755b7065c6b425bdcb3ec Mon Sep 17 00:00:00 2001 From: jerem Date: Wed, 25 Oct 2023 20:29:24 +0200 Subject: [PATCH 1/9] add accessibility module for highcharts --- .../components/chart-components/chart.js | 13 +++++ .../components/higher-education/charts.json | 54 ++++++++++++------- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/client/src/pages/country/components/chart-components/chart.js b/client/src/pages/country/components/chart-components/chart.js index 9660a3c..6ac4c62 100644 --- a/client/src/pages/country/components/chart-components/chart.js +++ b/client/src/pages/country/components/chart-components/chart.js @@ -1,5 +1,8 @@ import { Col } from '@dataesr/react-dsfr'; import Highcharts from 'highcharts'; +import HCExportingData from 'highcharts/modules/export-data'; +import HCExporting from 'highcharts/modules/exporting'; +// import HCAccessibility from 'highcharts/modules/accessibility'; import HighchartsReact from 'highcharts-react-official'; import PropTypes from 'prop-types'; @@ -7,6 +10,10 @@ import useFetchData from './hooks/useFetchData'; import './custom-style.scss'; +HCExporting(Highcharts); +HCExportingData(Highcharts); +require('highcharts/modules/accessibility')(Highcharts); + export default function Chart({ countryCode, data, hasDataHandler, otherCodes }) { const { options } = useFetchData({ base100: data.base100, @@ -27,6 +34,12 @@ export default function Chart({ countryCode, data, hasDataHandler, otherCodes }) if (nbEmpty === options.series.length) { return null; } + + options.accessibility = { + enabled: true, + description: data.description, + }; + hasDataHandler(true); return ( diff --git a/client/src/pages/country/components/higher-education/charts.json b/client/src/pages/country/components/higher-education/charts.json index 62fb865..9420ad9 100644 --- a/client/src/pages/country/components/higher-education/charts.json +++ b/client/src/pages/country/components/higher-education/charts.json @@ -8,7 +8,8 @@ "type": "line", "source": "Unesco", "base100": true, - "theme": "niveau" + "theme": "niveau", + "description": "" }, { "title": "Effectif total scolarisé en licence ou équivalent (niveau 6 de la CITE)", @@ -19,7 +20,8 @@ "type": "line", "source": "Unesco", "base100": true, - "theme": "niveau" + "theme": "niveau", + "description": "" }, { "title": "Effectif total scolarisé en master ou équivalent (niveau 7 de la CITE)", @@ -30,7 +32,8 @@ "type": "line", "source": "Unesco", "base100": true, - "theme": "niveau" + "theme": "niveau", + "description": "" }, { "title": "Effectif total scolarisé en doctorat ou équivalent (niveau 8 de la CITE)", @@ -41,7 +44,8 @@ "type": "line", "source": "Unesco", "base100": true, - "theme": "niveau" + "theme": "niveau", + "description": "" }, { "title": "Effectif total scolarisé dans l'enseignement supérieur", @@ -52,7 +56,8 @@ "type": "line", "source": "Unesco", "base100": true, - "theme": "niveau" + "theme": "niveau", + "description": "" }, { "title": "Part des diplômés dans d'autres domaines d'études que les Sciences", @@ -63,7 +68,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Agriculture, sylviculture, halieutique et sciences vétérinaire\"", @@ -74,7 +80,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Commerce, administration et droit\"", @@ -85,7 +92,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés au domaine d'études non-spécifié", @@ -96,7 +104,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Education\"", @@ -107,7 +116,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Ingénierie, industries de transformation et construction\"", @@ -118,7 +128,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Lettres et Arts\"", @@ -129,7 +140,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Santé et Protection sociale\"", @@ -140,7 +152,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Sciences naturelles, mathématiques et statistiques\"", @@ -151,7 +164,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Sciences sociales, journalisme et information\"", @@ -162,7 +176,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Sciences, Technologies, Ingénierie et Mathématiques\"", @@ -173,7 +188,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Services\"", @@ -184,7 +200,8 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" }, { "title": "Part des diplômés dans le domaine d'études \"Technologies de l’information et de la communication\"", @@ -195,6 +212,7 @@ "type": "line", "source": "Unesco", "base100": false, - "theme": "domaine" + "theme": "domaine", + "description": "" } ] \ No newline at end of file From 436395b5dd8694a3f25a68afd6f45b055c87b20e Mon Sep 17 00:00:00 2001 From: jerem Date: Thu, 26 Oct 2023 21:40:26 +0200 Subject: [PATCH 2/9] add skip link --- client/src/components/search-bar/index.js | 1 + client/src/index.scss | 8 ++ client/src/layout/header/index.js | 135 +++++++++++++--------- client/src/layout/index.js | 2 +- client/src/pages/homepage/index.js | 2 +- 5 files changed, 91 insertions(+), 57 deletions(-) diff --git a/client/src/components/search-bar/index.js b/client/src/components/search-bar/index.js index 87f36ed..13d5d52 100644 --- a/client/src/components/search-bar/index.js +++ b/client/src/components/search-bar/index.js @@ -100,6 +100,7 @@ const SearchBar = forwardRef((props, ref) => { onFocus={() => setShowOptions(true)} role="search" className={classNames(styles.form, _className)} + id="a11ySearch" >