Skip to content

Commit 12b3de0

Browse files
authored
Merge pull request #3672 from AlchemyCMS/backport/8.1-stable/pr-3671
[8.1-stable] fix(page tree): Use edit link in top frame
2 parents 114702f + 50671ba commit 12b3de0

4 files changed

Lines changed: 33 additions & 10 deletions

File tree

app/assets/builds/alchemy/admin.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/components/alchemy/admin/page_node.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
@page.name,
5353
url(:edit_page),
5454
title: t(:edit_page),
55-
class: "sitemap_pagename_link"
55+
class: "sitemap_pagename_link",
56+
"data-turbo-frame": "_top"
5657
) %>
5758
<% else %>
5859
<%= content_tag("span", @page.name, class: "sitemap_pagename_link") %>

app/stylesheets/alchemy/admin/errors.scss

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#errorExplanation {
2-
background: #ffdfdf;
2+
background: var(--notice-error-background-color);
33
padding: var(--spacing-2);
44
text-align: left;
55
margin-bottom: var(--spacing-2);
6-
border: 1px solid #d08f91;
7-
color: #690001;
6+
border: 1px solid var(--notice-error-border-color);
7+
color: var(--notice-error-text-color);
88
border-radius: var(--border-radius_medium);
99

1010
h2 {
@@ -51,16 +51,24 @@ body.error {
5151
}
5252

5353
.turbo-frame-error {
54-
display: block;
54+
display: flex;
55+
align-items: center;
56+
gap: var(--spacing-2);
5557
padding: var(--spacing-2);
56-
background-color: var(--color-yellow_medium);
57-
border: 1px solid var(--color-yellow_dark);
58+
background-color: var(--notice-warning-background-color);
59+
border: 1px solid var(--notice-warning-border-color);
5860
border-radius: var(--border-radius_medium);
5961
margin: var(--spacing-2);
60-
color: var(--color-yellow_dark);
62+
color: var(--notice-warning-text-color);
6163

6264
&:before {
63-
content: "⚠️";
65+
display: inline-block;
66+
content: "";
67+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM4.20568 19.0002H19.7941L11.9999 5.50017L4.20568 19.0002ZM10.9999 16.0002H12.9999V18.0002H10.9999V16.0002ZM10.9999 9.00017H12.9999V14.0002H10.9999V9.00017Z'%3E%3C/path%3E%3C/svg%3E")
68+
no-repeat center center;
69+
background-color: var(--notice-warning-text-color);
6470
padding: var(--spacing-2);
71+
width: var(--icon-size-md);
72+
height: var(--icon-size-md);
6573
}
6674
}

spec/features/admin/page_editing_feature_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@
3939
expect(page).to have_select("preview_url", options: ["Internal", "Foo Preview"])
4040
end
4141
end
42+
43+
context "in pages tree" do
44+
let!(:a_page) { create(:alchemy_page) }
45+
46+
describe "clicking the page name" do
47+
it "opens the page in edit mode", :js do
48+
visit alchemy.admin_pages_path(view: "tree")
49+
within ".sitemap_page[name='#{a_page.name}']" do
50+
click_link a_page.name
51+
end
52+
expect(page).to have_current_path("/admin/pages/#{a_page.id}/edit")
53+
end
54+
end
55+
end
4256
end
4357

4458
context "as editor" do

0 commit comments

Comments
 (0)