Remove isSelectable table prop

- this is now automatically detected by the presence of the `selectable` prop and no longer needs to be passed manually
This commit is contained in:
Cee Chen 2024-04-09 11:35:37 -07:00
parent fc31f49b42
commit 6897cc25e8
45 changed files with 1 additions and 52 deletions

View file

@ -242,7 +242,6 @@ export function Table<T extends UserContentCommonSchema>({
data-test-subj="itemsInMemTable"
rowHeader="attributes.title"
tableCaption={tableCaption}
isSelectable
/>
);
}

View file

@ -147,7 +147,6 @@ export const DrilldownTable: React.FC<DrilldownTableProps> = ({
items={drilldowns}
itemId="id"
columns={columns}
isSelectable={true}
responsiveBreakpoint={false}
selection={{
onSelectionChange: (selection) => {

View file

@ -118,7 +118,6 @@ const ContextEditorComponent: React.FC<Props> = ({
columns={columns}
compressed={true}
data-test-subj="contextEditor"
isSelectable={true}
itemId={FIELDS.FIELD}
items={rows}
pagination={pagination}

View file

@ -317,7 +317,6 @@ export const CategoryTable: FC<Props> = ({
compressed
items={categories}
columns={columns}
isSelectable={true}
selection={selectionValue}
itemId="key"
onTableChange={onTableChange}

View file

@ -341,7 +341,6 @@ export class AutoFollowPatternTable extends PureComponent {
pagination={pagination}
sorting={sorting}
selection={selection}
isSelectable={true}
rowProps={() => ({
'data-test-subj': 'row',
})}

View file

@ -326,7 +326,6 @@ export class FollowerIndicesTable extends PureComponent {
pagination={pagination}
sorting={sorting}
selection={selection}
isSelectable={true}
rowProps={() => ({
'data-test-subj': 'row',
})}

View file

@ -482,7 +482,6 @@ export const DataVisualizerTable = <T extends DataVisualizerTableItem>({
pagination={pagination}
sorting={sorting}
itemIdToExpandedRowMap={itemIdToExpandedRowMap}
isSelectable={false}
onTableChange={onTableChange}
data-test-subj={`dataVisualizerTable-${loading ? 'loading' : 'loaded'}`}
rowProps={(item) => ({

View file

@ -335,7 +335,6 @@ export const PackagePoliciesTable: React.FunctionComponent<Props> = ({
},
],
}}
isSelectable={false}
/>
);
};

View file

@ -307,7 +307,6 @@ export const AgentPolicyListPage: React.FunctionComponent<{}> = () => {
items={agentPolicyData ? agentPolicyData.items : []}
itemId="id"
columns={columns}
isSelectable={false}
pagination={{
pageIndex: pagination.currentPage - 1,
pageSize: pagination.pageSize,

View file

@ -337,7 +337,6 @@ export const AgentListTable: React.FC<Props> = (props: Props) => {
totalItemCount: totalAgents,
pageSizeOptions,
}}
isSelectable={true}
selection={
!authz.fleet.allAgents
? undefined

View file

@ -131,7 +131,6 @@ export const ComponentTable: FunctionComponent<Props> = ({
const tableProps: EuiInMemoryTableProps<ComponentTemplateListItem> = {
tableLayout: 'auto',
itemId: 'name',
isSelectable: true,
'data-test-subj': 'componentTemplatesTable',
sorting: { sort: { field: 'name', direction: 'asc' } },
selection: {

View file

@ -271,7 +271,6 @@ export const DataStreamTable: React.FunctionComponent<Props> = ({
columns={columns}
search={searchConfig}
sorting={sorting}
isSelectable={true}
selection={selectionConfig}
pagination={pagination}
rowProps={() => ({

View file

@ -169,7 +169,6 @@ export const PoliciesTable: FunctionComponent<Props> = ({
search={search}
pagination={pagination}
sorting={true}
isSelectable={false}
/>
);
};

View file

@ -281,7 +281,6 @@ export const LegacyTemplateTable: React.FunctionComponent<Props> = ({
columns={columns}
search={searchConfig}
sorting={sorting}
isSelectable={true}
selection={selectionConfig}
pagination={pagination}
rowProps={() => ({

View file

@ -282,7 +282,6 @@ export const TemplateTable: React.FunctionComponent<Props> = ({
columns={columns}
search={searchConfig}
sorting={sorting}
isSelectable={true}
selection={selectionConfig}
pagination={pagination}
rowProps={() => ({

View file

@ -114,7 +114,6 @@ export const PipelineTable: FunctionComponent<Props> = ({
const tableProps: EuiInMemoryTableProps<Pipeline> = {
itemId: 'name',
isSelectable: true,
'data-test-subj': 'pipelinesTable',
sorting: { sort: { field: 'name', direction: 'asc' } },
selection: {

View file

@ -186,7 +186,6 @@ function PipelinesTableUi({
<EuiInMemoryTable
columns={columns}
data-test-subj="pipelineTable"
isSelectable={isSelectable}
itemId="id"
items={pipelines}
message={message}

View file

@ -281,7 +281,6 @@ export const DataFrameAnalyticsList: FC<Props> = ({
allowNeutralSort={false}
columns={columns}
itemIdToExpandedRowMap={itemIdToExpandedRowMap}
isSelectable={false}
items={analytics}
itemId={DataFrameAnalyticsListColumn.id}
loading={isLoading}

View file

@ -238,7 +238,6 @@ export function AnalyticsIdSelector({
pagination={pagination}
sorting={true}
selection={selectionValue}
isSelectable={true}
/>
),
},
@ -259,7 +258,6 @@ export function AnalyticsIdSelector({
pagination={pagination}
sorting={true}
selection={selectionValue}
isSelectable={true}
/>
),
});

View file

@ -257,7 +257,6 @@ export const AllocatedModels: FC<AllocatedModelsProps> = ({
<EuiInMemoryTable<AllocatedModel>
allowNeutralSort={false}
columns={columns}
isSelectable={false}
items={models}
itemId={'key'}
rowProps={(item) => ({

View file

@ -221,7 +221,6 @@ export const NodesList: FC<NodesListProps> = ({ compactView = false }) => {
allowNeutralSort={false}
columns={columns}
itemIdToExpandedRowMap={itemIdToExpandedRowMap}
isSelectable={false}
items={items}
itemId={'id'}
loading={isLoading}

View file

@ -170,7 +170,6 @@ export const ProcessorsStats: FC<ProcessorsStatsProps> = ({ stats }) => {
<EuiInMemoryTable<ProcessorStatsItem>
allowNeutralSort={false}
columns={columns}
isSelectable={false}
items={items}
itemId={'id'}
rowProps={(item) => ({

View file

@ -397,7 +397,6 @@ export const NotificationsList: FC = () => {
<EuiBasicTable<NotificationItem>
columns={columns}
isSelectable={false}
items={itemsPerPage}
itemId={'id'}
loading={isLoading}

View file

@ -112,7 +112,6 @@ export const AnalyticsTable: FC<Props> = ({ items }) => {
allowNeutralSort={false}
className="mlAnalyticsTable"
columns={columns}
isSelectable={false}
items={items}
itemId={DataFrameAnalyticsListColumn.id}
onTableChange={onTableChange}

View file

@ -186,7 +186,6 @@ export const AnomalyDetectionTable: FC<Props> = ({ items, chartsService }) => {
allowNeutralSort={false}
className="mlAnomalyDetectionTable"
columns={columns}
isSelectable={false}
items={groupsList}
itemId={AnomalyDetectionListColumns.id}
onTableChange={onTableChange}

View file

@ -142,7 +142,6 @@ export const CalendarsListTable = ({
sorting={sorting}
loading={loading}
selection={tableSelection}
isSelectable={true}
data-test-subj={loading ? 'mlCalendarTable loading' : 'mlCalendarTable loaded'}
rowProps={(item) => ({
'data-test-subj': `mlCalendarListRow row-${item.calendar_id}`,

View file

@ -213,7 +213,6 @@ export function FilterListsTable({
pagination={true}
sorting={sorting}
selection={tableSelection}
isSelectable={true}
data-test-subj="mlFilterListsTable"
rowProps={(item) => ({
'data-test-subj': `mlFilterListRow row-${item.filter_id}`,

View file

@ -81,7 +81,6 @@ export const Table = () => {
onChange={onTableChange}
pagination={pagination}
data-test-subj="datasetQualityTable"
isSelectable
rowProps={{
'data-test-subj': 'datasetQualityTableRow',
}}

View file

@ -42,7 +42,6 @@ export const HostsTable = () => {
<EuiBasicTable
data-test-subj={`hostsView-table-${loading ? 'loading' : 'loaded'}`}
itemId="id"
isSelectable
selection={selection}
pagination={{
pageIndex: pagination.pageIndex ?? 0,

View file

@ -424,7 +424,6 @@ export class RemoteClusterTable extends Component {
pagination={pagination}
sorting={sorting}
selection={selection}
isSelectable={true}
data-test-subj="remoteClusterListTable"
/>
);

View file

@ -421,7 +421,6 @@ export class ReportListingTable extends Component<ListingPropsInternal, State> {
}
pagination={pagination}
selection={selection}
isSelectable={true}
onChange={this.onTableChange}
data-test-subj={REPORT_TABLE_ID}
rowProps={() => ({ 'data-test-subj': REPORT_TABLE_ROW_ID })}

View file

@ -289,7 +289,6 @@ export class RoleMappingsGridPage extends Component<Props, State> {
pagination={pagination}
loading={loadState === 'loadingTable'}
message={message}
isSelectable={true}
rowProps={() => {
return {
'data-test-subj': 'roleMappingRow',

View file

@ -191,7 +191,6 @@ export class RolesGridPage extends Component<Props, State> {
'data-test-subj': `roleRow`,
};
}}
isSelectable
/>
</ActionsEuiTableFormatting>
</>

View file

@ -282,7 +282,6 @@ export class UsersGridPage extends Component<Props, State> {
search={search}
sorting={sorting}
rowProps={rowProps}
isSelectable
/>
}
</>

View file

@ -61,7 +61,6 @@ const ExceptionsLinkedToListsComponent: React.FC<ExceptionsLinkedToListComponent
items={listAndReferences}
error={error}
columns={getSharedListsTableColumns()}
isSelectable={false}
sorting
data-test-subj="exceptionItemSharedList"
/>

View file

@ -86,7 +86,6 @@ export const AddPrebuiltRulesTable = React.memo(() => {
initialPageSize: RULES_TABLE_INITIAL_PAGE_SIZE,
pageSizeOptions: RULES_TABLE_PAGE_SIZE_OPTIONS,
}}
isSelectable
selection={{
selectable: () => true,
onSelectionChange: selectRules,

View file

@ -108,7 +108,6 @@ export const UpgradePrebuiltRulesTable = React.memo(() => {
initialPageSize: RULES_TABLE_INITIAL_PAGE_SIZE,
pageSizeOptions: RULES_TABLE_PAGE_SIZE_OPTIONS,
}}
isSelectable
selection={{
selectable: () => true,
onSelectionChange: selectRules,

View file

@ -88,13 +88,7 @@ export const AlertsCountComponent: React.FC<AlertsCountProps> = ({
return (
<Wrapper data-test-subj="alertsCountTable" className="eui-yScroll">
<EuiInMemoryTable
isSelectable={false}
columns={tableColumns}
items={items}
loading={loading}
sorting={true}
/>
<EuiInMemoryTable columns={tableColumns} items={items} loading={loading} sorting={true} />
</Wrapper>
);
};

View file

@ -194,7 +194,6 @@ export const RiskInputsTab = ({ entityType, entityName }: RiskInputsTabProps) =>
sorting
selection={euiTableSelectionProps}
onTableChange={onTableChange}
isSelectable
itemId="_id"
/>
</>

View file

@ -157,7 +157,6 @@ const RowRenderersBrowserComponent = ({
columns={columns}
search={search}
sorting={initialSorting}
isSelectable={true}
/>
);
};

View file

@ -418,7 +418,6 @@ export const PolicyTable: React.FunctionComponent<Props> = ({
sorting={sorting}
selection={selection}
pagination={pagination}
isSelectable={true}
rowProps={() => ({
'data-test-subj': 'row',
})}

View file

@ -300,7 +300,6 @@ export const RepositoryTable: React.FunctionComponent<Props> = ({
sorting={sorting}
selection={selection}
pagination={pagination}
isSelectable={true}
rowProps={() => ({
'data-test-subj': 'row',
})}

View file

@ -330,7 +330,6 @@ export const SnapshotTable: React.FunctionComponent<Props> = (props: Props) => {
});
}}
loading={isLoading}
isSelectable={true}
selection={selection}
pagination={pagination}
rowProps={() => ({

View file

@ -356,7 +356,6 @@ export const TransformList: FC<TransformListProps> = ({
className="transform__TransformTable"
columns={columns}
error={searchError}
isSelectable={false}
items={filteredTransforms}
itemId={TRANSFORM_LIST_COLUMN.ID}
itemIdToExpandedRowMap={itemIdToExpandedRowMap}

View file

@ -515,7 +515,6 @@ export const WatchListPage = () => {
},
}}
selection={selectionConfig}
isSelectable={true}
childrenBetween={
queryError && (
<>