-
Notifications
You must be signed in to change notification settings - Fork 2
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
HOSTSD-293 - fix for storage trends chart aspect ratio bug #127
Conversation
@@ -173,6 +173,26 @@ export const Dashboard = () => { | |||
[download], | |||
); | |||
|
|||
const renderStorageTrendsChart = (isLarge: boolean) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this use a React.useCallback()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the callback, should I use all the variables this component depends on as dependencies?
ex: [ dashboardServerItem, dashboardServerItems, dashboardTenant, dashboardOrganization, dashboardOperatingSystemItem, handleExport, ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you test using them all you'll find out if it gets in an infinite loop. But generally you want all of them.
@@ -173,6 +173,34 @@ export const Dashboard = () => { | |||
[download], | |||
); | |||
|
|||
const renderStorageTrendsChart = React.useCallback( | |||
(isLarge: Boolean) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to change from Boolean
to boolean
.
The Storage Trends chart aspect ratio was off when navigating back to the All Organizations view - the chart was too short because it was keeping the longer aspect ratio from the larger size of the chart on other views.
To fix this, it seems the chart needs to be rendered separately for each size depending on which view the user is looking at.