Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

1.3 KB
Raw Blame
<%# Insert the new child BEFORE the quick-add row, so it lands at the end of the children list and
    the quick-add input (never re-rendered) keeps focus + any in-progress typing. %>
<%= turbo_stream.before "subtask-quick-add-#{@parent.id}" do %>
  <%= render 'organisations/tickets/subtask_row',
             child: @child, project: @project, org: @current_organisation, status_def: @status_def %>
<% end %>

<%# Refresh progress (n -> n+1). The empty -> first-child case goes through create_first instead, so
    there is no empty hint to remove here. %>
<%= turbo_stream.replace "subtasks-progress-#{@parent.id}" do %>
  <%= render 'organisations/tickets/subtasks_progress', ticket: @parent %>
<% end %>

<%# Clear any previous inline error. %>
<%= turbo_stream.update "subtask-error-#{@parent.id}", "" %>

<%# The parent's Subs cell in the list counts its sub-tickets (TicketListColumns). %>
<%= safe_join(ticket_list_parent_streams(@child)) %>

<%# The new sub-task is a row of the list too. Its place, and whether the filter shows it, only
    the list's query knows, so the frame reloads from the page's live address. No frame on this
    page (the inbox, a standalone ticket): the action does nothing. The quick-add sits outside
    the frame and keeps its focus. %>
<%= turbo_stream.action(:reloadFrame, 'tickets_list_frame') %>