Fix inappropriate landmark nesting dashboard 10873 (#14308)
* change dashboard landmark nesting * switch to main db/schema.rb * remove unnecessary div * revert scema.rb to main * fix user_visits_dashboard test * change aside to nav, put nav back into main-content * remove unnecessary file * remove duplicate nav * add id to main Co-authored-by: Suzanne Aitchison <suzanne@forem.com> Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
This commit is contained in:
parent
15afbca471
commit
989bc21b3f
9 changed files with 60 additions and 82 deletions
|
|
@ -1,11 +1,9 @@
|
|||
<% title "Stats for Your Article" %>
|
||||
|
||||
<main id="main-content">
|
||||
<div id="user-dashboard">
|
||||
<h1 class="fs-4xl fw-medium align-center my-5">Stats for "<%= link_to @article.title, @article.current_state_path, id: "article", data: { "article-id" => @article.id, "organization-id" => @organization_id } %>"</h1>
|
||||
<h1 class="fs-4xl fw-medium align-center my-5">Stats for "<%= link_to @article.title, @article.current_state_path, id: "article", data: { "article-id" => @article.id, "organization-id" => @organization_id } %>"</h1>
|
||||
|
||||
<%= render "shared/stats" %>
|
||||
</div>
|
||||
<%= render "shared/stats" %>
|
||||
</main>
|
||||
|
||||
<%= javascript_packs_with_chunks_tag "analyticsArticle", defer: true %>
|
||||
|
|
|
|||
|
|
@ -1,43 +1,41 @@
|
|||
<% title "Analytics" %>
|
||||
|
||||
<main id="main-content">
|
||||
<div class="dashboard-container analytics-container crayons-layout" id="user-dashboard">
|
||||
<% if @organizations.any? %>
|
||||
<nav aria-label="Dashboards">
|
||||
<ul class="list-none">
|
||||
<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>
|
||||
<li>
|
||||
<a class="rounded-btn crayons-link--block organization"
|
||||
href="<%= dashboard_analytics_path %>"
|
||||
<%= params[:org_id] ? "" : 'aria-current="page"'.html_safe %>>
|
||||
Your Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<% @organizations.each do |org| %>
|
||||
<li>
|
||||
<a href="<%= dashboard_path %>" class="rounded-btn crayons-link--block rounded-btn--transparent">👈 Back to Main Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="rounded-btn crayons-link--block organization"
|
||||
href="<%= dashboard_analytics_path %>"
|
||||
<%= params[:org_id] ? "" : 'aria-current="page"'.html_safe %>>
|
||||
Your Dashboard
|
||||
<a
|
||||
class="rounded-btn crayons-link--block organization"
|
||||
href="<%= dashboard_analytics_org_path(org.id) %>"
|
||||
data-organization-id="<%= org.id %>"
|
||||
<%= params[:org_id].to_i == org.id ? 'aria-current="page"'.html_safe : "" %>>
|
||||
<%= org.name %> Analytics Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<% @organizations.each do |org| %>
|
||||
<li>
|
||||
<a
|
||||
class="rounded-btn crayons-link--block organization"
|
||||
href="<%= dashboard_analytics_org_path(org.id) %>"
|
||||
data-organization-id="<%= org.id %>"
|
||||
<%= params[:org_id].to_i == org.id ? 'aria-current="page"'.html_safe : "" %>>
|
||||
<%= org.name %> Analytics Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</nav>
|
||||
<% 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>
|
||||
<p>Welcome to the Analytics Dashboard, the home of in-depth user metrics so that authors can make data-driven decisions about the <%= Settings::Community.member_label %> ecosystem.</p>
|
||||
<p>This dashboard highlights deep insights especially relevant to <%= Settings::Community.member_label %> relations, authors, and serious bloggers.</p>
|
||||
</div>
|
||||
|
||||
<%= render "shared/stats" %>
|
||||
<div class="crayons-card p-3 mt-5">
|
||||
<h1 class="fs-4xl fw-medium">Analytics Dashboard for <%= @user_or_org.name %></h1>
|
||||
<p>Welcome to the Analytics Dashboard, the home of in-depth user metrics so that authors can make data-driven decisions about the <%= Settings::Community.member_label %> ecosystem.</p>
|
||||
<p>This dashboard highlights deep insights especially relevant to <%= Settings::Community.member_label %> relations, authors, and serious bloggers.</p>
|
||||
</div>
|
||||
|
||||
<%= render "shared/stats" %>
|
||||
</main>
|
||||
|
||||
<%= javascript_packs_with_chunks_tag "analyticsDashboard", defer: true %>
|
||||
|
|
|
|||
|
|
@ -3,17 +3,15 @@
|
|||
<div id="index-container"
|
||||
data-params="<%= params.to_json(only: %i[which per_page]) %>"
|
||||
data-which="followers">
|
||||
<main id="main-content">
|
||||
<header class="crayons-layout">
|
||||
<h1 class="p-2 pb-0 m:p-0 crayons-title">Dashboard » Followers</h1>
|
||||
<%= render "actions_mobile" %>
|
||||
</header>
|
||||
|
||||
<div class="crayons-layout crayons-layout--2-cols">
|
||||
<aside class="crayons-layout__sidebar-left">
|
||||
<main id="main-content" class="crayons-layout crayons-layout--2-cols">
|
||||
<div class="crayons-layout__sidebar-left">
|
||||
<%= render "actions" %>
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
<div class="crayons-layout__content" id="user-dashboard">
|
||||
<% if @follows.any? %>
|
||||
<div id="following-wrapper" class="grid gap-0 s:gap-3 m:gap-4 s:grid-cols-2 l:grid-cols-3 align-left s:align-center">
|
||||
|
|
@ -47,6 +45,5 @@
|
|||
<% end %>
|
||||
<%= render "sublist" %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,19 +3,17 @@
|
|||
<div id="index-container"
|
||||
data-params="<%= params.to_json(only: %i[action per_page]) %>"
|
||||
data-which="following">
|
||||
<main id="main-content">
|
||||
|
||||
<header class="crayons-layout">
|
||||
<h1 class="p-2 pb-0 m:p-0 crayons-title">Dashboard » Following organizations</h1>
|
||||
<%= render "actions_mobile" %>
|
||||
</header>
|
||||
|
||||
<div class="crayons-layout crayons-layout--2-cols">
|
||||
<aside class="crayons-layout__sidebar-left">
|
||||
<main id="main-content" class="crayons-layout crayons-layout--2-cols">
|
||||
<div class="crayons-layout__sidebar-left">
|
||||
<%= render "actions" %>
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
<div class="crayons-layout__content" id="user-dashboard">
|
||||
|
||||
<% if @followed_organizations.any? %>
|
||||
<div id="following-wrapper" class="grid gap-0 s:gap-3 m:gap-4 s:grid-cols-2 l:grid-cols-3 align-left s:align-center">
|
||||
<% @followed_organizations.each do |follow| %>
|
||||
|
|
@ -46,6 +44,5 @@
|
|||
<% end %>
|
||||
<%= render "sublist" %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,19 +3,16 @@
|
|||
<div id="index-container"
|
||||
data-params="<%= params.to_json(only: %i[action per_page]) %>"
|
||||
data-which="following">
|
||||
<main id="main-content">
|
||||
<header class="crayons-layout">
|
||||
<h1 class="p-2 pb-0 m:p-0 crayons-title">Dashboard » Following podcasts</h1>
|
||||
<%= render "actions_mobile" %>
|
||||
</header>
|
||||
|
||||
<div class="crayons-layout crayons-layout--2-cols">
|
||||
<aside class="crayons-layout__sidebar-left">
|
||||
<main id="main-content" class="crayons-layout crayons-layout--2-cols">
|
||||
<div class="crayons-layout__sidebar-left">
|
||||
<%= render "actions" %>
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
<div class="crayons-layout__content" id="user-dashboard">
|
||||
|
||||
<% if @followed_podcasts.any? %>
|
||||
<div id="following-wrapper" class="grid gap-0 s:gap-3 m:gap-4 s:grid-cols-2 l:grid-cols-3 align-left s:align-center">
|
||||
<% @followed_podcasts.each do |follow| %>
|
||||
|
|
@ -46,6 +43,5 @@
|
|||
<% end %>
|
||||
<%= render "sublist" %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,17 +3,15 @@
|
|||
<div id="index-container"
|
||||
data-params="<%= params.to_json(only: %i[action per_page]) %>"
|
||||
data-which="following">
|
||||
<main id="main-content">
|
||||
<header class="crayons-layout">
|
||||
<h1 class="p-2 pb-0 m:p-0 crayons-title">Dashboard » Following tags</h1>
|
||||
<%= render "actions_mobile" %>
|
||||
</header>
|
||||
|
||||
<div class="crayons-layout crayons-layout--2-cols">
|
||||
<aside class="crayons-layout__sidebar-left">
|
||||
<main id="main-content" class="crayons-layout crayons-layout--2-cols">
|
||||
<div class="crayons-layout__sidebar-left">
|
||||
<%= render "actions" %>
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
<div class="crayons-layout__content mb-5" id="user-dashboard">
|
||||
<% if @followed_tags.any? %>
|
||||
<%= javascript_packs_with_chunks_tag "dashboardTagsDisableUnchangedButtons", defer: true %>
|
||||
|
|
@ -59,6 +57,5 @@
|
|||
<% end %>
|
||||
<%= render "sublist" %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,19 +3,17 @@
|
|||
<div id="index-container"
|
||||
data-params="<%= params.to_json(only: %i[action per_page]) %>"
|
||||
data-which="following">
|
||||
<main id="main-content">
|
||||
|
||||
<header class="crayons-layout">
|
||||
<h1 class="p-2 pb-0 m:p-0 crayons-title">Dashboard » Following users</h1>
|
||||
<%= render "actions_mobile" %>
|
||||
</header>
|
||||
|
||||
<div class="crayons-layout crayons-layout--2-cols">
|
||||
<aside class="crayons-layout__sidebar-left">
|
||||
<div id="main-content" class="crayons-layout crayons-layout--2-cols">
|
||||
<div class="crayons-layout__sidebar-left">
|
||||
<%= render "actions" %>
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
<div class="crayons-layout__content" id="user-dashboard">
|
||||
|
||||
<% if @follows.any? %>
|
||||
<div id="following-wrapper" class="grid gap-0 s:gap-3 m:gap-4 s:grid-cols-2 l:grid-cols-3 align-left s:align-center">
|
||||
<% @follows.each do |follow| %>
|
||||
|
|
@ -48,6 +46,5 @@
|
|||
<% end %>
|
||||
<%= render "sublist" %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
<% title "Dashboard" %>
|
||||
|
||||
<main id="main-content">
|
||||
<header class="crayons-layout">
|
||||
<h1 class="p-2 pb-0 m:p-0 crayons-title">Dashboard</h1>
|
||||
<%= render "actions_mobile" %>
|
||||
<%= render "analytics" %>
|
||||
</header>
|
||||
|
||||
<div class="crayons-layout crayons-layout--2-cols">
|
||||
<aside class="crayons-layout__sidebar-left">
|
||||
<main id="main-content" class="crayons-layout crayons-layout--2-cols">
|
||||
<div class="crayons-layout__sidebar-left">
|
||||
<%= render "actions" %>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<div class="crayons-layout__content flex flex-col">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
|
|
@ -66,5 +65,4 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ RSpec.describe "Dashboard", type: :system, js: true do
|
|||
|
||||
visit dashboard_path
|
||||
|
||||
within "main > header" do
|
||||
within "header:nth-child(1)" do
|
||||
expect(page).to have_text("1")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue