Unified Dashboard: Register existing widgets in new Speed area
The widgets that should appear in the Speed area (created in #4031):
mainDashboardSpeedPrimary area:
- PageSpeed Insights widget (
DashboardPageSpeedWidget)
entityDashboardSpeedPrimary area:
- PageSpeed Insights widget (
DashboardPageSpeedWidget)
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
These widgets should be registered to the following areas and appear on the Main Dashboard and Entity Dashboard respectively, in this order:
mainDashboardSpeedPrimary area:
- PageSpeed Insights widget (
DashboardPageSpeedWidget)
entityDashboardSpeedPrimary area:
- PageSpeed Insights widget (
DashboardPageSpeedWidget)
Implementation Brief
Inside assets/js/modules/pagespeed-insights/index.js:
- Import
AREA_MAIN_DASHBOARD_SPEED_PRIMARYandAREA_ENTITY_DASHBOARD_SPEED_PRIMARYfromassets/js/googlesitekit/widgets/default-areas.js - Inside the call to
widgetsAPI.registerWidgetfor theDashboardPageSpeedWidget: - Add
AREA_MAIN_DASHBOARD_SPEED_PRIMARYandAREA_ENTITY_DASHBOARD_SPEED_PRIMARYto the array passed as the last argument.
Test Coverage
- No new tests required; existing ones should pass.
QA Brief
- Check that the
DashboardPageSpeedWidgetwidget has new areas defined in AC.
Changelog entry
- Add PageSpeed widget to Unified Dashboard.
Thanks, @johnPhillips, but I think the intention for this ticket was to add new areas (AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY and AREA_ENTITY_DASHBOARD_TRAFFIC_PRIMARY) to the existing DashboardPageSpeedWidget widget registration (an array passed as the 3rd argument): https://github.com/google/site-kit-wp/blob/ae0b02b9accd4a6f0cb84592f575cf0750f8678a/assets/js/modules/pagespeed-insights/index.js#L53-L61
No need to register this widget in the register-defaults.js file.
@eugene-manuilov Ahh 💡 I think I made this mistake on 4078 as well. Thanks for the clarification, I'll update the IBs for both.
IB :heavy_check_mark:
QA: :heavy_check_mark:
DashboardPageSpeedWidgetis registered on the Speed section and showing up on both main and entity dashboard.- If the module is not connected, the blue CTA appears. Clicking on it connects and refreshes the page.