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

HOSTSD-293 - fix for storage trends chart aspect ratio bug #127

Merged
merged 3 commits into from
Mar 27, 2024
Merged

HOSTSD-293 - fix for storage trends chart aspect ratio bug #127

merged 3 commits into from
Mar 27, 2024

Conversation

wkaspryk
Copy link
Collaborator

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.

@wkaspryk wkaspryk requested a review from Fosol March 27, 2024 18:32
@@ -173,6 +173,26 @@ export const Dashboard = () => {
[download],
);

const renderStorageTrendsChart = (isLarge: boolean) => {
Copy link
Contributor

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()?

Copy link
Collaborator Author

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, ]

Copy link
Contributor

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) => (
Copy link
Contributor

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.

@wkaspryk wkaspryk marked this pull request as ready for review March 27, 2024 19:29
@Fosol Fosol added this pull request to the merge queue Mar 27, 2024
Merged via the queue into main with commit e24657b Mar 27, 2024
1 check passed
@Fosol Fosol deleted the 293 branch March 27, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants