-
Notifications
You must be signed in to change notification settings - Fork 370
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-7155] - Link Accessibility & Markup on Billing Detail page #9697
Changes from all commits
61eaf7b
d1696a1
d905c87
53b9086
618f7a5
9bf0f40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Fixed | ||
--- | ||
|
||
Back link and CSV download button accessibility on Billing Detail page ([#9697](https://github.com/linode/manager/pull/9697)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ interface DownloadCSVProps { | |
data: unknown[]; | ||
filename: string; | ||
headers: { key: string; label: string }[]; | ||
onClick: () => void; | ||
onClick?: () => void; | ||
sx?: SxProps; | ||
text?: string; | ||
} | ||
|
@@ -40,20 +40,24 @@ export const DownloadCSV = ({ | |
text = 'Download CSV', | ||
}: DownloadCSVProps) => { | ||
return ( | ||
<> | ||
<CSVLink | ||
aria-hidden="true" | ||
className={className} | ||
data={cleanCSVData(data)} | ||
filename={filename} | ||
headers={headers} | ||
ref={csvRef} | ||
<CSVLink | ||
className={className} | ||
data={cleanCSVData(data)} | ||
filename={filename} | ||
headers={headers} | ||
ref={csvRef} | ||
> | ||
<Button | ||
buttonType={buttonType} | ||
component="span" | ||
disableRipple | ||
onClick={onClick} | ||
sx={sx} | ||
tabIndex={-1} | ||
/> | ||
<Button buttonType={buttonType} onClick={onClick} sx={sx}> | ||
> | ||
{text} | ||
</Button> | ||
</> | ||
</CSVLink> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we use the CSV link as the accessible element rather than the button. (also, downloads are semantically links with href) Rendering the as a span is a decent way to keep the styling identical while being semantically correct (buttons are not permitted within
|
||
); | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,14 +129,22 @@ export const InvoiceDetail = () => { | |
> | ||
<Grid container rowGap={2}> | ||
<Grid xs={12}> | ||
<Grid container spacing={2} sx={sxGrid} data-qa-invoice-header> | ||
<Grid container data-qa-invoice-header spacing={2} sx={sxGrid}> | ||
<Grid sm={4} sx={sxGrid} xs={12}> | ||
<Link to={`/account/billing`} data-qa-back-to-billing> | ||
<Link | ||
accessibleAriaLabel="Back to Billing" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the missing tag/accessibility support causing the console error: https://github.com/linode/manager/blob/develop/packages/manager/src/components/Link.tsx#L83-L88 It works! 🎉 |
||
data-qa-back-to-billing | ||
to={`/account/billing`} | ||
> | ||
<IconButton | ||
sx={{ | ||
padding: 0, | ||
}} | ||
component="span" | ||
disableFocusRipple | ||
role="none" | ||
size="large" | ||
tabIndex={-1} | ||
> | ||
<KeyboardArrowLeft | ||
sx={{ | ||
|
@@ -168,7 +176,6 @@ export const InvoiceDetail = () => { | |
data={items} | ||
filename={`invoice-${invoice.date}.csv`} | ||
headers={csvHeaders} | ||
onClick={() => csvRef.current.link.click()} | ||
sx={{ ...sxDownloadButton, marginRight: '8px' }} | ||
/> | ||
<Button | ||
|
@@ -246,5 +253,3 @@ export const InvoiceDetail = () => { | |
</Paper> | ||
); | ||
}; | ||
|
||
export default InvoiceDetail; |
This file was deleted.
This file was deleted.
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.
Looks like we still may need the onClick support on the
MaintenanceTable
component