Merge pull request #10530 from demarches-simplifiees/a11y-fix-nav

Correction de la structure de navigation
This commit is contained in:
mfo 2024-06-20 13:25:54 +00:00 committed by GitHub
commit cbe8d92f81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 74 additions and 79 deletions

View file

@ -1,6 +1,6 @@
.fr-grid-row
.fr-col-12
%nav.fr-translate.fr-nav
.fr-translate.fr-nav
.fr-nav__item.custom-fr-translate-flex-end
%button.fr-translate__btn.translate-no-icon.fr-btn.fr-btn--tertiary.custom-fr-translate-no-icon{ "aria-controls" => "filters", "aria-expanded" => "false", title: t('.button.select_filters') }
= t('.button.select_filters')

View file

@ -1,4 +1,4 @@
%nav#header-navigation.fr-nav{ role: :navigation, "aria-label" => t('main_menu', scope: [:layouts, :header]) }
#header-navigation.fr-nav
%ul.fr-nav__list
- if instructeur?
%li.fr-nav__item

View file

@ -1,4 +1,4 @@
%nav#header-navigation.fr-nav{ role: 'navigation', 'aria-label': 'Menu principal administrateur' }
#header-navigation.fr-nav
%ul.fr-nav__list
%li.fr-nav__item= link_to 'Mes démarches', admin_procedures_path, class:'fr-nav__link', 'aria-current': current_page?(controller: 'administrateurs/procedures', action: :index) ? 'true' : nil
- if Rails.application.config.ds_zonage_enabled

View file

@ -1,4 +1,4 @@
- content_for(:main_navigation) do
%nav#header-navigation.fr-nav{ role: 'navigation', 'aria-label': 'Menu principal gestionnaire' }
#header-navigation.fr-nav
%ul.fr-nav__list
%li.fr-nav__item= link_to 'Mes groupes gestionnaires', gestionnaire_groupe_gestionnaires_path, class:'fr-nav__link', 'aria-current': current_page?(controller: 'groupe_gestionnaires', action: :index) ? 'page' : nil

View file

@ -1,4 +1,4 @@
%nav.fr-translate.fr-nav{ role: "navigation", "aria-label"=> t('menu_aria_label', scope: [:layouts]) }
%nav.fr-translate.fr-nav{ role: "navigation", "aria-label"=> t('my_account', scope: [:layouts]) }
.fr-nav__item
%button.account-btn.fr-translate__btn.fr-btn{ "aria-controls" => "account", "aria-expanded" => "false", :title => t('my_account', scope: [:layouts]) }
%span= current_email

View file

@ -8,6 +8,7 @@
- is_user_context = nav_bar_profile == :user
- is_search_enabled = [params[:controller] == 'recherche', is_instructeur_context, is_expert_context, is_user_context && current_user.dossiers.count].any?
%header{ class: ["fr-header", content_for?(:notice_info) && "fr-header__with-notice-info"], role: "banner", "data-controller": "dsfr-header" }
%nav{ :role => "navigation", "aria-label" => t('layouts.header.main_menu') }
.fr-header__body
.fr-container
.fr-header__body-row
@ -52,7 +53,7 @@
= render partial: 'shared/help/help_dropdown_instructeur'
- else
// NB: on mobile in order to have links correctly aligned, we need a left icon
= link_to t('help'), t("links.common.faq.url"), class: 'fr-btn dropdown-button', title: t('help')
= link_to t('help'), t("links.common.faq.url"), class: 'fr-btn dropdown-button'

View file

@ -1,4 +1,4 @@
%nav.fr-translate.fr-nav{ :role => "navigation", title: t('.select_locale') }
.fr-translate.fr-nav
.fr-nav__item
%button.fr-translate__btn.fr-btn{ "aria-controls" => "translate", "aria-expanded" => "false", :title => t('.select_locale') }
= I18n.locale.upcase

View file

@ -1,5 +1,5 @@
- content_for(:main_navigation) do
%nav.fr-nav#header-navigation{ role: "navigation", aria: { label: 'Menu principal annonces' } }
#header-navigation.fr-nav
%ul.fr-nav__list
%li.fr-nav__item
= link_to "Toutes les annonces", super_admins_release_notes_path, class: "fr-nav__link", target: "_self", aria: { current: action == :index ? "page" : nil }

View file

@ -1,4 +1,4 @@
%nav#header-navigation.fr-nav{ role: :navigation, "aria-label" => t('main_menu', scope: [:layouts, :header]) }
#header-navigation.fr-nav
%ul.fr-nav__list
- if params[:controller] == 'users/commencer'
%li.fr-nav__item

View file

@ -2,7 +2,6 @@ en:
layouts:
header:
files: My files
menu_aria_label: 'Menu my profile'
go_superadmin: "Switch to super-admin"
go_user: "Switch to user"
go_instructor: "Switch to instructor"
@ -11,7 +10,7 @@ en:
go_gestionnaire: "Switch to admins group manager"
profile: "See my profile"
logout: "Log out"
my_account: "My account"
my_account: "My profile"
connected_as: "connected as %{profile}"
instructeur: instructor
administrateur: admin

View file

@ -2,7 +2,6 @@ fr:
layouts:
header:
files: Mes dossiers
menu_aria_label: 'Menu mon profil'
go_superadmin: "Passer en super-admin"
go_user: "Passer en usager"
go_instructor: "Passer en instructeur"
@ -11,7 +10,7 @@ fr:
go_gestionnaire: "Passer en gestionnaire"
profile: "Voir mon profil"
logout: "Se déconnecter"
my_account: "Mon compte"
my_account: "Mon profil"
connected_as: "connecté en tant qu%{profile}"
instructeur: instructeur
administrateur: administrateur

View file

@ -2110,7 +2110,6 @@
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
<a
class="fr-btn dropdown-button"
title="Aide"
href="/faq"
>Aide</a
>

View file

@ -2109,7 +2109,6 @@
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
<a
class="fr-btn dropdown-button"
title="Aide"
href="/faq"
>Aide</a
>

View file

@ -2109,7 +2109,6 @@
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
<a
class="fr-btn dropdown-button"
title="Aide
href="/faq"
>Aide</a
>

View file

@ -2109,7 +2109,6 @@
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
<a
class="fr-btn dropdown-button"
title="Aide"
href="/faq"
>Aide</a
>

View file

@ -130,7 +130,7 @@ module SystemHelpers
def log_out
within('.fr-header .fr-container .fr-header__tools .fr-btns-group') do
click_button(title: 'Mon compte')
click_button(title: 'Mon profil')
expect(page).to have_selector('#account.fr-collapse--expanded', visible: true)
click_on 'Se déconnecter'
end