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

Display TM stats on the landing page simultaneously #5749

Merged
merged 2 commits into from
May 5, 2023

Conversation

HelNershingThapa
Copy link
Contributor

Closes #5738

stats

  • Updates the component to load and display stats from two different APIs simultaneously. It does this by using the Promise.all() method, which allows concurrently fetching data from multiple sources.
  • Updated to show a dash ("-") instead of undefined values while the stats are still loading.

- Makes use of the Promise.all() method to set and display the stats at the same time
- Gets rid of the useFetchWithAbort hook to fetch TM stats and uses fetchLocalJSONAPIWithAbort to fetch inside of Promise.all() method
- Updates the component to show a dash ("-") instead of undefined values i.e. when the values are still loading.
- Adds test to expect stats from the endpoint
- Intercept request handler for system statistics
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@Aadesh-Baral Aadesh-Baral left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@d-rita d-rita left a comment

Choose a reason for hiding this comment

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

Works fine. The only issue I see in the future is if one of the endpoints is down, then no stats will be displayed.
stats

@HelNershingThapa
Copy link
Contributor Author

Works fine. The only issue I see in the future is if one of the endpoints is down, then no stats will be displayed.

Thanks for reviewing the pull request @d-rita and bringing up the potential issue with the endpoints being down. I've tracked this concern on a separate issue here, so I'll go ahead and merge the pull request now.

@HelNershingThapa HelNershingThapa merged commit b5ec128 into develop May 5, 2023
@HelNershingThapa HelNershingThapa deleted the fix/5738-simultaneous-stats-display branch May 5, 2023 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Inconsistent loading of stats on the landing page
3 participants