site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Unified Dashboard: Register existing widgets in new Speed area

Open tofumatt opened this issue 5 years ago • 4 comments

The widgets that should appear in the Speed area (created in #4031):

mainDashboardSpeedPrimary area:

  1. PageSpeed Insights widget (DashboardPageSpeedWidget)

entityDashboardSpeedPrimary area:

  1. 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_PRIMARY and AREA_ENTITY_DASHBOARD_SPEED_PRIMARY from assets/js/googlesitekit/widgets/default-areas.js
  • Inside the call to widgetsAPI.registerWidget for the DashboardPageSpeedWidget:
  • Add AREA_MAIN_DASHBOARD_SPEED_PRIMARY and AREA_ENTITY_DASHBOARD_SPEED_PRIMARY to the array passed as the last argument.

Test Coverage

  • No new tests required; existing ones should pass.

QA Brief

  • Check that the DashboardPageSpeedWidget widget has new areas defined in AC.

Changelog entry

  • Add PageSpeed widget to Unified Dashboard.

tofumatt avatar Sep 20 '21 16:09 tofumatt

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 avatar Sep 22 '21 14:09 eugene-manuilov

@eugene-manuilov Ahh 💡 I think I made this mistake on 4078 as well. Thanks for the clarification, I'll update the IBs for both.

johnPhillips avatar Sep 22 '21 14:09 johnPhillips

IB :heavy_check_mark:

eugene-manuilov avatar Sep 23 '21 11:09 eugene-manuilov

QA: :heavy_check_mark:

  • DashboardPageSpeedWidget is 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.

kuasha420 avatar Oct 18 '21 12:10 kuasha420