Pull assignments out of the double nesting
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<dialog class="popup panel flex-column align-start gap-half fill-white shadow" data-dialog-target="dialog">
|
||||
<strong class="popup__title margin-block-start-half pad-inline-half txt-nowrap">Assign this to…</strong>
|
||||
|
||||
<%= form_with url: bucket_bubble_assignments_path(bubble.bucket, bubble), class: "flex flex-column full-width popup__list", data: { controller: "form" } do |form| %>
|
||||
<%= form_with url: bubble_assignments_path(bubble), class: "flex flex-column full-width popup__list", data: { controller: "form" } do |form| %>
|
||||
<% bubble.bucket.users.active.sort_by(&:name).each do |user| %>
|
||||
<div class="btn popup__item">
|
||||
<%= form.check_box "assignee_id[]", {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<%= render "bubbles/cards/common/assignees", bubble: bubble do %>
|
||||
<%= turbo_frame_tag bubble, :assignment, src: new_bucket_bubble_assignment_path(bubble.bucket, bubble) %>
|
||||
<%= turbo_frame_tag bubble, :assignment, src: new_bubble_assignment_path(bubble) %>
|
||||
<% end %>
|
||||
|
||||
+1
-1
@@ -20,6 +20,7 @@ Rails.application.routes.draw do
|
||||
resources :bubbles do
|
||||
scope module: :bubbles do
|
||||
resource :pin
|
||||
resources :assignments
|
||||
end
|
||||
end
|
||||
|
||||
@@ -59,7 +60,6 @@ Rails.application.routes.draw do
|
||||
resource :recover
|
||||
resources :stagings
|
||||
resource :watch
|
||||
resources :assignments
|
||||
end
|
||||
|
||||
resources :taggings
|
||||
|
||||
@@ -6,19 +6,18 @@ class Bubbles::AssignmentsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "new" do
|
||||
get new_bucket_bubble_assignment_url(buckets(:writebook), bubbles(:logo))
|
||||
|
||||
get new_bubble_assignment_url(bubbles(:logo))
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "create" do
|
||||
assert_changes "bubbles(:logo).assigned_to?(users(:david))", from: false, to: true do
|
||||
post bucket_bubble_assignments_url(buckets(:writebook), bubbles(:logo)), params: { assignee_id: users(:david).id }, as: :turbo_stream
|
||||
post bubble_assignments_url(bubbles(:logo)), params: { assignee_id: users(:david).id }, as: :turbo_stream
|
||||
end
|
||||
assert_response :success
|
||||
|
||||
assert_changes "bubbles(:logo).assigned_to?(users(:david))", from: true, to: false do
|
||||
post bucket_bubble_assignments_url(buckets(:writebook), bubbles(:logo)), params: { assignee_id: users(:kevin).id }, as: :turbo_stream
|
||||
post bubble_assignments_url(bubbles(:logo)), params: { assignee_id: users(:kevin).id }, as: :turbo_stream
|
||||
end
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user