Skip to content

Commit

Permalink
Fix display of schedule final in preview mode
Browse files Browse the repository at this point in the history
  • Loading branch information
teodosii committed Jun 3, 2024
1 parent 2aa8639 commit 1c635ba
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
36 changes: 20 additions & 16 deletions grafana-plugin/src/components/GTable/GTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const GTable = <RT extends DefaultRecordType = DefaultRecordType>(props:
}, [rowSelection, columnsProp, data]);

return (
<div className={styles.root} data-testid="test__gTable">
<div className={cx(styles.root, { [styles.fixed]: props.tableLayout === 'fixed' })} data-testid="test__gTable">
<Table<RT>
expandable={expandable}
rowKey={rowKey}
Expand All @@ -156,20 +156,24 @@ export const GTable = <RT extends DefaultRecordType = DefaultRecordType>(props:
);
};

const getGTableStyles = (_theme: GrafanaTheme2) => {
return {
root: css`
table {
width: 100%;
}
`,
const getGTableStyles = () => ({
root: css`
table {
width: 100%;
}
`,

fixed: css`
table {
table-layout: fixed;
}
`,

pagination: css`
margin-top: 20px;
`,
pagination: css`
margin-top: 20px;
`,

checkbox: css`
display: inline-flex;
`,
};
};
checkbox: css`
display: inline-flex;
`,
});
2 changes: 1 addition & 1 deletion grafana-plugin/src/containers/Rotations/ScheduleFinal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const _ScheduleFinal: FC<ScheduleFinalProps> = observer(
</HorizontalGroup>
</div>
)}
<div className="u-position-relative">
<div className="u-position-relative we-are-here">
{rows.map(({ startDate }, index) => (
<TransitionGroup key={index} className={cx('u-position-relative', styles.layer, styles.layerFirst)}>
<TimelineMarks
Expand Down
1 change: 1 addition & 0 deletions grafana-plugin/src/pages/schedules/Schedules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class _SchedulesPage extends React.Component<SchedulesPageProps, SchedulesPageSt
total: results ? Math.ceil((count || 0) / page_size) : 0,
onChange: this.handlePageChange,
}}
tableLayout="fixed"
rowKey="id"
expandable={{
expandedRowKeys: expandedRowKeys,
Expand Down

0 comments on commit 1c635ba

Please sign in to comment.