diff --git a/app/models/move.rb b/app/models/move.rb index ac1ea21a9..b82889823 100644 --- a/app/models/move.rb +++ b/app/models/move.rb @@ -80,10 +80,12 @@ def executed? executed_at? end - def previous_moves - return nil unless step&.previous_step + def previous_step_moves + step&.previous_step&.moves + end - step.previous_step.moves + def previous_moves + moves_project&.moves&.where(step: step.previous_steps) end def refresh_prev_data diff --git a/app/views/moves/index.html.erb b/app/views/moves/index.html.erb index 7f290e032..112c91275 100644 --- a/app/views/moves/index.html.erb +++ b/app/views/moves/index.html.erb @@ -31,18 +31,24 @@ <%= render List::DataTableComponent.new(decorate(@moves)) do |table| %> <% table.with_column(Server.model_name.human) do |move| %> <%= link_to move.moveable, server_path(move.moveable), data: { turbo_frame: :_top } %> + + <%= render move.decorated.status_to_badge_component %> + +
<%= Server.human_attribute_name(:numero) %> : <%= move.moveable.numero %>
- <% end %> - - <% table.with_column(Manager.model_name.human) do |move| %> - <%= move.moveable.manager %> - <% end %> - - <% table.with_column(Domain.model_name.human) do |move| %> - <%= move.moveable.domain %> +
+ Gestionnaire : + <%= move.moveable.manager %> +
+
+ Domaine : + <%= move.moveable.domain %> +
<% end %> <% table.with_column(Move.human_attribute_name(:prev_frame_id)) do |move| %> @@ -58,6 +64,17 @@ <%= Server.human_attribute_name(:position) %> : <%= move.prev_position %> + + <%= link_to "#", + class: "", + data: { turbo_frame: :_top } do %> + + <%= t("visualization.title") %> + <% end %> <% end %> <% table.with_column(Move.human_attribute_name(:frame_id)) do |move| %> @@ -69,20 +86,23 @@ controller: "tooltip", bs_placement: "top", } %> + - + <%= link_to "#", + class: "", + data: { turbo_frame: :_top } do %> + + <%= t("visualization.title") %> + <% end %>
<%= Server.human_attribute_name(:position) %> : <%= move.position %>
<% end %> - <% table.with_column(Move.human_attribute_name(:status)) do |move| %> - - <%= render move.decorated.status_to_badge_component %> - - <% end %> - <% table.with_column(t(".remove_existing_connections_on_execution"), text_align: :center) do |move| %> <%= render move.moved_connections_to_badge_component %> <% end %> @@ -90,6 +110,9 @@ <% table.with_column(style: "min-width: 120px; width: 120px") do |move| %>
<% unless @moves_project.archived? || move.executed? %> + <%= link_to "Modifier les connexions", "#", + class: "btn btn-outline-primary", + aria: { hidden: true } %> <%= link_to t("action.execute"), execute_moves_project_step_move_path(@moves_project_step, move), title: t(".action.execute_move"), @@ -148,13 +171,6 @@
- <% if @moves_project.unarchived? %> - <%= link_to t(".edit_connections"), - frame_moves_project_moves_project_step_path(@moves_project, @moves_project_step, frame), - class: "btn btn-outline-primary text-nowrap", - data: { turbo_frame: :_top } %> - <% end %> - <%= link_to print_moves_project_moves_project_step_path(@moves_project, @moves_project_step, frame), class: "btn btn-sm btn-outline-primary", data: { turbo_frame: :_top }, diff --git a/app/views/moves_projects/show.html.erb b/app/views/moves_projects/show.html.erb index 244e84098..19c3b71b3 100644 --- a/app/views/moves_projects/show.html.erb +++ b/app/views/moves_projects/show.html.erb @@ -90,24 +90,6 @@ <% end %>
<% end %> - - <% if @moves_project.steps.any? %> - <%= turbo_frame_tag( - dom_id(Move, :frames), - loading: :lazy, - src: moves_project_step_moves_path(@moves_project.steps.last), - class: "pt-4", - ) do %> -
- <%= t("has_many_turbo_frame_component.loading") %> - -
- <% end %> - <% else %> -
- <%= render CardEmptyDataComponent.new %> -
- <% end %>