refactor(procedure_admins): use component

This commit is contained in:
simon lehericey 2022-11-21 12:31:41 +01:00 committed by LeSim
parent 924d2ae15d
commit 066c441b61
3 changed files with 5 additions and 4 deletions

View file

@ -1,3 +1,4 @@
- if @administrateur.present? - if @administrateur.present?
= turbo_stream.append "administrateurs", partial: 'administrateur', locals: { procedure: @procedure, administrateur: @administrateur } = turbo_stream.update 'administrateurs',
render(Procedure::ProcedureAdministrateurs::AdministrateurComponent.with_collection(@procedure.administrateurs.order('users.email'), procedure: @procedure))
= turbo_stream.replace "new_administrateur", partial: 'add_admin_form', locals: { procedure: @procedure, disabled_as_super_admin: administrateur_as_manager? } = turbo_stream.replace "new_administrateur", partial: 'add_admin_form', locals: { procedure: @procedure, disabled_as_super_admin: administrateur_as_manager? }

View file

@ -1,2 +1,2 @@
- if @administrateur.present? = turbo_stream.update 'administrateurs',
= turbo_stream.remove(@administrateur) render(Procedure::ProcedureAdministrateurs::AdministrateurComponent.with_collection(@procedure.administrateurs.order('users.email'), procedure: @procedure))

View file

@ -12,7 +12,7 @@
%th= 'Enregistré le' %th= 'Enregistré le'
%th= 'État' %th= 'État'
%tbody#administrateurs %tbody#administrateurs
= render partial: 'administrateur', collection: @procedure.administrateurs.order('users.email'), locals: { procedure: @procedure } = render(Procedure::ProcedureAdministrateurs::AdministrateurComponent.with_collection(@procedure.administrateurs.order('users.email'), procedure: @procedure))
%tfoot %tfoot
%tr %tr
%th{ colspan: 4 } %th{ colspan: 4 }