Merge branch 'dev' into new_design_edit_attestation

This commit is contained in:
jpoulvel 2020-07-30 09:53:09 +02:00 committed by GitHub
commit 62e04a6ca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 304 additions and 1145 deletions

View file

@ -72,19 +72,6 @@ module DossierHelper
end
end
# On the 22/01/2020, a technical error on the demarches-simplifees.fr
# instance caused some files attached to some dossiers to be deleted.
#
# This method returns true if the dossier contained attachments
# whose files were deleted during this incident.
def has_lost_attachments(dossier)
if dinum_instance?
dossiers_with_lost_attachments_ids.include?(dossier.id)
else
false
end
end
def status_badge(state)
status_text = dossier_display_state(state, lower: true)
status_class = state.tr('_', '-')
@ -114,16 +101,4 @@ module DossierHelper
end
end
end
private
def dinum_instance?
# rubocop:disable DS/ApplicationName
ENV['APP_HOST']&.ends_with?('demarches-simplifiees.fr')
# rubocop:enable DS/ApplicationName
end
def dossiers_with_lost_attachments_ids
@@ids ||= YAML.load_file(Rails.root.join('config', 'dossiers-with-lost-attachments.yml'))
end
end