-
Notifications
You must be signed in to change notification settings - Fork 90
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
Tech: simplifie le service de projection des colonnes #11041
base: main
Are you sure you want to change the base?
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: app/controllers/instructeurs/procedures_controller.rb
Did you find this useful? React with a 👍 or 👎 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11041 +/- ##
===========================================
- Coverage 84.31% 35.65% -48.67%
===========================================
Files 1171 1174 +3
Lines 25833 31441 +5608
Branches 4875 3432 -1443
===========================================
- Hits 21782 11209 -10573
- Misses 4051 20232 +16181 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
f2e3402
to
dae046c
Compare
class ColumnLoaders::ChampColumnLoader | ||
def self.load(columns, dossier_ids) | ||
Champ | ||
.where(stable_id: columns.map(&:stable_id), dossier_id: dossier_ids) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.where(stable_id: columns.map(&:stable_id), dossier_id: dossier_ids) | |
.where(stable_id: columns.map(&:stable_id), dossier_id: dossier_ids, stream: 'main') |
.where(stable_id: columns.map(&:stable_id), dossier_id: dossier_ids) | ||
.select(:dossier_id, :value, :stable_id, :type, :external_id, :data, :value_json) | ||
.group_by(&:dossier_id) | ||
.map { |dossier_id, champs| load_one_dossier(dossier_id, champs, columns) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.map { |dossier_id, champs| load_one_dossier(dossier_id, champs, columns) } | |
.map { |dossier_id, champs| load_one_dossier(dossier_id, champs.index_by(&:stable_id), columns) } |
@@ -1,10 +1,8 @@ | |||
# frozen_string_literal: true | |||
|
|||
class ExportedColumnFormatter | |||
def self.format(column:, champ_or_dossier:, format:) | |||
return if champ_or_dossier.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi tu veux sortir ce code ?
because of bb236f6
e3533de
to
fd49030
Compare
fd49030
to
8653c7f
Compare
&.join(' / ') | ||
end | ||
|
||
def champ_for(column) = @dossier.champs.find { _1.stable_id == column.stable_id } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ça, ça marche ici par chance car il n'y a pas de répétitions possibles dans le tableau de bord
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Et dans tous les cas, il ne faut plus passer par le dossier.champs
. Jamais.
when :self | ||
nil | ||
when :type_de_champ | ||
:champs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il faut ajouter les attachements ici
No description provided.