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

PORTALS-3270: Tool detail page spacing between lines is too large #1327

Merged
merged 9 commits into from
Nov 5, 2024
4 changes: 4 additions & 0 deletions apps/synapse-portal-framework/src/style/_Markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
line-height: 23px;
}

.SubsectionRowRenderer .markdown p {
padding-bottom: 0;
}

.markdown p a {
font-weight: 700;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ $svg-icon-height: 30px;
[role='heading'] {
padding-top: 30px;
}
[role='subHeading'] {
padding-top: 10px;
margin-bottom: 5px;
}
}

&.tab-layout {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ describe('SubsectionRowRenderer rendering tests', () => {
})

await waitFor(() => {
expect(screen.getAllByRole('heading').length).toBe(1)
expect(screen.getAllByRole('heading')[0].textContent).toBe(
expect(screen.getAllByRole('subHeading').length).toBe(1)
expect(screen.getAllByRole('subHeading')[0].textContent).toBe(
'Catalog Number',
)

Expand All @@ -75,8 +75,8 @@ describe('SubsectionRowRenderer rendering tests', () => {
})

await waitFor(() => {
expect(screen.getAllByRole('heading').length).toBe(1)
expect(screen.getAllByRole('heading')[0].textContent).toBe(
expect(screen.getAllByRole('subHeading').length).toBe(1)
expect(screen.getAllByRole('subHeading')[0].textContent).toBe(
'fundingAgency',
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ const SubsectionRowRenderer: React.FunctionComponent<
}
return (
<div
key={`${colIndex}`}
key={`header-${colIndex}`}
className="SubsectionRowRenderer__item"
role="table"
>
<Typography
variant={
columnNameIsSectionTitle ? 'sectionTitle' : 'subsectionHeader'
}
role="heading"
role="subHeading"
Copy link
Member

Choose a reason for hiding this comment

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

Is "subHeading" a valid ARIA role? Heading is... https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/heading_role
For the spacing change, would it be appropriate to define sx properties in this Typography component instead of relying on the css?

Copy link
Collaborator Author

@kianamcc kianamcc Nov 1, 2024

Choose a reason for hiding this comment

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

@jay-hodgson subHeading is indeed not a valid ARIA role. I just reverted it back to "heading". If I use sx I have to use !important to override the global styles but with inline css, I can override it!

>
{selectColumn.name}
</Typography>
Expand All @@ -148,7 +148,7 @@ const SubsectionRowRenderer: React.FunctionComponent<
values = jsonData.map((val: string, index: number) => {
return (
<div
key={index}
key={`row-${rowIndex}-col-${colIndex}-multi-value`}
className="SubsectionRowRenderer__item__value"
role="row"
>
Expand Down Expand Up @@ -200,7 +200,7 @@ const SubsectionRowRenderer: React.FunctionComponent<
}
values = (
<div
key={rowIndex}
key={`row-${rowIndex}-col-${colIndex}-single`}
className="SubsectionRowRenderer__item__value"
role="row"
>
Expand Down
Loading