Skip to content

425 add error and empty and loading states#22054

Merged
vraja-pro merged 13 commits intotrunkfrom
425-add-error-and-empty-and-loading-states
Feb 20, 2025
Merged

425 add error and empty and loading states#22054
vraja-pro merged 13 commits intotrunkfrom
425-add-error-and-empty-and-loading-states

Conversation

@vraja-pro
Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro commented Feb 18, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • Adds error messages to the dashboard widgets.

Relevant technical choices:

  • I address the timeout error on the error alert both for client side time out and server side.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Enable the feature branch and connect to site kit to see the "Top 5 most popular content" widget.
define( 'YOAST_SEO_GOOGLE_SITE_KIT_FEATURE', true );
  • The errors copy should match the copy in the design.
  • Test the errors for timeout, no permission, and general error for the site kit top 5 most popular content and scores widgets:
  • Timeout
    • To mimic a timeout or other errors you can edit the src/dashboard/user-interface/scores/abstract-scores-route.php file change line 190 to 408. Adjusting the status code of the response in the get_scores method (currently found here), Changing to 408 should result in getting the timeout error.
    • Change the same for the Top 5 most popular content n src/dashboard/user-interface/time-based-seo-metrics/time-based-seo-metrics-route.php
  • No permission
    • Log in a SEO manager role and see you get the no permission error for the "Top 5 most popular content"
  • General error
    • Open dev tools on the network tab and change the connection to "offline" and then click on the alert center tab and then return to the dashboard.
    • Check you see the general error.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes Add error and empty and loading states

@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Feb 18, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 18, 2025

Pull Request Test Coverage Report for Build 44c154ec476218acd4d525827c85f2b770b42312

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 18 of 18 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 57.808%

Totals Coverage Status
Change from base Build 6632fd67170d486a78e9fc57e438b426f4ba2b6b: 0.005%
Covered Lines: 13664
Relevant Lines: 23266

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR ❓

Comment thread packages/js/src/dashboard/fetch/timeout-error.js
Comment thread packages/js/src/dashboard/fetch/fetch-json.js
Comment thread packages/js/src/dashboard/components/error-alert.js Outdated
Comment thread packages/js/src/dashboard/components/error-alert.js Outdated
Comment thread packages/js/src/dashboard/scores/components/scores.js
Comment thread packages/js/src/dashboard/components/error-alert.js Outdated
Comment thread packages/js/tests/dashboard/components/error-alert.test.js Outdated
Comment thread packages/js/tests/dashboard/components/error-alert.test.js
Comment thread packages/js/tests/dashboard/components/error-alert.test.js
Co-authored-by: Igor <35524806+igorschoester@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

Copy link
Copy Markdown
Contributor

@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AT 🚧

All good, except... in the design the scores have a different timeout message than the rest. But in your PR they are all the same.

@vraja-pro
Copy link
Copy Markdown
Contributor Author

It was a mistake in the design, Kai is updating it right now. The copy is correct.

@vraja-pro vraja-pro added this to the 24.7 milestone Feb 20, 2025
@vraja-pro vraja-pro merged commit c455fe6 into trunk Feb 20, 2025
@vraja-pro vraja-pro deleted the 425-add-error-and-empty-and-loading-states branch February 20, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants