help: add a custom help dropdown in gestionnaire context

This commit is contained in:
Pierre de La Morinerie 2019-03-19 14:48:26 +01:00
parent 549b17f75e
commit 69580288a4
4 changed files with 26 additions and 11 deletions

View file

@ -23,12 +23,6 @@
- avis_counter = current_gestionnaire.avis.without_answer.count
- if avis_counter > 0
%span.badge.warning= avis_counter
%li
.tab-link.contact-link
Aide
.contact-details
Besoin daide technique ? Contactez-nous
= contact_link("par email")
- if nav_bar_profile == :user
%ul.header-tabs
@ -98,5 +92,7 @@
.header-help
- if nav_bar_profile == :user && dossier.present?
= render partial: 'new_user/dossier_help_dropdown', locals: { dossier: dossier }
- elsif nav_bar_profile == :gestionnaire
= render partial: 'new_gestionnaire/help_dropdown'
- else
= link_to 'Aide', FAQ_URL, class: "button primary"

View file

@ -0,0 +1,20 @@
.dropdown.help-dropdown
.button.primary.dropdown-button Aide
.dropdown-content.fade-in-down
%ul.dropdown-items
-# Use the help website
%li
= link_to FAQ_URL, target: "_blank", rel: "noopener" do
%span.icon.help
.dropdown-description
%h4.help-dropdown-title Un problème avec le site ?
%p Trouvez votre réponse dans laide en ligne.
-# Technical contact
%li
= mail_to CONTACT_EMAIL do
%span.icon.mail
.dropdown-description
%h4.help-dropdown-title Contact technique
%p Envoyez nous un message à #{CONTACT_EMAIL}.

View file

@ -66,10 +66,10 @@ feature 'Getting help:' do
login_as gestionnaire, scope: :gestionnaire
end
scenario 'a Help button is visible on signed-in pages' do
scenario 'a Help menu is visible on signed-in pages' do
visit gestionnaire_procedures_path
within('.new-header') do
expect(page).to have_help_button
expect(page).to have_help_menu
end
end
end

View file

@ -28,9 +28,8 @@ describe 'layouts/_new_header.html.haml', type: :view do
it { is_expected.to have_css("a.header-logo[href=\"#{gestionnaire_procedures_path}\"]") }
it "displays the contact infos" do
expect(rendered).to have_text("Contact")
expect(rendered).to have_link("par email", href: contact_url)
it 'displays the Help dropdown menu' do
expect(rendered).to have_css(".help-dropdown")
end
end
end