Fix Analytics Dashboard Page missing "Back To Dashboard" button (#14310)
* fix analytic page have no back-to-dashboard button when user have no organization * resolve conflict with main * remove dump * add test for back to dashboard button
This commit is contained in:
parent
3d1727b3a8
commit
991f8b4baa
2 changed files with 16 additions and 7 deletions
|
|
@ -1,12 +1,12 @@
|
|||
<% title "Analytics" %>
|
||||
|
||||
<main class="dashboard-container analytics-container crayons-layout" id="main-content">
|
||||
<% if @organizations.any? %>
|
||||
<nav aria-label="Dashboards">
|
||||
<ul class="list-none">
|
||||
<li>
|
||||
<a href="<%= dashboard_path %>" class="rounded-btn crayons-link--block rounded-btn--transparent">👈 Back to Main Dashboard</a>
|
||||
</li>
|
||||
<nav aria-label="Dashboards">
|
||||
<ul class="list-none">
|
||||
<li>
|
||||
<a href="<%= dashboard_path %>" class="rounded-btn crayons-link--block rounded-btn--transparent">👈 Back to Main Dashboard</a>
|
||||
</li>
|
||||
<% if @organizations.any? %>
|
||||
<li>
|
||||
<a class="rounded-btn crayons-link--block organization"
|
||||
href="<%= dashboard_analytics_path %>"
|
||||
|
|
@ -25,9 +25,10 @@
|
|||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</nav>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="crayons-card p-3 mt-5">
|
||||
<h1 class="fs-4xl fw-medium">Analytics Dashboard for <%= @user_or_org.name %></h1>
|
||||
|
|
|
|||
|
|
@ -268,6 +268,14 @@ RSpec.describe "Dashboards", type: :request do
|
|||
get "/dashboard/analytics"
|
||||
expect(response.body).to include("Analytics")
|
||||
end
|
||||
|
||||
it "page always contain back to dashboard button" do
|
||||
sign_in user
|
||||
get "/dashboard/analytics"
|
||||
within "nav" do
|
||||
expect(page).to have_selector("a[href='/dashboard']")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "when user is an org admin" do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue