Skip to content

Commit

Permalink
Updated to move description list item workflow execution name to it's…
Browse files Browse the repository at this point in the history
… own partial to fix display issue when clearing a workflow execution name. Fixed bug with header not being updated with the current name
  • Loading branch information
deepsidhu85 committed Jan 10, 2025
1 parent 2e6eb1c commit 47f79f2
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 28 deletions.
16 changes: 3 additions & 13 deletions app/views/projects/workflow_executions/_summary.html.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
<div class="px-4 py-4">
<dl
class="
max-w-md
text-slate-900
divide-y
divide-slate-200
dark:text-white
max-w-md text-slate-900 divide-y divide-slate-200 dark:text-white
dark:divide-slate-700
"
>
<div class="flex flex-col pb-3">
<dt class="mb-1 text-slate-500 md:text-lg dark:text-slate-400"><%= t(:".run_id") %></dt>
<dd class="text-lg font-semibold text-slate-900 dark:text-white"><%= @workflow_execution.run_id %></dd>
</div>
<% unless @workflow_execution.name.blank? %>
<div class="flex flex-col pb-3">
<dt class="mb-1 text-slate-500 md:text-lg dark:text-slate-400"><%= t(:".name") %></dt>
<dd class="text-lg font-semibold text-slate-900 dark:text-white">
<%= turbo_frame_tag('we_name') do %>
<%= @workflow_execution.name %></dd>
<% end %>
</div>
<%= turbo_frame_tag('we_name') do %>
<%= render partial: "workflow_execution_name" %>
<% end %>
<div class="flex flex-col py-3">
<dt class="mb-1 text-slate-500 md:text-lg dark:text-slate-400"><%= t(:".workflow_name") %></dt>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<% unless @workflow_execution.name.blank? %>
<div class="flex flex-col pb-3">
<dt class="mb-1 text-slate-500 md:text-lg dark:text-slate-400">Name</dt>
<dd class="text-lg font-semibold text-slate-900 dark:text-white"><%= @workflow_execution.name %></dd>
</div>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
} %>

<%= turbo_stream.update "we_name" do %>
<%= @workflow_execution.name %>
<%= render partial: "workflow_execution_name" %>
<% end %>
<% else %>
<%= turbo_stream.update "edit_workflow_execution_error_alert",
Expand Down
11 changes: 2 additions & 9 deletions app/views/workflow_executions/_summary.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,8 @@
<% end %>
</dd>
</div>
<% unless @workflow_execution.name.blank? %>
<div class="flex flex-col pb-3">
<dt class="mb-1 text-slate-500 md:text-lg dark:text-slate-400"><%= t(:".name") %></dt>
<dd class="text-lg font-semibold text-slate-900 dark:text-white">
<%= turbo_frame_tag('we_name') do %>
<%= @workflow_execution.name %>
<% end %>
</dd>
</div>
<%= turbo_frame_tag('we_name') do %>
<% render partial: "workflow_execution_name" %>
<% end %>
<div class="flex flex-col py-3">
<dt class="mb-1 text-slate-500 md:text-lg dark:text-slate-400"><%= t(:".workflow_name") %></dt>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<% unless @workflow_execution.name.blank? %>
<div class="flex flex-col pb-3">
<dt class="mb-1 text-slate-500 md:text-lg dark:text-slate-400">Name</dt>
<dd class="text-lg font-semibold text-slate-900 dark:text-white"><%= @workflow_execution.name %></dd>
</div>
<% end %>
4 changes: 2 additions & 2 deletions app/views/workflow_executions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<%= turbo_frame_tag "edit_dialog" %>

<%= render Viral::PageHeaderComponent.new(title: @workflow_execution.name.blank? ? @workflow_execution.metadata["workflow_name"] :
turbo_frame_tag('we_name_header') do @workflow_execution.name end, id: @workflow_execution.id, id_color: find_pill_color_for_state(@workflow_execution.state)) do |component| %>
<%= render Viral::PageHeaderComponent.new(title: turbo_frame_tag('we_name_header') do @workflow_execution.name.blank? ? @workflow_execution.metadata["workflow_name"] :
@workflow_execution.name end, id: @workflow_execution.id, id_color: find_pill_color_for_state(@workflow_execution.state)) do |component| %>
<%= component.with_icon(name: "beaker", classes: "h-14 w-14 text-primary-700") %>
<%= component.with_buttons do %>
<div class="flex flex-row">
Expand Down
10 changes: 7 additions & 3 deletions app/views/workflow_executions/update.turbo_stream.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
} %>

<%= turbo_stream.update "we_name" do %>
<%= @workflow_execution.name %>
<%= render partial: "workflow_execution_name" %>
<% end %>

<%= turbo_stream.update "we_name_header" do %>
<%= @workflow_execution.name %>
<%= turbo_stream.replace "we_name_header" do %>
<% if @workflow_execution.name.blank? %>
<%= @workflow_execution.metadata["workflow_name"] %>
<% else %>
<%= @workflow_execution.name %>
<% end %>
<% end %>
<% else %>
<%= turbo_stream.update "edit_workflow_execution_error_alert",
Expand Down

0 comments on commit 47f79f2

Please sign in to comment.