[EuiTables] Misc syntax cleanups/chores

- remove unnecessary props that already default to false

- various syntax nits

- small CSS fixes
This commit is contained in:
Cee Chen 2024-04-09 14:09:03 -07:00
parent c180bc30af
commit 3db5f8ced0
13 changed files with 13 additions and 18 deletions

View file

@ -116,7 +116,6 @@ export const DocViewerLegacyTable = ({
items={items}
columns={tableColumns}
rowProps={onSetRowProps}
pagination={false}
responsiveBreakpoint={false}
/>
);

View file

@ -313,7 +313,7 @@ export const ChangePointsTable: FC<ChangePointsTableProps> = ({
return (
<EuiInMemoryTable<ChangePointAnnotation>
itemId={'id'}
itemId="id"
selection={selectionValue}
loading={isLoading}
data-test-subj={`aiopsChangePointResultsTable ${isLoading ? 'loading' : 'loaded'}`}

View file

@ -395,7 +395,7 @@ export const DataVisualizerTable = <T extends DataVisualizerTableItem>({
backgroundColor: euiTheme.colors.emptyShade,
boxShadow: `inset 0 0px 0, inset 0 -1px 0 ${euiTheme.border.color}`,
},
'.euiTableRow > .euiTableRowCel': {
'.euiTableRow > .euiTableRowCell': {
borderTop: 0,
},
[useEuiMinBreakpoint('s')]: {

View file

@ -308,7 +308,7 @@ export const BrowserStepsList = ({
defaultMessage: 'No data found',
})
}
tableLayout={'auto'}
tableLayout="auto"
itemId="_id"
itemIdToExpandedRowMap={testNowMode || showExpand ? expandedMap : undefined}
/>

View file

@ -295,13 +295,12 @@ export const TestRunsTable = ({
itemId="docId"
itemIdToExpandedRowMap={expandedRows}
css={{ overflowX: isTabletOrGreater ? 'auto' : undefined }}
compressed={false}
loading={pingsLoading}
columns={columns}
error={pingsError?.body?.message}
items={sortedPings}
noItemsMessage={pingsLoading ? LOADING_TEST_RUNS : NO_DATA_FOUND}
tableLayout={'auto'}
tableLayout="auto"
sorting={sorting}
onChange={handleTableChange}
rowProps={getRowProps}

View file

@ -11,8 +11,7 @@ import {
EuiBasicTable,
EuiTableSortingType,
EuiPanel,
EuiSpacer,
useEuiTheme,
EuiHorizontalRule,
useIsWithinMinBreakpoint,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
@ -50,7 +49,6 @@ export const MonitorList = ({
loadPage,
reloadPage,
}: Props) => {
const { euiTheme } = useEuiTheme();
const isXl = useIsWithinMinBreakpoint('xxl');
const [monitorPendingDeletion, setMonitorPendingDeletion] =
@ -104,8 +102,7 @@ export const MonitorList = ({
<>
<EuiPanel hasBorder={false} hasShadow={false} paddingSize="none">
{recordRangeLabel}
<EuiSpacer size="s" />
<hr style={{ border: `1px solid ${euiTheme.colors.lightShade}` }} />
<EuiHorizontalRule margin="s" />
<EuiBasicTable
aria-label={i18n.translate('xpack.synthetics.management.monitorList.title', {
defaultMessage: 'Synthetics monitors list',

View file

@ -67,7 +67,7 @@ export const Table = (props: Props) => {
</EuiText>
<EuiSpacer size="s" />
<TableWithoutHeader
tableLayout={'fixed'}
tableLayout="fixed"
compressed
responsiveBreakpoint={false}
columns={columns}

View file

@ -127,7 +127,7 @@ export function PingListTable({ loading, error, pings, onChange }: Props) {
defaultMessage: 'No history found',
})
}
tableLayout={'auto'}
tableLayout="auto"
onChange={onChange}
/>
);

View file

@ -239,7 +239,7 @@ export function PingListTable({ loading, error, pings, pagination, onChange, fai
defaultMessage: 'No history found',
})
}
tableLayout={'auto'}
tableLayout="auto"
rowProps={getRowProps}
onChange={onChange}
/>

View file

@ -67,7 +67,7 @@ export const Table = (props: Props) => {
</EuiText>
<EuiSpacer size="s" />
<TableWithoutHeader
tableLayout={'fixed'}
tableLayout="fixed"
compressed
responsiveBreakpoint={false}
columns={columns}

View file

@ -233,7 +233,7 @@ export const MonitorListComponent: ({
<NoItemsMessage loading={Boolean(loading || isPending)} filters={filters} />
}
columns={columns}
tableLayout={'auto'}
tableLayout="auto"
rowProps={
hideExtraColumns
? ({ monitor_id: monitorId }) => ({

View file

@ -247,7 +247,7 @@ export const StepsList = ({
defaultMessage: 'No history found',
})
}
tableLayout={'auto'}
tableLayout="auto"
rowProps={getRowProps}
/>
</>

View file

@ -186,7 +186,7 @@ export const RiskInputsTab = ({ entityType, entityName }: RiskInputsTabProps) =>
<RiskInputsUtilityBar pagination={pagination} selectedAlerts={selectedItems} />
<EuiSpacer size="xs" />
<EuiInMemoryTable
compressed={true}
compressed
loading={loadingRiskScore || loadingAlerts}
items={alertsData ?? []}
columns={alertsColumns}