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

fix: [M3-7758] - Linode Network Graph Tooltip - Incorrect Units #10197

Conversation

bnussman-akamai
Copy link
Member

Description 📝

In our new Recharts graphs, the tooltip unit would sometimes not match the units that the graph was using. This PR fixes that issue. The graph's units (shown in the graph title), should match what is shown in the tooltip.

Changes 🔄

  • De-ramda-ifyed the touched file 😤
  • Removed unused totalTraffic prop 🗑️
  • Fixed tooltip units 🔧

Target release date 🗓️

Please specify a release date to guarantee timely review of this PR. If exact date is not known, please approximate and update it as needed.

Preview 📷

Before After
Notice how the tooltip shows 31.63 Kb/s. This is not correct. It is really 31.63 Mb/s Notice how the tooltip shows 31.63 Mb/s
Screenshot 2024-02-15 at 12 56 13 PM Screenshot 2024-02-15 at 12 56 53 PM

How to test 🧪

Prerequisites

  • Have Linodes that have some traffic metrics (ask me if you need an account to test on)

Reproduction steps

  • Go to the detail page of a Linode
  • Go to the Analytics tab
  • Observe that a graph can have different units shown in the tooltip than in the title

Verification steps

  • Verify the tooltip units match the graph's title's units 📈

As an Author I have considered 🤔

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@bnussman-akamai bnussman-akamai added Bug Fixes for regressions or bugs Recharts Effort to replace chartjs library labels Feb 15, 2024
@bnussman-akamai bnussman-akamai self-assigned this Feb 15, 2024
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner February 15, 2024 18:06
@bnussman-akamai bnussman-akamai requested review from mjac0bs and abailly-akamai and removed request for a team February 15, 2024 18:06
@@ -298,7 +267,7 @@ const Graph = (props: GraphProps) => {
height={420}
showLegend
timezone={timezone}
unit={' Kb/s'}
unit={` ${unit}/s`}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the primary fix. We now pass the unit instead of using the hardcoded Kb/s unit.

Copy link

github-actions bot commented Feb 15, 2024

Coverage Report:
Base Coverage: 81.26%
Current Coverage: 81.26%

Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

✅ Confirmed unit change
✅ Refactor is nice 🔥

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Fix looks good!

privateIn: pathOr([], ['data', 'netv6', 'private_in'], stats),
privateOut: pathOr([], ['data', 'netv6', 'private_out'], stats),
publicIn: pathOr([], ['data', 'netv6', 'in'], stats),
publicOut: pathOr([], ['data', 'netv6', 'out'], stats),
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you ❤️

@bnussman-akamai bnussman-akamai merged commit 455f09b into linode:develop Feb 16, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fixes for regressions or bugs Recharts Effort to replace chartjs library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants