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 overflow issues on metrics table #8448

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions frontend/src/__generated/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
// src/pages/Graphing/components/Table.css.ts
var firstCell = "_1s4anja4";
Vadman97 marked this conversation as resolved.
Show resolved Hide resolved
var fullHeight = "_1s4anja1";
var preventScroll = "_1s4anja3";
var scrollableBody = "_1s4anja2";
var tableRow = "_1s4anja5";
Vadman97 marked this conversation as resolved.
Show resolved Hide resolved
var tableWrapper = "_1s4anja0";
export {
firstCell,
fullHeight,
preventScroll,
scrollableBody,
tableRow,
tableWrapper
Vadman97 marked this conversation as resolved.
Show resolved Hide resolved
};
8 changes: 8 additions & 0 deletions frontend/src/pages/Graphing/components/Table.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ export const scrollableBody = style({
export const preventScroll = style({
overflowY: 'hidden',
})

export const firstCell = style({
minWidth: '106px',
Vadman97 marked this conversation as resolved.
Show resolved Hide resolved
})

export const tableRow = style({
overflow: 'hidden',
Vadman97 marked this conversation as resolved.
Show resolved Hide resolved
})
32 changes: 22 additions & 10 deletions frontend/src/pages/Graphing/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,24 @@ export const MetricTable = ({
<Box height="full" cssClass={style.tableWrapper}>
<Table noBorder className={style.fullHeight}>
<Table.Head>
<Table.Row>
<Table.Row className={style.tableRow}>
Vadman97 marked this conversation as resolved.
Show resolved Hide resolved
{showXAxisColumn && (
<Table.Header>{xAxisMetric}</Table.Header>
<Table.Header>
<Text lines="1" cssClass={style.firstCell}>
{xAxisMetric}
</Text>
Vadman97 marked this conversation as resolved.
Show resolved Hide resolved
</Table.Header>
)}
{series.map((s, i) => (
<Table.Header key={i}>
{showMetricFn
? getMetricDisplay(
yAxisMetric,
yAxisFunction,
)
: s}
<Text lines="1">
{showMetricFn
? getMetricDisplay(
yAxisMetric,
yAxisFunction,
)
: s}
</Text>
</Table.Header>
))}
</Table.Row>
Expand All @@ -86,10 +92,15 @@ export const MetricTable = ({
}

return (
<Table.Row key={i}>
<Table.Row key={i} className={style.tableRow}>
Vadman97 marked this conversation as resolved.
Show resolved Hide resolved
{showXAxisColumn && (
<Table.Cell key={i}>
<Text size="small" color="default">
<Text
size="small"
color="default"
lines="1"
cssClass={style.firstCell}
>
{xAxisTickFormatter(
d[xAxisMetric],
)}
Expand Down Expand Up @@ -123,6 +134,7 @@ export const MetricTable = ({
<Text
size="small"
color="default"
lines="1"
>
{value}
</Text>
Expand Down
Loading