Skip to content

Commit

Permalink
fix: Minor fixes of Project exporter based on real data
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Nov 23, 2023
1 parent 38f7ed6 commit 6c6b6c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/app/services/backoffice/csv/project_exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ def call
column(I18n.t("simple_form.labels.project.problem")) { |r| r.problem }
column(I18n.t("simple_form.labels.project.solution")) { |r| r.solution }
column(I18n.t("simple_form.labels.project.target_groups")) do |r|
r.target_groups.map { |tg| ProjectTargetGroup.find(tg).name }.join(", ")
r.target_groups.to_a.map { |tg| ProjectTargetGroup.find(tg).name }.join(", ")
end
column(I18n.t("simple_form.labels.project.expected_impact")) { |r| r.expected_impact }
column(I18n.t("backoffice.projects.export.impact_areas")) do |r|
r.impact_areas.map { |ia| ImpactArea.find(ia).name }.join(", ")
r.impact_areas.to_a.map { |ia| ImpactArea.find(ia).name }.join(", ")
end
column(I18n.t("backoffice.projects.export.sdgs")) do |r|
r.sdgs.map { |sdg| Sdg.find(sdg).name }.join(", ")
end
column(I18n.t("backoffice.projects.export.looking_for_funding")) { |r| I18n.t(r.looking_for_funding.to_s) }
column(I18n.t("backoffice.projects.export.ticket_size")) { |r| TicketSize.find(r.ticket_size).name }
column(I18n.t("backoffice.projects.export.ticket_size")) do |r|
r.ticket_size.present? ? TicketSize.find(r.ticket_size).name : ""
end
column(I18n.t("backoffice.projects.export.instrument_types")) do |r|
r.instrument_types.map { |it| InstrumentType.find(it).name }.join(", ")
r.instrument_types.to_a.map { |it| InstrumentType.find(it).name }.join(", ")
end
column(I18n.t("simple_form.labels.project.funding_plan")) { |r| r.funding_plan }
column(I18n.t("simple_form.labels.project.received_funding")) { |r| I18n.t(r.received_funding) }
Expand Down

0 comments on commit 6c6b6c3

Please sign in to comment.