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

feat(dossier): enable refresh after update on more champs #9299

Merged
merged 1 commit into from
Jul 11, 2023
Merged
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
21 changes: 11 additions & 10 deletions app/models/type_de_champ.rb
Original file line number Diff line number Diff line change
Expand Up @@ -566,18 +566,19 @@ def refresh_after_update?
end

def self.refresh_after_update?(type_champ)
# We should refresh all champs after update except for champs using react or custom refresh
# logic (RNA, SIRET, etc.)
case type_champ
when type_champs.fetch(:epci),
type_champs.fetch(:communes),
type_champs.fetch(:multiple_drop_down_list),
type_champs.fetch(:dossier_link),
type_champs.fetch(:linked_drop_down_list),
type_champs.fetch(:drop_down_list),
type_champs.fetch(:textarea),
type_champs.fetch(:cojo)
true
else
when type_champs.fetch(:address),
type_champs.fetch(:annuaire_education),
type_champs.fetch(:carte),
type_champs.fetch(:piece_justificative),
type_champs.fetch(:titre_identite),
type_champs.fetch(:rna),
type_champs.fetch(:siret)
false
else
true
end
end

Expand Down