Skip to content

Commit

Permalink
Increase various column widths with text that are now cut off due to …
Browse files Browse the repository at this point in the history
…new sortable icon

+ use first custom `responsiveBreakpoint` to handle table with lots of columns!! 🎉
  • Loading branch information
cee-chen committed Apr 18, 2024
1 parent fa99ad8 commit 718fc3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class Table extends PureComponent<TableProps, TableState> {
name: i18n.translate('savedObjectsManagement.objectsTable.table.columnTypeName', {
defaultMessage: 'Type',
}),
width: '50px',
width: '65px',
align: 'center',
description: i18n.translate(
'savedObjectsManagement.objectsTable.table.columnTypeDescription',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export const HostsTable = () => {
/>
<EuiBasicTable
data-test-subj={`hostsView-table-${loading ? 'loading' : 'loaded'}`}
// This table has a lot of columns, so break down into mobile view sooner
responsiveBreakpoint="xl"
itemId="id"
selection={selection}
pagination={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const useHostsTable = () => {
return items.sort(sortTableData(sorting)).slice(startIndex, endIndex);
}, [items, pagination, sorting]);

const metricColumnsWidth = displayAlerts ? '11%' : '15%';
const metricColumnsWidth = displayAlerts ? '12%' : '16%';

const columns: Array<EuiBasicTableColumn<HostNodeRow>> = useMemo(
() => [
Expand Down Expand Up @@ -360,7 +360,7 @@ export const useHostsTable = () => {
formula={formulas?.rx.value}
/>
),
width: '10%',
width: '12%',
field: 'rx',
sortable: true,
'data-test-subj': 'hostsView-tableRow-rx',
Expand All @@ -375,7 +375,7 @@ export const useHostsTable = () => {
formula={formulas?.tx.value}
/>
),
width: '10%',
width: '12%',
field: 'tx',
sortable: true,
'data-test-subj': 'hostsView-tableRow-tx',
Expand Down

0 comments on commit 718fc3c

Please sign in to comment.