Merge pull request #7685 from mfo/US/new-breadcrumb-ux

Header et fil d'ariane DSFR
This commit is contained in:
mfo 2022-09-06 11:13:43 +02:00 committed by GitHub
commit c119077987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 396 additions and 313 deletions

View file

@ -24,4 +24,4 @@ $blue-france-700: #00006D;
$blue-france-500: #000091;
$blue-france-400: #7F7FC8;
$g700: #383838;
$alt-blue-france: rgba(245, 245, 254, 1);

View file

@ -1,27 +0,0 @@
@import "colors";
@import "constants";
.breadcrumbs {
li {
display: inline-block;
font-weight: bold;
font-size: 14px;
a {
color: $black;
text-decoration: underline;
}
&::after {
content: " > ";
}
&:last-child {
color: $blue-france-500;
&::after {
content: none;
}
}
}
}

View file

@ -4,7 +4,6 @@
.france-connect-login {
h2 {
color: $black;
font-size: 24px;
}
}

View file

@ -2,7 +2,7 @@
@import "constants";
.sub-header {
background-color: $light-grey;
background-color: $alt-blue-france;
padding-top: $default-padding;
margin-bottom: $sub-header-bottom-margin;
border-bottom: 1px solid $border-grey;

View file

@ -65,6 +65,10 @@
}
}
.relative {
position: relative;
}
// display
.hidden {
display: none;

View file

@ -1,5 +1,16 @@
@import '@gouvfr/dsfr/dist/core/core.css';
@import '@gouvfr/dsfr/dist/component/link/link.css';
@import '@gouvfr/dsfr/dist/component/logo/logo.css';
@import '@gouvfr/dsfr/dist/component/form/form.css';
@import '@gouvfr/dsfr/dist/component/badge/badge.css';
@import '@gouvfr/dsfr/dist/component/navigation/navigation.css';
@import '@gouvfr/dsfr/dist/component/button/button.css';
@import '@gouvfr/dsfr/dist/component/alert/alert.css';
@import '@gouvfr/dsfr/dist/component/callout/callout.css';
@import '@gouvfr/dsfr/dist/component/breadcrumb/breadcrumb.css';
@import '@gouvfr/dsfr/dist/component/table/table.css';
@import '@gouvfr/dsfr/dist/component/modal/modal.css';
@import '@gouvfr/dsfr/dist/component/input/input.css';
@import '@gouvfr/dsfr/dist/component/search/search.css';
@import '@gouvfr/dsfr/dist/component/translate/translate.css';
@import '@gouvfr/dsfr/dist/component/header/header.css';

View file

@ -1,14 +1,33 @@
#breadcrumbs.sub-header
.container.flex.justify-between.align-baseline.column
%ul.breadcrumbs.mt-1.mb-3
- steps.each do |step|
%li= step
%nav.fr-breadcrumb.mt-0{ role: "navigation", aria: { label: t('you_are_here', scope: [:layouts, :breadcrumb]) } }
%button.fr-breadcrumb__button{ aria: { expanded: "false", controls: "breadcrumb-1" } }
= t('show', scope: [:layouts, :breadcrumb])
.fr-collapse#breadcrumb-1
%ol.fr-breadcrumb__list
%li= link_to t('root', scope: [:layouts, :breadcrumb]), root_path, class: 'fr-breadcrumb__link'
- steps.each.with_index do |step, i|
- if i == steps.size - 1
%li{ aria: { current: "page" } }
%span.fr-breadcrumb__link= step[0]
- else
%li= link_to step[0], step[1], class: 'fr-breadcrumb__link'
- if defined?(preview) && preview
.mb-2
= link_to "Prévisualiser le formulaire", apercu_admin_procedure_path(@procedure), target: "_blank", rel: "noopener", class: 'button'
= link_to "Continuer >", admin_procedure_path(@procedure), title: 'Vous pourrez revenir ici par la suite', class: 'button accepted'
= link_to t('preview', scope: [:layouts, :breadcrumb]), apercu_admin_procedure_path(@procedure), target: "_blank", rel: "noopener", class: 'button'
= link_to t('continue', scope: [:layouts, :breadcrumb]), admin_procedure_path(@procedure), title: t('continue_title', scope: [:layouts, :breadcrumb]), class: 'button accepted'
- if defined?(metadatas)
%ul.admin-metadata
- metadatas.each do |metadata|
%li= metadata
.metadatas.pb-3
%p.fr-h1.fr-mb-0= t('created_at', scope: [:layouts, :breadcrumb], number: @procedure.id, date: @procedure.created_at.strftime('%d/%m/%Y'))
- if @procedure.close?
%p.fr-h2= t('closed_at', scope: [:layouts, :breadcrumb], date: @procedure.closed_at.strftime('%d/%m/%Y'))
%p
- if @procedure.locked?
= t('published', scope: [:layouts, :breadcrumb])
= link_to procedure_lien(@procedure), procedure_lien(@procedure)
- else
= t('draft', scope: [:layouts, :breadcrumb])

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Export et Archives'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Export et Archives']] }
.container

View file

@ -1,9 +1,9 @@
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Attestation'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Attestation']] }
.procedure-form#attestation-template-edit
.procedure-form__columns.container

View file

@ -1,9 +1,9 @@
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Fin de dépot'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Fin de dépot']] }
.procedure-form
.procedure-form__columns.container

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Liste des experts'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Liste des experts']] }
.container
%h1.page-title.mt-2 Experts invités sur #{@procedure.libelle}

View file

@ -1,13 +1,13 @@
- if @procedure.routee?
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to(t('.procedures'), admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
t('.instructors_group')] }
locals: { steps: [[t('.procedures'), admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
[t('.instructors_group')]] }
- else
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Instructeurs'] }
locals: { steps: [[t('.procedures'), admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Instructeurs']] }
.container.groupe-instructeur
%h1 Gérer les instructeurs et les options d'instruction de « #{@procedure.libelle} »

View file

@ -1,8 +1,8 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to('Groupes dinstructeurs', admin_procedure_groupe_instructeurs_path(@procedure)),
@groupe_instructeur.label] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Groupes dinstructeurs', admin_procedure_groupe_instructeurs_path(@procedure)],
[@groupe_instructeur.label]] }
.container.groupe-instructeur

View file

@ -1,8 +1,8 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to('Groupes dinstructeurs', admin_procedure_groupe_instructeurs_path(@procedure)),
@groupe_instructeur.label] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Groupes dinstructeurs', admin_procedure_groupe_instructeurs_path(@procedure)],
[@groupe_instructeur.label]] }
.container.groupe-instructeur
= render partial: 'administrateurs/groups_header'

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
Procedure.human_attribute_name(:jeton_api_particulier)] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
[Procedure.human_attribute_name(:jeton_api_particulier)]] }
.container
.flex

View file

@ -1,8 +1,8 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to(Procedure.human_attribute_name(:jeton_api_particulier), admin_procedure_api_particulier_path(@procedure)),
'Jeton'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
[Procedure.human_attribute_name(:jeton_api_particulier), admin_procedure_api_particulier_path(@procedure)],
['Jeton']] }
.container
%h1.page-title

View file

@ -3,10 +3,10 @@
= render partial: 'admin/closed_mail_template_attestation_inconsistency_alert'
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to("Emails", admin_procedure_mail_templates_path(@procedure)),
@mail_template.class.const_get(:DISPLAYED_NAME)] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
["Emails", admin_procedure_mail_templates_path(@procedure)],
[@mail_template.class.const_get(:DISPLAYED_NAME)]] }
.procedure-form
.procedure-form__columns.container

View file

@ -1,6 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to("#{@procedure.libelle}", admin_procedure_path(@procedure)), "Configuration des emails"] }
locals: { steps: [['Démarches', admin_procedures_path],
["#{@procedure.libelle.truncate_words(4)}", admin_procedure_path(@procedure)],
["Configuration des emails"]] }
.container
- @mail_templates.each do |mail_template|

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Administrateurs'], preview: false }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Administrateurs']], preview: false }
.container
%h1 Gérer les administrateurs de « #{@procedure.libelle} »

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Configuration des annotations privées'], preview: true }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Configuration des annotations privées']], preview: true }
.container
%h1 Configuration des annotations privées

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)),
'Configuration des champs'], preview: @procedure.draft_revision.valid? }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Configuration des champs']], preview: @procedure.draft_revision.valid? }
.container
%h1 Configuration des champs

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
"#{@procedure.libelle}", 'archiver'],
metadatas: ["Créée le #{@procedure.created_at.strftime('%d/%m/%Y')} - n° #{@procedure.id}", "#{@procedure.close? ? "Close le #{@procedure.closed_at.strftime('%d/%m/%Y')}" : @procedure.locked? ? "Publiée - #{procedure_lien(@procedure)}" : "Brouillon"}"] }
locals: { steps: [['Démarches', admin_procedures_path],
["#{@procedure.libelle.truncate_words(4)} - archiver"]],
metadatas: true }
.container
.card

View file

@ -1,9 +1,9 @@
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Description'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Description']] }
.procedure-form
.procedure-form__columns.container
= form_for @procedure,

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Jeton'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Jeton']] }
.container
%h1.page-title

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Modifications'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Modifications']] }
.container
%h1.page-title
Historique des modifications du formulaire

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'MonAvis'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['MonAvis']] }
.container
%h1.page-title

View file

@ -1,8 +1,8 @@
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
'Nouvelle'] }
locals: { steps: [['Démarches', admin_procedures_path],
['Nouvelle']] }
.procedure-form
.procedure-form__columns.container

View file

@ -1,8 +1,8 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Publication'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Publication']] }
.container
- if @procedure.draft_types_de_champ.dubious.present?
.card.warning.mb-3

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
"#{@procedure.libelle}", ],
metadatas: ["Créée le #{@procedure.created_at.strftime('%d/%m/%Y')} - n° #{@procedure.id}", "#{@procedure.close? ? "Close le #{@procedure.closed_at.strftime('%d/%m/%Y')}" : @procedure.locked? ? "Publiée - #{procedure_lien(@procedure)}" : "Brouillon"}"] }
locals: { steps: [['Démarches', admin_procedures_path],
["#{@procedure.libelle.truncate_words(4)}"]],
metadatas: true }
.container.procedure-admin-container
- if @procedure.draft_revision.valid?

View file

@ -1,6 +1,6 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
'Transfert'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Transfert']] }
.container
= render partial: 'procedure_transfert'

View file

@ -1,8 +1,8 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)),
link_to('Choix du service', admin_services_path(procedure_id: @procedure.id)),
'Modifier le service'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Choix du service', admin_services_path(procedure_id: @procedure.id)],
['Modifier le service']] }
.container

View file

@ -1,7 +1,7 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)),
'Choix du service'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Choix du service']] }
#services-index.container
%h1.fr-h1 Liste des Services

View file

@ -1,8 +1,8 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)),
link_to('Choix du service', admin_services_path(procedure_id: @procedure.id)),
'Nouveau service'] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Choix du service', admin_services_path(procedure_id: @procedure.id)],
['Nouveau service']] }
.container
%h1 Nouveau Service

View file

@ -1,8 +1,8 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
link_to(Procedure.human_attribute_name(:jeton_api_particulier), admin_procedure_api_particulier_path(@procedure)),
t('.data_sources')] }
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
[Procedure.human_attribute_name(:jeton_api_particulier), admin_procedure_api_particulier_path(@procedure)],
[t('.data_sources')]] }
.container
%h1.page-title= t('.title')

View file

@ -1,7 +1,7 @@
= turbo_stream.replace 'breadcrumbs' , render(partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Démarches', admin_procedures_path),
link_to(@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)),
'Configuration des champs'],
locals: { steps: [['Démarches', admin_procedures_path],
[@procedure.libelle.truncate_words(4), admin_procedure_path(@procedure)],
['Configuration des champs']],
preview: @procedure.draft_revision.valid? })
= turbo_stream.replace 'errors-summary', render(TypesDeChampEditor::ErrorsSummary.new(revision: @procedure.draft_revision))

View file

@ -1,8 +1,8 @@
- content_for(:title, "Archives pour #{@procedure.libelle}")
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
'Archives'] }
locals: { steps: [[@procedure.libelle.truncate_words(4), instructeur_procedure_path(@procedure)],
['Archives']] }
.container
%h1.mb-2 Archives

View file

@ -1,8 +1,8 @@
- content_for(:title, "Notifications pour #{@procedure.libelle}")
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
'Groupes dinstructeurs'] }
locals: { steps: [[@procedure.libelle.truncate_words(4), instructeur_procedure_path(@procedure)],
['Groupes dinstructeurs']] }
.container.groupe-instructeur
.card

View file

@ -2,9 +2,9 @@
- content_for(:title, "Instructeurs du groupe #{@groupe_instructeur.label}")
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
link_to('Groupes dinstructeurs', instructeur_groupes_path(@procedure)),
@groupe_instructeur.label] }
locals: { steps: [[@procedure.libelle.truncate_words(4), instructeur_procedure_path(@procedure)],
['Groupes dinstructeurs', instructeur_groupes_path(@procedure)],
[@groupe_instructeur.label]] }
- else
- content_for(:title, "Instructeurs de la démarche #{@procedure.libelle}")

View file

@ -1,8 +1,8 @@
- content_for(:title, "Notifications pour #{@procedure.libelle}")
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
'Notifications'] }
locals: { steps: [[@procedure.libelle.truncate_words(4), instructeur_procedure_path(@procedure)],
['Notifications']] }
.container
%h1

View file

@ -1,8 +1,8 @@
- content_for(:title, "Contacter les usagers pour #{@procedure.libelle}")
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
t('.contact_users')] }
locals: { steps: [[@procedure.libelle.truncate_words(4), instructeur_procedure_path(@procedure)],
[t('.contact_users')]] }
.messagerie.container
- if @email_usagers_dossiers.present?
%p.notice.mb-2.mt-4

View file

@ -2,7 +2,7 @@
- content_for(:title, title)
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
t('.title')] }
locals: { steps: [[@procedure.libelle.truncate_words(4), instructeur_procedure_path(@procedure)],
[t('.title')]] }
= render partial: 'shared/procedures/stats', locals: { title: title }

View file

@ -1,43 +1,43 @@
.dropdown.header-menu-opener{ data: { controller: 'menu-button' } }
%button.button.dropdown-button.icon-only.header-menu-button{ title: "Mon compte", data: { menu_button_target: 'button' } }
%span.hidden= t("my_account", scope: [:layouts])
= image_tag "icons/account-circle.svg", alt: 'Mon compte', width: 24, height: 24, loading: 'lazy'
%ul.header-menu.dropdown-content#mon_compte_menu{ data: { menu_button_target: 'menu' } }
%li
.menu-item{ title: current_email }
= current_email
- if super_admin_signed_in?
%li
= link_to manager_root_path, class: "menu-item menu-link" do
= image_tag "icons/super-admin.svg", alt: ''
= t('go_superadmin', scope: [:layouts])
- if multiple_devise_profile_connect?
- if user_signed_in? && nav_bar_profile != :user
%li
= link_to dossiers_path, class: "menu-item menu-link" do
= image_tag "icons/switch-profile.svg", alt: ''
= t('go_user', scope: [:layouts])
- if instructeur_signed_in? && nav_bar_profile != :instructeur
%li
= link_to instructeur_procedures_path, class: "menu-item menu-link" do
= image_tag "icons/switch-profile.svg", alt: ''
= t('go_instructor', scope: [:layouts])
- if expert_signed_in? && nav_bar_profile != :expert
%li
= link_to expert_all_avis_path, class: "menu-item menu-link" do
= image_tag "icons/switch-profile.svg", alt: ''
= t('go_expert', scope: [:layouts])
- if administrateur_signed_in? && nav_bar_profile != :administrateur
%li
= link_to admin_procedures_path, class: "menu-item menu-link" do
= image_tag "icons/switch-profile.svg", alt: ''
= t('go_admin', scope: [:layouts])
%nav.fr-nav{ role: "navigation", "aria-label"=> t('menu_aria_label', scope: [:layouts]) }
.fr-nav__item
%button.fr-translate__btn.fr-btn{ "aria-controls" => "account", "aria-expanded" => "false", :title => t('my_account', scope: [:layouts]) }
= image_tag "icons/account-circle.svg", alt: t('my_account', scope: [:layouts]), width: 20, height: 20, loading: 'lazy'
 
= " #{current_email}"
#account.fr-collapse.fr-menu
%ul.fr-menu__list
- if super_admin_signed_in?
%li
= link_to manager_root_path, class: "fr-nav__link flex align-center" do
= image_tag "icons/super-admin.svg", alt: '',width: 20, height: 20, class: 'mr-1'
= t('go_superadmin', scope: [:layouts])
- if multiple_devise_profile_connect?
- if user_signed_in? && nav_bar_profile != :user
%li
= link_to dossiers_path, class: "fr-nav__link flex align-center" do
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
= t('go_user', scope: [:layouts])
- if instructeur_signed_in? && nav_bar_profile != :instructeur
%li
= link_to instructeur_procedures_path, class: "fr-nav__link flex align-center" do
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
= t('go_instructor', scope: [:layouts])
- if expert_signed_in? && nav_bar_profile != :expert
%li
= link_to expert_all_avis_path, class: "fr-nav__link flex align-center" do
= image_tag "icons/switch-profile.svg", alt: ''
= t('go_expert', scope: [:layouts])
- if administrateur_signed_in? && nav_bar_profile != :administrateur
%li
= link_to admin_procedures_path, class: "fr-nav__link flex align-center" do
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
= t('go_admin', scope: [:layouts])
%li
= link_to profil_path, class: "menu-item menu-link" do
= image_tag "icons/switch-profile.svg", alt: ''
= t('profile', scope: [:layouts])
%li
= link_to destroy_user_session_path, method: :delete, class: "menu-item menu-link" do
= image_tag "icons/sign-out.svg", alt: ''
= t('logout', scope: [:layouts])
%li
= link_to profil_path, class: "fr-nav__link flex align-center" do
= image_tag "icons/switch-profile.svg", alt: '', width: 20, height: 20, class: 'mr-1'
= t('profile', scope: [:layouts])
%li
= link_to destroy_user_session_path, method: :delete, class: "fr-nav__link flex align-center" do
= image_tag "icons/sign-out.svg", alt: '', width: 20, height: 20, class: 'mr-1'
= t('logout', scope: [:layouts])

View file

@ -2,86 +2,102 @@
- nav_bar_profile = controller.try(:nav_bar_profile) || :guest
- dossier = controller.try(:dossier_for_help)
- procedure = controller.try(:procedure_for_help)
- is_instructeur_context = nav_bar_profile == :instructeur && instructeur_signed_in?
- is_expert_context = nav_bar_profile == :expert && expert_signed_in?
- 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: current_page?(root_path) ? "fr-header" : "fr-header new-header-with-border", role: "banner" }
.fr-header__body
.fr-container
.fr-header__body-row
.fr-header__brand.fr-enlarge-link
.fr-header__brand-top
.fr-header__logo
%p.fr-logo
République
= succeed "Française" do
%br/
.fr-header__navbar
- if is_search_enabled
%button.fr-btn--search.fr-btn{ "aria-controls" => "search-modal", "data-fr-opened" => "false", :title => t('views.users.dossiers.search.search_file') }= t('views.users.dossiers.search.search_file')
%button.fr-btn--menu.fr-btn{ "aria-controls" => "burger-menu", "aria-haspopup" => "menu", "data-fr-opened" => "false", :title => "Menu" } Menu
.fr-header__service
- root_profile_link, root_profile_libelle = root_path_info_for_profile(nav_bar_profile)
%header.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border", role: 'banner' }
.header-inner-content
= link_to root_profile_link, :title => root_profile_libelle do
%p.fr-header__service-title= APPLICATION_NAME
%p.fr-header__service-tagline Simplement dématérialiser
.flex.align-center.justify-center
- if params[:controller] == 'users/commencer'
= link_to 'Revenir en arrière', url_for(:back), class: "button", title: "Revenir sur le site de mon administration"
- else
- root_profile_link, root_profile_libelle = root_path_info_for_profile(nav_bar_profile)
= link_to root_profile_link, class: 'header-logo justify-center', title: root_profile_libelle do
= image_tag HEADER_LOGO_SRC, alt: HEADER_LOGO_ALT, width: HEADER_LOGO_WIDTH, height: HEADER_LOGO_HEIGHT, loading: 'lazy'
%span.big.site-title>
= APPLICATION_NAME
%span.small.site-title>
= APPLICATION_SHORTNAME
.fr-header__tools
.fr-header__tools-links.relative
- if nav_bar_profile == :instructeur && instructeur_signed_in?
- current_url = request.path_info
%ul.header-tabs
- if current_instructeur.procedures.any?
%li
= active_link_to t('utils.procedure'), instructeur_procedures_path, active: ['dossiers','procedures'].include?(controller_name), class: 'tab-link'
- if current_instructeur.user.expert && current_expert.avis_summary[:total] > 0
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
%ul.fr-btns-group
- if instructeur_signed_in? || user_signed_in?
%li
= render partial: 'layouts/account_dropdown', locals: { nav_bar_profile: nav_bar_profile }
- elsif (request.path != new_user_session_path && request.path !=agent_connect_path)
- if request.path == new_user_registration_path
%li
.fr-hidden-sm.fr-unhidden-lg.fr-link--sm= t('views.shared.account.already_user_question')
%li= link_to t('views.shared.account.signin'), new_user_session_path, class: "fr-btn"
- if nav_bar_profile == :expert && expert_signed_in?
%ul.header-tabs
- if current_expert.user.instructeur && current_instructeur.procedures.any?
%li
= active_link_to t('utils.procedure'), instructeur_procedures_path, active: ['dossiers','procedures'].include?(controller_name), class: 'tab-link'
%li
- if dossier.present? && nav_bar_profile == :user
= render partial: 'shared/help/help_dropdown_dossier', locals: { dossier: dossier }
- if current_expert.avis_summary[:total] > 0
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
- elsif procedure.present? && (nav_bar_profile == :user || nav_bar_profile == :guest)
= render partial: 'shared/help/help_dropdown_procedure', locals: { procedure: procedure }
- if nav_bar_profile == :user
%ul.header-tabs
%li
= active_link_to t('.files'), dossiers_path, active: :inclusive, class: 'tab-link'
- if current_user.expert && current_expert.avis_summary[:total] > 0
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
- elsif nav_bar_profile == :instructeur
= render partial: 'shared/help/help_dropdown_instructeur'
- else
%li= render partial: 'shared/help/help_button'
%ul.header-right-content
- if params[:controller] == 'recherche'
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
- if nav_bar_profile == :instructeur && instructeur_signed_in?
%li
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
- if nav_bar_profile == :expert && expert_signed_in?
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
- if localization_enabled?
%li= render partial: 'layouts/locale_dropdown'
- if nav_bar_profile == :user && user_signed_in? && current_user.dossiers.count > 2
%li
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_dossiers_path }
- if instructeur_signed_in? || user_signed_in?
%li
= render partial: 'layouts/account_dropdown', locals: { nav_bar_profile: nav_bar_profile }
- if params[:controller] == 'recherche'
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
- elsif (request.path != new_user_session_path && request.path != agent_connect_path)
- if request.path == new_user_registration_path
%li
= t('views.shared.account.already_user_question')
%li
= link_to t('views.shared.account.signin'), new_user_session_path, class: "button secondary"
- if is_instructeur_context
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
%li
- if dossier.present? && nav_bar_profile == :user
= render partial: 'shared/help/help_dropdown_dossier', locals: { dossier: dossier }
- if is_expert_context
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
- elsif procedure.present? && (nav_bar_profile == :user || nav_bar_profile == :guest)
= render partial: 'shared/help/help_dropdown_procedure', locals: { procedure: procedure }
- if is_user_context && current_user.dossiers.count > 2
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_dossiers_path }
- elsif nav_bar_profile == :instructeur
= render partial: 'shared/help/help_dropdown_instructeur'
- has_header = [is_instructeur_context, is_expert_context, is_user_context]
#burger-menu.fr-header__menu.fr-modal{ "aria-labelledby" => "burger_button" }
.fr-container
%button#burger_button.fr-btn--close.fr-btn{ "aria-controls" => "burger-menu", :title => t('close_modal', scope: [:layouts, :header]) }= t('close_modal', scope: [:layouts, :header])
.fr-header__menu-links
%nav#navigation-478.fr-nav{ "aria-label" => t('main_menu', scope: [:layouts, :header]) , :role => "navigation" }
%ul.fr-nav__list
-# Questionner UX pour un back JS
- if params[:controller] == 'users/commencer'
%li.fr-nav__item
= link_to t('back', scope: [:layouts, :header]), url_for(:back), title: t('back_title', scope: [:layouts, :header]), class: 'fr-nav__link'
- else
= render partial: 'shared/help/help_button'
- if is_instructeur_context
- if current_instructeur.procedures.any?
- current_url = request.path_info
%li.fr-nav__item
= active_link_to t('utils.procedure'), instructeur_procedures_path, active: ['dossiers','procedures'].include?(controller_name), class: 'fr-nav__link'
- if current_instructeur.user.expert && current_expert.avis_summary[:total] > 0
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
- if localization_enabled?
%li
= render partial: 'layouts/locale_dropdown'
- if is_expert_context
- if current_expert.user.instructeur && current_instructeur.procedures.any?
%li.fr-nav__item= active_link_to t('utils.procedure'), instructeur_procedures_path, active: ['dossiers','procedures'].include?(controller_name), class: 'fr-nav__link'
- if current_expert.avis_summary[:total] > 0
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
- if is_user_context
%li.fr-nav__item= active_link_to t('.files'), dossiers_path, active: :inclusive, class: 'fr-nav__link'
- if current_user.expert && current_expert.avis_summary[:total] > 0
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }

View file

@ -1,12 +1,14 @@
.dropdown.locale-dropdown.header-menu-opener{ data: { controller: 'menu-button' } }
%button.button.dropdown-button.icon-only.header-menu-button{ title: t('.languages'), data: { menu_button_target: 'button' } }
%span.hidden
= t('.languages')
= image_tag "icons/translate-icon.svg", alt: t('.languages'), width: 24, height: 24, loading: :lazy, aria: { hidden: true }
%ul.header-menu.dropdown-content{ data: { menu_button_target: 'menu' } }
%li
= active_link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link", active: I18n.locale == :fr do
Français
%li
= active_link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link", active: I18n.locale == :en do
English
%nav.fr-translate.fr-nav{ :role => "navigation", title: t('.select_locale') }
.fr-nav__item
%button.fr-translate__btn.fr-btn{ "aria-controls" => "translate", "aria-expanded" => "false", :title => t('.select_locale') }
= t(".#{I18n.locale}")
%span.fr-hidden-lg= t('.francais')
#translate.fr-collapse.fr-menu
%ul.fr-menu__list
%li
= active_link_to save_locale_path(locale: :fr), method: :post, class: "fr-translate__language fr-nav__link", active: I18n.locale == :fr, hreflang: "fr", lang: "fr" do
= t('.fr_francais')
%li
= active_link_to save_locale_path(locale: :en), method: :post, class: "fr-translate__language fr-nav__link", active: I18n.locale == :en, hreflang: "en", lang: "en" do
= t('.en_english')

View file

@ -1,5 +1,11 @@
.header-search{ role: 'search' }
= form_tag "#{search_endpoint}", method: :get, class: "form" do
= text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.search_file'), aria: { label: t('views.users.dossiers.search.search_file') }
%button{ title: t('views.users.dossiers.search.search_file') }
= image_tag "icons/search-blue.svg", alt: 'Rechercher', 'aria-hidden':'true', width: 24, height: 24, loading: 'lazy'
#search-modal.fr-header__search.fr-modal
.fr-container.fr-container-lg--fluid
%button.fr-btn--close.fr-btn{ "aria-controls" => "search-modal", :title => t('close_modal', scope: [:layouts, :header]) }= t('close_modal', scope: [:layouts, :header])
#search-473.fr-search-bar{ :role => "search" }
= form_tag "#{search_endpoint}", method: :get, class: "flex width-100" do
= label_tag "q", t('views.users.dossiers.search.search_file'), class: 'fr-label'
= text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: t('views.users.dossiers.search.search_file'), aria: { label: t('views.users.dossiers.search.search_file') }, class: "fr-input"
%button.fr-btn{ title: t('views.users.dossiers.search.search_file') }
= image_tag "icons/search-blue.svg", alt: t('views.users.dossiers.search.search_file'), 'aria-hidden':'true', width: 24, height: 24, loading: 'lazy'

View file

@ -1,5 +1,5 @@
%li
= active_link_to expert_all_avis_path, active: controller_name == 'avis', class: 'tab-link' do
%li.fr-nav__item
= active_link_to expert_all_avis_path, active: controller_name == 'avis', class: 'fr-nav__link' do
Avis
- if current_expert.avis_summary[:unanswered] > 0
%span.badge.warning= current_expert.avis_summary[:unanswered]

View file

@ -1,6 +1,6 @@
- if FranceConnectService.enabled?
.france-connect-login
%h2.important-header
%h2.fr-h6.mb-0
= t('views.shared.france_connect_login.title')
%p
= t('views.shared.france_connect_login.description')

View file

@ -1 +1 @@
= link_to t('help'), FAQ_URL, class: 'button primary'
= link_to t('help'), FAQ_URL, class: 'fr-btn', target: '_blank', rel: 'noopener'

View file

@ -1,5 +1,5 @@
.dropdown.help-dropdown{ data: { controller: 'menu-button' } }
%button.button.primary.dropdown-button{ data: { menu_button_target: 'button' } }
%button.fr-btn.dropdown-button{ data: { menu_button_target: 'button' } }
= t('help')
#help-menu.dropdown-content.fade-in-down{ data: { menu_button_target: 'menu' } }
%ul.dropdown-items

View file

@ -1,5 +1,5 @@
.dropdown.help-dropdown{ data: { controller: 'menu-button' } }
%button.button.primary.dropdown-button{ data: { menu_button_target: 'button' } }
%button.fr-btn.dropdown-button{ data: { menu_button_target: 'button' } }
= t('help')
#help-menu.dropdown-content.fade-in-down{ data: { menu_button_target: 'menu' } }
%ul.dropdown-items

View file

@ -1,5 +1,5 @@
.dropdown.help-dropdown{ data: { controller: 'menu-button' } }
%button.button.primary.dropdown-button{ data: { menu_button_target: 'button' } }
%button.fr-btn.dropdown-button{ data: { menu_button_target: 'button' } }
= t('help')
#help-menu.dropdown-content.fade-in-down{ data: { menu_button_target: 'menu' } }
%ul.dropdown-items

View file

@ -4,7 +4,7 @@
.auth-form.sign-in-form
= form_for SuperAdmin.new, url: super_admin_session_path, html: { class: "form" } do |f|
%h1 Connectez-vous
%h1.fr-h2 Connectez-vous
= f.label :email, "Email (nom@site.com)"
= f.text_field :email, type: :email, autocomplete: 'username', autofocus: true

View file

@ -1,6 +1,6 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [link_to('Tableau de bord', tableau_de_bord_helper_path),
'Profil'] }
locals: { steps: [['Tableau de bord', tableau_de_bord_helper_path],
['Profil']] }
#profil-page.container
%h1 Profil

View file

@ -3,7 +3,7 @@
.auth-form
= devise_error_messages!
= form_for resource, url: user_registration_path, html: { class: "form" } do |f|
%h1= t('views.registrations.new.title', name: APPLICATION_NAME)
%h1.fr-h2= t('views.registrations.new.title', name: APPLICATION_NAME)
= render partial: 'shared/france_connect_login', locals: { url: france_connect_particulier_path }

View file

@ -66,8 +66,19 @@ en:
line3: administrative forms.
are_you_new: First time on %{app_name}?
my_account: My account
header:
close_modal: 'Fermer'
back: "Back"
back_title: "Revenir sur le site de mon administration"
main_menu: "Main menu"
locale_dropdown:
languages: "Languages"
select_locale: "Choose a language"
fr: FR
en: EN
francais: " - French"
fr_francais: FR - French
en_english: EN - English
notifications:
actions:
access: View your File

View file

@ -56,8 +56,19 @@ fr:
line3: administratifs dématérialisés.
are_you_new: Vous êtes nouveau sur %{app_name} ?
my_account: Mon compte
header:
close_modal: 'Fermer'
back: "Revenir en arrière"
back_title: "Revenir sur le site de mon administration"
main_menu: "Menu principal"
locale_dropdown:
languages: "Langues"
select_locale: "Sélectionner une langue"
fr: FR
en: EN
francais: " - Français"
fr_francais: FR - Français
en_english: EN - Anglais
notifications:
actions:
access: Consulter mon dossier

View file

@ -2,6 +2,7 @@ en:
layouts:
header:
files: Files
menu_aria_label: 'Menu my profile'
go_superadmin: "Switch to super-admin"
go_user: "Switch to user"
go_instructor: "Switch to instructor"
@ -9,3 +10,4 @@ en:
go_admin: "Switch to administrator"
profile: "See my profile"
logout: "Log out"
my_account: "My account"

View file

@ -2,6 +2,7 @@ fr:
layouts:
header:
files: Dossiers
menu_aria_label: 'Menu mon profil'
go_superadmin: "Passer en super-admin"
go_user: "Passer en usager"
go_instructor: "Passer en instructeur"
@ -9,3 +10,4 @@ fr:
go_admin: "Passer en administrateur"
profile: "Voir mon profil"
logout: "Se déconnecter"
my_account: "Mon compte"

View file

@ -0,0 +1,13 @@
en:
layouts:
breadcrumb:
root: "Home"
you_are_here: "You are here"
show: Show breadcrumb
preview: "Preview the form"
continue: "Continue >"
continue_title: "You can comeback using this link"
created_at: "Created at %{date} - n° %{number}"
closed_at: "Closed at %{date}"
published: "Published"
draft: "Draft"

View file

@ -0,0 +1,13 @@
fr:
layouts:
breadcrumb:
root: "Accueil"
you_are_here: "Vous êtes ici"
show: "Voir le fil dAriane"
preview: "Prévisualiser le formulaire"
continue: "Continuer >"
continue_title: "Vous pourrez revenir ici par la suite"
created_at: "Créée le %{date} - n° %{number}"
closed_at: "Close le %{date}"
published: "Publiée "
draft: "Brouillon"

View file

@ -126,9 +126,10 @@ module SystemHelpers
end
def log_out
click_button(title: 'Mon compte')
click_on 'Se déconnecter'
within('.fr-header .fr-container .fr-header__tools .fr-btns-group') do
click_button(title: 'Mon compte')
click_on 'Se déconnecter'
end
expect(page).to have_current_path(root_path)
end

View file

@ -38,7 +38,7 @@ describe 'Administrateurs can edit procedures', js: true do
click_on 'Enregistrer'
expect(page).to have_selector('.breadcrumbs li', text: 'Ma petite démarche')
expect(page).to have_selector('.fr-breadcrumb li', text: 'Ma petite démarche')
end
end
@ -55,7 +55,7 @@ describe 'Administrateurs can edit procedures', js: true do
click_on 'Enregistrer'
expect(page).to have_selector('.breadcrumbs li', text: 'Ma petite démarche')
expect(page).to have_selector('.fr-breadcrumb li', text: 'Ma petite démarche')
end
end
end

View file

@ -1,7 +1,7 @@
describe 'Getting help:' do
scenario 'a Help button is visible on public pages' do
visit '/'
within('.new-header') do
within('.fr-header') do
expect(page).to have_help_button
end
end
@ -12,7 +12,7 @@ describe 'Getting help:' do
scenario 'a Help menu provides administration contacts and a link to the FAQ' do
visit commencer_path(path: procedure.path)
within('.new-header') do
within('.fr-header') do
expect(page).to have_help_menu
end
@ -34,7 +34,7 @@ describe 'Getting help:' do
scenario 'a Help button is visible on signed-in pages' do
visit dossiers_path
within('.new-header') do
within('.fr-header') do
expect(page).to have_help_button
end
end
@ -45,7 +45,7 @@ describe 'Getting help:' do
scenario 'a Help menu provides administration contacts and a link to the FAQ' do
visit dossier_path(dossier)
within('.new-header') do
within('.fr-header') do
expect(page).to have_help_menu
end
@ -63,7 +63,7 @@ describe 'Getting help:' do
scenario 'a Help menu provides links to the Messagerie and to the FAQ' do
visit dossier_path(dossier)
within('.new-header') do
within('.fr-header') do
expect(page).to have_help_menu
end
@ -84,7 +84,7 @@ describe 'Getting help:' do
scenario 'a Help menu is visible on signed-in pages' do
visit instructeur_procedures_path
within('.new-header') do
within('.fr-header') do
expect(page).to have_help_menu
end
end

View file

@ -7,8 +7,8 @@ describe 'Accessing the website in different languages:' do
visit new_user_session_path
expect(page).to have_text('Connectez-vous')
click_on 'Langues'
click_on 'English'
find('.fr-translate__btn').click
find('.fr-nav__link[hreflang="en"]').click
# The page is now in English
expect(page).to have_text('Sign in')

View file

@ -259,8 +259,7 @@ describe 'Instructing a dossier:', js: true do
end
def log_in(email, password, check_email: true)
visit '/'
click_on 'Connexion'
visit new_user_session_path
expect(page).to have_current_path(new_user_session_path)
sign_in_with(email, password, check_email)

View file

@ -84,11 +84,11 @@ describe 'The routing', js: true do
# the search only show litteraires dossiers
fill_in 'q', with: scientifique_user.email
click_on 'Rechercher'
find('.fr-search-bar .fr-btn').click
expect(page).to have_text('0 dossier trouvé')
fill_in 'q', with: litteraire_user.email
click_on 'Rechercher'
find('.fr-search-bar .fr-btn').click
expect(page).to have_text('1 dossier trouvé')
## and the result is clickable

View file

@ -12,11 +12,8 @@ describe 'Invitations' do
scenario 'on the form, the owner of a dossier can invite another user to collaborate on the dossier', js: true do
log_in(owner)
navigate_to_brouillon(dossier)
fill_in 'Texte obligatoire', with: 'Some edited value'
send_invite_to "user_invite@exemple.fr"
expect(page).to have_current_path(brouillon_dossier_path(dossier))
expect(page).to have_text("Une invitation a été envoyée à user_invite@exemple.fr.")
expect(page).to have_text("user_invite@exemple.fr")
@ -144,8 +141,7 @@ describe 'Invitations' do
private
def log_in(user)
visit '/'
click_on 'Connexion'
visit new_user_session_path
sign_in_with(user.email, user.password)
expect(page).to have_current_path(dossiers_path)
end

View file

@ -1,4 +1,4 @@
describe 'user access to the list of their dossiers' do
describe 'user access to the list of their dossiers', js: true do
let(:user) { create(:user) }
let!(:dossier_brouillon) { create(:dossier, user: user) }
let!(:dossier_en_construction) { create(:dossier, :with_populated_champs, :en_construction, user: user) }
@ -86,7 +86,7 @@ describe 'user access to the list of their dossiers' do
context "when the dossier does not exist" do
before do
page.find_by_id('q').set(10000000)
click_button("Rechercher")
find('.fr-search-bar .fr-btn').click
end
it "shows an error message on the dossiers page" do
@ -100,7 +100,7 @@ describe 'user access to the list of their dossiers' do
before do
page.find_by_id('q').set(dossier_other_user.id)
click_button("Rechercher")
find('.fr-search-bar .fr-btn').click
end
it "shows an error message on the dossiers page" do
@ -112,7 +112,7 @@ describe 'user access to the list of their dossiers' do
context "when the dossier belongs to the user" do
before do
page.find_by_id('q').set(dossier_en_construction.id)
click_button("Rechercher")
find('.fr-search-bar .fr-btn').click
end
it "redirects to the dossier page" do
@ -128,7 +128,7 @@ describe 'user access to the list of their dossiers' do
context 'when it only matches one dossier' do
before do
click_button("Rechercher")
find('.fr-search-bar .fr-btn').click
end
it "redirects to the dossier page" do
expect(current_path).to eq(dossier_path(dossier_en_construction))
@ -138,7 +138,7 @@ describe 'user access to the list of their dossiers' do
context 'when it matches multiple dossier' do
before do
dossier_en_construction2.champs.first.update(value: dossier_en_construction.champs.first.value)
click_button("Rechercher")
find('.fr-search-bar .fr-btn').click
end
it "redirects to the search results" do

View file

@ -1,11 +1,13 @@
describe 'Managing password:' do
describe 'Managing password:', js: true do
context 'for simple users' do
let(:user) { create(:user) }
let(:new_password) { 'a simple password' }
scenario 'a simple user can reset their password' do
visit root_path
click_on 'Connexion'
within('.fr-header .fr-container .fr-header__tools .fr-btns-group') do
click_on 'Connexion'
end
click_on 'Mot de passe oublié ?'
expect(page).to have_current_path(new_user_password_path)
@ -34,7 +36,9 @@ describe 'Managing password:' do
scenario 'an admin can reset their password', js: true do
visit root_path
click_on 'Connexion'
within('.fr-header .fr-container .fr-header__tools .fr-btns-group') do
click_on 'Connexion'
end
click_on 'Mot de passe oublié ?'
expect(page).to have_current_path(new_user_password_path)

View file

@ -19,7 +19,7 @@ describe 'layouts/_header.html.haml', type: :view do
let(:user) { nil }
let(:profile) { nil }
it { is_expected.to have_css("a.header-logo[href=\"#{root_path}\"]") }
it { is_expected.to have_css(".fr-header__logo") }
it 'displays the Help link' do
expect(subject).to have_link('Aide', href: FAQ_URL)
@ -42,7 +42,7 @@ describe 'layouts/_header.html.haml', type: :view do
let(:user) { create(:user) }
let(:profile) { :user }
it { is_expected.to have_css("a.header-logo[href=\"#{dossiers_path}\"]") }
it { is_expected.to have_css(".fr-header__logo") }
it { is_expected.to have_link("Dossiers", href: dossiers_path) }
it 'displays the Help button' do
@ -56,7 +56,7 @@ describe 'layouts/_header.html.haml', type: :view do
let(:profile) { :instructeur }
let(:current_instructeur) { instructeur }
it { is_expected.to have_css("a.header-logo[href=\"#{instructeur_procedures_path}\"]") }
it { is_expected.to have_css(".fr-header__logo") }
it 'displays the Help dropdown menu' do
expect(subject).to have_css(".help-dropdown")