From 32e01b13ef1de4f7853989f71f60db60548eb662 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 11 Oct 2022 10:34:05 +0200 Subject: [PATCH] refactor(user dossier): mutualize update/update_brouillon --- app/controllers/users/dossiers_controller.rb | 2 +- app/views/users/dossiers/update_brouillon.turbo_stream.haml | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 app/views/users/dossiers/update_brouillon.turbo_stream.haml diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index f878a4130..8714119cd 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -181,7 +181,7 @@ module Users respond_to do |format| format.html { render :brouillon } - format.turbo_stream { render layout: false } + format.turbo_stream { render(:update, layout: false) } end end diff --git a/app/views/users/dossiers/update_brouillon.turbo_stream.haml b/app/views/users/dossiers/update_brouillon.turbo_stream.haml deleted file mode 100644 index 29b5aa4fb..000000000 --- a/app/views/users/dossiers/update_brouillon.turbo_stream.haml +++ /dev/null @@ -1,6 +0,0 @@ -- to_shows, to_hides = @dossier.champs.filter(&:conditional?).partition(&:visible?) - -- if to_shows.present? - = turbo_stream.show_all(to_shows.map { "##{_1.input_group_id}" }.join(',')) -- if to_hides.present? - = turbo_stream.hide_all(to_hides.map { "##{_1.input_group_id}" }.join(','))