Skip to content

Commit

Permalink
πŸžπŸ”¨ Gizmo: Fix bug where removing a Gizmo fails
Browse files Browse the repository at this point in the history
- #1565

OK this is also a bit much; but it does fix the bug. I'm going to try
and tighten it up a bit
  • Loading branch information
zspencer committed Jun 25, 2023
1 parent b6dd7a1 commit 8706547
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/assets/stylesheets/components/button.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* @todo DELETE ME */
@layer components {
[type="reset"],
[type="button"],
[type="submit"],
button,
.button {
@apply font-bold py-2 px-4 my-1 rounded bg-primary-500 text-white text-center transition ease-in-out duration-150;
@apply font-bold py-2 px-4 rounded bg-primary-500 text-white text-center transition ease-in-out duration-150;

&:hover {
@apply bg-primary-700;
Expand Down
11 changes: 7 additions & 4 deletions app/views/furnitures/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<section id="<%= dom_id(furniture) %>">
<%- if policy(furniture).edit? %>
<%= form_with(model: [furniture.room.space, furniture.room, furniture], local: true) do |form| %>
<%= form_with(model: [furniture.room.space, furniture.room, furniture]) do |form| %>
<div>
<%= render partial: furniture.furniture.form_template, locals: { form: form } %>
</div>
<footer>
<%- if policy(furniture).destroy? %>
<%= form.button name: "_method", value: "delete", class: "--danger" do %>
<%=t('.destroy')%>
<%- end %>
<%= render ButtonComponent.new(
label: t('.destroy', name: furniture.furniture.model_name.human.titleize),
href: [furniture.room.space, furniture.room, furniture],
title: t('.destroy', name: furniture.furniture.model_name.human.titleize),
method: :delete,
scheme: :danger) %>
<%- end %>
<%- if furniture.furniture.attribute_names.present? %>
Expand Down
1 change: 1 addition & 0 deletions app/views/furnitures/_furniture.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
label: t('icons.edit'),
href: edit_href,
method: :get,
turbo_stream: true,
title: t('.edit_title', name: furniture.furniture.model_name.human.titleize),
scheme: :secondary) %>
<%- end %>
Expand Down
1 change: 0 additions & 1 deletion spec/system/furniture_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
include ActiveJob::TestHelper
it "Managing Furniture" do
space = create(:space, :with_entrance, :with_members, member_count: 1)
# Sign in to the Space
sign_in(space.members.first, space)

add_gizmo("Markdown Text Block", room: space.entrance)
Expand Down

0 comments on commit 8706547

Please sign in to comment.