-
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
Update splash screen to offer the view-only dashboard to admins #4811
Comments
IB ✔️ |
QA Update:
|
The view in storybook is accurate as I understand it from the ACs because they only mention adding the button. So the storybook view is correct, but the in-plugin version isn't, so I'll take a look. |
Thanks @felixarntz. @tofumatt was feeling a bit unwell earlier so I've picked this up in case he's not able to get to it any time soon. Have created a followup PR: #5181. |
@tofumatt @felixarntz looks like there was a flaw in the ACs which prevents the button from being displayed when relying on the I think this can be solved with a one-line change when checking the shared dashboard capability. site-kit-wp/includes/Core/Permissions/Permissions.php Lines 474 to 483 in 7be61fc
If the user has a shared role but hasn't dismissed the splash item, we can simply require I'll open a new issue for addressing this as it should get updated test coverage as well which would likely be too time consuming to fit in here. |
@aaemnnosttv Good catch. I wonder then, should we even consider the dismissal of the splash screen inside of the capability? I'm thinking now that it may be more appropriate to check explicitly for the dismissal in the few places where it's needed rather than baking it into the capability. Other than the complexity that baking the check into the capability introduces based on the feedback, I think it even makes sense just from a capability standpoint. There is nothing sensitive about seeing the shared dashboard even without dismissing the splash screen, so maybe this shouldn't have been part of the capability check in the first place. It's just that from a product perspective, we want people to go through it. But it's not critical from a security or functionality perspective, it's just good for more clear UX. Hence I think now this shouldn't be baked into a capability check. We could for example also include logic to redirect to the splash screen when someone who is not authenticated hasn't dismissed the splash screen. We could basically say on the server side when adding the screen:
What do you think? |
@felixarntz I think the reason it was baked in was that we would need to check that in all the same places where the capability is used.
That makes sense, I think it may just make things a bit more complicated to "unpack" this to check the dismissal explicitly.
This should already be the case now, isn't it? The dashboard requires
This would be incomplete I think because an authenticated admin who can TL;DR I think the proper solution may be to decouple the two as you're suggesting, however I think it would be simpler to get things working as an intermediate step to make the smaller change suggested above and then the decoupling can be more of a pure refactoring. |
Maybe a new @felixarntz are you happy for this all to happen in a separate issue or is there anything else you think is necessary to finalize this one? |
@aaemnnosttv I think we can definitely address this in a separate issue. It seems like we need to think about the approach a bit more anyway. Looking back at your original proposal:
I think this would cause problems with users that can authenticate though. If you are an admin that can read shared module data, you can also decide to not authenticate, like a non-admin, and instead go to the shared dashboard. In that case we still need to show them the splash screen and the admin would have to dismiss it the same like a non-admin. I'm still leaning towards breaking out the dismissal from capabilities. Primarily because of what I mentioned before that it's not security-sensitive in any way, and also because we would only need it in a capability because we have the splash screen as a separate screen technically and in WP we typically use capabilities to determine which screen to show. In a perfect world, maybe we would only have the dashboard, and the splash screen could almost be like a modal on top of the dashboard, all handled in JS. So from that perspective, I think decoupling dismissal from the capabilities makes sense. Regarding the effort, I think we could make this change by exclusively updating server-side code, and I would assume the amount of places where we check whether the user can access the shared dashboard are fairly limited. Worst case, even if we somewhere accidentally linked to the shared dashboard, the user would get redirected to the splash screen if they hadn't dismissed the splash screen yet. |
Sounds good, I'll open a new issue to refine this 👍
Aside from this issue, I don't think we have any checks for the shared dashboard outside of |
Feature Description
With dashboard sharing, users who are able to authenticate (admins) will see a different splash screen than users who cannot. This issue is about updating the splash screen for admins to be able to go straight to the shared dashboard if they are able to (if any module is shared with admins).
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
SetupUsingProxyWithSignIn
) should be updated to offer a new "Go to dashboard" button as a secondary action to the primary sign in with Google button<ViewOnlySplash />
#4810 before navigating to the dashboardVIEW_SHARED_DASHBOARD
capabilityImplementation Brief
assets/js/components/setup/SetupUsingProxyWithSignIn.js
,hasCapability
selector withgooglesitekit_view_shared_dashboard
as parameter to see if the user has permission to view the shared dashboard.dashboardSharing
is enabled via theuseFeature
hook, passingdashboardSharing
as parameter.inProgressFeedback
, add a newButton
with the translatedGo to dashboard
text. TheButton
should be rendered only if the user has permission to view the shared dashboard and thedashboardSharing
feature flag is enabled.onClick
prop toButton
and the callback function should dismiss theshared_dashboard_splash
item and navigate to the dashboard.shared_dashboard_splash
item, dispatch thedismissItem
action of thecore/user
data store.core/site
data store via thegetAdminURL
selector, withgooglesitekit-dashboard
as parameter.assets/js/components/setup/SetupUsingProxyWithSignIn.stories.js
to include a story where theGo to dashboard
is rendered.Test Coverage
QA Brief
dashboardSharing
enabled, then ensure you see these buttons at the bottom of the setup page:QA Brief Update
As per this comment, the "Go to dashboard" button styling should match the styling for the "Reset Site Kit" button.
Changelog entry
The text was updated successfully, but these errors were encountered: