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

EVA-280 - ⚡️ Réduit le temps de chargement de la situation place du marché #1825

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
4 changes: 2 additions & 2 deletions app/models/question_clic_dans_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class QuestionClicDansImage < Question

def as_json(_options = nil)
json = base_json
json['image_au_clic'] = svg_attachment_base64(image_au_clic) if image_au_clic.attached?
json['image_au_clic_url'] = cdn_for(image_au_clic) if image_au_clic.attached?
json.merge!(json_audio_fields, additional_json_fields)
end

Expand Down Expand Up @@ -52,7 +52,7 @@ def base_json
json['type'] = 'clic-dans-image'
json['illustration'] = cdn_for(illustration) if illustration.attached?
json['description'] = description
json['zone_cliquable'] = svg_attachment_base64(zone_cliquable) if zone_cliquable.attached?
json['zone_cliquable_url'] = cdn_for(zone_cliquable) if zone_cliquable.attached?
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/question_glisser_deposer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class QuestionGlisserDeposer < Question

def as_json(_options = nil)
json = base_json
json['zone_depot_url'] = svg_attachment_base64(zone_depot) if zone_depot.attached?
json['zone_depot_url'] = cdn_for(zone_depot) if zone_depot.attached?
json.merge!(json_audio_fields, reponses_fields)
end

Expand Down
6 changes: 3 additions & 3 deletions spec/models/question_clic_dans_image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
json = question_clic_dans_image.as_json
expect(json.keys)
.to match_array(%w[description id intitule audio_url nom_technique type illustration
modalite_reponse zone_cliquable image_au_clic consigne_audio
modalite_reponse zone_cliquable_url image_au_clic_url consigne_audio
score metacompetence demarrage_audio_modalite_reponse])
expect(json['type']).to eql('clic-dans-image')
expect(json['intitule']).to eql('Mon Intitulé')
Expand All @@ -47,8 +47,8 @@
intitule.audio
))
expect(json['modalite_reponse']).to eql(modalite.ecrit)
expect(json['zone_cliquable']).to start_with('data:image/svg+xml;base64,')
expect(json['image_au_clic']).to start_with('data:image/svg+xml;base64,')
expect(json['zone_cliquable_url']).to start_with('http://')
expect(json['image_au_clic_url']).to start_with('http://')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/models/question_glisser_deposer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
expect(json['illustration']).to eql(Rails.application.routes.url_helpers.url_for(
question.illustration
))
expect(json['zone_depot_url']).to start_with('data:image/svg+xml;base64,')
expect(json['zone_depot_url']).to start_with('http://')
end

describe 'les reponsesNonClassees' do
Expand Down
Loading