Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show friendly error message on API fetch failure on stats #17570

Conversation

tnir
Copy link
Contributor

@tnir tnir commented May 4, 2022

Signed-off-by: Takuya Noguchi takninnovationresearch@gmail.com

What type of PR is this? (check all applicable)

  • Refactor
  • Bug Fix
  • Optimization

Description

Shows friendly error message on API fetch failures on /:user/:slug/stats.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

  1. Install uBlock Origin on your Chrome browser: https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en
  2. Make sure EasyPrivacy is enabled as uBlock Origin filter list: https://easylist.to/
  3. Prepare Rails app with this PR to run Rails server.
  4. Access to /orville_rippin/a-summer-bird-cage-quibusdam-impedit-47p9/stats on your dev server.
before after
Screenshot 2021-05-19 at 16 45 44 adapted from #13804 (courtesy of @TastefulElk) (768px screen width)

cf. Another screenshot (with 1024px screen width):
3000-forem-forem-pgkt86igaqj ws-us43 gitpod io_orville_rippin_a-summer-bird-cage-quibusdam-impedit-47p9_stats(iPad Mini)

Although I know the team is getting rid of Bootstrap CSS (#17412), Bootstrap is used additionally in this PR as it is already used on this page.

UI accessibility concerns?

n/a

Added/updated tests?

  • No, and this is why: there are no tests for app/javascript/analytics/client.js and app/javascript/analytics/dashboard.js at all.

@tnir tnir requested review from a team, Ridhwana and msarit and removed request for a team May 4, 2022 16:48
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label May 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2022

Thank you for opening this PR! We appreciate you!

For all pull requests coming from third-party forks we will need to
review the PR before we can process it through our CI pipelines.

A Forem Team member will review this contribution and get back to
you as soon as possible!

@tnir tnir force-pushed the tnir/13804-friendly-error-message-on-stats-with-ublock-easyprivacy branch 2 times, most recently from 040ebfa to 91e987f Compare May 5, 2022 08:41
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
@tnir tnir force-pushed the tnir/13804-friendly-error-message-on-stats-with-ublock-easyprivacy branch from 91e987f to edb09f6 Compare May 5, 2022 08:42
@tnir
Copy link
Contributor Author

tnir commented May 5, 2022

This PR is now ready for review.

@tnir
Copy link
Contributor Author

tnir commented May 10, 2022

@forem-team Thoughts?

Copy link
Contributor

@jeremyf jeremyf left a comment

Choose a reason for hiding this comment

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

Thank you for the walkthrough of the code. This looks good to me.

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels May 10, 2022
@tnir
Copy link
Contributor Author

tnir commented May 13, 2022

@Ridhwana @msarit Could you review this? 🙇

@Ridhwana
Copy link
Contributor

@Ridhwana @msarit Could you review this? 🙇

@tnir apologies for the delay here - I'll review and test this PR by tomorrow at the latest.

Copy link
Contributor

@Ridhwana Ridhwana left a comment

Choose a reason for hiding this comment

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

Tested this and it works great, thank you @tnir ✨ I'll merge it later today 😊

@Ridhwana Ridhwana merged commit c3c33aa into forem:main May 18, 2022
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels May 18, 2022
@tnir tnir deleted the tnir/13804-friendly-error-message-on-stats-with-ublock-easyprivacy branch May 19, 2022 00:13
@tnir
Copy link
Contributor Author

tnir commented May 19, 2022

Thank you for merging, @Ridhwana!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants