Merge pull request #9256 from demarches-simplifiees/user-dashboard/change-design-from-table-to-tile-part-2

[refonte usager] Tableau de bord - Changer design de tableau à tuiles
This commit is contained in:
Colin Darie 2023-07-10 13:28:51 +00:00 committed by GitHub
commit 6cf9ea6459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 332 additions and 333 deletions

View file

@ -1,17 +0,0 @@
// Push the timestamps column to the right of the row
@import "colors";
.admin-procedures-list-timestamps {
margin-left: auto;
}
// Fix a Safari flexbox bug where the inner procedure logo
// would stretch the container vertically.
// See https://stackoverflow.com/questions/57516373/image-stretching-in-flexbox-in-safari
.admin-procedures-list-row.infos {
align-items: flex-start;
a:not(:hover) {
background-image: none; // remove DSFR underline
}
}

View file

@ -183,7 +183,7 @@
text-align: left;
top: 5 * $default-spacer;
cursor: default;
z-index: 10;
z-index: 11;
list-style: none;
a {

View file

@ -4,20 +4,26 @@
.card {
padding: ($default-spacer * 3) ($default-spacer * 2);
border: 1px solid $border-grey;
margin-bottom: $default-spacer * 2;
margin-bottom: $default-spacer * 4;
background: #FFFFFF;
.notice {
font-size: 16px;
color: #666666;
margin-top: -8px;
margin-bottom: 16px;
}
.card-title {
color: $black;
font-weight: bold;
font-size: 20px;
line-height: 1.5rem;
margin-bottom: $default-spacer * 2;
a:not(:hover) {
background-image: none; // remove DSFR underline
}
}
.logo {
width: auto;
max-width: 50px;
height: fit-content;
margin-right: $default-spacer * 2;
}
&.feedback {

View file

@ -11,6 +11,10 @@
align-items: flex-start;
}
&.align-end {
align-items: end;
}
&.align-baseline {
align-items: baseline;
}

View file

@ -13,20 +13,25 @@ class Dsfr::AlertComponent < ApplicationComponent
end
def alert_class(state)
["fr-alert fr-alert--#{state}", extra_class_names].compact.flatten
class_names(
"fr-alert fr-alert--#{state}" => true,
"fr-alert--sm" => size == :sm,
extra_class_names => true
)
end
private
def initialize(state:, title:, extra_class_names: nil, heading_level: 'h3')
def initialize(state:, title: '', size: '', extra_class_names: nil, heading_level: 'h3')
@state = state
@title = title
@size = size
@block = block
@extra_class_names = extra_class_names
@heading_level = heading_level
end
attr_reader :state, :title, :block, :extra_class_names, :heading_level
attr_reader :state, :title, :size, :block, :extra_class_names, :heading_level
private
end

View file

@ -1,4 +1,5 @@
%div{ class: alert_class(state) }
= content_tag(heading_level, class: 'fr-alert__title') do
= "#{prefix_for_state}#{title}"
- if size != :sm
= content_tag(heading_level, class: 'fr-alert__title') do
= "#{prefix_for_state}#{title}"
= body

View file

@ -28,9 +28,9 @@ module Users
@dossiers_invites = current_user.dossiers_invites.merge(dossiers_visibles)
@dossiers_supprimes_recemment = current_user.dossiers.hidden_by_user.merge(dossiers)
@dossiers_supprimes_definitivement = current_user.deleted_dossiers.includes(:procedure).order_by_updated_at
@dossier_transfers = DossierTransfer.for_email(current_user.email)
@dossier_transferes = dossiers_visibles.where(dossier_transfer_id: DossierTransfer.for_email(current_user.email).ids)
@dossiers_close_to_expiration = current_user.dossiers.close_to_expiration.merge(dossiers_visibles)
@statut = statut(@user_dossiers, @dossiers_traites, @dossiers_invites, @dossiers_supprimes_recemment, @dossiers_supprimes_definitivement, @dossier_transfers, @dossiers_close_to_expiration, params[:statut])
@statut = statut(@user_dossiers, @dossiers_traites, @dossiers_invites, @dossiers_supprimes_recemment, @dossiers_supprimes_definitivement, @dossier_transferes, @dossiers_close_to_expiration, params[:statut])
@dossiers = case @statut
when 'en-cours'
@ -44,7 +44,7 @@ module Users
when 'dossiers-supprimes-definitivement'
@dossiers_supprimes_definitivement
when 'dossiers-transferes'
@dossier_transfers
@dossier_transferes
when 'dossiers-expirant'
@dossiers_close_to_expiration
end.page(page)
@ -406,14 +406,14 @@ module Users
# if the status tab is filled, then this tab
# else first filled tab
# else en-cours
def statut(mes_dossiers, dossiers_traites, dossiers_invites, dossiers_supprimes_recemment, dossiers_supprimes_definitivement, dossier_transfers, dossiers_close_to_expiration, params_statut)
def statut(mes_dossiers, dossiers_traites, dossiers_invites, dossiers_supprimes_recemment, dossiers_supprimes_definitivement, dossier_transferes, dossiers_close_to_expiration, params_statut)
tabs = {
'en-cours' => mes_dossiers.present?,
'traites' => dossiers_traites.present?,
'dossiers-invites' => dossiers_invites.present?,
'dossiers-supprimes-recemment' => dossiers_supprimes_recemment.present?,
'dossiers-supprimes-definitivement' => dossiers_supprimes_definitivement.present?,
'dossiers-transferes' => dossier_transfers.present?,
'dossiers-transferes' => dossier_transferes.present?,
'dossiers-expirant' => dossiers_close_to_expiration.present?
}
if tabs[params_statut]

View file

@ -10,7 +10,7 @@
.card
.card-title= t('.titles.allow_invite_experts')
%p.notice= t('.descriptions.allow_invite_experts')
%p= t('.descriptions.allow_invite_experts')
= form_for @procedure,
method: :put,
url: allow_expert_review_admin_procedure_path(@procedure),
@ -24,7 +24,7 @@
- if @procedure.allow_expert_review?
.card
.card-title= t('.titles.manage_procedure_experts')
%p.notice= t('.descriptions.manage_procedure_experts')
%p= t('.descriptions.manage_procedure_experts')
= form_for @procedure,
method: :put,
url: experts_require_administrateur_invitation_admin_procedure_path(@procedure),
@ -37,7 +37,7 @@
.card
.card-title= t('.titles.allow_expert_messaging')
%p.notice= t('.descriptions.allow_expert_messaging')
%p= t('.descriptions.allow_expert_messaging')
= form_for @procedure,
method: :put,
url: allow_expert_messaging_admin_procedure_path(@procedure),
@ -56,8 +56,8 @@
html: { class: 'form' } do |f|
.instructeur-wrapper
%p.notice Pendant l'instruction dun dossier, les instructeurs peuvent demander leur avis à un ou plusieurs experts.
%p#experts-emails.notice Entrez les adresses email des experts que vous souhaitez affecter à cette démarche
%p Pendant l'instruction dun dossier, les instructeurs peuvent demander leur avis à un ou plusieurs experts.
%p#experts-emails Entrez les adresses email des experts que vous souhaitez affecter à cette démarche
= hidden_field_tag :emails, nil
= react_component("ComboMultiple",
options: [],

View file

@ -4,7 +4,7 @@
= form_for :instructeur, url: { action: :add_instructeur, id: groupe_instructeur.id }, html: { class: 'form' } do |f|
.instructeur-wrapper
- if !procedure.routing_enabled?
%p.notice Entrez les adresses email des instructeurs que vous souhaitez affecter à cette démarche
%p Entrez les adresses email des instructeurs que vous souhaitez affecter à cette démarche
- if disabled_as_super_admin
= f.select :emails, available_instructeur_emails, {}, disabled: disabled_as_super_admin, id: 'instructeur_emails'

View file

@ -1,41 +1,70 @@
- procedures.each do |procedure|
.card
.admin-procedures-list-row.infos.flex
- if procedure.logo.present?
= image_tag procedure.logo, alt: procedure.libelle, width: '100'
.flex.column.ml-1
.card-title
= link_to procedure.libelle, admin_procedure_path(procedure), style: 'color: black;'
= link_to commencer_url(procedure.path), commencer_url(procedure.path), class: 'fr-link fr-mb-1w'
.admin-procedures-list-timestamps
%p.notice N° #{procedure.id}
%p.notice créée le #{procedure.created_at.strftime('%d/%m/%Y')}
- if procedure.published_at.present?
%p.notice publiée le #{procedure.published_at.strftime('%d/%m/%Y')}
- if procedure.updated_at.today?
%p.notice modifiée à #{procedure.updated_at.strftime('%H:%M')}
- else
%p.notice modifiée le #{procedure.updated_at.strftime('%d/%m/%Y %H:%M')}
- if procedure.closed_at.present?
%p.notice archivée le #{procedure.closed_at.strftime('%d/%m/%Y')}
- elsif procedure.auto_archive_on&.future?
%p.notice sera clôturée le #{procedure.auto_archive_on.strftime('%d/%m/%Y')}
.admin-procedures-list-row.actions.flex.justify-between
.flex.justify-between
%div
- if procedure.routing_enabled?
%span.icon.person
%span.badge.baseline= procedure.groupe_instructeurs.count
.flex
- if procedure.logo.present?
= image_tag procedure.logo, alt: procedure.libelle, class: 'logo'
%div
.card-title
= link_to procedure.libelle, admin_procedure_path(procedure)
= link_to commencer_url(procedure.path), commencer_url(procedure.path), class: 'fr-link fr-mb-1w'
%p.fr-mt-1w.fr-mb-1w
= t('administrateurs.procedures.created_at')
= procedure.created_at.strftime('%d/%m/%Y')
- if procedure.published_at.present?
%span
= t('administrateurs.procedures.published_at')
= procedure.published_at.strftime('%d/%m/%Y')
- if procedure.updated_at.today?
%span
= t('administrateurs.procedures.updated_at_today')
= procedure.updated_at.strftime('%H:%M')
- else
%span
= t('administrateurs.procedures.updated_at')
= procedure.updated_at.strftime('%d/%m/%Y %H:%M')
- if procedure.closed_at.present?
%span
= t('administrateurs.procedures.closed_at')
= procedure.closed_at.strftime('%d/%m/%Y')
- elsif procedure.auto_archive_on&.future?
%span
= t('administrateurs.procedures.auto_archive_on')
= procedure.auto_archive_on.strftime('%d/%m/%Y')
%div
- if procedure.routing_enabled?
%span.icon.person
%span.fr-badge= procedure.groupe_instructeurs.count
- else
%span.icon.person
%span.fr-badge= procedure.instructeurs.count
%span.icon.folder.fr-ml-1w
%span.fr-badge= procedure.dossiers.state_not_brouillon.visible_by_administration.count
.text-right
%p.fr-mb-0 N° #{procedure.id}
- if procedure.close?
%span.fr-badge.fr-badge--sm.fr-badge--warning
= t('closed', scope: [:layouts, :breadcrumb])
- elsif procedure.locked?
%span.fr-badge.fr-badge--sm.fr-badge--success
= t('published', scope: [:layouts, :breadcrumb])
- else
%span.icon.person
%span.badge.baseline= procedure.instructeurs.count
%span.icon.folder
%span.badge.baseline= procedure.dossiers.state_not_brouillon.visible_by_administration.count
%span.fr-badge.fr-badge--sm.fr-badge--new
= t('draft', scope: [:layouts, :breadcrumb])
.flex.justify-end
%ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline.fr-btns-group--icon-right
- unless procedure.discarded?
%li
@ -80,4 +109,3 @@
%span.icon.unarchive
.dropdown-description
%h4= t('administrateurs.dropdown_actions.restore')

View file

@ -1,38 +1,31 @@
- if deleted_dossiers.present?
%span.fr-h6.fr-mr-2w
.fr-h6.fr-mb-2w
= page_entries_info deleted_dossiers
.fr-table.fr-table--bordered.fr-table--no-caption.fr-mt-2w
%table.table.dossiers-table.hoverable.display-table
%caption= t('views.users.dossiers.dossiers_list.caption')
%thead
%tr
%th.number-col Nº dossier
%th Démarche
%th Raison de suppression
%th Date de suppression
%tbody
- deleted_dossiers.each do |dossier|
%tr{ data: { 'dossier-id': dossier.dossier_id } }
%td.number-col
%span.icon.folder
= dossier.dossier_id
%td
= dossier.procedure.libelle
- deleted_dossiers.each do |dossier|
.card
.flex.justify-between
%div
%h2.card-title
= dossier.procedure.libelle
%td.cell-link
= deletion_reason_badge(dossier.reason)
%td
= dossier.updated_at.strftime('%d/%m/%Y')
%p.fr-icon--sm.fr-icon-delete-line.fr-mb-0
= t('views.users.dossiers.dossiers_list.deleted', date: l(dossier.updated_at.to_date))
= "-"
= t("activerecord.attributes.deleted_dossier.reason.#{dossier.reason}")
= paginate deleted_dossiers, views_prefix: 'shared'
.text-right
%p.fr-mb-0
= t('views.users.dossiers.dossiers_list.n_dossier')
= dossier.dossier_id
%span.fr-badge.fr-badge--sm.fr-badge--warning
= t('views.users.dossiers.dossiers_list.deleted_badge')
= paginate deleted_dossiers, views_prefix: 'shared'
- else
.blank-tab
%h2.empty-text
= t("views.users.dossiers.account_creation.empty")
%h2.empty-text= t('views.users.dossiers.dossiers_list.no_result_title')
%p.empty-text-details
= t("views.users.dossiers.account_creation.detail_one")
%p.empty-text-details
= t("views.users.dossiers.account_creation.detail_two")
#{APPLICATION_BASE_URL}/commencer/xxx.
= t('views.users.dossiers.dossiers_list.no_result_text_html', app_base: APPLICATION_BASE_URL)

View file

@ -7,23 +7,19 @@
- if has_actions
= render Dropdown::MenuComponent.new(wrapper: :div, wrapper_options: {class: 'invite-user-actions'}, menu_options: {id: dom_id(dossier, :actions_menu)}, button_options: {class: 'fr-btn--sm'}) do |menu|
- menu.with_button_inner_html do
= t('views.users.dossiers.dossier_action.actions')
- if has_edit_action
- if dossier.brouillon?
= link_to t('views.users.dossiers.dossier_action.edit_draft'), (url_for_dossier(dossier)), class: 'fr-btn fr-btn--sm fr-mr-1w'
- if has_edit_action
- if dossier.brouillon?
- menu.with_item do
= link_to(url_for_dossier(dossier), role: 'menuitem') do
%span.icon.edit
.dropdown-description
= t('views.users.dossiers.dossier_action.edit_draft')
- else
= link_to t('views.users.dossiers.dossier_action.edit_dossier'), modifier_dossier_path(dossier), class: 'fr-btn fr-btn--sm fr-btn--tertiary fr-mr-1w'
= render Dropdown::MenuComponent.new(wrapper: :div, wrapper_options: {class: 'invite-user-actions'}, menu_options: {id: dom_id(dossier, :actions_menu)}, button_options: {class: 'fr-btn--sm fr-btn--tertiary'}) do |menu|
- menu.with_button_inner_html do
- if has_edit_action
= t('views.users.dossiers.dossier_action.other_actions')
- else
- menu.with_item do
= link_to(modifier_dossier_path(dossier), role: 'menuitem') do
%span.icon.edit
.dropdown-description
= t('views.users.dossiers.dossier_action.edit_dossier')
= t('views.users.dossiers.dossier_action.actions')
- if has_transfer_action
- menu.with_item do

View file

@ -1,53 +1,97 @@
- if dossiers.present?
%span.fr-h6.fr-mr-2w
.fr-h6.fr-mb-2w
= page_entries_info dossiers
.fr-table.fr-table--bordered.fr-table--no-caption.fr-mt-2w
%table.table.dossiers-table.hoverable.hack-to-display-dropdown
%caption= t('views.users.dossiers.dossiers_list.caption')
%thead
%tr
%th.number-col{ scope: :col }= t('views.users.dossiers.dossiers_list.n_dossier')
%th{ scope: :col }= t('views.users.dossiers.dossiers_list.procedure')
- if dossiers.present?
%th{ scope: :col }= t('views.users.dossiers.dossiers_list.requester')
%th.status-col{ scope: :col }= t('views.users.dossiers.dossiers_list.status')
%th.updated-at-col{ scope: :col }= t('views.users.dossiers.dossiers_list.updated')
%th.action-col.follow-col{ scope: :col }= t('views.users.dossiers.dossiers_list.actions')
%tbody
- dossiers.each do |dossier|
- if dossier.transfer.present?
%tr.fr-background-alt--blue-france.no-border
%td.fr-py-2w{ colspan: 100 }
.flex.align-center
%p.fr-mb-0
%small
= t('views.users.dossiers.transfers.sender_demande_en_cours', id: dossier.id, email: dossier.transfer.email)
.ml-auto
= link_to t('views.users.dossiers.transfers.revoke'), transfer_path(dossier.transfer), class: 'fr-btn fr-btn--sm fr-btn--tertiary-no-outline', method: :delete
%tr{ data: { 'dossier-id': dossier.id } }
%th.number-col{ scope: :row }
= link_to(url_for_dossier(dossier), class: 'cell-link', tabindex: -1) do
%span.icon.folder
= dossier.id
%td
- dossiers.each do |dossier|
.card
.flex.justify-between
%div
%h2.card-title
- if ["dossiers-transferes", "dossiers-supprimes-recemment"].exclude?(@statut)
= link_to(url_for_dossier(dossier), class: 'cell-link') do
= procedure_libelle(dossier.procedure)
- if dossiers.present?
%td
%span.cell-link= demandeur_dossier(dossier)
%td.status-col
- if dossier.pending_correction?
= pending_correction_badge(:for_user)
= dossier.procedure.libelle
- else
= dossier.procedure.libelle
- if demandeur_dossier(dossier).present?
%p.fr-icon--sm.fr-icon-user-line
= demandeur_dossier(dossier)
- if dossier.hidden_by_user?
%p.fr-icon--sm.fr-icon-delete-line
= t('views.users.dossiers.dossiers_list.deleted', date: l(dossier.hidden_by_user_at.to_date))
- else
%p.fr-icon--sm.fr-icon-edit-box-line
- if dossier.depose_at.present?
%span
= t('views.users.dossiers.dossiers_list.depose_at', date: l(dossier.depose_at.to_date))
- else
= status_badge(dossier.state)
%span
= t('views.users.dossiers.dossiers_list.created_at', date: l(dossier.created_at.to_date))
- if dossier.created_at != dossier.updated_at
= t('views.users.dossiers.dossiers_list.updated_at', date: l(dossier.updated_at.to_datetime))
%td.updated-at-col.cell-link
= try_format_date(dossier.updated_at)
%td.action-col.follow-col
= render partial: 'dossier_actions', locals: { dossier: dossier }
- if dossier.invites.present?
%p.fr-icon--sm.fr-icon-shield-line
= t('views.users.dossiers.dossiers_list.shared_with')
= dossier.invites.map(&:email).join(', ')
.text-right
%p.fr-mb-0
= t('views.users.dossiers.dossiers_list.n_dossier')
= dossier.id
- if @statut == "dossiers-supprimes-recemment"
%span.fr-badge.fr-badge--sm.fr-badge--warning
= t('views.users.dossiers.dossiers_list.deleted_badge')
- else
= status_badge(dossier.state, 'fr-mb-1w')
- if dossier.pending_correction?
%br
= pending_correction_badge(:for_user)
- if dossier.procedure.close? && !dossier.termine?
= render Dsfr::AlertComponent.new(state: :info, size: :sm, extra_class_names: "fr-mb-2w") do |c|
- c.body do
%p
= t('views.users.dossiers.dossiers_list.procedure_closed')
- if dossier.pending_correction?
= render Dsfr::AlertComponent.new(state: :warning, size: :sm, extra_class_names: "fr-mb-2w") do |c|
- c.body do
%p
= t('views.users.dossiers.dossiers_list.pending_correction')
- if dossier.transfer.present?
- if @statut == "dossiers-transferes"
= render Dsfr::AlertComponent.new(state: :info, size: :sm) do |c|
- c.body do
%p
= t('views.users.dossiers.transfers.receiver_demande_en_cours', id: dossier.id, email: dossier.user.email)
%p
= link_to t('views.users.dossiers.transfers.accept'), transfer_path(dossier.transfer), class: "fr-link fr-mr-1w", method: :put
= link_to t('views.users.dossiers.transfers.reject'), transfer_path(dossier.transfer), class: "fr-link", method: :delete
- else
= render Dsfr::AlertComponent.new(state: :info, size: :sm, extra_class_names: "fr-mb-2w") do |c|
- c.body do
%p
= t('views.users.dossiers.transfers.sender_demande_en_cours', id: dossier.id, email: dossier.transfer.email)
%p
= link_to t('views.users.dossiers.transfers.revoke'), transfer_path(dossier.transfer), class: 'fr-link', method: :delete
- if ["dossiers-transferes", "dossiers-supprimes-recemment"].exclude?(@statut)
.flex.justify-end
= render partial: 'dossier_actions', locals: { dossier: dossier }
- if @statut == "dossiers-supprimes-recemment"
.flex.justify-end
= link_to restore_dossier_path(dossier.id), method: :patch, class: "fr-btn fr-btn--sm" do
Restaurer
= paginate dossiers, views_prefix: 'shared'
= paginate dossiers, views_prefix: 'shared'
- else
- if filter.filter_params.present?

View file

@ -1,44 +0,0 @@
- if hidden_dossiers.present?
%span.fr-h6.fr-mr-2w
= page_entries_info hidden_dossiers
.fr-table.fr-table--bordered.fr-table--no-caption.fr-mt-2w
%table.table.dossiers-table.hoverable
%caption= t('views.users.dossiers.dossiers_list.caption')
%thead
%tr
%th.number-col Nº dossier
%th Démarche
%th Raison de suppression
%th Date de suppression
%th.action-col.follow-col Actions
%tbody
- hidden_dossiers.each do |dossier|
- libelle_demarche = dossier.procedure.libelle
%tr{ data: { 'dossier-id': dossier.id } }
%td.number-col
%span.icon.folder
= dossier.id
%td
= libelle_demarche
%td.cell-link
= deletion_reason_badge("user_request")
%td
= dossier.updated_at.strftime('%d/%m/%Y')
%td.action-col.follow-col
= link_to restore_dossier_path(dossier.id), method: :patch, class: "fr-btn" do
Restaurer
= paginate hidden_dossiers, views_prefix: 'shared'
- else
.blank-tab
%h2.empty-text
= t("views.users.dossiers.account_creation.empty")
%p.empty-text-details
= t("views.users.dossiers.account_creation.detail_one")
%p.empty-text-details
= t("views.users.dossiers.account_creation.detail_two")
#{APPLICATION_BASE_URL}/commencer/xxx.

View file

@ -1,35 +0,0 @@
- if dossier_transfers.present?
.fr-table.fr-table--bordered
%table.table.dossiers-table.display-table
%thead
%tr
%th.number-col= t('views.users.dossiers.dossiers_list.n_dossier')
%th= t('views.users.dossiers.dossiers_list.procedure')
%th= t('views.users.dossiers.dossiers_list.status')
%th.action-col.follow-col Date de dépot
%tbody
- dossier_transfers.each do |transfer|
- transfer.dossiers.each do |dossier|
%tr.fr-background-alt--blue-france.no-border
%td.fr-py-2w{ colspan: 100 }
.flex.align-center
%p.fr-mb-0
%small
= t('views.users.dossiers.transfers.receiver_demande_en_cours', id: dossier.id, email: transfer.dossiers.first.user.email)
.ml-auto
= link_to t('views.users.dossiers.transfers.accept'), transfer_path(transfer), class: "fr-btn fr-btn--sm fr-btn--tertiary", method: :put
= link_to t('views.users.dossiers.transfers.reject'), transfer_path(transfer), class: "fr-btn fr-btn--sm fr-btn--tertiary-no-outline", method: :delete
%tr{ data: { 'transfer-id': transfer.id } }
%th.number-col{ scope: :row }
%span.icon.folder
= dossier.id
%td= dossier.procedure.libelle
%td= status_badge(dossier.state)
%td.action-col.follow-col{ style: 'padding: 18px;' }= (dossier.depose_at || dossier.created_at).strftime('%d/%m/%Y')
= paginate dossier_transfers, views_prefix: 'shared'
- else
.blank-tab
%h2.empty-text Aucune demande de transfert de dossiers ne vous a été adressée.

View file

@ -56,46 +56,32 @@
active: @statut == 'dossiers-supprimes-definitivement',
badge: number_with_html_delimiter(@dossiers_supprimes_definitivement.count))
- if @dossier_transfers.present?
= tab_item(t('pluralize.dossiers_transferes', count: @dossier_transfers.count),
- if @dossier_transferes.present?
= tab_item(t('pluralize.dossiers_transferes', count: @dossier_transferes.count),
dossiers_path(statut: 'dossiers-transferes'),
active: @statut == 'dossiers-transferes',
badge: number_with_html_delimiter(@dossier_transfers.count))
badge: number_with_html_delimiter(@dossier_transferes.count))
.fr-container
- if @statut == "en-cours"
- if @first_brouillon_recently_updated.present?
= render Dsfr::CalloutComponent.new(title: t('users.dossiers.header.callout.first_brouillon_recently_updated_title'), heading_level: 'h2') do |c|
- c.with_body do
%p
= t('users.dossiers.header.callout.first_brouillon_recently_updated_text', time_ago: time_ago_in_words(@first_brouillon_recently_updated.created_at), libelle: @first_brouillon_recently_updated.procedure.libelle )
= link_to t('users.dossiers.header.callout.first_brouillon_recently_updated_button'), url_for_dossier(@first_brouillon_recently_updated), class: 'fr-btn'
.fr-grid-row.fr-grid-row--center
.fr-col-xl-10
- if @statut == "en-cours"
- if @first_brouillon_recently_updated.present?
= render Dsfr::CalloutComponent.new(title: t('users.dossiers.header.callout.first_brouillon_recently_updated_title'), heading_level: 'h2') do |c|
- c.with_body do
%p
= t('users.dossiers.header.callout.first_brouillon_recently_updated_text', time_ago: time_ago_in_words(@first_brouillon_recently_updated.created_at), libelle: @first_brouillon_recently_updated.procedure.libelle )
= link_to t('users.dossiers.header.callout.first_brouillon_recently_updated_button'), url_for_dossier(@first_brouillon_recently_updated), class: 'fr-btn'
- if @search_terms.present?
%h2.page-title Résultat de la recherche pour « #{@search_terms} »
= render partial: "dossiers_list", locals: { dossiers: @dossiers }
- if @search_terms.present?
%h2.page-title Résultat de la recherche pour « #{@search_terms} »
= render partial: "dossiers_list", locals: { dossiers: @dossiers }
- else
= render Dossiers::UserFilterComponent.new(statut: @statut, filter: @filter)
- else
= render Dossiers::UserFilterComponent.new(statut: @statut, filter: @filter)
- if @statut == "en-cours"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- if @statut == "traites"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- if @statut == "dossiers-invites"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- if @statut == "dossiers-supprimes-recemment"
= render partial: "hidden_dossiers_list", locals: { hidden_dossiers: @dossiers }
- if @statut == "dossiers-supprimes-definitivement"
= render partial: "deleted_dossiers_list", locals: { deleted_dossiers: @dossiers }
- if @statut == "dossiers-transferes"
-# /!\ in this context, @dossiers is a collection of DossierTransfer not Dossier
= render partial: "transfered_dossiers_list", locals: { dossier_transfers: @dossiers }
- if @statut == "dossiers-expirant"
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }
- if @statut == "dossiers-supprimes-definitivement"
-# /!\ in this context, @dossiers is a collection of DeletedDossier not Dossier
= render partial: "deleted_dossiers_list", locals: { deleted_dossiers: @dossiers }
- else
= render partial: "dossiers_list", locals: { dossiers: @dossiers, filter: @filter, statut: @statut }

View file

@ -393,10 +393,6 @@ en:
dossier_not_in_instructor_group: "File no. %{dossier_id} of the “%{procedure_libelle}” procedure corresponds to your search, but it is attached to the “%{groupe_instructeur_label}” instructor group."
users:
dossiers:
account_creation:
empty: "No file"
detail_one: "To complete a procedure, contact your administration and ask for the link to the procedure."
detail_two: "This one should look like"
fix_champ: "fill in this field"
archived_dossier: "Your file will be kept %{duree_conservation_dossiers_dans_ds} more months"
identite:
@ -460,17 +456,19 @@ en:
index:
dossiers: "My files"
dossiers_list:
caption: My files
procedure: "Procedure"
n_dossier: "File n."
requester: "Requester"
status: "Status"
updated: "Updated"
actions: "Actions"
no_result_title: No files
no_result_text_html: "To fill a procedure, contact your administration asking for the procedure link. <br> It should look like %{app_base}/commencer/xxx."
no_result_text_with_filter: found with selected filters
no_result_reset_filter: Reset filters
procedure_closed: This procedure has been closed, you will not be able to submit a file again from the procedure link, contact your administration for more information.
pending_correction: This procedure is awaiting your corrections. Correct the fields that are notified by an alert message in the form.
depose_at: First submission on %{date}
created_at: Created at %{date}
updated_at: updated at %{date}
shared_with: File shared with
deleted: Deleted at %{date}
deleted_badge: Deleted
transfers:
sender_demande_en_cours: "A transfer request is pending on file Nº %{id} to %{email}"
receiver_demande_en_cours: "Transfer request on file Nº %{id} sent by %{email}"
@ -483,8 +481,9 @@ en:
clone: "Duplicate the file"
delete_dossier: "Delete the file"
transfer_dossier: "Transfer the file"
edit_draft: "Edit the draft"
edit_draft: "Keep filling"
actions: "Actions"
other_actions: "Other actions"
sessions:
new:
sign_in: Sign in on %{application_name}
@ -743,6 +742,13 @@ en:
new:
title: Pick a password
continue: Continue
procedures:
created_at: created at
published_at: published at
updated_at_today: updated at
updated_at: updated at
closed_at: closed at
auto_archive_on: will close at
users:
dossiers:
test_procedure: "This file is submitted on a test procedure. Any modification of the procedure by the administrator (addition of a field, publication of the procedure, etc.) will result in the removal of the file."

View file

@ -395,10 +395,6 @@ fr:
dossier_not_in_instructor_group: "Le dossier n° %{dossier_id} de la procédure « %{procedure_libelle} » correspond à votre recherche mais il est rattaché au groupe dinstructeurs « %{groupe_instructeur_label} »."
users:
dossiers:
account_creation:
empty: "Aucun dossier"
detail_one: "Pour remplir une démarche, contactez votre administration en lui demandant le lien de la démarche."
detail_two: "Celui ci doit ressembler à"
fix_champ: "corriger lerreur"
archived_dossier: "Votre dossier sera conservé %{duree_conservation_dossiers_dans_ds} mois supplémentaire"
identite:
@ -462,25 +458,28 @@ fr:
index:
dossiers: "Mes dossiers"
dossiers_list:
caption: Mes dossiers
procedure: "Démarche"
n_dossier: "Nº dossier"
requester: "Demandeur"
status: "Statut"
updated: "Mis à jour"
actions: "Actions"
no_result_title: Aucun dossier
no_result_text_html: "Pour remplir une démarche, contactez votre administration en lui demandant le lien de la démarche. <br> Celui ci doit ressembler à %{app_base}/commencer/xxx."
no_result_text_with_filter: ne correspond aux filtres sélectionnés
no_result_reset_filter: Réinitialiser les filtres
procedure_closed: Cette démarche a été clôturée, vous ne pourrez pas redéposer de dossier à partir du lien de la démarche, contactez votre administration pour plus dinformation.
pending_correction: Cette démarche est en attente de vos corrections. Corriger les champs qui sont notifiés par un message dalerte dans le formulaire.
depose_at: Déposé le %{date}
created_at: Créé le %{date}
updated_at: modifié le %{date}
shared_with: Dossier partagé avec
deleted: Supprimé le %{date}
deleted_badge: Supprimé
dossier_action:
edit_dossier: "Modifier le dossier"
start_other_dossier: "Commencer un autre dossier vide"
clone: "Dupliquer ce dossier"
delete_dossier: "Supprimer le dossier"
transfer_dossier: "Transférer le dossier"
edit_draft: "Modifier le brouillon"
edit_draft: "Continuer à remplir"
actions: "Actions"
other_actions: "Autres actions"
transfers:
sender_demande_en_cours: "Une demande de transfert est en cours sur le dossier Nº %{id} pour %{email}"
receiver_demande_en_cours: "Demande de transfert pour le dossier Nº %{id} envoyé par %{email}"
@ -819,6 +818,12 @@ fr:
to_clone: Cloner
to_close: Clore
procedures:
created_at: créée le
published_at: publiée le
updated_at_today: modifiée à
updated_at: modifiée le
closed_at: archivée le
auto_archive_on: sera clôturée le
show:
ready: "Validé"
needs_configuration: "À configurer"

View file

@ -0,0 +1,16 @@
en:
activerecord:
models:
deleted_dossier:
one: "Deleted file"
other: "Deleted files"
attributes:
deleted_dossier:
reason:
user_request: User request
manager_request: Manager request
user_removed: User removed
procedure_removed: Procedure removed
expired: Expired
unknown: Unknow
instructeur_request: Deleted by instructor

View file

@ -1,5 +1,9 @@
fr:
activerecord:
models:
deleted_dossier:
one: "Dossier supprimé"
other: "Dossiers supprimés"
attributes:
deleted_dossier:
reason:

View file

@ -34,7 +34,7 @@ describe 'As an administrateur I wanna clone a procedure', js: true do
scenario do
visit admin_procedures_path
expect(page.find_by_id('procedures')['data-item-count']).to eq('1')
page.all('.admin-procedures-list-row .dropdown .fr-btn').first.click
page.all('.card .dropdown .fr-btn').first.click
page.all('.clone-btn').first.click
visit admin_procedures_path(statut: "brouillons")
expect(page.find_by_id('procedures')['data-item-count']).to eq('1')

View file

@ -66,18 +66,18 @@ describe 'The routing with rules', js: true do
expect(page).to have_text('Le nom est à présent « littéraire ». ')
# add victor to littéraire groupe
fill_in 'Emails', with: 'victor@inst.com'
fill_in 'Emails', with: 'victor@gouv.fr'
perform_enqueued_jobs { click_on 'Affecter' }
expect(page).to have_text("Linstructeur victor@inst.com a été affecté")
expect(page).to have_text("Linstructeur victor@gouv.fr a été affecté")
victor = User.find_by(email: 'victor@inst.com').instructeur
victor = User.find_by(email: 'victor@gouv.fr').instructeur
# add superwoman to littéraire groupe
fill_in 'Emails', with: 'superwoman@inst.com'
# add alain to littéraire groupe
fill_in 'Emails', with: 'alain@gouv.fr'
perform_enqueued_jobs { click_on 'Affecter' }
expect(page).to have_text("Linstructeur superwoman@inst.com a été affecté")
expect(page).to have_text("Linstructeur alain@gouv.fr a été affecté")
superwoman = User.find_by(email: 'superwoman@inst.com').instructeur
alain = User.find_by(email: 'alain@gouv.fr').instructeur
# add inactive groupe
click_on 'Ajout de groupes'
@ -94,16 +94,16 @@ describe 'The routing with rules', js: true do
expect(page).to have_text('Le nom est à présent « scientifique ». ')
# add marie to scientifique groupe
fill_in 'Emails', with: 'marie@inst.com'
fill_in 'Emails', with: 'marie@gouv.fr'
perform_enqueued_jobs { click_on 'Affecter' }
expect(page).to have_text("Linstructeur marie@inst.com a été affecté")
expect(page).to have_text("Linstructeur marie@gouv.fr a été affecté")
marie = User.find_by(email: 'marie@inst.com').instructeur
marie = User.find_by(email: 'marie@gouv.fr').instructeur
# add superwoman to scientifique groupe
fill_in 'Emails', with: 'superwoman@inst.com'
fill_in 'Emails', with: 'alain@gouv.fr'
perform_enqueued_jobs { click_on 'Affecter' }
expect(page).to have_text("Linstructeur superwoman@inst.com a été affecté")
expect(page).to have_text("Linstructeur alain@gouv.fr a été affecté")
# add routing rules
within('.target') { select('Spécialité') }
@ -183,7 +183,7 @@ describe 'The routing with rules', js: true do
visit new_user_session_path
sign_in_with litteraire_user.email, password
click_on litteraire_user.dossiers.first.id.to_s
click_on litteraire_user.dossiers.first.procedure.libelle
click_on 'Modifier mon dossier'
fill_in litteraire_user.dossiers.first.champs_public.first.libelle, with: 'some value'
@ -223,7 +223,7 @@ describe 'The routing with rules', js: true do
log_out
# the instructeurs who belong to scientifique AND litteraire groups manage scientifique and litteraire dossiers
register_instructeur_and_log_in(superwoman.email)
register_instructeur_and_log_in(alain.email)
visit instructeur_procedure_path(procedure, params: { statut: 'tous' })
expect(page).to have_text(litteraire_user.email)
expect(page).to have_text(scientifique_user.email)
@ -242,7 +242,7 @@ describe 'The routing with rules', js: true do
# the instructeurs who belong to scientifique AND litteraire groups should have a notification
visit new_user_session_path
sign_in_with superwoman.user.email, password
sign_in_with alain.user.email, password
expect(page).to have_current_path(instructeur_procedures_path)
expect(find('.procedure-stats')).to have_css('span.notifications')
@ -282,7 +282,7 @@ describe 'The routing with rules', js: true do
def user_update_group(user, new_group)
login_as user, scope: :user
visit dossiers_path
click_on user.dossiers.first.id.to_s
click_on user.dossiers.first.procedure.libelle
click_on "Modifier mon dossier"
choose(new_group)

View file

@ -149,13 +149,13 @@ describe 'Invitations' do
def navigate_to_brouillon(dossier)
expect(page).to have_current_path(dossiers_path)
click_on(dossier.id.to_s)
click_on(dossier.procedure.libelle)
expect(page).to have_current_path(brouillon_dossier_path(dossier))
end
def navigate_to_dossier(dossier)
expect(page).to have_current_path(dossiers_path)
click_on(dossier.id.to_s)
click_on(dossier.procedure.libelle)
expect(page).to have_current_path(dossier_path(dossier))
end

View file

@ -157,15 +157,16 @@ describe 'user access to the list of their dossiers', js: true do
context 'when user clicks on delete button', js: true do
scenario 'the dossier is deleted' do
within(:css, "tr[data-dossier-id=\"#{dossier_brouillon.id}\"]") do
click_on 'Actions'
expect(page).to have_content(dossier_en_construction.procedure.libelle)
within(:css, ".card", match: :first) do
click_on 'Autres actions'
page.accept_alert('Confirmer la suppression ?') do
click_on 'Supprimer le dossier'
end
end
expect(page).to have_content('Votre dossier a bien été supprimé')
expect(page).not_to have_content(dossier_brouillon.procedure.libelle)
expect(page).not_to have_content(dossier_en_construction.procedure.libelle)
end
end
@ -177,10 +178,10 @@ describe 'user access to the list of their dossiers', js: true do
end
context 'when user clicks on clone button', js: true do
scenario 'the dossier is deleted' do
within(:css, "tr[data-dossier-id=\"#{dossier_brouillon.id}\"]") do
click_on 'Actions'
click_on 'Dupliquer ce dossier'
scenario 'the dossier is cloned' do
within(:css, ".card", match: :first) do
click_on 'Autres actions'
expect { click_on 'Dupliquer ce dossier' }.to change { dossier_brouillon.user.dossiers.count }.by(1)
end
expect(page).to have_content("Votre dossier a bien été dupliqué. Vous pouvez maintenant le vérifier, ladapter puis le déposer.")

View file

@ -11,8 +11,8 @@ describe 'Transfer dossier:' do
end
scenario 'the user can transfer dossier to another user' do
within(:css, "tr[data-dossier-id=\"#{dossier.id}\"]") do
click_on 'Actions'
within(:css, ".card", match: :first) do
click_on 'Autres actions'
click_on 'Transférer le dossier'
end

View file

@ -16,7 +16,7 @@ describe 'users/dossiers/index', type: :view do
assign(:dossiers_supprimes_recemment, Kaminari.paginate_array(user_dossiers).page(1))
assign(:dossiers_supprimes_definitivement, Kaminari.paginate_array(user_dossiers).page(1))
assign(:dossiers_traites, Kaminari.paginate_array(user_dossiers).page(1))
assign(:dossier_transfers, Kaminari.paginate_array([]).page(1))
assign(:dossier_transferes, Kaminari.paginate_array([]).page(1))
assign(:dossiers_close_to_expiration, Kaminari.paginate_array([]).page(1))
assign(:dossiers, Kaminari.paginate_array(user_dossiers).page(1))
assign(:statut, statut)
@ -24,19 +24,19 @@ describe 'users/dossiers/index', type: :view do
render
end
it 'affiche la liste des dossiers' do
expect(rendered).to have_selector('.dossiers-table tbody tr', count: 3)
it 'affiche les dossiers' do
expect(rendered).to have_selector('.card', count: 3)
end
it 'affiche les informations des dossiers' do
dossier = user_dossiers.first
expect(rendered).to have_text(dossier_brouillon.id.to_s)
expect(rendered).to have_text(dossier_brouillon.procedure.libelle)
expect(rendered).to have_link(dossier_brouillon.id.to_s, href: brouillon_dossier_path(dossier_brouillon))
expect(rendered).to have_link(dossier_brouillon.procedure.libelle, href: brouillon_dossier_path(dossier_brouillon))
expect(rendered).to have_text(dossier_en_construction.id.to_s)
expect(rendered).to have_text(dossier_en_construction.procedure.libelle)
expect(rendered).to have_link(dossier_en_construction.id.to_s, href: dossier_path(dossier_en_construction))
expect(rendered).to have_link(dossier_en_construction.procedure.libelle, href: dossier_path(dossier_en_construction))
end
it 'naffiche pas une alerte pour continuer à remplir un dossier' do