Merge pull request #9261 from colinux/improve-demande-page

ETQ instructeur/usager: propositions d'améliorations visuelles de la page de demande
This commit is contained in:
mfo 2023-06-29 07:58:20 +00:00 committed by GitHub
commit 8962791464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 269 additions and 227 deletions

View file

@ -145,44 +145,47 @@ $landing-breakpoint: 1040px;
background-color: var(--background-alt-blue-france);
}
.more-info {
background-color: #FFFFFF;
}
.numbers {
@extend %horizontal-list;
justify-content: space-around;
width: 100%;
}
.number {
@extend %horizontal-list-item;
width: 320px;
text-align: center;
@media (max-width: $landing-breakpoint) {
margin-bottom: 15px;
.landing {
.more-info {
background-color: #FFFFFF;
}
}
.number-value {
color: var(--text-action-high-blue-france);
font-size: 2rem;
line-height: 2rem;
font-weight: 600;
}
.numbers {
@extend %horizontal-list;
justify-content: space-around;
width: 100%;
}
.number-label {
max-width: 10rem;
margin: auto;
font-weight: 600;
font-size: 1.25rem;
line-height: 1.5rem;
color: var(--text-label-grey);
}
.number {
@extend %horizontal-list-item;
width: 320px;
text-align: center;
.number-label-third {
max-width: 13rem;
@media (max-width: $landing-breakpoint) {
margin-bottom: 15px;
}
}
.number-value {
color: var(--text-action-high-blue-france);
font-size: 2rem;
line-height: 2rem;
font-weight: 600;
}
.number-label {
max-width: 10rem;
margin: auto;
font-weight: 600;
font-size: 1.25rem;
line-height: 1.5rem;
color: var(--text-label-grey);
}
.number-label-third {
max-width: 13rem;
}
}
$users-breakpoint: 950px;

View file

@ -28,4 +28,31 @@ class Dossiers::ChampRowShowComponent < ApplicationComponent
key
end
def each_champ(&block)
@champs.filter { show_champ?(_1) }.each(&block)
end
private
# champ.blank? is overloaded, disable the cop
# rubocop:disable Rails/Present
def show_champ?(champ)
if view_usager?
true
elsif champ.blank? && updated_after_deposer?(champ)
true
else
!champ.blank?
end
end
# rubocop:enable Rails/Present
def view_usager?
@profile == 'usager'
end
def view_instructeur?
@profile == 'instructeur'
end
end

View file

@ -1,4 +1,4 @@
- @champs.each do |champ|
- each_champ do |champ|
.fr-px-4v.fr-my-2v
- if champ.repetition?
%p.champ-label= "#{champ.libelle} :"
@ -11,7 +11,7 @@
- if updated_after_deposer?(champ)
%p.fr-mb-0.fr-text--sm
%span{ class: highlight_if_unseen_class(@demande_seen_at, champ.updated_at) }
%span.fr-badge.fr-badge--sm{ class: badge_class_if_unseen(@demande_seen_at, champ.updated_at) }
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(champ.updated_at))
- if champ.blank?

View file

@ -17,6 +17,13 @@ module DossierHelper
end
end
def badge_class_if_unseen(seen_at, updated_at)
return if updated_at.blank? || seen_at.blank?
return if seen_at > updated_at
"fr-badge--new"
end
def url_for_dossier(dossier)
if dossier.brouillon?
brouillon_dossier_path(dossier)

View file

@ -4,9 +4,9 @@
%p.champ-label.flex-grow= dossier.procedure.routing_criteria_name
%p.fr-mb-0.fr-text--xs
- if demande_seen_at&.<(dossier.groupe_instructeur_updated_at)
%span{ class: highlight_if_unseen_class(demande_seen_at, dossier.groupe_instructeur_updated_at) }
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(dossier.updated_at))
- if demande_seen_at && dossier.groupe_instructeur_updated_at && demande_seen_at < dossier.groupe_instructeur_updated_at
%span.fr-badge.fr-badge--sm{ class: badge_class_if_unseen(demande_seen_at, dossier.groupe_instructeur_updated_at) }
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: try_format_datetime(dossier.groupe_instructeur_updated_at))
.champ-content{ class: highlight_if_unseen_class(demande_seen_at, dossier.groupe_instructeur_updated_at) }
%p= dossier.groupe_instructeur.label

View file

@ -4,7 +4,7 @@
.fr-container.counter-start-header-section.dossier-show
.fr-grid-row.fr-grid-row--center
.fr-col-12.fr-col-lg-10.fr-col-xl-8
.fr-col-xl-10
%h2.fr-h6.fr-background-alt--grey.fr-mb-0
.flex-grow.fr-py-3v.fr-px-4v= t('views.shared.dossiers.demande.en_construction')

View file

@ -1,196 +1,197 @@
- if etablissement.as_degraded_mode?
.fr-alert.fr-alert--warning.fr-alert--sm
%p
LʼINSEE est indisponible, les informations sur lʼentreprise arriveront dʼici quelques heures.
- if profile == "instructeur"
%p
Il nʼest pas possible dʼaccepter ou de refuser un dossier sans cette étape.
.fr-my-2v
%p.champ-label SIRET :
.champ-content
%p= etablissement.siret
- else
- if etablissement.diffusable_commercialement == false && profile != 'instructeur'
.fr-my-2v
.champ-content
%p= t('warning_for_private_info', scope: 'views.shared.dossiers.identite_entreprise', siret: pretty_siret(etablissement.siret))
- else
.fr-my-2v
%p.champ-label Dénomination :
.champ-content
%p= raison_sociale_or_name(etablissement)
.fr-background-alt--grey.fr-p-3v
- if etablissement.as_degraded_mode?
.fr-alert.fr-alert--warning.fr-alert--sm
%p
LʼINSEE est indisponible, les informations sur lʼentreprise arriveront dʼici quelques heures.
- if profile == "instructeur"
%p
Il nʼest pas possible dʼaccepter ou de refuser un dossier sans cette étape.
.fr-my-2v
%p.champ-label SIRET :
.champ-content
%p #{pretty_siret(etablissement.siret)} #{ render Dsfr::CopyButtonComponent.new(text: etablissement.siret, title: "Copier le siret dans le presse-papier", success: "Le siret a été copié dans le presse-papier") }
%p= etablissement.siret
- else
- if etablissement.diffusable_commercialement == false && profile != 'instructeur'
.fr-my-2v
.champ-content
%p= t('warning_for_private_info', scope: 'views.shared.dossiers.identite_entreprise', siret: pretty_siret(etablissement.siret))
- else
.fr-my-2v
%p.champ-label Dénomination :
.champ-content
%p= raison_sociale_or_name(etablissement)
.fr-my-2v
%p.champ-label SIRET :
.champ-content
%p #{pretty_siret(etablissement.siret)} #{ render Dsfr::CopyButtonComponent.new(text: etablissement.siret, title: "Copier le siret dans le presse-papier", success: "Le siret a été copié dans le presse-papier") }
- unless local_assigns[:short_identity]
- if etablissement.siret != etablissement.entreprise.siret_siege_social
.fr-my-2v
%p.champ-label SIRET du siège social:
.champ-content
%p= etablissement.entreprise.siret_siege_social
.fr-my-2v
%p.champ-label Forme juridique :
.champ-content
%p= sanitize(etablissement.entreprise.forme_juridique)
.fr-my-2v
%p.champ-label Libellé NAF :
.champ-content
%p= etablissement.libelle_naf
.fr-my-2v
%p.champ-label Code NAF :
.champ-content
%p= etablissement.naf
.fr-my-2v
%p.champ-label Date de création :
.champ-content
%p
= try_format_date(etablissement.entreprise.date_creation)
- if etablissement.entreprise_etat_administratif.present?
%span.label= humanized_entreprise_etat_administratif(etablissement)
- if profile == 'instructeur'
.fr-my-2v
%p.champ-label
Effectif mensuel
= try_format_mois_effectif(etablissement)
(URSSAF) :
.champ-content
%p= etablissement.entreprise_effectif_mensuel
.fr-my-2v
%p.champ-label
Effectif moyen annuel
= etablissement.entreprise_effectif_annuel_annee
(URSSAF) :
.champ-content
%p= etablissement.entreprise_effectif_annuel
.fr-my-2v
%p.champ-label Effectif de l'organisation (INSEE) :
.champ-content
%p
= effectif(etablissement)
.fr-my-2v
%p.champ-label Numéro de TVA intracommunautaire :
.champ-content
%p= etablissement.entreprise.numero_tva_intracommunautaire
.fr-my-2v
%p.champ-label Adresse :
.champ-content
%p
- etablissement.adresse.split("\n").each do |line|
= line
%br
.fr-my-2v
%p.champ-label Capital social :
.champ-content
%p= pretty_currency(etablissement.entreprise.capital_social)
.fr-my-2v
%p.champ-label Chiffre daffaires :
.champ-content
%p
- if profile == 'instructeur'
%details
- etablissement.exercices.each_with_index do |exercice, index|
= "#{exercice.date_fin_exercice.year} : "
= pretty_currency(exercice.ca)
%br
- elsif etablissement.exercices.present?
= t('activemodel.models.exercices_summary', count: etablissement.exercices.count)
- if etablissement.entreprise_bilans_bdf.present?
- if profile == 'instructeur'
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
locals: { libelle: 'Résultat exercice', key: 'resultat_exercice', etablissement: etablissement }
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
locals: { libelle: "Excédent brut dexploitation", key: 'excedent_brut_exploitation', etablissement: etablissement }
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
locals: { libelle: 'Fonds de roulement net global', key: 'fonds_roulement_net_global', etablissement: etablissement }
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
locals: { libelle: 'Besoin en fonds de roulement', key: 'besoin_en_fonds_de_roulement', etablissement: etablissement }
- unless local_assigns[:short_identity]
- if etablissement.siret != etablissement.entreprise.siret_siege_social
.fr-my-2v
%p.champ-label
Chiffres financiers clés (Banque de France)
= "en #{pretty_currency_unit(etablissement.entreprise_bilans_bdf_monnaie)} :"
- if controller.is_a?(Instructeurs::AvisController)
.champ-content
%p
Les consulter
= link_to "au format csv", bilans_bdf_instructeur_avis_path(@avis, format: 'csv')
,
= link_to "au format xlsx", bilans_bdf_instructeur_avis_path(@avis, format: 'xlsx')
ou
= link_to "au format ods", bilans_bdf_instructeur_avis_path(@avis, format: 'ods')
- else
.champ-content
%p
Les consulter
= link_to "au format csv", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'csv')
,
= link_to "au format xlsx", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'xlsx')
ou
= link_to "au format ods", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'ods')
- else
.fr-my-2v
%p.champ-label
Bilans Banque de France :
%p.champ-label SIRET du siège social:
.champ-content
%p Les 3 derniers bilans connus de votre entreprise par la Banque de France ont été joints à votre dossier.
- if etablissement.entreprise_attestation_sociale.attached?
%p= etablissement.entreprise.siret_siege_social
.fr-my-2v
%p.champ-label Attestation sociale :
- if profile == 'instructeur'
.champ-content
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_sociale)
- else
.champ-content
%p Une attestation de vigilance délivrée par l'ACOSS a été jointe à votre dossier.
- if etablissement.entreprise_attestation_fiscale.attached?
.fr-my-2v
%p.champ-label Attestation fiscale :
- if profile == 'instructeur'
.champ-content
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_fiscale)
- else
.champ-content
%p Une attestation fiscale délivrée par l'URSSAF a été jointe à votre dossier.
- if etablissement.association?
.fr-my-2v
%p.champ-label Numéro RNA :
%p.champ-label Forme juridique :
.champ-content
%p= etablissement.association_rna
%p= sanitize(etablissement.entreprise.forme_juridique)
.fr-my-2v
%p.champ-label Titre :
%p.champ-label Libellé NAF :
.champ-content
%p= etablissement.association_titre
%p= etablissement.libelle_naf
.fr-my-2v
%p.champ-label Objet :
%p.champ-label Code NAF :
.champ-content
%p= etablissement.association_objet
%p= etablissement.naf
.fr-my-2v
%p.champ-label Date de création :
.champ-content
%p= try_format_date(etablissement.association_date_creation)
.fr-my-2v
%p.champ-label Date de publication :
.champ-content
%p= try_format_date(etablissement.association_date_publication)
.fr-my-2v
%p.champ-label Date de déclaration :
.champ-content
%p= try_format_date(etablissement.association_date_declaration)
%p
= try_format_date(etablissement.entreprise.date_creation)
- unless local_assigns[:short_identity]
%p
= link_to "➡ Autres informations sur lorganisme sur « annuaire-entreprises.data.gouv.fr » (ex: fiche dimmatriculation RNCS)",
annuaire_link(etablissement.siret),
target: "_blank"
- if etablissement.entreprise_etat_administratif.present?
%span.label= humanized_entreprise_etat_administratif(etablissement)
- if profile == 'instructeur'
.fr-my-2v
%p.champ-label
Effectif mensuel
= try_format_mois_effectif(etablissement)
(URSSAF) :
.champ-content
%p= etablissement.entreprise_effectif_mensuel
.fr-my-2v
%p.champ-label
Effectif moyen annuel
= etablissement.entreprise_effectif_annuel_annee
(URSSAF) :
.champ-content
%p= etablissement.entreprise_effectif_annuel
.fr-my-2v
%p.champ-label Effectif de l'organisation (INSEE) :
.champ-content
%p
= effectif(etablissement)
.fr-my-2v
%p.champ-label Numéro de TVA intracommunautaire :
.champ-content
%p= etablissement.entreprise.numero_tva_intracommunautaire
.fr-my-2v
%p.champ-label Adresse :
.champ-content
%p
- etablissement.adresse.split("\n").each do |line|
= line
%br
.fr-my-2v
%p.champ-label Capital social :
.champ-content
%p= pretty_currency(etablissement.entreprise.capital_social)
.fr-my-2v
%p.champ-label Chiffre daffaires :
.champ-content
%p
- if profile == 'instructeur'
%details
- etablissement.exercices.each_with_index do |exercice, index|
= "#{exercice.date_fin_exercice.year} : "
= pretty_currency(exercice.ca)
%br
- elsif etablissement.exercices.present?
= t('activemodel.models.exercices_summary', count: etablissement.exercices.count)
- if etablissement.entreprise_bilans_bdf.present?
- if profile == 'instructeur'
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
locals: { libelle: 'Résultat exercice', key: 'resultat_exercice', etablissement: etablissement }
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
locals: { libelle: "Excédent brut dexploitation", key: 'excedent_brut_exploitation', etablissement: etablissement }
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
locals: { libelle: 'Fonds de roulement net global', key: 'fonds_roulement_net_global', etablissement: etablissement }
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
locals: { libelle: 'Besoin en fonds de roulement', key: 'besoin_en_fonds_de_roulement', etablissement: etablissement }
.fr-my-2v
%p.champ-label
Chiffres financiers clés (Banque de France)
= "en #{pretty_currency_unit(etablissement.entreprise_bilans_bdf_monnaie)} :"
- if controller.is_a?(Instructeurs::AvisController)
.champ-content
%p
Les consulter
= link_to "au format csv", bilans_bdf_instructeur_avis_path(@avis, format: 'csv')
,
= link_to "au format xlsx", bilans_bdf_instructeur_avis_path(@avis, format: 'xlsx')
ou
= link_to "au format ods", bilans_bdf_instructeur_avis_path(@avis, format: 'ods')
- else
.champ-content
%p
Les consulter
= link_to "au format csv", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'csv')
,
= link_to "au format xlsx", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'xlsx')
ou
= link_to "au format ods", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'ods')
- else
.fr-my-2v
%p.champ-label
Bilans Banque de France :
.champ-content
%p Les 3 derniers bilans connus de votre entreprise par la Banque de France ont été joints à votre dossier.
- if etablissement.entreprise_attestation_sociale.attached?
.fr-my-2v
%p.champ-label Attestation sociale :
- if profile == 'instructeur'
.champ-content
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_sociale)
- else
.champ-content
%p Une attestation de vigilance délivrée par l'ACOSS a été jointe à votre dossier.
- if etablissement.entreprise_attestation_fiscale.attached?
.fr-my-2v
%p.champ-label Attestation fiscale :
- if profile == 'instructeur'
.champ-content
%p= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_fiscale)
- else
.champ-content
%p Une attestation fiscale délivrée par l'URSSAF a été jointe à votre dossier.
- if etablissement.association?
.fr-my-2v
%p.champ-label Numéro RNA :
.champ-content
%p= etablissement.association_rna
.fr-my-2v
%p.champ-label Titre :
.champ-content
%p= etablissement.association_titre
.fr-my-2v
%p.champ-label Objet :
.champ-content
%p= etablissement.association_objet
.fr-my-2v
%p.champ-label Date de création :
.champ-content
%p= try_format_date(etablissement.association_date_creation)
.fr-my-2v
%p.champ-label Date de publication :
.champ-content
%p= try_format_date(etablissement.association_date_publication)
.fr-my-2v
%p.champ-label Date de déclaration :
.champ-content
%p= try_format_date(etablissement.association_date_declaration)
- unless local_assigns[:short_identity]
%p
= link_to "➡ Autres informations sur lorganisme sur « annuaire-entreprises.data.gouv.fr » (ex: fiche dimmatriculation RNCS)",
annuaire_link(etablissement.siret),
target: "_blank"

View file

@ -1,9 +1,13 @@
.fr-px-2w
%p.fr-my-2w
= t(:submitted_at, scope: [:views, :shared, :dossiers, :form], datetime: l(dossier.depose_at))
%br
- if dossier.last_champ_updated_at.present? && dossier.last_champ_updated_at > dossier.depose_at
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: l(dossier.last_champ_updated_at))
.fr-my-2w
%p
= t(:submitted_at, scope: [:views, :shared, :dossiers, :form], datetime: l(dossier.depose_at))
%br
- if dossier.last_champ_updated_at.present? && dossier.last_champ_updated_at > dossier.depose_at
= t(:updated_at, scope: [:views, :shared, :dossiers, :form], datetime: l(dossier.last_champ_updated_at))
.fr-highlight
%p.fr-text--sm.fr-text-mention--grey Sauf mention contraire, les champs ont été saisis à la date du dépôt du dossier.
- if dossier.justificatif_motivation.attached?

View file

@ -9,7 +9,7 @@
- if @dossier.en_construction?
.fr-container
.fr-grid-row.fr-grid-row--center
.fr-col-md-10.fr-col-xl-9
.fr-col-xl-10
= render Dossiers::EnConstructionNotSubmittedComponent.new(dossier: @dossier, user: current_user)
= render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil, profile: 'usager' }
@ -17,7 +17,7 @@
.fr-container.fr-mt-2w
.fr-grid-row.fr-grid-row--center
.fr-col-12.fr-col-lg-10.fr-col-xl-8
.fr-col-xl-10
- if !@dossier.read_only?
= link_to t('views.users.dossiers.demande.edit_dossier'), modifier_dossier_path(@dossier), class: 'fr-btn fr-btn-sm', 'title'=> "Modifier mon dossier tant qu'il n'est pas passé en instruction"
.clearfix

View file

@ -112,7 +112,7 @@ describe 'shared/dossiers/champs', type: :view do
let(:champ) { create(:champ_dossier_link, dossier: dossier, value: nil) }
let(:champs) { [champ] }
it { is_expected.to include("non saisi") }
it { is_expected.not_to include("non saisi") }
context 'when profile is usager' do
let(:profile) { "usager" }
@ -125,7 +125,7 @@ describe 'shared/dossiers/champs', type: :view do
let(:champ) { create(:champ_without_piece_justificative, dossier:) }
let(:champs) { [champ] }
it { is_expected.to include("pièce justificative non saisie") }
it { is_expected.not_to include("pièce justificative non saisie") }
context 'when profile is usager' do
let(:profile) { "usager" }