Add a content area to the Header in the Unified Dashboard for Entity Info and notifications
See original GitHub issueFeature Description
There should be a section in the header of the dashboard that displays content in the view between the header and the pill links, see:

The logic to display this content is covered elsewhere; this issue is just above creating the component that can be used to style either the Entity information (shown above) or the Notifications that appear in this area when any are present.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- A new prop
subHeader
should be added to theHeader
component. It should be used to place arbitrary content in the header area highlighted in the screenshot. It should appear below the<header>
tag in theHeader
component. (https://github.com/google/site-kit-wp/blob/5f12f3b3b59b1517bc2a0efa4d427120de2e4239/assets/js/components/Header.js#L41-L71) - This prop should be used by the components in #4146 and #4152 to wrap their output when inside the
<Header>
component - When the
subHeader
prop is passed components/eg. a non-null
value, the output should match the styles in the Figma mockup: https://www.figma.com/file/VILRieNSLg2DOVyEgFBkXe/[MVP]-Generic-Dashboard?node-id=459%3A2117 (note how the bottom border/shadow of the header becomes the border/shadow of the subheader instead when there is one, i.e. it’s almost like the header expands). There should be no inner padding though as that should be defined by whatever is rendered within the container. - The component should NOT be sticky, unlike the rest of the header. When the user scrolls down the page, this section of the header should disappear and not follow the user down the page.
- The
BannerNotifications
component from #4152 should be rendered within the new sub-header container, but only if on the “main dashboard” (i.e. not if on the “entity dashboard”).
Implementation Brief
Integration in Header
- Update
Header
to accept a newsubHeader
prop which should take an optionalelement
- If provided, this element should be rendered in a new grid inner (row), and full-width grid cell below the existing elements wrapping the main menu (i.e. as a child of
mdc-layout-grid
)
- If provided, this element should be rendered in a new grid inner (row), and full-width grid cell below the existing elements wrapping the main menu (i.e. as a child of
- Update
stories/header.stories.js
to add a new story for showing the header with a dummy component - Add
subHeader={<BannerNotifications />}
to theDashboardMainApp
’sHeader
component (https://github.com/google/site-kit-wp/blob/94ab93a3bf301b165aebfdb0b4df75a815ffd96b/assets/js/components/DashboardMainApp.js#L42) to output the notifications on the Main Dashboard.
Test Coverage
- Add a Storybook story to show what the header looks like with “Empty” or “Dummy” content—eg the padding and extra border dividing the header from the subheader should appear, with another border between the subheader and navigation
QA Brief
- Enable the
unifiedDashboard
feature flag. - Check if the a notification is rendered below the header at the following URL:
/wp-admin/admin.php?page=googlesitekit-dashboard¬ification=authentication_success
- There should be no visible lines separating the header and the sub header content.
- Scroll down the page, the header should be sticky.
Changelog entry
- Add a generic content area for the Header in the Unified Dashboard.
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
Header—ArcGIS Dashboards | Documentation
A header is a reserved area along the top of your dashboard that you can use to give your dashboard a unique identity,...
Read more >Scaffold Unified Dashboard tab bar with chip/pill dummy links
This component should be "sticky", such that it appears below the subHeader prop (see Add a content area to the Header in the...
Read more >Enable or disable global header options
Enable or disable global header options ; Navigate to All > Service Portals > Portals. ; Click Employee Center. ; Click here to...
Read more >Change the banner or logo - Dynamics 365 - Microsoft Learn
Go to Navigation pane > Modules > Common > Common > Default dashboard. You should see the new banner or logo image on...
Read more >Unified Data Model field list | Chronicle Security - Google Cloud
Information stored in one or more Entities can add this additional context. ... Do not place protocol metadata in Extensions; put it in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tofumatt @felixarntz @kuasha420 A few things I noticed
subHeader
prop displayed withinmdc-layout-grid
. I think we should not do that, but instead leave the implementation to the rendered component. For e.g theNotification
component already usesmdc-*
class names. So I would suggest we just have a full width wrapper instead of having a grid layout.box-shadow
differs on small and large screens. I suggest we keep them consistent and since we are not really focusing on the designs in Figma, I suggest we use theshadow
mixin we already have.box-shadow
even though when we have a sub header because the latter is not sticky.I have a PR created for the above points.
Let me know what you think.
@wpdarren The QAB says going to the following URL:
/wp-admin/admin.php?page=googlesitekit-dashboard¬ification=authentication_success
. In doing so, theBannerNotifications
component will be passed to theHeader
component via thesubHeader
prop. It’s a way to test the latter. Then it should match the designs in Figma, meaning there should no be any borders between the header and the sub header (BannerNotifications
in this case), and then only the header is sticky upon scrolling.Let me know if that clears things up.