Merge pull request #6015 from betagouv/main

2021-03-24-01
This commit is contained in:
Kara Diaby 2021-03-24 10:02:25 +01:00 committed by GitHub
commit cddd61a44b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 17 deletions

View file

@ -93,9 +93,9 @@ def render_single_champ(pdf, champ)
end end
pdf.text "\n" pdf.text "\n"
when 'Champs::ExplicationChamp' when 'Champs::ExplicationChamp'
format_in_2_lines(pdf, champ.libelle, champ.description) format_in_2_columns(pdf, champ.libelle, champ.description)
when 'Champs::CarteChamp' when 'Champs::CarteChamp'
format_in_2_lines(pdf, champ.libelle, champ.to_feature_collection.to_json) format_in_2_columns(pdf, champ.libelle, champ.to_feature_collection.to_json)
when 'Champs::SiretChamp' when 'Champs::SiretChamp'
pdf.font 'marianne', style: :bold, size: 9 do pdf.font 'marianne', style: :bold, size: 9 do
pdf.text champ.libelle pdf.text champ.libelle
@ -105,10 +105,10 @@ def render_single_champ(pdf, champ)
pdf.text "\n" pdf.text "\n"
when 'Champs::NumberChamp' when 'Champs::NumberChamp'
value = number_with_delimiter(champ.to_s) value = number_with_delimiter(champ.to_s)
format_in_2_lines(pdf, champ.libelle, value) format_in_2_columns(pdf, champ.libelle, value)
else else
value = champ.to_s.empty? ? 'Non communiqué' : champ.to_s value = champ.to_s.empty? ? 'Non communiqué' : champ.to_s
format_in_2_lines(pdf, champ.libelle, value) format_in_2_columns(pdf, champ.libelle, value)
end end
end end
@ -181,7 +181,7 @@ prawn_document(page_size: "A4") do |pdf|
pdf.text "Ce dossier est <b>#{dossier_display_state(@dossier, lower: true)}</b>.", inline_format: true pdf.text "Ce dossier est <b>#{dossier_display_state(@dossier, lower: true)}</b>.", inline_format: true
pdf.text "\n" pdf.text "\n"
if @dossier.motivation.present? if @dossier.motivation.present?
format_in_2_lines(pdf, "Motif de la décision", @dossier.motivation) format_in_2_columns(pdf, "Motif de la décision", @dossier.motivation)
end end
add_title(pdf, 'Historique') add_title(pdf, 'Historique')
add_etats_dossier(pdf, @dossier) add_etats_dossier(pdf, @dossier)

View file

@ -16,7 +16,7 @@
- if unspecified_attestation_champs.present? - if unspecified_attestation_champs.present?
.warning .warning
Attention, les valeurs suivantes n'ont pas été renseignées mais sont nécessaires pour pouvoir envoyer une attestation valide : Attention, les valeurs suivantes n'ont pas été renseignées mais sont nécessaires pour pouvoir envoyer une attestation valide :
- unspecified_champs, unspecified_annotations_privees = unspecified_attestation_champs.partition(&:private) - unspecified_annotations_privees, unspecified_champs = unspecified_attestation_champs.partition(&:private)
- if unspecified_champs.present? - if unspecified_champs.present?
%h4 Champs de la demande %h4 Champs de la demande

View file

@ -1,10 +1,10 @@
namespace :after_party do namespace :after_party do
desc 'Deployment task: backfill_experts_procedure_on_avis_2' desc 'Deployment task: backfill_experts_procedure_id_on_avis_table'
task backfill_experts_procedure_on_avis_2: :environment do task backfill_experts_procedure_id_on_avis_table: :environment do
puts "Running deploy task 'backfill_experts_procedure_on_avis_2'" puts "Running deploy task 'backfill_experts_procedure_id_on_avis_table'"
without_instructeur = Avis.where(experts_procedure_id: nil, answer: nil, instructeur_id: nil).where.not(email: nil) without_instructeur = Avis.where(experts_procedure_id: nil, instructeur_id: nil).where.not(email: nil)
with_instructeur = Avis.where(experts_procedure_id: nil, answer: nil, email: nil).where.not(instructeur_id: nil) with_instructeur = Avis.where(experts_procedure_id: nil, email: nil).where.not(instructeur_id: nil)
progress = ProgressReport.new(without_instructeur.count) progress = ProgressReport.new(without_instructeur.count)
progress2 = ProgressReport.new(with_instructeur.count) progress2 = ProgressReport.new(with_instructeur.count)

View file

@ -1,7 +1,7 @@
describe 'instructeurs/dossiers/state_button_motivation.html.haml', type: :view do describe 'instructeurs/dossiers/state_button_motivation.html.haml', type: :view do
let(:dossier) { create(:dossier, :en_instruction) } let(:dossier) { create(:dossier, :en_instruction) }
subject! do subject do
render( render(
'instructeurs/dossiers/state_button_motivation.html.haml', 'instructeurs/dossiers/state_button_motivation.html.haml',
dossier: dossier, dossier: dossier,
@ -14,12 +14,15 @@ describe 'instructeurs/dossiers/state_button_motivation.html.haml', type: :view
) )
end end
context 'with an attestation preview' do context 'without attestation' do
let(:dossier) { create :dossier, :accepte, :with_attestation } it { expect(subject).not_to have_link(href: apercu_attestation_instructeur_dossier_path(dossier.procedure, dossier)) }
it { expect(rendered).to have_link(href: apercu_attestation_instructeur_dossier_path(dossier.procedure, dossier)) }
end end
context 'without an attestation preview' do context 'with an attestation' do
it { expect(rendered).not_to have_link(href: apercu_attestation_instructeur_dossier_path(dossier.procedure, dossier)) } let(:dossier) { create :dossier, :accepte, :with_attestation }
it 'includes a link to preview the attestation' do
expect(subject).to have_link(href: apercu_attestation_instructeur_dossier_path(dossier.procedure, dossier))
end
end end
end end