Improve flow for adding stages

Previously the new stage form replaced the list, now it properly appends
This commit is contained in:
Jason Zimdars
2025-05-22 21:48:44 -05:00
parent b64bde96eb
commit 53c19e8e07
2 changed files with 7 additions and 5 deletions
+5 -3
View File
@@ -14,9 +14,11 @@
<%= turbo_frame_tag dom_id(workflow, :stages) do %>
<%= render partial: "workflows/stages/stage", collection: workflow.stages %>
<%= link_to new_workflow_stage_path(workflow), class: "btn txt-small" do %>
<%= icon_tag "add" %>
<span class="for-screen-reader">New stage</span>
<%= turbo_frame_tag dom_id(workflow, :new_stage) do %>
<%= link_to new_workflow_stage_path(workflow), class: "btn txt-small" do %>
<%= icon_tag "add" %>
<span class="for-screen-reader">New stage</span>
<% end %>
<% end %>
<% end %>
</div>
+2 -2
View File
@@ -1,5 +1,5 @@
<%= turbo_frame_tag dom_id(@stage.workflow, :stages) do %>
<%= form_with model: @stage, url: workflow_stages_path(@stage.workflow), class: "flex align-center gap-half", data: { controller: "form" } do |form| %>
<%= turbo_frame_tag dom_id(@stage.workflow, :new_stage) do %>
<%= form_with model: @stage, url: workflow_stages_path(@stage.workflow), class: "flex align-center gap-half", data: { controller: "form", turbo_frame: dom_id(@stage.workflow, :stages) } do |form| %>
<%= form.text_field :name, required: true, autofocus: true, class: "input", data: { action: "keydown.esc@document->form#cancel" } %>
<%= form.button type: :submit, class: "btn btn--positive txt-small" do %>
<%= icon_tag "check" %>