mirror of
https://github.com/usetrmnl/terminus.git
synced 2026-08-13 14:29:27 -07:00
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:
@@ -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>
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
@@ -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" }
|
||||
|
||||
Reference in New Issue
Block a user