Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETQ instructeur : un message m'incite à ajouter la colonne "Labels" dans mon tableau de suivi des dossiers #11244

Merged
merged 4 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/views/instructeurs/dossiers/_header_top.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,20 @@
= b.check_box(checked: DossierLabel.find_by(dossier_id: dossier.id, label_id: b.value).present? )
= b.label(class: "fr-label fr-tag fr-tag--sm fr-tag--#{Label.colors.fetch(b.object.color)}") { b.text }

%hr
%hr.fr-pb-2w
%p.fr-text--sm.fr-text-mention--grey.fr-mb-0
%b Besoin d'autres labels ?
%br
Contactez les
= link_to 'administrateurs de la démarche', administrateurs_instructeur_procedure_path(dossier.procedure), class: 'fr-link fr-link--sm', **external_link_attributes
- if !@procedure_presentation.displayed_columns.any? { |c| c.column == "label_id" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour info, ça aurait aussi pu être

Suggested change
- if !@procedure_presentation.displayed_columns.any? { |c| c.column == "label_id" }
- if @procedure_presentation.displayed_columns.none? { |c| c.column == "label_id" }

(gain de lisibilité en évitant l'inversion de condition avec !) :

%hr.fr-mt-2w
.fr-notice.fr-notice--info
.fr-container
.fr-notice__body.fr-p-0
%p
%span.fr-notice__title Pensez à personnaliser votre tableau
%span.fr-notice__desc de suivi des dossiers en ajoutant la colonne « Labels ».

.header-actions.fr-ml-auto
= render partial: 'instructeurs/dossiers/header_actions', locals: { dossier: }
2 changes: 1 addition & 1 deletion spec/views/instructeur/dossiers/show.html.haml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
let(:current_instructeur) { create(:instructeur) }
let(:dossier) { create(:dossier, :en_construction) }
let(:statut) { { statut: 'tous' } }
let(:procedure_presentation) { double(instructeur: current_instructeur, procedure: dossier.procedure) }
let(:procedure_presentation) { double(instructeur: current_instructeur, procedure: dossier.procedure, displayed_columns: []) }

before do
sign_in(current_instructeur.user)
Expand Down
Loading