Drop into the stream working

This commit is contained in:
Jorge Manrubia
2025-09-26 12:47:12 +02:00
parent d7ef9749c0
commit 57b00b6402
8 changed files with 28 additions and 8 deletions
@@ -4,6 +4,6 @@ class Columns::Cards::Drops::NotNowsController < ApplicationController
def create
@card.postpone
render turbo_stream: turbo_stream.replace("now-now-cards", partial: "collections/show/not_now", locals: { collection: @card.collection })
render turbo_stream: turbo_stream.replace("not-now", partial: "collections/show/not_now", locals: { collection: @card.collection })
end
end
@@ -0,0 +1,10 @@
class Columns::Cards::Drops::StreamsController < ApplicationController
include CardScoped
def create
@card.send_back_to_triage
set_page_and_extract_portion_from @collection.cards.awaiting_triage.reverse_chronologically
render turbo_stream: turbo_stream.replace("the-stream", partial: "collections/show/stream", locals: { collection: @card.collection, page: @page })
end
end
+10
View File
@@ -26,4 +26,14 @@ module Card::Postponable
end
end
end
def resume
if postponed?
transaction do
reopen
activity_spike&.destroy
not_now.destroy
end
end
end
end
+1 -2
View File
@@ -28,8 +28,7 @@ module Card::Triageable
def send_back_to_triage
transaction do
reopen
activity_spike&.destroy
resume
update!(column: nil)
end
end
+1 -1
View File
@@ -5,7 +5,7 @@
<%= render "collections/show/not_now", collection: collection %>
</div>
<%= render "collections/show/stream", page: page, collection: collection %>
<%= render "collections/show/stream", collection: collection, page: page %>
<div class="card-columns__right">
<%= render partial: "collections/show/column", collection: collection.columns, cached: true %>
+1 -1
View File
@@ -1,4 +1,4 @@
<section id="now-now-cards" class="cards cards--on-deck is-collapsed" style="--card-color: var(--color-card-complete);"
<section id="not-now" class="cards cards--on-deck is-collapsed" style="--card-color: var(--color-card-complete);"
data-collapsible-columns-target="column"
data-drag-and-drop-target="container"
data-drag-and-drop-url="<%= columns_card_drops_not_now_path("__id__") %>"
+3 -3
View File
@@ -1,12 +1,12 @@
<section id="considering-cards" class="cards cards--considering"
<section id="the-stream" class="cards cards--considering"
data-drag-and-drop-target="container"
data-drop-target="considering">
data-drag-and-drop-url="<%= columns_card_drops_stream_path("__id__") %>">
<div class="cards__decoration"></div>
<%= render "columns/show/add_card_button", collection: collection %>
<% if page.used? %>
<%= render "collections/columns/list", cards: @page.records, draggable: true %>
<%= render "collections/columns/list", cards: page.records, draggable: true %>
<% unless page.last? %>
<div class="full-width">
+1
View File
@@ -40,6 +40,7 @@ Rails.application.routes.draw do
scope module: "cards" do
namespace :drops do
resource :not_now
resource :stream
resource :closure
resources :columns
end