feat(dossier): display france connect information notice only to instructeur
This commit is contained in:
parent
efa19926e4
commit
125724d416
6 changed files with 16 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
||||
|
|
|
@ -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 }
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue