-
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
Widgets don't load when URL has no initial hash and traffic section isn't available #5388
Comments
Given the unit tests, component re-shuffling, and QA involved in this I feel like it should be bumped to an 11 estimate just in-case for planning, but other than that looks good. IB ✅ |
QA Update:
|
@wpdarren Those errors, I believe, are what's being worked on in #5310… or possibly another permissions issue… there's a few of them! 😅 They're bugs but should be covered elsewhere I think. So I think this should be considered done if it passes the QA Brief, and permissions issues should be filed separately. If that one isn't covered by any open issues in the Dashboard Sharing epic, please do add it to the list and assign me to define the ACs 👍🏻 |
QA Update: ✅Verified:
|
Bug Description
The dashboard navigation introduced with the unified dashboard controls the hash in the URL and if not set, sets it to the fist section:
#traffic
. Until now, this has worked fine because all users are guaranteed to have that section available. With dashboard sharing, it's possible that the Traffic section may not be present if Search Console and Analytics are not shared with a user's role.In this situation, a URL without a hash will still get
#traffic
set by default which also has the effect of "activating" theuseInViewSelect
hooks that all API/reporting selectors use for lazy-loading. This results in the first actually-in-view section not being active.This is not 100% reproducible and may also involve a race condition or other factors like not scrolling after the initial load.
Steps to reproduce
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Note this may not be available right away so async resolution may be needed
Implementation Brief
assets/js/components/DashboardNavigation
.assets/js/components/DashboardNavigation.js
toassets/js/components/DashboardNavigation/Navigation.js
, renaming the component in the process.assets/js/components/DashboardNavigation.stories.js
toassets/js/components/DashboardNavigation/index.stories.js
assets/js/components/DashboardNavigation.test.js
toassets/js/components/DashboardNavigation/index.test.js
assets/js/components/DashboardNavigation/index.js
which does the following:getViewableModules
selection of thecore/user
data store. Refer toviewableModules
inassets/js/components/DashboardNavigation/Navigation.js
null
ifgetViewableModules
isundefined
, else returnNavigation
imported fromassets/js/components/DashboardNavigation/Navigation.js
assets/js/components/DashboardNavigation/Navigation.js
,getDefaultChipID
which does the following:viewOnlyDashboard
isfalse
, returnANCHOR_ID_TRAFFIC
showTraffic
istrue
, returnANCHOR_ID_TRAFFIC
showContent
istrue
, returnANCHOR_ID_CONTENT
showSpeed
istrue
, returnANCHOR_ID_SPEED
showMonetization
istrue
, returnANCHOR_ID_MONETIZATION
isValidChipID
which accepts a parameter,chipID
, which returnstrue
based on the following:showTraffic
istrue
andchipID
isANCHOR_ID_TRAFFIC
showContent
istrue
andchipID
isANCHOR_ID_CONTENT
showSpeed
istrue
andchipID
isANCHOR_ID_SPEED
showMonetization
istrue
andchipID
isANCHOR_ID_MONETIZATION
false
.useMount
,initialHash
, instead of hard coding the hash toANCHOR_ID_TRAFFIC
, get the default chip ID fromgetDefaultChipID
and update the hash to the default chip ID.isValidChipID
. If the chip ID is not valid, update the hash to the default chip ID.Test Coverage
assets/js/components/DashboardNavigation/index.test.js
to make sure the first chip ID is selected when no hash is selectedQA Brief
#speed
not#traffic
.Using a normal Site Kit admin, the URL hash should still start with
#traffic
when viewing the Site Kit dashboard.Changelog entry
The text was updated successfully, but these errors were encountered: