Skip to content

Commit

Permalink
Merge pull request #381 from AgenceBio/thomas/fix/a11y-batch1
Browse files Browse the repository at this point in the history
  • Loading branch information
thom4parisot authored Jun 25, 2024
2 parents 6848da2 + 17b51e5 commit 64f7cf5
Show file tree
Hide file tree
Showing 37 changed files with 269 additions and 165 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const route = useRoute()
const title = computed(() => route.meta?.seo?.title)
// SEO
useHead({ title, titleTemplate: '%s — CartoBio (beta)' })
useHead({ title, titleTemplate: '%s — CartoBio' })
</script>
<style>
Expand Down
10 changes: 5 additions & 5 deletions src/components/MainFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
</div>
<ul class="fr-footer__content-list">
<li class="fr-footer__content-item">
<a class="fr-footer__content-link" target="_blank" href="https://agencebio.org">agencebio.org</a>
<a class="fr-footer__content-link" target="_blank" href="https://agencebio.org">agencebio.org<lien-externe /></a>
</li>
<li class="fr-footer__content-item">
<a class="fr-footer__content-link" target="_blank" href="https://www.data.gouv.fr/fr/dataset/616d6531c2951bbe8bd97771/">data.gouv.fr</a>
<a class="fr-footer__content-link" target="_blank" href="https://www.data.gouv.fr/fr/dataset/616d6531c2951bbe8bd97771/">data.gouv.fr<lien-externe /></a>
</li>
</ul>
</div>
Expand All @@ -46,9 +46,9 @@
</li>
<li class="fr-footer__bottom-item fr-footer__bottom-link">
Code source :
<a target="_blank" class="fr-footer__bottom-link" href="https://github.com/AgenceBio/cartobio-front">interface</a>
<a target="_blank" class="fr-footer__bottom-link" href="https://github.com/AgenceBio/cartobio-front">interface<lien-externe /></a>
et
<a target="_blank" class="fr-footer__bottom-link" href="https://github.com/AgenceBio/cartobio-front"><abbr title="Application Programmable Interface" lang="en">API</abbr></a>
<a target="_blank" class="fr-footer__bottom-link" href="https://github.com/AgenceBio/cartobio-front"><abbr title="Application Programmable Interface" lang="en">API</abbr><lien-externe /></a>
</li>
<li class="fr-footer__bottom-item">
<router-link class="fr-footer__bottom-link" to="/accessibilite">Accessibilité: non conforme</router-link>
Expand All @@ -59,7 +59,7 @@
</ul>
<div class="fr-footer__bottom-copy">
<p>Sauf mention contraire, tous les contenus de ce site sont sous <a
href="https://github.com/etalab/licence-ouverte/blob/master/LO.md" target="_blank">licence etalab-2.0</a>
href="https://github.com/etalab/licence-ouverte/blob/master/LO.md" target="_blank">licence etalab-2.0<lien-externe /></a>
</p>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/components/MainHeader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe("MainHeader", () => {
const wrapper = mount(MainHeader)

expect(wrapper.find('.tool-username').exists()).toEqual(false)
expect(wrapper.find('.fr-header__tools').text()).toEqual('À propos Aide Connexion')
expect(wrapper.find('.fr-nav[role="navigation"]').text()).toEqual('Aide À propos de CartoBio Connexion')
expect(wrapper.find('.fr-header__tools').text()).toEqual('À propos Aide Connexion')
expect(wrapper.find('.fr-nav[role="navigation"]').text()).toEqual('Aide À propos de CartoBio Connexion')
})

test("with a warning header", async () => {
Expand Down Expand Up @@ -58,7 +58,7 @@ describe("MainHeader", () => {
})

expect(wrapper.find('.tool-username').exists()).toEqual(false)
expect(wrapper.find('.fr-header__tools').text()).toEqual('À propos Aide Connexion')
expect(wrapper.find('.fr-header__tools').text()).toEqual('À propos Aide Connexion')
})

test("as a certification body", async () => {
Expand All @@ -69,7 +69,7 @@ describe("MainHeader", () => {
await flushPromises()

expect(wrapper.find('.tool-username a').classes('fr-icon-medal-fill')).toEqual(true)
expect(wrapper.find('.fr-nav[role="navigation"]').text()).toEqual('Nom Aide À propos de CartoBio Déconnexion')
expect(wrapper.find('.fr-nav[role="navigation"]').text()).toEqual('Nom Aide À propos de CartoBio Déconnexion')
expect(wrapper.find('.fr-nav[role="navigation"] a').attributes('href')).toEqual('/certification/exploitations')
expect(wrapper.find('.fr-nav[role="navigation"] a[target="_blank"]').attributes('href')).toEqual('https://docs-cartobio.agencebio.org/organisme-certification')

Expand All @@ -85,7 +85,7 @@ describe("MainHeader", () => {
await flushPromises()

expect(wrapper.find('.tool-username a').classes('fr-icon-plant-fill')).toEqual(true)
expect(wrapper.find('.fr-nav[role="navigation"]').text()).toEqual('Nom Aide À propos de CartoBio Déconnexion')
expect(wrapper.find('.fr-nav[role="navigation"]').text()).toEqual('Nom Aide À propos de CartoBio Déconnexion')
expect(wrapper.find('.fr-nav[role="navigation"] a').attributes('href')).toEqual('/exploitations')
expect(wrapper.find('.fr-nav[role="navigation"] a[target="_blank"]').attributes('href')).toEqual('https://docs-cartobio.agencebio.org/agriculteurs.trices')
})
Expand All @@ -98,6 +98,6 @@ describe("MainHeader", () => {
await flushPromises()

expect(wrapper.find('.tool-username a').classes('fr-icon-account-circle-fill')).toEqual(true)
expect(wrapper.find('.fr-nav[role="navigation"]').text()).toEqual('Nom Aide À propos de CartoBio Déconnexion')
expect(wrapper.find('.fr-nav[role="navigation"]').text()).toEqual('Nom Aide À propos de CartoBio Déconnexion')
})
})
6 changes: 3 additions & 3 deletions src/components/MainHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<li>
<a :href="documentationPage" target="_blank"
class="fr-btn fr-btn--icon-left fr-icon-questionnaire-fill">
Aide
Aide<lien-externe />
</a>
</li>
<li class="tool-username" aria-hidden="true" v-if="isLogged">
Expand Down Expand Up @@ -109,7 +109,7 @@
<li class="fr-nav__item">
<a :href="documentationPage" target="_blank" rel="noopener"
class="fr-nav__link fr-btn--icon-left fr-icon-questionnaire-fill">
Aide
Aide<lien-externe />
</a>
</li>
<li class="fr-nav__item">
Expand Down Expand Up @@ -181,7 +181,7 @@
<p class="fr-notice__title">
CartoBio rencontre actuellement des problèmes techniques.
<a href="https://docs-cartobio.agencebio.org/statut" rel="noreferrer noopener" target="_blank">
Visitez la page de statut pour en savoir plus.
Visitez la page de statut pour en savoir plus.<lien-externe />
</a>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/landing-page/ProductFlow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<li>
<span>
<strong class="fr-text--lead">Localiser votre territoire</strong><br />
<a href="https://www.agencebio.org/cartobio/" class="fr-link fr-icon-arrow-right-line fr-link--icon-right" target="_blank">Naviguer sur la carte</a>
<a href="https://www.agencebio.org/cartobio/" class="fr-link fr-icon-arrow-right-line fr-link--icon-right" target="_blank">Naviguer sur la carte<lien-externe /></a>
</span>
</li>
<li>
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/LayerSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<img src="@/assets/map/classification.jpg" alt="" />
<span>
<abbr title="Registre Parcellaire Graphique">RPG</abbr> {{ currentCampagne }}
<small class="fr-hint-text">Voir la <a href="https://docs-cartobio.agencebio.org/agriculteurs.trices/annexes/legendes-de-la-carte" @click.stop target="_blank">méthode de classification</a></small>
<small class="fr-hint-text">Voir la <a href="https://docs-cartobio.agencebio.org/agriculteurs.trices/annexes/legendes-de-la-carte" @click.stop target="_blank">méthode de classification<lien-externe /></a></small>
</span>
</button>
<button class="menu-entry" :class="{ 'active': cadastre }" @click="$emit('update:cadastre', !cadastre)" :aria-label="`${!cadastre ? 'Activer' : 'Désactiver'} le calque références cadastrales`">
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/MapContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ onMounted(() => {
onAdd: () => {
const el = document.createElement('div')
el.className = 'maplibregl-ctrl maplibregl-ctrl-attrib'
el.innerHTML = '<a href="https://docs-cartobio.agencebio.org/agriculteurs.trices/annexes/legendes-de-la-carte" target="_blank">Sources des données et licences</a>'
el.innerHTML = '<a href="https://docs-cartobio.agencebio.org/agriculteurs.trices/annexes/legendes-de-la-carte" target="_blank">Sources des données et licences<span class="fr-sr-only"> (ouvre un nouvel onglet)</span></a>'
return el
}
}, 'bottom-right')
Expand Down
2 changes: 1 addition & 1 deletion src/components/records/State.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("CertificationState", () => {
const wrapper = mount(State, { props: {
record: { 'certification_state': CertificationState.CERTIFIED, certification_date_debut: new Date('2023-01-01') }
} })
expect(wrapper.text()).toContain("Certifié 2023")
expect(wrapper.text()).toContain("Certifié2023")
expect(wrapper.attributes()).toHaveProperty('aria-label', "Certifié en 2023")
})
})
4 changes: 2 additions & 2 deletions src/components/records/State.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<span :class="['fr-badge', stateInfo.color]" :aria-label="dateLabel ? `${stateInfo.label} en ${dateLabel}` : stateInfo.label">
{{ stateInfo.label }}
<span v-if="showDate && dateLabel" class="year">{{ dateLabel }}</span>
<span aria-hidden>{{ stateInfo.label }}</span>
<span v-if="showDate && dateLabel" class="year" aria-hidden>{{ dateLabel }}</span>
</span>
</template>

Expand Down
Loading

0 comments on commit 64f7cf5

Please sign in to comment.