Open aaemnnosttv opened 4 days ago
I looked at a JS approach first, however by using the Network speed throttling, the majority of the delay in loading is waiting for the React app to be loaded. This is why I implement a PHP/CSS implementation here.
Feature Description
The WP dashboard widget "Site Kit Summary" has no "skeleton" component while loading as many others do on the main SK dashboard. This results in a substantial shift between the page load and when the widget renders and loads.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
[ ] Update
includes/Core/Admin/Dashboard.php
:current_user_can( Permissions::READ_SHARED_MODULE_DATA, $module )
.googlesitekit-wp-dashboard-loading googlesitekit-wp-dashboard-loading__analytics_active_and_connected googlesitekit-wp-dashboard-loading__can_view_analytics loading__can_view_search_console
googlesitekit-preview-block
containing a div with thegooglesitekit-preview-block__wrapper
class (The DOM of the PreviewBlock component), decide the number based on best match to the output of the final dashboard app.[ ] Update
assets/sass/components/wp-dashboard/_googlesitekit-wp-dashboard.scss
:googlesitekit-wp-dashboard-loading
div and it's preview blocks match the exact height of the final returned widget based on:[ ] Update the render function in
assets/js/googlesitekit-wp-dashboard.js
to remove existing dom elements from the render container before rending the WPDashboardApp.Test Coverage
tests/phpunit/integration/Core/Admin/DashboardTest.php
to test that the correct classes are rendered based on the key states above.QA Brief
Changelog entry