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-8391] - Account maintenance CSV download in the first attempt #11025

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11025-fixed-1727790118989.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Download Account Maintenance CSVs on the first attempt ([#11025](https://github.com/linode/manager/pull/11025))
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable jsx-a11y/anchor-is-valid */
import { Theme } from '@mui/material/styles';
import * as React from 'react';
import { makeStyles } from 'tss-react/mui';

Expand Down Expand Up @@ -28,6 +27,7 @@ import {
import { MaintenanceTableRow } from './MaintenanceTableRow';

import type { AccountMaintenance, Filter } from '@linode/api-v4';
import type { Theme } from '@mui/material/styles';

const preferenceKey = 'account-maintenance';

Expand Down Expand Up @@ -136,7 +136,9 @@ const MaintenanceTable = ({ type }: Props) => {

const downloadCSV = async () => {
await getCSVData();
csvRef.current.link.click();
setTimeout(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is a bit of a hack, please add a comment as to why we are doing this

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree on the necessity of adding an explanatory comment here

csvRef.current.link.click();
}, 0);
};

return (
Expand Down
Loading