Skip to content

Commit

Permalink
fix: Do not set height for wrapping layouts when there are dynamicall…
Browse files Browse the repository at this point in the history
…y sized layouts embedded, it will mess up displaying of them.

If alerts table has no dedicated controls return plain table only
  • Loading branch information
tiithansen committed Jul 6, 2024
1 parent 3dacbd1 commit 5d0b294
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
44 changes: 25 additions & 19 deletions src/components/AlertsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,24 +204,30 @@ export function AlertsTable(labelFilters?: LabelFilters, showVariableControls =

const queryBuilder = new AlertsQueryBuilder(labelFilters);

return new EmbeddedScene({
$variables: variables,
controls: controls,
body: new SceneFlexLayout({
children: [
new SceneFlexItem({
width: '100%',
body: new AsyncTable<TableRow>({
columns: columns,
createRowId: createRowId,
asyncDataRowMapper: rowMapper,
$data: queryBuilder.rootQueryBuilder(variables, defaultSorting),
queryBuilder: queryBuilder,
expandedRowBuilder: expandedRowSceneBuilder(createRowId),
sorting: defaultSorting,
}),
}),
],
}),
const table = new AsyncTable<TableRow>({
columns: columns,
createRowId: createRowId,
asyncDataRowMapper: rowMapper,
$data: queryBuilder.rootQueryBuilder(variables, defaultSorting),
queryBuilder: queryBuilder,
expandedRowBuilder: expandedRowSceneBuilder(createRowId),
sorting: defaultSorting,
})

if (showVariableControls || shouldCreateVariables) {
return new EmbeddedScene({
$variables: variables,
controls: controls,
body: new SceneFlexLayout({
children: [
new SceneFlexItem({
width: '100%',
body: table,
}),
],
}),
})
} else {
return table;
}
}
1 change: 0 additions & 1 deletion src/pages/Workloads/tabs/DaemonSets/ExpandedRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export function buildExpandedRowScene(row: TableRow) {
key: `${row.namespace}/${row.daemonset}`,
direction: 'column',
width: '100%',
height: 500,
children: [
new SceneFlexLayout({
direction: 'row',
Expand Down
2 changes: 0 additions & 2 deletions src/pages/Workloads/tabs/StatefulSets/ExpandedRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ export function buildExpandedRowScene(row: TableRow) {
key: `${row.namespace}/${statefulset}`,
direction: 'column',
width: '100%',
height: 500,
children: [
new SceneFlexLayout({
direction: 'row',
height: 300,
children: [
new SceneFlexItem({
body: getPodsScene(staticLabelFilters, false, false)
Expand Down

0 comments on commit 5d0b294

Please sign in to comment.