Skip to content

Commit

Permalink
Merge pull request #11209 from demarches-simplifiees/add-labels-to-ex…
Browse files Browse the repository at this point in the history
…port-ldu

[ETQ instructeur] je retrouve les labels dans les exports
  • Loading branch information
lisa-durand authored Jan 16, 2025
2 parents 6ca8ddb + 7e49823 commit 7d4f814
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/assets/stylesheets/dsfr.scss
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,8 @@ input[type='radio'] {
display: none !important;
}
}

// We want labels to be centered inside dossiers table
.fr-table .fr-tags-group .fr-tag {
margin-top: 0.5rem;
}
2 changes: 2 additions & 0 deletions app/models/columns/dossier_column.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def value(dossier)
dossier.individual.public_send(column)
when 'groupe_instructeur'
dossier.groupe_instructeur.label
when 'dossier_labels'
dossier.labels.map(&:name).join(' ')
when 'followers_instructeurs'
dossier.followers_instructeurs.map(&:email).join(' ')
end
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/columns_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def dossier_columns_for_export
columns.concat([dossier_motivation_column])
columns.concat(sva_svr_columns(for_export: true)) if sva_svr_enabled?
columns.concat([groupe_instructeurs_id_column, followers_instructeurs_email_column])
columns.concat([dossier_labels_column])

# ensure the columns exist in main list
# otherwise, they will be found by the find_column method
Expand Down
3 changes: 2 additions & 1 deletion spec/models/concerns/columns_concern_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
procedure.find_column(label: "Date de traitement"),
procedure.find_column(label: "Motivation de la décision"),
procedure.find_column(label: "Instructeurs"),
procedure.find_column(label: "Groupe instructeur")
procedure.find_column(label: "Groupe instructeur"),
procedure.find_column(label: "Labels")
]
actuals = procedure.dossier_columns_for_export.map(&:h_id)
expected.each do |expected_col|
Expand Down

0 comments on commit 7d4f814

Please sign in to comment.