-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a content area to the Header in the Unified Dashboard for Entity Info and notifications #4050
Comments
I have made some observation while working on the IB according to Acceptance Criteria.
Looking for feedback. |
Totally, that's actually a way better approach and I think will totally work for what we want to do. I think I even wanted to propose it in the ACs originally, but for some reason I guess my brain went with the more imperative approach. But Slot/Fill is way nicer AND less code! 🙂 I've updated the ACs, let's go with that approach. If any other ACs related to this issue need updating I'll do that too 👍🏻 |
After a discussion with Eugene, Felix, and Evan, we actually realised that we don't need the slot/fill implementation here, at least for now, and can get away with this component rendering a few, specific things according to the design:
I think originally we had planned for this to be a more generic content are that would be used by other things, but we couldn't remember what for and I think that need has gone 😓 So I've reworked the ACs as this is now a much less complicated component/set of ACs Sorry @kuasha420 for making you think on theses ACs and write up that solid IB for slot/fill, though I have copied it to a new issue (#4212) in case we want to revisit slot/fill for the header (or any other section of the plugin) in the future. I've moved this back to IB now that there are new, simpler ACs (again!) for the issue. Hopefully this is the last revision we make to the ACs! 😅 |
@tofumatt I think the ACs could even be further simplified, as there's already dedicated issues for the two pieces of content (#4146 and #4152) to conditionally render in here. I think the last two bullet points could be removed from the ACs, as those parts are to be implemented in those issues. I'd say in this issue we should focus only on getting the area ready, and it might be a good idea to include a Storybook story with some demo content for it, just to see what it looks like with "any" content inside and to ensure the styling makes sense. cc @kuasha420 |
Hmmm, we shouldn't be rendering the I suppose if it's currently only possible for one piece of content to appear in the header at a time—given notifications won't appear on the Entity Dashobard… maybe this should just be thought of as the "wrapper component" with no logic. I think that makes sense, but it's just a re-framing of the issue. I've updated the ACs again, but I've assigned you to have a look at them to make sure they make sense @felixarntz. If they're good feel free to move this over to IB 👍🏻 |
@tofumatt Ah that's a good point that we need an actual container. I wonder though, we might still be able to have the Regarding the Figma design itself, it looks like that new shadow above was recently added - but the Figma file also has some note about advising not to do that. I left a comment asking for clarification. |
@tofumatt Ahh, thanks for clarifying. I think I was confused by the wording: "This prop should be used by the components in #4146 and #4152 to wrap their output when inside the Now that that's clarified, that makes sense. Note though that current approach still wouldn't ensure that the sub-header only renders if there is actually something in there. That is because e.g. the |
Yes, especially now that there is only one border between the nav bar and the entire header, I think this will be fine. Essentially, if there is zero So I think this approach should do fine and this IB should cover it, but let me know if you have any other questions about this approach. 👍🏻 |
Sounds good - IB ✅ |
@tofumatt @felixarntz @kuasha420
I have a PR created for the above points. Let me know what you think. |
@asvinb Great points. Your point about a full-width container is also in the ACs - it says there that it shouldn't have any inner padding, which I basically meant to express with that it should be full-width and not assume/restrict anything about the content within :) |
@felixarntz @asvinb @tofumatt Looking at the initial ticket description and AC's, the QAB doesn't appear to be accurate. Please could you clarify if it is, and if not, any additional info would be appreciated. |
@wpdarren The QAB says going to the following URL: Let me know if that clears things up. |
Feature 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
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. (site-kit-wp/assets/js/components/Header.js
Lines 41 to 71 in 5f12f3b
<Header>
componentsubHeader
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/%5BMVP%5D-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.BannerNotifications
component from Implement notifications infrastructure layer for unified dashboard #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
Header
to accept a newsubHeader
prop which should take an optionalelement
mdc-layout-grid
)stories/header.stories.js
to add a new story for showing the header with a dummy componentsubHeader={<BannerNotifications />}
to theDashboardMainApp
'sHeader
component (site-kit-wp/assets/js/components/DashboardMainApp.js
Line 42 in 94ab93a
Test Coverage
QA Brief
unifiedDashboard
feature flag./wp-admin/admin.php?page=googlesitekit-dashboard¬ification=authentication_success
Changelog entry
The text was updated successfully, but these errors were encountered: