From b3fd3e65703ba8e450c99be33f44686952aaf33e Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 8 Nov 2024 14:09:52 +0100 Subject: [PATCH 1/2] move last call to procedure_presentation controller --- app/components/dossiers/notified_toggle_component.rb | 1 + .../notified_toggle_component.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/dossiers/notified_toggle_component.rb b/app/components/dossiers/notified_toggle_component.rb index dc927958a..f624dbcce 100644 --- a/app/components/dossiers/notified_toggle_component.rb +++ b/app/components/dossiers/notified_toggle_component.rb @@ -3,6 +3,7 @@ class Dossiers::NotifiedToggleComponent < ApplicationComponent def initialize(procedure:, procedure_presentation:) @procedure = procedure + @procedure_presentation = procedure_presentation @sorted_column = procedure_presentation.sorted_column end end diff --git a/app/components/dossiers/notified_toggle_component/notified_toggle_component.html.haml b/app/components/dossiers/notified_toggle_component/notified_toggle_component.html.haml index 272167f90..1c1d44a4c 100644 --- a/app/components/dossiers/notified_toggle_component/notified_toggle_component.html.haml +++ b/app/components/dossiers/notified_toggle_component/notified_toggle_component.html.haml @@ -1,5 +1,5 @@ -= form_tag update_sort_instructeur_procedure_path(@procedure), - method: :get, data: { controller: 'autosubmit' } do += form_with model: [:instructeur, @procedure_presentation], + data: { controller: 'autosubmit' } do .fr-fieldset__element.fr-m-0 .fr-checkbox-group.fr-checkbox-group--sm = hidden_field_tag 'sorted_column[id]', @procedure.notifications_column.id From ec9a88a64e8db61f10fb7a6500d9d415f4ef6e3d Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 12 Nov 2024 09:43:27 +0100 Subject: [PATCH 2/2] simplify new --- app/components/dossiers/notified_toggle_component.rb | 4 ++-- app/views/instructeurs/procedures/show.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/dossiers/notified_toggle_component.rb b/app/components/dossiers/notified_toggle_component.rb index f624dbcce..bd3c3d9ec 100644 --- a/app/components/dossiers/notified_toggle_component.rb +++ b/app/components/dossiers/notified_toggle_component.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true class Dossiers::NotifiedToggleComponent < ApplicationComponent - def initialize(procedure:, procedure_presentation:) - @procedure = procedure + def initialize(procedure_presentation:) @procedure_presentation = procedure_presentation + @procedure = procedure_presentation.procedure @sorted_column = procedure_presentation.sorted_column end end diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 8c6063308..00753ecb1 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -62,7 +62,7 @@ .flex.align-center - if @filtered_sorted_paginated_ids.present? || @current_filters.count > 0 = render partial: "dossiers_filter_dropdown", locals: { procedure: @procedure, statut: @statut, procedure_presentation: @procedure_presentation } - = render Dossiers::NotifiedToggleComponent.new(procedure: @procedure, procedure_presentation: @procedure_presentation) if @statut != 'a-suivre' + = render Dossiers::NotifiedToggleComponent.new(procedure_presentation: @procedure_presentation) if @statut != 'a-suivre' .fr-ml-auto - if @dossiers_count > 0