From c767164e28177befa8a7c09cc69a3d8056f890e2 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Tue, 19 Dec 2023 11:22:50 +0100 Subject: [PATCH] add expert in current_account and mode badge to the right --- app/controllers/application_controller.rb | 1 + app/views/layouts/_account_dropdown.haml | 4 ++-- spec/system/experts/expert_spec.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 03048b045..db1e49832 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -88,6 +88,7 @@ class ApplicationController < ActionController::Base gestionnaire: current_gestionnaire, administrateur: current_administrateur, instructeur: current_instructeur, + expert: current_expert, user: current_user }.compact end diff --git a/app/views/layouts/_account_dropdown.haml b/app/views/layouts/_account_dropdown.haml index 527ac7387..c824c2029 100644 --- a/app/views/layouts/_account_dropdown.haml +++ b/app/views/layouts/_account_dropdown.haml @@ -1,9 +1,9 @@ %nav.fr-translate.fr-nav{ role: "navigation", "aria-label"=> t('menu_aria_label', 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]) } - %div{ class: "fr-badge fr-badge--sm fr-mr-1w #{color_by_role(nav_bar_profile)}" } - = t("layouts.#{nav_bar_profile}") = " #{current_email}" + %div{ class: "fr-badge fr-badge--sm fr-ml-1w #{color_by_role(nav_bar_profile)}" } + = t("layouts.#{nav_bar_profile}") #account.fr-collapse.fr-menu %ul.fr-menu__list.max-content - if multiple_devise_profile_connect? diff --git a/spec/system/experts/expert_spec.rb b/spec/system/experts/expert_spec.rb index c383161ad..baddbfb52 100644 --- a/spec/system/experts/expert_spec.rb +++ b/spec/system/experts/expert_spec.rb @@ -36,7 +36,7 @@ describe 'Inviting an expert:' do visit new_user_session_path sign_in_with avis.expert.email, password - expect(page).to have_content('Connecté(e).') + expect(page).to have_content('Vous pouvez à tout moment alterner entre vos différents profils : expert, usager.') expect(page).to have_current_path(expert_all_avis_path) end end