Bug Description
Here's the scenario
- I set up analytics and allow key metrics
- I disconnect analytics
- The 'Analytics is disconnected' CTA appears for admin. This is fine.
- However, it also appears for editors with view-only access, which is not expected. They don't have the ability to connect analytics and thus, the CTA should not appear.
Screenshot attached below.
Screenshots
Details
Additional Context
- PHP Version:
- OS: [e.g. iOS]
- Browser: [e.g. chrome, safari]
- Plugin Version: [e.g. 22]
- Device: [e.g. iPhone6]
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- When Analytics has been connected and then disconnected, view-only users should see the "Analytics is disconnected" banner and tile without the "Connect Analytics" CTA or "Maybe later" link, replaced with the message: "Metrics cannot be displayed without Analytics. To fix the issue, contact your administrator."
- Admin users continue to see the existing "Connect Analytics" CTA and "Maybe later" link unchanged.
Implementation Brief
Test Coverage
- Add a test case in
ConnectGA4CTAWidget.test.js for the view-only context.
QA Brief
- Set up Site Kit with Google Analytics.
- Set up Key Metrics and ensure a handful of GA KM widgets are added to the dashboard.
- Now disconnect Analytics.
- Verify that the "Analytics is disconnected" notification appears with the CTA as expected.
- Log in as a view-only user.
- Verify that the "Analytics is disconnected" notification appears, but without the CTA, according to the ACs.
- Verify that any tile showing the Analytics disconnected notice does not show the CTA.
Changelog entry
- Fixed the "Analytics is disconnected" CTA banner and tile to hide actionable connect buttons for view-only users.
Bug Description
Here's the scenario
Screenshot attached below.
Screenshots
Details
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
assets/js/modules/analytics-4/components/widgets/ConnectGA4CTAWidget.js, whenuseViewOnly()returnstrue:descriptionwith a message that directs the user to contact their administrator (e.g."Metrics cannot be displayed without Analytics. To fix the issue, contact your administrator.").ctaButtontoundefined(hide the "Connect Analytics" button).footertoundefined(hide the "Maybe later" link).AnalyticsDisconnectedNotice.js(assets/js/components/email-reporting/notices/AnalyticsDisconnectedNotice.js) which already handles view-only correctly.assets/js/components/KeyMetrics/ConnectModuleCTATile.js, whenuseViewOnly()returnstrue:<Link>element (thehandleConnectModulecallback fromuseActivateModuleCallbackalready returnsnullfor non-admin users, but the link itself still renders with a non-functional click handler — it should be hidden entirely).ConnectGA4CTAWidget.stories.js.Test Coverage
ConnectGA4CTAWidget.test.jsfor the view-only context.QA Brief
Changelog entry