diff --git a/app/assets/stylesheets/buttons.scss b/app/assets/stylesheets/buttons.scss index 0b35195f8..edaf01c16 100644 --- a/app/assets/stylesheets/buttons.scss +++ b/app/assets/stylesheets/buttons.scss @@ -338,6 +338,10 @@ ul.dropdown-items { color: $blue-france-500; } -.account-btn::before { - content: none !important; +.account-btn { + flex-wrap: wrap; + + &::before { + content: none !important; + } } diff --git a/app/views/layouts/_account_dropdown.haml b/app/views/layouts/_account_dropdown.haml index c824c2029..cb1f38d49 100644 --- a/app/views/layouts/_account_dropdown.haml +++ b/app/views/layouts/_account_dropdown.haml @@ -1,8 +1,11 @@ %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]) } - = " #{current_email}" - %div{ class: "fr-badge fr-badge--sm fr-ml-1w #{color_by_role(nav_bar_profile)}" } + %span= current_email + - if dossier.present? && dossier&.france_connect_information.present? + %span +  via FranceConnect + %span{ 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 diff --git a/app/views/layouts/_header.haml b/app/views/layouts/_header.haml index daf80c12b..03360414e 100644 --- a/app/views/layouts/_header.haml +++ b/app/views/layouts/_header.haml @@ -34,7 +34,7 @@ %ul.fr-btns-group.flex.align-center - if instructeur_signed_in? || user_signed_in? %li - = render partial: 'layouts/account_dropdown', locals: { nav_bar_profile: nav_bar_profile } + = render partial: 'layouts/account_dropdown', locals: { nav_bar_profile: nav_bar_profile, dossier: dossier } - elsif (request.path != new_user_session_path && request.path !=agent_connect_path) - if request.path == new_user_registration_path %li diff --git a/app/views/shared/dossiers/_demande.html.haml b/app/views/shared/dossiers/_demande.html.haml index 5ec17bd28..529242842 100644 --- a/app/views/shared/dossiers/_demande.html.haml +++ b/app/views/shared/dossiers/_demande.html.haml @@ -1,4 +1,4 @@ -- if dossier.france_connect_information.present? +- if dossier.france_connect_information.present? && current_user.instructeur? && !current_user.owns_or_invite?(dossier) - content_for(:notice_info) do = render partial: "shared/dossiers/france_connect_informations_notice", locals: { user_information: dossier.france_connect_information } diff --git a/app/views/shared/dossiers/_edit.html.haml b/app/views/shared/dossiers/_edit.html.haml index 11d21382c..1bb72da93 100644 --- a/app/views/shared/dossiers/_edit.html.haml +++ b/app/views/shared/dossiers/_edit.html.haml @@ -1,7 +1,6 @@ - dossier_for_editing = dossier.en_construction? ? dossier.owner_editing_fork : dossier - -- if dossier.france_connect_information.present? +- if dossier.france_connect_information.present? && current_user.instructeur? && !current_user.owns_or_invite?(dossier) - content_for(:notice_info) do = render partial: "shared/dossiers/france_connect_informations_notice", locals: { user_information: dossier.france_connect_information } diff --git a/spec/views/users/dossiers/demande.html.haml_spec.rb b/spec/views/users/dossiers/demande.html.haml_spec.rb index f013ceb37..5c9679225 100644 --- a/spec/views/users/dossiers/demande.html.haml_spec.rb +++ b/spec/views/users/dossiers/demande.html.haml_spec.rb @@ -44,8 +44,8 @@ describe 'users/dossiers/demande', type: :view do render end - it 'fills the individual with the informations from France Connect' do - expect(view.content_for(:notice_info)).to have_text("Le dossier a été déposé par le compte de #{france_connect_information.given_name} #{france_connect_information.family_name}, authentifié par FranceConnect le #{france_connect_information.updated_at.strftime('%d/%m/%Y')}") + it 'does not fill the individual with the informations from France Connect' do + expect(view.content_for(:notice_info)).not_to have_text("Le dossier a été déposé par le compte de #{france_connect_information.given_name} #{france_connect_information.family_name}, authentifié par FranceConnect le #{france_connect_information.updated_at.strftime('%d/%m/%Y')}") end end