Added download action to all design templates

Surfaces the export work via the UI so anyone can click on any design and immediately export for sharing with others.

Milestone: minor
This commit is contained in:
Brooke Kuhlmann
2026-08-11 16:59:59 -06:00
parent 8b4cc9c08a
commit 82edc66a3c
3 changed files with 14 additions and 3 deletions
+4 -2
View File
@@ -5,11 +5,13 @@
<%= render "shared/actions/view", path: routes.path(:design, id: template.id) %>
<%= render "shared/actions/edit", path: routes.path(:design_edit, id: template.id) %>
<%= render "shared/actions/download",
path: routes.path(:design_export, design_id: template.id),
name: "design-#{template.name}.zip" %>
<%= render "shared/actions/delete",
path: routes.path(:design, id: template.id),
subject: :design,
target: ".bit-page" %>
</div>
</li>
+3
View File
@@ -43,5 +43,8 @@
<%= scope(:tooltip_action_content, label: "Clear").render %>
<%= scope(:tooltip_action_content, label: "View").render %>
<%= scope(:tooltip_action_content, label: "Edit").render %>
<%= scope(:tooltip_action_content, label: "Download").render %>
<%= scope(:tooltip_action_content, label: "Delete").render %>
</section>
+7 -1
View File
@@ -27,10 +27,16 @@ RSpec.describe "Designs", :db do
it "edits", :js do
visit routes.path(:design_edit, id: template.id)
expect(page).to have_text("Edit Design")
end
it "exports" do
visit routes.path(:designs)
click_link "Download"
expect(page.source.encoding).to eq(Encoding::ASCII_8BIT)
end
it "deletes", :js do
visit routes.path(:designs)
accept_prompt { click_button "Delete" }