From c392f61b3c5ebc3c3eafa8ef82e4b63c9c9ca629 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Tue, 12 Nov 2019 11:22:50 -0700 Subject: [PATCH 01/11] table types changes --- package.json | 2 +- .../index_pattern_table.tsx | 4 +- .../fetch/components/shard_failure_table.tsx | 14 +- .../inspector/public/views/data/types.ts | 4 +- .../plugins/kbn_tp_run_pipeline/package.json | 2 +- .../kbn_tp_custom_visualizations/package.json | 2 +- .../kbn_tp_embeddable_explorer/package.json | 2 +- .../kbn_tp_sample_panel_action/package.json | 2 +- typings/@elastic/eui/index.d.ts | 13 -- x-pack/legacy/plugins/infra/types/eui.d.ts | 18 --- .../components/ml_in_memory_table/types.ts | 129 ++++-------------- .../restore_table/shards_table.tsx | 1 + .../snapshot_table/snapshot_table.tsx | 4 +- .../enabled_features/feature_table.tsx | 2 +- .../components/transform_list/columns.tsx | 18 +-- .../expanded_row_messages_pane.tsx | 4 +- .../expanded_row_preview_pane.tsx | 21 +-- .../transform_list/transform_list.tsx | 9 +- .../transform_list/transform_table.tsx | 2 +- .../tabs/checkup/deprecations/index_table.tsx | 6 +- .../functional/monitor_list/monitor_list.tsx | 10 +- .../functional/monitor_list/types.ts | 4 +- .../components/functional/ping_list.tsx | 2 +- .../json_watch_edit_simulate_results.tsx | 6 +- .../watch_list/components/watch_list.tsx | 2 +- x-pack/package.json | 2 +- yarn.lock | 6 +- 27 files changed, 94 insertions(+), 197 deletions(-) diff --git a/package.json b/package.json index b0a74a4a5e04f..732ae7532b8e8 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "@elastic/charts": "^14.0.0", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "1.0.5", - "@elastic/eui": "14.9.0", + "@elastic/eui": "file:///Users/chanderprall/package", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.3.3", diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index_pattern_table/index_pattern_table.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index_pattern_table/index_pattern_table.tsx index f54afc4a5e359..f254a6bc22a0d 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index_pattern_table/index_pattern_table.tsx +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index_pattern_table/index_pattern_table.tsx @@ -59,7 +59,7 @@ const columns = [ ))} ), - dataType: 'string', + dataType: 'string' as const, sortable: ({ sort }: { sort: string }) => sort, }, ]; @@ -72,7 +72,7 @@ const pagination = { const sorting = { sort: { field: 'title', - direction: 'asc', + direction: 'asc' as const, }, }; diff --git a/src/legacy/ui/public/courier/fetch/components/shard_failure_table.tsx b/src/legacy/ui/public/courier/fetch/components/shard_failure_table.tsx index 7b19102647701..54de64e52f745 100644 --- a/src/legacy/ui/public/courier/fetch/components/shard_failure_table.tsx +++ b/src/legacy/ui/public/courier/fetch/components/shard_failure_table.tsx @@ -113,20 +113,18 @@ export function ShardFailureTable({ failures }: { failures: ShardFailure[] }) { }, ]; - const sorting = { - sort: { - field: 'index', - direction: 'desc', - }, - }; - return ( ); diff --git a/src/plugins/inspector/public/views/data/types.ts b/src/plugins/inspector/public/views/data/types.ts index 54371726ef86d..d867a95fe25ca 100644 --- a/src/plugins/inspector/public/views/data/types.ts +++ b/src/plugins/inspector/public/views/data/types.ts @@ -20,11 +20,11 @@ export interface DataViewColumn { name: string; field: string; - sortable: Function; + sortable: (item: DataViewRow) => string | number; render: DataViewColumnRender; } -type DataViewColumnRender = (value: string) => string; +type DataViewColumnRender = (value: string, _item: DataViewRow) => string; export interface DataViewRow { [fields: string]: { diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index da1bb597f5730..3b1993579ef1f 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.9.0", + "@elastic/eui": "file:///Users/chanderprall/package", "react": "^16.8.0", "react-dom": "^16.8.0" } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index 4d0444265825a..050c7c373c160 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.9.0", + "@elastic/eui": "file:///Users/chanderprall/package", "react": "^16.8.0" } } diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json index 9df9352f76fc2..f383c78b1c942 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.9.0", + "@elastic/eui": "file:///Users/chanderprall/package", "react": "^16.8.0" }, "scripts": { diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json index 054276b620907..12bc5e575ad66 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "14.9.0", + "@elastic/eui": "file:///Users/chanderprall/package", "react": "^16.8.0" }, "scripts": { diff --git a/typings/@elastic/eui/index.d.ts b/typings/@elastic/eui/index.d.ts index 39fc30230de18..ef2189df3379c 100644 --- a/typings/@elastic/eui/index.d.ts +++ b/typings/@elastic/eui/index.d.ts @@ -25,17 +25,4 @@ declare module '@elastic/eui' { export const EuiDescribedFormGroup: React.SFC; export const EuiCodeEditor: React.SFC; export const Query: any; - - export interface EuiTableCriteria { - page: { index: number; size: number }; - sort?: { - field?: string; - direction?: Direction; - }; - } - export const EuiBasicTable: React.ComponentClass<{ - onTableChange?: (criteria: EuiTableCriteria) => void; - sorting: { sort?: EuiTableCriteria['sort'] }; - [key: string]: any; - }>; } diff --git a/x-pack/legacy/plugins/infra/types/eui.d.ts b/x-pack/legacy/plugins/infra/types/eui.d.ts index ef58bfcb2fa04..97d9cf9dd5e60 100644 --- a/x-pack/legacy/plugins/infra/types/eui.d.ts +++ b/x-pack/legacy/plugins/infra/types/eui.d.ts @@ -56,22 +56,4 @@ declare module '@elastic/eui' { export const EuiHideFor: React.SFC; export const EuiShowFor: React.SFC; - - type EuiInMemoryTableProps = CommonProps & { - items?: any; - columns?: any; - sorting?: any; - search?: any; - selection?: any; - pagination?: any; - itemId?: any; - isSelectable?: any; - loading?: any; - hasActions?: any; - message?: any; - rowProps?: any; - cellProps?: any; - responsive?: boolean; - }; - export const EuiInMemoryTable: React.SFC; } diff --git a/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/types.ts b/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/types.ts index fac0309e0aeb6..461f773d87d6e 100644 --- a/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/types.ts +++ b/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/types.ts @@ -4,86 +4,28 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Component, HTMLAttributes, ReactElement, ReactNode } from 'react'; +import { Component, ReactNode } from 'react'; -import { CommonProps, EuiInMemoryTable } from '@elastic/eui'; +import { + EuiInMemoryTable, + Direction, + EuiTableActionsColumnType, + EuiTableComputedColumnType, + EuiTableFieldDataColumnType, +} from '@elastic/eui'; // At some point this could maybe solved with a generic . type Item = any; -// Not using an enum here because the original HorizontalAlignment is also a union type of string. -type HorizontalAlignment = 'left' | 'center' | 'right'; +export type FieldDataColumnType = EuiTableFieldDataColumnType; -type SortableFunc = (item: Item) => any; -type Sortable = boolean | SortableFunc; -type DATA_TYPES = any; -type FooterFunc = (payload: { items: Item[]; pagination: any }) => ReactNode; -type RenderFunc = (value: any, record?: any) => ReactNode; -export interface FieldDataColumnType { - field: string; - name: ReactNode; - description?: string; - dataType?: DATA_TYPES; - width?: string; - sortable?: Sortable; - align?: HorizontalAlignment; - truncateText?: boolean; - render?: RenderFunc; - footer?: string | ReactElement | FooterFunc; - textOnly?: boolean; - 'data-test-subj'?: string; -} - -export interface ComputedColumnType { - render: RenderFunc; - name?: ReactNode; - description?: string; - sortable?: (item: Item) => any; - width?: string; - truncateText?: boolean; - 'data-test-subj'?: string; -} - -type ICON_TYPES = any; -type IconTypesFunc = (item: Item) => ICON_TYPES; // (item) => oneOf(ICON_TYPES) -type BUTTON_ICON_COLORS = any; -type ButtonIconColorsFunc = (item: Item) => BUTTON_ICON_COLORS; // (item) => oneOf(ICON_BUTTON_COLORS) -interface DefaultItemActionType { - type?: 'icon' | 'button'; - name: string; - description: string; - onClick?(item: Item): void; - href?: string; - target?: string; - available?(item: Item): boolean; - enabled?(item: Item): boolean; - isPrimary?: boolean; - icon?: ICON_TYPES | IconTypesFunc; // required when type is 'icon' - color?: BUTTON_ICON_COLORS | ButtonIconColorsFunc; -} - -interface CustomItemActionType { - render(item: Item, enabled: boolean): ReactNode; - available?(item: Item): boolean; - enabled?(item: Item): boolean; - isPrimary?: boolean; -} +export type ComputedColumnType = EuiTableComputedColumnType; -export interface ExpanderColumnType { - align?: HorizontalAlignment; - width?: string; - isExpander: boolean; - render: RenderFunc; +export interface ExpanderColumnType extends ComputedColumnType { + isExpander: true; } -type SupportedItemActionType = DefaultItemActionType | CustomItemActionType; - -export interface ActionsColumnType { - actions: SupportedItemActionType[]; - name?: ReactNode; - description?: string; - width?: string; -} +export type ActionsColumnType = EuiTableActionsColumnType; export type ColumnType = | ActionsColumnType @@ -147,18 +89,23 @@ export enum SORT_DIRECTION { DESC = 'desc', } export type SortDirection = SORT_DIRECTION.ASC | SORT_DIRECTION.DESC; +interface SortFields { + field: string; + direction: SortDirection | Direction; +} export interface Sorting { - sort: { - field: string; - direction: SortDirection; - }; + sort?: SortFields; } -export type SortingPropType = boolean | Sorting; +export type SortingPropType = + | boolean + | { + sort: SortFields; + }; type SelectionType = any; export interface OnTableChangeArg extends Sorting { - page: { index: number; size: number }; + page?: { index: number; size: number }; } type ItemIdTypeFunc = (item: Item) => string; @@ -166,34 +113,8 @@ type ItemIdType = | string // the name of the item id property | ItemIdTypeFunc; -export type EuiInMemoryTableProps = CommonProps & { - columns: ColumnType[]; - hasActions?: boolean; - isExpandable?: boolean; - isSelectable?: boolean; - items?: Item[]; - loading?: boolean; - message?: HTMLAttributes; - error?: string; - compressed?: boolean; - search?: SearchType; - pagination?: PaginationProp; - sorting?: SortingPropType; - // Set `allowNeutralSort` to false to force column sorting. Defaults to true. - allowNeutralSort?: boolean; - responsive?: boolean; - selection?: SelectionType; - itemId?: ItemIdType; - itemIdToExpandedRowMap?: Record; - rowProps?: (item: Item) => void | Record; - cellProps?: () => void | Record; - onTableChange?: (arg: OnTableChangeArg) => void; -}; - interface ComponentWithConstructor extends Component { new (): Component; } -export const MlInMemoryTableBasic = (EuiInMemoryTable as any) as ComponentWithConstructor< - EuiInMemoryTableProps ->; +export const MlInMemoryTableBasic: typeof EuiInMemoryTable = EuiInMemoryTable; diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/restore_list/restore_table/shards_table.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/restore_list/restore_table/shards_table.tsx index e85d3b4a465f7..912840b602310 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/restore_list/restore_table/shards_table.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/restore_list/restore_table/shards_table.tsx @@ -193,6 +193,7 @@ export const ShardsTable: React.FunctionComponent = ({ shards }) => { but this component treats a number of fields as required items={shards} columns={columns} /> diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_table/snapshot_table.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_table/snapshot_table.tsx index dbf584acd5470..2c92318873aed 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_table/snapshot_table.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_table/snapshot_table.tsx @@ -243,7 +243,7 @@ export const SnapshotTable: React.FunctionComponent = ({ const sorting = { sort: { field: 'startTimeInMillis', - direction: 'desc', + direction: 'desc' as const, }, }; @@ -331,7 +331,7 @@ export const SnapshotTable: React.FunctionComponent = ({ }, filters: [ { - type: 'field_value_selection', + type: 'field_value_selection' as const, field: 'repository', name: i18n.translate('xpack.snapshotRestore.snapshotList.table.repositoryFilterLabel', { defaultMessage: 'Repository', diff --git a/x-pack/legacy/plugins/spaces/public/views/management/edit_space/enabled_features/feature_table.tsx b/x-pack/legacy/plugins/spaces/public/views/management/edit_space/enabled_features/feature_table.tsx index 91f14cf228c55..1ff41c11fa03d 100644 --- a/x-pack/legacy/plugins/spaces/public/views/management/edit_space/enabled_features/feature_table.tsx +++ b/x-pack/legacy/plugins/spaces/public/views/management/edit_space/enabled_features/feature_table.tsx @@ -70,7 +70,7 @@ export class FeatureTable extends Component { id: 'xpack.spaces.management.enabledSpaceFeaturesFeatureColumnTitle', defaultMessage: 'Feature', }), - render: (feature: Feature) => { + render: (feature: Feature, _item: { feature: Feature; space: Props['space'] }) => { return ( diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/columns.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/columns.tsx index 19ab74cc9ed85..ebe4f7efda055 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/columns.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/columns.tsx @@ -87,15 +87,15 @@ export const getColumns = ( } const columns: [ - ExpanderColumnType, - FieldDataColumnType, - FieldDataColumnType, - FieldDataColumnType, - FieldDataColumnType, - ComputedColumnType, - ComputedColumnType, - ComputedColumnType, - ActionsColumnType + ExpanderColumnType, + FieldDataColumnType, + FieldDataColumnType, + FieldDataColumnType, + FieldDataColumnType, + ComputedColumnType, + ComputedColumnType, + ComputedColumnType, + ActionsColumnType ] = [ { align: RIGHT_ALIGNMENT, diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_messages_pane.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_messages_pane.tsx index 526152a829963..de48b7f9fbf5e 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_messages_pane.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_messages_pane.tsx @@ -120,8 +120,8 @@ export const ExpandedRowMessagesPane: React.SFC = ({ transformId }) => { const onChange = ({ page = { index: 0, size: 10 }, }: { - page: { index: number; size: number }; - sort: { field: string; direction: string }; + page?: { index: number; size: number }; + sort?: { field: string; direction: string }; }) => { const { index, size } = page; diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_preview_pane.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_preview_pane.tsx index 68f2964d41e57..c935d5d376e5d 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_preview_pane.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_preview_pane.tsx @@ -7,6 +7,7 @@ import React, { FC, useState } from 'react'; import { i18n } from '@kbn/i18n'; import moment from 'moment-timezone'; +import { Direction } from '@elastic/eui'; import { SortDirection, SORT_DIRECTION, FieldDataColumnType } from '../../../../../shared_imports'; import { useApi } from '../../../../hooks/use_api'; @@ -68,11 +69,13 @@ function getDataFromTransform( export const ExpandedRowPreviewPane: FC = ({ transformConfig }) => { const [previewData, setPreviewData] = useState([]); - const [columns, setColumns] = useState([]); + const [columns, setColumns] = useState< + Array> | [] + >([]); const [pageIndex, setPageIndex] = useState(0); const [pageSize, setPageSize] = useState(10); - const [sortField, setSortField] = useState(''); - const [sortDirection, setSortDirection] = useState(SORT_DIRECTION.ASC); + const [sortDirection, setSortDirection] = useState(SORT_DIRECTION.ASC); + const [sortField, setSortField] = useState(''); const [isLoading, setIsLoading] = useState(false); const [errorMessage, setErrorMessage] = useState(''); const api = useApi(); @@ -97,8 +100,10 @@ export const ExpandedRowPreviewPane: FC = ({ transformConfig }) => { const columnKeys = getFlattenedFields(resp.preview[0]); columnKeys.sort(sortColumns(groupByArr)); - const tableColumns: FieldDataColumnType[] = columnKeys.map(k => { - const column: FieldDataColumnType = { + const tableColumns: Array< + FieldDataColumnType + > = columnKeys.map(k => { + const column: FieldDataColumnType = { field: k, name: k, sortable: true, @@ -170,7 +175,7 @@ export const ExpandedRowPreviewPane: FC = ({ transformConfig }) => { const sorting = { sort: { - field: sortField, + field: sortField as string, direction: sortDirection, }, }; @@ -179,8 +184,8 @@ export const ExpandedRowPreviewPane: FC = ({ transformConfig }) => { page = { index: 0, size: 10 }, sort = { field: columns[0].field, direction: SORT_DIRECTION.ASC }, }: { - page: { index: number; size: number }; - sort: { field: string; direction: SortDirection }; + page?: { index: number; size: number }; + sort?: { field: keyof typeof previewData[number]; direction: SortDirection | Direction }; }) => { const { index, size } = page; setPageIndex(index); diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_list.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_list.tsx index 02abadb85fbd0..aee55b971bb97 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_list.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_list.tsx @@ -18,6 +18,7 @@ import { EuiFlexItem, EuiPopover, EuiTitle, + Direction, } from '@elastic/eui'; import { OnTableChangeArg, SortDirection, SORT_DIRECTION } from '../../../../../shared_imports'; @@ -97,7 +98,7 @@ export const TransformList: FC = ({ const [pageSize, setPageSize] = useState(10); const [sortField, setSortField] = useState(TRANSFORM_LIST_COLUMN.ID); - const [sortDirection, setSortDirection] = useState(SORT_DIRECTION.ASC); + const [sortDirection, setSortDirection] = useState(SORT_DIRECTION.ASC); const { capabilities } = useContext(AuthorizationContext); const disabled = @@ -329,10 +330,10 @@ export const TransformList: FC = ({ }, filters: [ { - type: 'field_value_selection', + type: 'field_value_selection' as const, field: 'state.state', name: i18n.translate('xpack.transform.statusFilter', { defaultMessage: 'Status' }), - multiSelect: 'or', + multiSelect: 'or' as const, options: Object.values(TRANSFORM_STATE).map(val => ({ value: val, name: val, @@ -340,7 +341,7 @@ export const TransformList: FC = ({ })), }, { - type: 'field_value_selection', + type: 'field_value_selection' as const, field: 'mode', name: i18n.translate('xpack.transform.modeFilter', { defaultMessage: 'Mode' }), multiSelect: false, diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_table.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_table.tsx index cd6f6654a8e9e..ba394bac096d5 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_table.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_table.tsx @@ -73,7 +73,7 @@ const getInitialSorting = (columns: any, sorting: any) => { }; }; -export class TransformTable extends MlInMemoryTableBasic { +export class TransformTable extends MlInMemoryTableBasic { static getDerivedStateFromProps(nextProps: any, prevState: any) { const derivedState = { ...prevState.prevProps, diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/index_table.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/index_table.tsx index 5a1deb59c270e..423ad19ea0f75 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/index_table.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/index_table.tsx @@ -72,7 +72,11 @@ export class IndexDeprecationTableUI extends React.Component< columns.push(this.actionsColumn); } - const sorting = { sort: { field: sortField, direction: sortDirection } }; + const items = this.getRows(); + + const sorting = { + sort: { field: sortField as keyof typeof items[number], direction: sortDirection }, + }; const pagination = { pageIndex, pageSize, diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx index 5774453ff67ab..33484223203a9 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx @@ -132,7 +132,7 @@ export const MonitorListComponent = (props: Props) => { // sorting={sorting} columns={[ { - align: 'left', + align: 'left' as const, field: 'state.monitor.status', name: i18n.translate('xpack.uptime.monitorList.statusColumnLabel', { defaultMessage: 'Status', @@ -142,7 +142,7 @@ export const MonitorListComponent = (props: Props) => { }, }, { - align: 'left', + align: 'left' as const, field: 'state.monitor.name', name: i18n.translate('xpack.uptime.monitorList.nameColumnLabel', { defaultMessage: 'Name', @@ -159,7 +159,7 @@ export const MonitorListComponent = (props: Props) => { sortable: true, }, { - align: 'left', + align: 'left' as const, field: 'state.url.full', name: i18n.translate('xpack.uptime.monitorList.urlColumnLabel', { defaultMessage: 'URL', @@ -191,10 +191,8 @@ export const MonitorListComponent = (props: Props) => { ), }, { - id: 'actions', align: 'right', field: 'state', - hasActions: true, mobileOptions: { header: false, }, @@ -211,7 +209,7 @@ export const MonitorListComponent = (props: Props) => { ), }, { - align: 'left', + align: 'left' as const, field: 'monitor_id', name: '', sortable: true, diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/types.ts b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/types.ts index 8f7ebcaf36e75..a25603d3603d9 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/types.ts +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/types.ts @@ -18,11 +18,11 @@ export interface CondensedCheckStatus { } export interface Criteria { - page: { + page?: { index: number; size: number; }; - sort: { + sort?: { field: string; direction: 'asc' | 'desc'; }; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/ping_list.tsx index fb7c0a5af1e7f..425c3f41f0f4c 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/ping_list.tsx @@ -306,7 +306,7 @@ export const PingListComponent = ({ itemId="id" itemIdToExpandedRowMap={itemIdToExpandedRowMap} pagination={pagination} - onChange={({ page: { size } }: Criteria) => onPageCountChange(size)} + onChange={(criteria: Criteria) => onPageCountChange(criteria.page!.size)} /> diff --git a/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate_results.tsx b/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate_results.tsx index 1b2b4ab935e8c..ceb85c9d14af6 100644 --- a/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate_results.tsx +++ b/x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate_results.tsx @@ -101,8 +101,10 @@ export const JsonWatchEditSimulateResults = ({ defaultMessage: 'State', } ), - dataType: 'string', - render: (actionState: string) => , + dataType: 'string' as const, + render: (actionState: string, _item: typeof actionsTableData[number]) => ( + + ), }, { field: 'actionReason', diff --git a/x-pack/legacy/plugins/watcher/public/sections/watch_list/components/watch_list.tsx b/x-pack/legacy/plugins/watcher/public/sections/watch_list/components/watch_list.tsx index d5191c56643c2..5e20d589201bb 100644 --- a/x-pack/legacy/plugins/watcher/public/sections/watch_list/components/watch_list.tsx +++ b/x-pack/legacy/plugins/watcher/public/sections/watch_list/components/watch_list.tsx @@ -371,7 +371,7 @@ export const WatchList = () => { ? i18n.translate('xpack.watcher.sections.watchList.watchTable.disabledWatchTooltipText', { defaultMessage: 'This watch is read-only', }) - : undefined, + : '', }; const searchConfig = { diff --git a/x-pack/package.json b/x-pack/package.json index 402c3e95159f3..c6db5a3381672 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -179,7 +179,7 @@ "@elastic/ctags-langserver": "^0.1.11", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "1.0.5", - "@elastic/eui": "14.9.0", + "@elastic/eui": "file:///Users/chanderprall/package", "@elastic/filesaver": "1.1.2", "@elastic/javascript-typescript-langserver": "^0.3.3", "@elastic/lsp-extension": "^0.1.2", diff --git a/yarn.lock b/yarn.lock index 30d5f1544ecdd..0036b9f41d73f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1188,10 +1188,8 @@ tabbable "^1.1.0" uuid "^3.1.0" -"@elastic/eui@14.9.0": - version "14.9.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-14.9.0.tgz#934ab8d51c56671635dc17ac20ec325f43ceda75" - integrity sha512-0ZztvfRO3SNgHtS8a+4i6CSG3Yc+C0Kodzc7obY5wkOzissrnbwLZdU79hU/H6DHYCt/zYDdGcrDp6BeD67RtQ== +"@elastic/eui@file:../../package": + version "14.8.0" dependencies: "@types/lodash" "^4.14.116" "@types/numeral" "^0.0.25" From 9647727f6ed952a2a585bc344c6b0b743dbed626 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Wed, 30 Oct 2019 14:42:02 -0600 Subject: [PATCH 02/11] more types --- .../open_timeline/timelines_table/index.tsx | 2 +- .../public/components/paginated_table/index.tsx | 6 ++++-- x-pack/legacy/plugins/siem/public/graphql/types.ts | 14 ++++++++------ .../home/policy_list/policy_table/policy_table.tsx | 4 ++-- .../repository_table/repository_table.tsx | 4 ++-- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.tsx b/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.tsx index 278668eb1d8b4..39bc75bae7ba2 100644 --- a/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.tsx @@ -125,7 +125,7 @@ export const TimelinesTable = pure( const sorting = { sort: { - field: sortField, + field: sortField as keyof OpenTimelineResult, direction: sortDirection, }, }; diff --git a/x-pack/legacy/plugins/siem/public/components/paginated_table/index.tsx b/x-pack/legacy/plugins/siem/public/components/paginated_table/index.tsx index 7be0c1885811b..5716fd931f49e 100644 --- a/x-pack/legacy/plugins/siem/public/components/paginated_table/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/paginated_table/index.tsx @@ -14,12 +14,12 @@ import { EuiLoadingContent, EuiPagination, EuiPopover, + Direction, } from '@elastic/eui'; import { noop } from 'lodash/fp'; import React, { memo, useState, useEffect } from 'react'; import styled, { css } from 'styled-components'; -import { Direction } from '../../graphql/types'; import { AuthTableColumns } from '../page/hosts/authentications_table'; import { HostsTableColumns } from '../page/hosts/hosts_table'; import { NetworkDnsColumns } from '../page/network/network_dns_table/columns'; @@ -252,10 +252,12 @@ export const PaginatedTable = memo( ) : ( <> ( direction: sorting.direction, }, } - : null + : undefined } /> diff --git a/x-pack/legacy/plugins/siem/public/graphql/types.ts b/x-pack/legacy/plugins/siem/public/graphql/types.ts index 833102a0d00bc..fa92229dbd652 100644 --- a/x-pack/legacy/plugins/siem/public/graphql/types.ts +++ b/x-pack/legacy/plugins/siem/public/graphql/types.ts @@ -6,6 +6,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { Direction as EuiDirection } from '@elastic/eui'; + export type Maybe = T | null; export interface PageInfoNote { @@ -52,7 +54,7 @@ export interface PaginationInput { export interface SortField { sortFieldId: string; - direction: Direction; + direction: Direction | EuiDirection; } export interface LastTimeDetails { @@ -64,25 +66,25 @@ export interface LastTimeDetails { export interface HostsSortField { field: HostsFields; - direction: Direction; + direction: Direction | EuiDirection; } export interface UsersSortField { field: UsersFields; - direction: Direction; + direction: Direction | EuiDirection; } export interface NetworkTopTablesSortField { field: NetworkTopTablesFields; - direction: Direction; + direction: Direction | EuiDirection; } export interface NetworkDnsSortField { field: NetworkDnsFields; - direction: Direction; + direction: Direction | EuiDirection; } export interface NetworkHttpSortField { @@ -92,7 +94,7 @@ export interface NetworkHttpSortField { export interface TlsSortField { field: TlsFields; - direction: Direction; + direction: Direction | EuiDirection; } export interface PageInfoTimeline { diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_table/policy_table.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_table/policy_table.tsx index 62038f9963836..f4e46cf12e7a9 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_table/policy_table.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_table/policy_table.tsx @@ -283,7 +283,7 @@ export const PolicyTable: React.FunctionComponent = ({ const sorting = { sort: { field: 'name', - direction: 'asc', + direction: 'asc' as const, }, }; @@ -362,7 +362,7 @@ export const PolicyTable: React.FunctionComponent = ({ }, filters: [ { - type: 'field_value_selection', + type: 'field_value_selection' as const, field: 'repository', name: i18n.translate('xpack.snapshotRestore.policyList.table.repositoryFilterLabel', { defaultMessage: 'Repository', diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx index e8df533cb3496..d121ea4108c18 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx @@ -171,7 +171,7 @@ export const RepositoryTable: React.FunctionComponent = ({ const sorting = { sort: { field: 'name', - direction: 'asc', + direction: 'asc' as const, }, }; @@ -265,7 +265,7 @@ export const RepositoryTable: React.FunctionComponent = ({ }, filters: [ { - type: 'field_value_selection', + type: 'field_value_selection' as const, field: 'type', name: i18n.translate('xpack.snapshotRestore.repositoryList.table.typeFilterLabel', { defaultMessage: 'Type', From fd26c36781ebebbb72b613cc973e531a64d627ac Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Fri, 15 Nov 2019 09:57:20 -0700 Subject: [PATCH 03/11] siem table conversions --- .../event_details/event_fields_browser.tsx | 1 + .../siem/public/components/event_details/helpers.tsx | 12 +----------- .../components/fields_browser/category_columns.tsx | 2 +- .../public/components/fields_browser/field_items.tsx | 4 ++-- .../components/ml/tables/anomalies_host_table.tsx | 4 +++- .../components/ml/tables/anomalies_network_table.tsx | 4 +++- .../siem/public/components/ml/tables/basic_table.tsx | 12 +++++------- .../components/ml_popover/jobs_table/jobs_table.tsx | 2 +- .../plugins/siem/public/components/notes/columns.tsx | 4 +++- .../plugins/siem/public/components/notes/helpers.tsx | 8 +++----- .../plugins/siem/public/components/notes/index.tsx | 5 ++--- .../open_timeline/timelines_table/index.tsx | 5 ++++- .../page/network/network_http_table/index.tsx | 3 ++- .../pages/detection_engine/rule_details/index.tsx | 5 ++++- .../public/pages/detection_engine/rules/index.tsx | 5 ++++- 15 files changed, 39 insertions(+), 37 deletions(-) diff --git a/x-pack/legacy/plugins/siem/public/components/event_details/event_fields_browser.tsx b/x-pack/legacy/plugins/siem/public/components/event_details/event_fields_browser.tsx index 41e920643b1b9..cec8ddff1a7c9 100644 --- a/x-pack/legacy/plugins/siem/public/components/event_details/event_fields_browser.tsx +++ b/x-pack/legacy/plugins/siem/public/components/event_details/event_fields_browser.tsx @@ -33,6 +33,7 @@ export const EventFieldsBrowser = React.memo( return (
, column `render` callbacks expect complete BrowserField items={sortBy(data, ['field']).map(item => { return { ...item, diff --git a/x-pack/legacy/plugins/siem/public/components/event_details/helpers.tsx b/x-pack/legacy/plugins/siem/public/components/event_details/helpers.tsx index 49486ea032481..a4ec8ff2c4907 100644 --- a/x-pack/legacy/plugins/siem/public/components/event_details/helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/components/event_details/helpers.tsx @@ -20,17 +20,7 @@ export const search = { box: { incremental: true, placeholder: i18n.PLACEHOLDER, - schema: { - fieldId: { - type: 'string', - }, - valuesFlattened: { - type: 'string', - }, - description: { - type: 'string', - }, - }, + schema: true, }, }; diff --git a/x-pack/legacy/plugins/siem/public/components/fields_browser/category_columns.tsx b/x-pack/legacy/plugins/siem/public/components/fields_browser/category_columns.tsx index 1845a0bae88d5..a4a53a5a51435 100644 --- a/x-pack/legacy/plugins/siem/public/components/fields_browser/category_columns.tsx +++ b/x-pack/legacy/plugins/siem/public/components/fields_browser/category_columns.tsx @@ -118,7 +118,7 @@ export const getCategoryColumns = ({ name: '', sortable: true, truncateText: false, - render: (categoryId: string) => ( + render: (categoryId: string, _: { categoryId: string }) => ( onCategorySelected(categoryId)}> diff --git a/x-pack/legacy/plugins/siem/public/components/fields_browser/field_items.tsx b/x-pack/legacy/plugins/siem/public/components/fields_browser/field_items.tsx index e909a983deedb..dc902b792d601 100644 --- a/x-pack/legacy/plugins/siem/public/components/fields_browser/field_items.tsx +++ b/x-pack/legacy/plugins/siem/public/components/fields_browser/field_items.tsx @@ -170,13 +170,13 @@ export const getFieldColumns = () => [ field: 'field', name: i18n.FIELD, sortable: true, - render: (field: React.ReactNode) => <>{field}, + render: (field: React.ReactNode, _: FieldItem) => <>{field}, width: '250px', }, { field: 'description', name: i18n.DESCRIPTION, - render: (description: string) => ( + render: (description: string, _: FieldItem) => ( <>{description} diff --git a/x-pack/legacy/plugins/siem/public/components/ml/tables/anomalies_host_table.tsx b/x-pack/legacy/plugins/siem/public/components/ml/tables/anomalies_host_table.tsx index 05f9683a79c97..7afcca47a8765 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/tables/anomalies_host_table.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/tables/anomalies_host_table.tsx @@ -27,7 +27,7 @@ const sorting = { field: 'anomaly.severity', direction: 'desc', }, -}; +} as const; export const AnomaliesHostTable = React.memo( ({ startDate, endDate, narrowDateRange, hostName, skip, type }): JSX.Element | null => { @@ -71,8 +71,10 @@ export const AnomaliesHostTable = React.memo( /> type is not as specific as EUI's... columns={columns} compressed + // @ts-ignore ...which leads to `networks` not "matching" the columns items={hosts} pagination={pagination} sorting={sorting} diff --git a/x-pack/legacy/plugins/siem/public/components/ml/tables/anomalies_network_table.tsx b/x-pack/legacy/plugins/siem/public/components/ml/tables/anomalies_network_table.tsx index 24baa7505d00b..341e1c6e49235 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/tables/anomalies_network_table.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/tables/anomalies_network_table.tsx @@ -26,7 +26,7 @@ const sorting = { field: 'anomaly.severity', direction: 'desc', }, -}; +} as const; export const AnomaliesNetworkTable = React.memo( ({ startDate, endDate, narrowDateRange, skip, ip, type, flowTarget }): JSX.Element | null => { @@ -69,8 +69,10 @@ export const AnomaliesNetworkTable = React.memo( /> type is not as specific as EUI's... columns={columns} compressed + // @ts-ignore ...which leads to `networks` not "matching" the columns items={networks} pagination={pagination} sorting={sorting} diff --git a/x-pack/legacy/plugins/siem/public/components/ml/tables/basic_table.tsx b/x-pack/legacy/plugins/siem/public/components/ml/tables/basic_table.tsx index 537519e5c9d2e..9f227c1cb5bd9 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/tables/basic_table.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/tables/basic_table.tsx @@ -5,13 +5,11 @@ */ import styled from 'styled-components'; -import { EuiInMemoryTable, EuiInMemoryTableProps } from '@elastic/eui'; +import { EuiInMemoryTable } from '@elastic/eui'; -// TODO: Remove this once EuiBasicTable supports in its table props the boolean of compressed -type ExtendedInMemoryTable = EuiInMemoryTableProps & { compressed: boolean }; -const Extended: React.FunctionComponent = EuiInMemoryTable; - -export const BasicTable = styled(Extended)` +export const BasicTable: typeof EuiInMemoryTable & { displayName: string } = styled( + EuiInMemoryTable +)` tbody { th, td { @@ -22,6 +20,6 @@ export const BasicTable = styled(Extended)` display: block; } } -`; +` as any; // eslint-disable-line @typescript-eslint/no-explicit-any BasicTable.displayName = 'BasicTable'; diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/jobs_table.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/jobs_table.tsx index b15c684b1bbbe..9e2ebcb87d8fd 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/jobs_table.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/jobs_table.tsx @@ -81,7 +81,7 @@ const getJobsTableColumns = ( ), align: CENTER_ALIGNMENT, width: '80px', - }, + } as const, ]; const getPaginatedItems = (items: SiemJob[], pageIndex: number, pageSize: number): SiemJob[] => diff --git a/x-pack/legacy/plugins/siem/public/components/notes/columns.tsx b/x-pack/legacy/plugins/siem/public/components/notes/columns.tsx index 91ce947d727b8..ec23dda39dd82 100644 --- a/x-pack/legacy/plugins/siem/public/components/notes/columns.tsx +++ b/x-pack/legacy/plugins/siem/public/components/notes/columns.tsx @@ -6,7 +6,7 @@ import * as React from 'react'; import { pure } from 'recompose'; - +import { EuiTableDataType } from '@elastic/eui'; import { NoteCard } from './note_card'; import * as i18n from './translations'; @@ -21,6 +21,7 @@ interface Item { interface Column { field: string; + dataType?: EuiTableDataType; name: string; sortable: boolean; truncateText: boolean; @@ -30,6 +31,7 @@ interface Column { export const columns: Column[] = [ { field: 'note', + dataType: 'string', name: i18n.NOTE, sortable: true, truncateText: false, diff --git a/x-pack/legacy/plugins/siem/public/components/notes/helpers.tsx b/x-pack/legacy/plugins/siem/public/components/notes/helpers.tsx index f220fc1c7f790..8dc24c934efaf 100644 --- a/x-pack/legacy/plugins/siem/public/components/notes/helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/components/notes/helpers.tsx @@ -36,11 +36,9 @@ export const search = { incremental: true, placeholder: i18n.SEARCH_PLACEHOLDER, schema: { - user: { - type: 'string', - }, - note: { - type: 'string', + fields: { + user: 'string', + note: 'string', }, }, }, diff --git a/x-pack/legacy/plugins/siem/public/components/notes/index.tsx b/x-pack/legacy/plugins/siem/public/components/notes/index.tsx index 29f7686ade88b..5650acdca1f7b 100644 --- a/x-pack/legacy/plugins/siem/public/components/notes/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/notes/index.tsx @@ -34,11 +34,11 @@ const NotesPanel = styled(EuiPanel)` NotesPanel.displayName = 'NotesPanel'; -const InMemoryTable = styled(EuiInMemoryTable)` +const InMemoryTable: typeof EuiInMemoryTable & { displayName: string } = styled(EuiInMemoryTable)` overflow-x: hidden; overflow-y: auto; height: 220px; -`; +` as any; // eslint-disable-line @typescript-eslint/no-explicit-any InMemoryTable.displayName = 'InMemoryTable'; @@ -66,7 +66,6 @@ export const Notes = React.memo( data-test-subj="notes-table" items={getNotesByIds(noteIds)} columns={columns} - pagination={false} search={search} sorting={true} /> diff --git a/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.tsx b/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.tsx index 39bc75bae7ba2..766b806b7d990 100644 --- a/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiBasicTable } from '@elastic/eui'; +import { EuiBasicTable as _EuiBasicTable } from '@elastic/eui'; import * as React from 'react'; import { pure } from 'recompose'; import styled from 'styled-components'; @@ -23,6 +23,9 @@ import { getCommonColumns } from './common_columns'; import { getExtendedColumns } from './extended_columns'; import { getIconHeaderColumns } from './icon_header_columns'; +// there are a number of type mismatches across this file +const EuiBasicTable: any = _EuiBasicTable; // eslint-disable-line @typescript-eslint/no-explicit-any + const BasicTable = styled(EuiBasicTable)` .euiTableCellContent { animation: none; //Prevents applying max-height from animation diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/network_http_table/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/network_http_table/index.tsx index e5ad39b814caa..714452abdb584 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/network_http_table/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/network_http_table/index.tsx @@ -11,6 +11,7 @@ import { ActionCreator } from 'typescript-fsa'; import { networkActions } from '../../../../store/actions'; import { + Direction, NetworkHttpEdges, NetworkHttpFields, NetworkHttpSortField, @@ -83,7 +84,7 @@ const NetworkHttpTableComponent = React.memo( tableType, updates: { sort: { - direction: criteria.sort.direction, + direction: criteria.sort.direction as Direction, }, }, }); diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rule_details/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rule_details/index.tsx index da3e5fb2083dd..6715a5917ac14 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rule_details/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rule_details/index.tsx @@ -5,7 +5,7 @@ */ import { - EuiBasicTable, + EuiBasicTable as _EuiBasicTable, EuiButton, EuiButtonIcon, EuiCallOut, @@ -46,6 +46,9 @@ import { SpyRoute } from '../../../utils/route/spy_routes'; import { DetectionEngineEmptyPage } from '../detection_engine_empty_page'; import * as i18n from './translations'; +// there are a number of type mismatches across this file +const EuiBasicTable: any = _EuiBasicTable; // eslint-disable-line @typescript-eslint/no-explicit-any + // Michael: Will need to change this to get the current datetime format from Kibana settings. const dateTimeFormat = (value: string) => { return moment(value).format('M/D/YYYY, h:mm A'); diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/index.tsx index 9d2f5dc0a6c29..f58bab3370597 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/index.tsx @@ -7,7 +7,7 @@ import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; import { EuiBadge, - EuiBasicTable, + EuiBasicTable as _EuiBasicTable, EuiButton, EuiFieldSearch, EuiFlexGroup, @@ -24,6 +24,9 @@ import { import moment from 'moment'; import React, { useState } from 'react'; +// there are a number of type mismatches across this file +const EuiBasicTable: any = _EuiBasicTable; // eslint-disable-line @typescript-eslint/no-explicit-any + import { getEmptyTagValue } from '../../../components/empty_value'; import { HeaderPage } from '../../../components/header_page'; import { HeaderSection } from '../../../components/header_section'; From 355b1fda43ffcb2790c30518c1493ef56c6feb14 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 18 Nov 2019 08:54:33 -0700 Subject: [PATCH 04/11] Updated rest of x-pack for EUI table typees --- .../table_list_view/table_list_view.tsx | 6 +- .../components/shared/ManagedTable/index.tsx | 14 ++-- .../public/components/table/table.tsx | 4 +- .../components/table/table_type_configs.tsx | 2 +- .../public/pages/beat/details.tsx | 3 +- .../template_table/template_table.tsx | 8 +- .../components/nodes_overview/table.tsx | 6 +- .../analysis/sections/anomalies/table.tsx | 4 +- x-pack/legacy/plugins/infra/types/eui.d.ts | 8 -- .../ml_in_memory_table/ml_in_memory_table.tsx | 2 +- .../components/ml_in_memory_table/types.ts | 79 ++----------------- .../components/exploration/exploration.tsx | 9 +-- .../regression_exploration/results_table.tsx | 17 ++-- .../analytics_list/analytics_list.tsx | 5 +- .../components/analytics_panel/table.tsx | 6 +- .../anomaly_detection_panel/table.tsx | 4 +- .../public/components/report_listing.tsx | 9 +-- .../components/api_keys_grid_page.tsx | 5 +- .../privilege_space_table.tsx | 6 +- .../roles_grid/components/roles_grid_page.tsx | 9 +-- .../users_grid/components/users_list_page.tsx | 10 +-- .../source_index_preview.tsx | 4 +- .../components/step_define/pivot_preview.tsx | 4 +- 23 files changed, 73 insertions(+), 151 deletions(-) diff --git a/src/plugins/kibana_react/public/table_list_view/table_list_view.tsx b/src/plugins/kibana_react/public/table_list_view/table_list_view.tsx index dde8efa7e1106..bc6c2c10c603f 100644 --- a/src/plugins/kibana_react/public/table_list_view/table_list_view.tsx +++ b/src/plugins/kibana_react/public/table_list_view/table_list_view.tsx @@ -23,7 +23,6 @@ import { i18n } from '@kbn/i18n'; import { debounce, indexBy, sortBy, uniq } from 'lodash'; import { EuiTitle, - // @ts-ignore EuiInMemoryTable, EuiPage, EuiPageBody, @@ -36,6 +35,7 @@ import { EuiOverlayMask, EuiConfirmModal, EuiCallOut, + EuiBasicTableColumn, } from '@elastic/eui'; import { ToastsStart, UiSettingsClientContract } from 'kibana/public'; import { toMountPoint } from '../util'; @@ -366,7 +366,7 @@ class TableListView extends React.Component>} // EuiBasicTableColumn is stricter than Column pagination={this.pagination} loading={this.state.isFetchingItems} message={noItemsMessage} diff --git a/x-pack/legacy/plugins/apm/public/components/shared/ManagedTable/index.tsx b/x-pack/legacy/plugins/apm/public/components/shared/ManagedTable/index.tsx index 7f2632dc3d81f..cb2fdb481399f 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/ManagedTable/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/ManagedTable/index.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiBasicTable } from '@elastic/eui'; +import { EuiBasicTable, EuiBasicTableColumn } from '@elastic/eui'; import { sortByOrder } from 'lodash'; import React, { useMemo, useCallback, ReactNode } from 'react'; import { useUrlParams } from '../../../hooks/useUrlParams'; @@ -69,8 +69,8 @@ function UnoptimizedManagedTable(props: Props) { const sort = useMemo(() => { return { sort: { - field: sortField, - direction: sortDirection + field: sortField as keyof T, + direction: sortDirection as 'asc' | 'desc' } }; }, [sortField, sortDirection]); @@ -78,7 +78,7 @@ function UnoptimizedManagedTable(props: Props) { const onTableChange = useCallback( (options: { page: { index: number; size: number }; - sort: { field: string; direction: 'asc' | 'desc' }; + sort?: { field: keyof T; direction: 'asc' | 'desc' }; }) => { history.push({ ...history.location, @@ -86,8 +86,8 @@ function UnoptimizedManagedTable(props: Props) { ...toQuery(history.location.search), page: options.page.index, pageSize: options.page.size, - sortField: options.sort.field, - sortDirection: options.sort.direction + sortField: options.sort!.field, + sortDirection: options.sort!.direction }) }); }, @@ -107,7 +107,7 @@ function UnoptimizedManagedTable(props: Props) { >} // EuiBasicTableColumn is stricter than ITableColumn pagination={pagination} sorting={sort} onChange={onTableChange} diff --git a/x-pack/legacy/plugins/beats_management/public/components/table/table.tsx b/x-pack/legacy/plugins/beats_management/public/components/table/table.tsx index 8b101196d21ee..26ddd682405cb 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/table/table.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/table/table.tsx @@ -93,7 +93,7 @@ export class Table extends React.Component { }; const selectionOptions = hideTableControls - ? null + ? undefined : { onSelectionChange: this.setSelection, selectable: () => true, @@ -148,7 +148,7 @@ export class Table extends React.Component { ); } - private onTableChange = (page: { index: number; size: number } = { index: 0, size: 50 }) => { + private onTableChange = ({ page }: { page: { index: number; size: number } }) => { if (this.props.onTableChange) { this.props.onTableChange(page.index, page.size); } diff --git a/x-pack/legacy/plugins/beats_management/public/components/table/table_type_configs.tsx b/x-pack/legacy/plugins/beats_management/public/components/table/table_type_configs.tsx index 6f03f884563e1..6fff7574c39e6 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/table/table_type_configs.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/table/table_type_configs.tsx @@ -14,7 +14,7 @@ import { ConnectedLink } from '../navigation/connected_link'; import { TagBadge } from '../tag'; export interface ColumnDefinition { - align?: string; + align?: 'left' | 'right' | 'center' | undefined; field: string; name: string; sortable?: boolean; diff --git a/x-pack/legacy/plugins/beats_management/public/pages/beat/details.tsx b/x-pack/legacy/plugins/beats_management/public/pages/beat/details.tsx index 9b3707b1661f4..9d8a3f1030959 100644 --- a/x-pack/legacy/plugins/beats_management/public/pages/beat/details.tsx +++ b/x-pack/legacy/plugins/beats_management/public/pages/beat/details.tsx @@ -13,6 +13,7 @@ import { EuiSpacer, EuiText, EuiTitle, + EuiBasicTableColumn, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; @@ -98,7 +99,7 @@ class BeatDetailPageUi extends React.PureComponent { ), })); - const columns = [ + const columns: Array> = [ { field: 'displayValue', name: intl.formatMessage({ diff --git a/x-pack/legacy/plugins/index_management/public/app/sections/home/template_list/template_table/template_table.tsx b/x-pack/legacy/plugins/index_management/public/app/sections/home/template_list/template_table/template_table.tsx index 2faae50bdb489..6070b25fb1ca2 100644 --- a/x-pack/legacy/plugins/index_management/public/app/sections/home/template_list/template_table/template_table.tsx +++ b/x-pack/legacy/plugins/index_management/public/app/sections/home/template_list/template_table/template_table.tsx @@ -7,7 +7,7 @@ import React, { useState, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiInMemoryTable, EuiIcon, EuiButton, EuiLink } from '@elastic/eui'; +import { EuiInMemoryTable, EuiIcon, EuiButton, EuiLink, EuiBasicTableColumn } from '@elastic/eui'; import { TemplateListItem, Template } from '../../../../../../common/types'; import { BASE_PATH, UIM_TEMPLATE_SHOW_DETAILS_CLICK } from '../../../../../../common/constants'; import { TemplateDeleteModal } from '../../../../components'; @@ -31,7 +31,7 @@ export const TemplateTable: React.FunctionComponent = ({ const [selection, setSelection] = useState([]); const [templatesToDelete, setTemplatesToDelete] = useState>([]); - const columns = [ + const columns: Array> = [ { field: 'name', name: i18n.translate('xpack.idxMgmt.templateList.table.nameColumnTitle', { @@ -138,6 +138,7 @@ export const TemplateTable: React.FunctionComponent = ({ enabled: ({ isManaged }: Template) => !isManaged, }, { + type: 'icon', name: i18n.translate('xpack.idxMgmt.templateList.table.actionCloneTitle', { defaultMessage: 'Clone', }), @@ -179,7 +180,7 @@ export const TemplateTable: React.FunctionComponent = ({ field: 'name', direction: 'asc', }, - }; + } as const; const selectionConfig = { onSelectionChange: setSelection, @@ -190,6 +191,7 @@ export const TemplateTable: React.FunctionComponent = ({ defaultMessage: 'You cannot delete a managed template.', }); } + return ''; }, }; diff --git a/x-pack/legacy/plugins/infra/public/components/nodes_overview/table.tsx b/x-pack/legacy/plugins/infra/public/components/nodes_overview/table.tsx index 5b201d2be4333..9c342500bf1a1 100644 --- a/x-pack/legacy/plugins/infra/public/components/nodes_overview/table.tsx +++ b/x-pack/legacy/plugins/infra/public/components/nodes_overview/table.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiButtonEmpty, EuiInMemoryTable, EuiToolTip } from '@elastic/eui'; +import { EuiButtonEmpty, EuiInMemoryTable, EuiToolTip, EuiBasicTableColumn } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { last } from 'lodash'; @@ -50,7 +50,7 @@ export const TableView = class extends React.PureComponent { public readonly state: State = initialState; public render() { const { nodes, options, formatter, timeRange, nodeType } = this.props; - const columns = [ + const columns: Array> = [ { field: 'name', name: i18n.translate('xpack.infra.tableView.columnName.name', { defaultMessage: 'Name' }), @@ -144,7 +144,7 @@ export const TableView = class extends React.PureComponent { field: 'value', direction: 'desc', }, - }; + } as const; return ( ; - type EuiErrorBoundaryProps = CommonProps & { - children: React.ReactNode; - }; - type EuiSizesResponsive = 'xs' | 's' | 'm' | 'l' | 'xl'; type EuiResponsiveProps = CommonProps & { children: React.ReactNode; sizes: EuiSizesResponsive[]; }; - - export const EuiHideFor: React.SFC; - - export const EuiShowFor: React.SFC; } diff --git a/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/ml_in_memory_table.tsx b/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/ml_in_memory_table.tsx index d5316b22a6a6f..48c0f62b0eeb7 100644 --- a/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/ml_in_memory_table.tsx +++ b/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/ml_in_memory_table.tsx @@ -73,7 +73,7 @@ const getInitialSorting = (columns: any, sorting: any) => { import { MlInMemoryTableBasic } from './types'; -export class MlInMemoryTable extends MlInMemoryTableBasic { +export class MlInMemoryTable extends MlInMemoryTableBasic { static getDerivedStateFromProps(nextProps: any, prevState: any) { const derivedState = { ...prevState.prevProps, diff --git a/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/types.ts b/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/types.ts index 461f773d87d6e..c55ed7e580e2a 100644 --- a/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/types.ts +++ b/x-pack/legacy/plugins/ml/public/components/ml_in_memory_table/types.ts @@ -4,8 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Component, ReactNode } from 'react'; - import { EuiInMemoryTable, Direction, @@ -14,9 +12,6 @@ import { EuiTableFieldDataColumnType, } from '@elastic/eui'; -// At some point this could maybe solved with a generic . -type Item = any; - export type FieldDataColumnType = EuiTableFieldDataColumnType; export type ComputedColumnType = EuiTableComputedColumnType; @@ -27,62 +22,11 @@ export interface ExpanderColumnType extends ComputedColumnType { export type ActionsColumnType = EuiTableActionsColumnType; -export type ColumnType = - | ActionsColumnType - | ComputedColumnType - | ExpanderColumnType - | FieldDataColumnType; - -type QueryType = any; - -interface Schema { - strict?: boolean; - fields?: Record; - flags?: string[]; -} - -interface SearchBoxConfigPropTypes { - placeholder?: string; - incremental?: boolean; - schema?: Schema; -} - -interface Box { - placeholder?: string; - incremental?: boolean; - // here we enable the user to just assign 'true' to the schema, in which case - // we will auto-generate it out of the columns configuration - schema?: boolean | SearchBoxConfigPropTypes['schema']; -} - -type SearchFiltersFiltersType = any; - -interface ExecuteQueryOptions { - defaultFields: string[]; - isClauseMatcher: () => void; - explain: boolean; -} - -type SearchType = - | boolean - | { - toolsLeft?: ReactNode; - toolsRight?: ReactNode; - defaultQuery?: QueryType; - box?: Box; - filters?: SearchFiltersFiltersType; - onChange?: (arg: any) => void; - executeQueryOptions?: ExecuteQueryOptions; - }; - -interface PageSizeOptions { - pageSizeOptions: number[]; -} -interface InitialPageOptions extends PageSizeOptions { - initialPageIndex: number; - initialPageSize: number; -} -type PaginationProp = boolean | PageSizeOptions | InitialPageOptions; +export type ColumnType = + | ActionsColumnType + | ComputedColumnType + | ExpanderColumnType + | FieldDataColumnType; export enum SORT_DIRECTION { ASC = 'asc', @@ -102,19 +46,8 @@ export type SortingPropType = sort: SortFields; }; -type SelectionType = any; - export interface OnTableChangeArg extends Sorting { page?: { index: number; size: number }; } -type ItemIdTypeFunc = (item: Item) => string; -type ItemIdType = - | string // the name of the item id property - | ItemIdTypeFunc; - -interface ComponentWithConstructor extends Component { - new (): Component; -} - -export const MlInMemoryTableBasic: typeof EuiInMemoryTable = EuiInMemoryTable; +export const MlInMemoryTableBasic = EuiInMemoryTable; diff --git a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/exploration/exploration.tsx b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/exploration/exploration.tsx index 11bb62dec1624..fba73e30e7a86 100644 --- a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/exploration/exploration.tsx +++ b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/exploration/exploration.tsx @@ -48,7 +48,6 @@ import { toggleSelectedField, DataFrameAnalyticsConfig, EsFieldName, - EsDoc, MAX_COLUMNS, INDEX_STATUS, } from '../../../../common'; @@ -169,7 +168,7 @@ export const Exploration: FC = React.memo(({ jobId, jobStatus }) => { docFieldsCount = docFields.length; } - const columns: ColumnType[] = []; + const columns: Array> = []; if (jobConfig !== undefined && selectedFields.length > 0 && tableItems.length > 0) { // table cell color coding takes into account: @@ -190,14 +189,14 @@ export const Exploration: FC = React.memo(({ jobId, jobStatus }) => { columns.push( ...selectedFields.sort(sortColumns(tableItems[0], jobConfig.dest.results_field)).map(k => { - const column: ColumnType = { + const column: ColumnType = { field: k, name: k, sortable: true, truncateText: true, }; - const render = (d: any, fullItem: EsDoc) => { + const render = (d: any, fullItem: typeof tableItems[number]) => { if (Array.isArray(d) && d.every(item => typeof item === 'string')) { // If the cells data is an array of strings, return as a comma separated list. // The list will get limited to 5 items with `…` at the end if there's more in the original array. @@ -345,7 +344,7 @@ export const Exploration: FC = React.memo(({ jobId, jobStatus }) => { if (sort.field !== sortField || sort.direction !== sortDirection) { setClearTable(true); - loadExploreData(sort); + loadExploreData(sort as { field: string; direction: SORT_DIRECTION }); } }; } diff --git a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx index 5ba3b8ed45939..325cc3a350617 100644 --- a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx +++ b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx @@ -26,6 +26,7 @@ import { Query, } from '@elastic/eui'; +import { EuiInMemoryTableProps } from '@elastic/eui/src/components/basic_table/in_memory_table'; import { Query as QueryType } from '../../../analytics_management/components/analytics_list/common'; import { @@ -34,6 +35,7 @@ import { OnTableChangeArg, SortingPropType, SORT_DIRECTION, + SortDirection, } from '../../../../../components/ml_in_memory_table'; import { formatHumanReadableDateTimeSeconds } from '../../../../../util/date_utils'; @@ -45,7 +47,6 @@ import { toggleSelectedField, DataFrameAnalyticsConfig, EsFieldName, - EsDoc, MAX_COLUMNS, getPredictedFieldName, INDEX_STATUS, @@ -105,19 +106,19 @@ export const ResultsTable: FC = React.memo(({ jobConfig, jobStatus }) => docFieldsCount = docFields.length; } - const columns: ColumnType[] = []; + const columns: Array> = []; if (jobConfig !== undefined && selectedFields.length > 0 && tableItems.length > 0) { columns.push( ...selectedFields.sort(sortRegressionResultsColumns(tableItems[0], jobConfig)).map(k => { - const column: ColumnType = { + const column: ColumnType = { field: k, name: k, sortable: true, truncateText: true, }; - const render = (d: any, fullItem: EsDoc) => { + const render = (d: any, fullItem: typeof tableItems[number]) => { if (Array.isArray(d) && d.every(item => typeof item === 'string')) { // If the cells data is an array of strings, return as a comma separated list. // The list will get limited to 5 items with `…` at the end if there's more in the original array. @@ -257,7 +258,11 @@ export const ResultsTable: FC = React.memo(({ jobConfig, jobStatus }) => setPageSize(size); if (sort.field !== sortField || sort.direction !== sortDirection) { - loadExploreData({ ...sort, searchQuery }); + loadExploreData({ + field: sort.field, + direction: sort.direction as SortDirection, + searchQuery, + }); } }; } @@ -285,7 +290,7 @@ export const ResultsTable: FC = React.memo(({ jobConfig, jobStatus }) => } }; - const search = { + const search: EuiInMemoryTableProps['search'] = { onChange: onQueryChange, defaultQuery: searchString, box: { diff --git a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx index 6de278cda16e6..0b4eecbddd212 100644 --- a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx +++ b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx @@ -15,6 +15,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer, + EuiInMemoryTableProps, } from '@elastic/eui'; import { DataFrameAnalyticsId, useRefreshAnalyticsList } from '../../../../common'; @@ -271,7 +272,7 @@ export const DataFrameAnalyticsList: FC = ({ hidePerPageOptions: false, }; - const search = { + const search: EuiInMemoryTableProps['search'] = { onChange: onQueryChange, box: { incremental: true, @@ -323,7 +324,7 @@ export const DataFrameAnalyticsList: FC = ({ const { field, direction } = sort; setSortField(field); - setSortDirection(direction); + setSortDirection(direction as SORT_DIRECTION); }; return ( diff --git a/x-pack/legacy/plugins/ml/public/overview/components/analytics_panel/table.tsx b/x-pack/legacy/plugins/ml/public/overview/components/analytics_panel/table.tsx index 7ee9cff107db8..06e7125b7ee1b 100644 --- a/x-pack/legacy/plugins/ml/public/overview/components/analytics_panel/table.tsx +++ b/x-pack/legacy/plugins/ml/public/overview/components/analytics_panel/table.tsx @@ -37,7 +37,7 @@ export const AnalyticsTable: FC = ({ items }) => { const [sortDirection, setSortDirection] = useState(SORT_DIRECTION.ASC); // id, type, status, progress, created time, view icon - const columns: ColumnType[] = [ + const columns: Array> = [ { field: DataFrameAnalyticsListColumn.id, name: i18n.translate('xpack.ml.overview.analyticsList.id', { defaultMessage: 'ID' }), @@ -95,7 +95,7 @@ export const AnalyticsTable: FC = ({ items }) => { const { field, direction } = sort; setSortField(field); - setSortDirection(direction); + setSortDirection(direction as SORT_DIRECTION); }; const pagination = { @@ -121,7 +121,7 @@ export const AnalyticsTable: FC = ({ items }) => { hasActions={false} isExpandable={false} isSelectable={false} - items={items} + items={items as DataFrameAnalyticsListRow[]} itemId={DataFrameAnalyticsListColumn.id} onTableChange={onTableChange} pagination={pagination} diff --git a/x-pack/legacy/plugins/ml/public/overview/components/anomaly_detection_panel/table.tsx b/x-pack/legacy/plugins/ml/public/overview/components/anomaly_detection_panel/table.tsx index c61d5889e9243..66e815e2ee839 100644 --- a/x-pack/legacy/plugins/ml/public/overview/components/anomaly_detection_panel/table.tsx +++ b/x-pack/legacy/plugins/ml/public/overview/components/anomaly_detection_panel/table.tsx @@ -60,7 +60,7 @@ export const AnomalyDetectionTable: FC = ({ items, jobsList, statsBarData const [sortDirection, setSortDirection] = useState(SORT_DIRECTION.ASC); // columns: group, max anomaly, jobs in group, latest timestamp, docs processed, action to explorer - const columns: ColumnType[] = [ + const columns: Array> = [ { field: AnomalyDetectionListColumns.id, name: i18n.translate('xpack.ml.overview.anomalyDetection.tableId', { @@ -178,7 +178,7 @@ export const AnomalyDetectionTable: FC = ({ items, jobsList, statsBarData const { field, direction } = sort; setSortField(field); - setSortDirection(direction); + setSortDirection(direction as SORT_DIRECTION); }; const pagination = { diff --git a/x-pack/legacy/plugins/reporting/public/components/report_listing.tsx b/x-pack/legacy/plugins/reporting/public/components/report_listing.tsx index 1a75b65f70eb4..9783372aa29c4 100644 --- a/x-pack/legacy/plugins/reporting/public/components/report_listing.tsx +++ b/x-pack/legacy/plugins/reporting/public/components/report_listing.tsx @@ -4,11 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -// TODO: Remove once typescript definitions are in EUI -declare module '@elastic/eui' { - export const EuiBasicTable: React.SFC; -} - import { i18n } from '@kbn/i18n'; import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; import moment from 'moment'; @@ -17,7 +12,7 @@ import React, { Component } from 'react'; import chrome from 'ui/chrome'; import { toastNotifications } from 'ui/notify'; import { - EuiBasicTable as EuiBasicTableTyped, + EuiBasicTable, EuiButtonIcon, EuiPageContent, EuiSpacer, @@ -297,7 +292,7 @@ class ReportListingUi extends Component { }; return ( - { field: 'expiration', direction: 'asc', }, - }; + } as const; const pagination = { initialPageSize: 20, @@ -206,7 +207,7 @@ export class ApiKeysGridPage extends Component { }, }; - const search = { + const search: EuiInMemoryTableProps['search'] = { toolsLeft: selectedItems.length ? ( {invalidateApiKeyPrompt => { diff --git a/x-pack/legacy/plugins/security/public/views/management/edit_role/components/privileges/kibana/space_aware_privilege_section/privilege_space_table.tsx b/x-pack/legacy/plugins/security/public/views/management/edit_role/components/privileges/kibana/space_aware_privilege_section/privilege_space_table.tsx index 3c49e5717ba42..e54b5ff9c45da 100644 --- a/x-pack/legacy/plugins/security/public/views/management/edit_role/components/privileges/kibana/space_aware_privilege_section/privilege_space_table.tsx +++ b/x-pack/legacy/plugins/security/public/views/management/edit_role/components/privileges/kibana/space_aware_privilege_section/privilege_space_table.tsx @@ -8,8 +8,8 @@ import { EuiBadgeProps, EuiButtonEmpty, EuiButtonIcon, - // @ts-ignore EuiInMemoryTable, + EuiBasicTableColumn, } from '@elastic/eui'; import { FormattedMessage, InjectedIntl } from '@kbn/i18n/react'; import _ from 'lodash'; @@ -113,7 +113,7 @@ export class PrivilegeSpaceTable extends Component { return {}; }; - const columns: Record = [ + const columns: Array> = [ { field: 'spaces', name: 'Spaces', @@ -274,12 +274,10 @@ export class PrivilegeSpaceTable extends Component { } return ( - // @ts-ignore missing rowProps from typedef { return { className: isGlobalPrivilegeDefinition(item.privileges) diff --git a/x-pack/legacy/plugins/security/public/views/management/roles_grid/components/roles_grid_page.tsx b/x-pack/legacy/plugins/security/public/views/management/roles_grid/components/roles_grid_page.tsx index d0645f85946db..2083a93f4b33c 100644 --- a/x-pack/legacy/plugins/security/public/views/management/roles_grid/components/roles_grid_page.tsx +++ b/x-pack/legacy/plugins/security/public/views/management/roles_grid/components/roles_grid_page.tsx @@ -16,6 +16,7 @@ import { EuiText, EuiTitle, EuiButtonIcon, + EuiBasicTableColumn, } from '@elastic/eui'; import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; import _ from 'lodash'; @@ -108,17 +109,14 @@ class RolesGridPageUI extends Component { ) : null} { - // @ts-ignore missing rowProps typedef !role.metadata || !role.metadata._reserved, - selectableMessage: (selectable: boolean) => - !selectable ? 'Role is reserved' : undefined, + selectableMessage: (selectable: boolean) => (!selectable ? 'Role is reserved' : ''), onSelectionChange: (selection: Role[]) => this.setState({ selection }), }} pagination={{ @@ -144,7 +142,6 @@ class RolesGridPageUI extends Component { direction: 'asc', }, }} - // @ts-ignore missing rowProps typedef rowProps={() => { return { 'data-test-subj': 'roleRow', @@ -271,7 +268,7 @@ class RolesGridPageUI extends Component { }, ], }, - ]; + ] as Array>; }; private getVisibleRoles = () => { diff --git a/x-pack/legacy/plugins/security/public/views/management/users_grid/components/users_list_page.tsx b/x-pack/legacy/plugins/security/public/views/management/users_grid/components/users_list_page.tsx index 651b073cb114e..df8522e5f32f9 100644 --- a/x-pack/legacy/plugins/security/public/views/management/users_grid/components/users_list_page.tsx +++ b/x-pack/legacy/plugins/security/public/views/management/users_grid/components/users_list_page.tsx @@ -17,6 +17,7 @@ import { EuiPageContentHeaderSection, EuiPageContentBody, EuiEmptyPrompt, + EuiBasicTableColumn, } from '@elastic/eui'; import { toastNotifications } from 'ui/notify'; import { injectI18n, FormattedMessage, InjectedIntl } from '@kbn/i18n/react'; @@ -84,7 +85,7 @@ class UsersListPageUI extends Component { ); } const path = '#/management/security/'; - const columns = [ + const columns: Array> = [ { field: 'full_name', name: intl.formatMessage({ @@ -169,8 +170,7 @@ class UsersListPageUI extends Component { const selectionConfig = { itemId: 'username', selectable: (user: User) => !(user.metadata && user.metadata._reserved), - selectableMessage: (selectable: boolean) => - !selectable ? 'User is a system user' : undefined, + selectableMessage: (selectable: boolean) => (!selectable ? 'User is a system user' : ''), onSelectionChange: (updatedSelection: User[]) => this.setState({ selection: updatedSelection }), }; @@ -190,7 +190,7 @@ class UsersListPageUI extends Component { field: 'full_name', direction: 'asc', }, - }; + } as const; const rowProps = () => { return { 'data-test-subj': 'userRow', @@ -237,7 +237,6 @@ class UsersListPageUI extends Component { ) : null} { - // @ts-ignore missing responsive from typedef { loading={users.length === 0} search={search} sorting={sorting} - // @ts-ignore missing responsive from typedef rowProps={rowProps} isSelectable /> diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/source_index_preview.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/source_index_preview.tsx index 8c870cc83636d..b9b891bf8a64d 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/source_index_preview.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/source_index_preview.tsx @@ -183,8 +183,8 @@ export const SourceIndexPreview: React.SFC = React.memo(({ cellClick, que docFieldsCount = docFields.length; } - const columns: ColumnType[] = selectedFields.map(k => { - const column: ColumnType = { + const columns: Array> = selectedFields.map(k => { + const column: ColumnType = { field: `_source["${k}"]`, name: k, sortable: true, diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/pivot_preview.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/pivot_preview.tsx index 681a0f7e6ba3f..6a19aefc84b12 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/pivot_preview.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/pivot_preview.tsx @@ -210,7 +210,7 @@ export const PivotPreview: SFC = React.memo(({ aggs, groupBy, columnKeys.sort(sortColumns(groupByArr)); const columns = columnKeys.map(k => { - const column: ColumnType = { + const column: ColumnType = { field: k, name: k, sortable: true, @@ -251,7 +251,7 @@ export const PivotPreview: SFC = React.memo(({ aggs, groupBy, const sorting = { sort: { - field: columns[0].field, + field: columns[0].field as string, direction: SORT_DIRECTION.ASC, }, }; From 0b5c331c8498c6bb472bab81fc310733fa2605bd Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 18 Nov 2019 10:48:49 -0700 Subject: [PATCH 05/11] updated x-pack changes against master --- .../public/pages/logs/analysis/sections/anomalies/table.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/infra/public/pages/logs/analysis/sections/anomalies/table.tsx b/x-pack/legacy/plugins/infra/public/pages/logs/analysis/sections/anomalies/table.tsx index d0837228c3863..b2f9047753c03 100644 --- a/x-pack/legacy/plugins/infra/public/pages/logs/analysis/sections/anomalies/table.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/logs/analysis/sections/anomalies/table.tsx @@ -168,8 +168,8 @@ export const AnomaliesTable: React.FunctionComponent<{ ); }; -const StyledEuiBasicTable = euiStyled(EuiBasicTable)` +const StyledEuiBasicTable: typeof EuiBasicTable = euiStyled(EuiBasicTable)` & .euiTable { table-layout: auto; } -`; +` as any; // eslint-disable-line @typescript-eslint/no-explicit-any From 205d7b4fc3ad7ee4dedbe6036302696e21f9eca6 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Tue, 10 Dec 2019 12:48:42 -0700 Subject: [PATCH 06/11] Update to published eui 17.1.0 --- package.json | 2 +- .../plugins/kbn_tp_run_pipeline/package.json | 2 +- .../plugins/kbn_tp_custom_visualizations/package.json | 2 +- .../plugins/kbn_tp_embeddable_explorer/package.json | 2 +- .../plugins/kbn_tp_sample_panel_action/package.json | 2 +- .../application/components/job_messages/job_messages.tsx | 5 ++--- x-pack/package.json | 2 +- yarn.lock | 8 ++++---- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 8ccb138a3aced..fff85dfaf7c91 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "@elastic/charts": "^14.0.0", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "1.0.5", - "@elastic/eui": "17.0.0", + "@elastic/eui": "17.1.0", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.3.3", diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index ae4fa1578fb2b..fbfa599edc872 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "17.0.0", + "@elastic/eui": "17.1.0", "react": "^16.12.0", "react-dom": "^16.12.0" } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index 32da6eade2b42..5361ac1b78111 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "17.0.0", + "@elastic/eui": "17.1.0", "react": "^16.12.0" } } diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json index 0ab65667d6f82..0ceaad841ea6b 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "17.0.0", + "@elastic/eui": "17.1.0", "react": "^16.12.0" }, "scripts": { diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json index 6f661ab2a79e1..f8db08b0b064e 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "17.0.0", + "@elastic/eui": "17.1.0", "react": "^16.12.0" }, "scripts": { diff --git a/x-pack/legacy/plugins/ml/public/application/components/job_messages/job_messages.tsx b/x-pack/legacy/plugins/ml/public/application/components/job_messages/job_messages.tsx index 5fb3ab95e4ea0..9cea47ded09b4 100644 --- a/x-pack/legacy/plugins/ml/public/application/components/job_messages/job_messages.tsx +++ b/x-pack/legacy/plugins/ml/public/application/components/job_messages/job_messages.tsx @@ -61,8 +61,8 @@ export const JobMessages: FC = ({ messages, loading, error }) const defaultSorting = { sort: { - field: 'timestamp', - direction: 'asc', + field: 'timestamp' as const, + direction: 'asc' as const, }, }; @@ -74,7 +74,6 @@ export const JobMessages: FC = ({ messages, loading, error }) items={messages} columns={columns} sorting={defaultSorting} - // @ts-ignore compressed={true} loading={loading} error={error} diff --git a/x-pack/package.json b/x-pack/package.json index a92839eadefa4..35eb45dc78dbd 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -176,7 +176,7 @@ "@babel/runtime": "^7.5.5", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "1.0.5", - "@elastic/eui": "17.0.0", + "@elastic/eui": "17.1.0", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.1.0", "@elastic/node-crypto": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index cfef1bec7e6a0..07a8aaa38281e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1226,10 +1226,10 @@ tabbable "^1.1.0" uuid "^3.1.0" -"@elastic/eui@17.0.0": - version "17.0.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-17.0.0.tgz#2b53500b9f4849fdf58f88ea89e10a0b58836acc" - integrity sha512-bWTVKbChPGh7AHLxW1o9yp7O3hL9lTVj69DVaaLBOz9K0JnDrWZ5VDvWL9AAguFWq9OEMY9oWjyBhQZr1ZeZbA== +"@elastic/eui@17.1.0": + version "17.1.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-17.1.0.tgz#ad747d944f46fd131d184dbb3f7ae183a3f37859" + integrity sha512-5XBlxLfBrkQauFDE9N94PK21E/AP3UWxIs/ww0TbRb6PNRNxLGwKfdHPZb3tDA8It3Ksd6OfDz4d5+0ASQ5GIQ== dependencies: "@types/lodash" "^4.14.116" "@types/numeral" "^0.0.25" From a3e4dd60935e5d5c5860c540c0796f6a5a73044d Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Thu, 12 Dec 2019 10:47:53 -0700 Subject: [PATCH 07/11] kibana snapshots --- package.json | 2 +- .../flyout_service.test.tsx.snap | 4 +- .../__snapshots__/modal_service.test.tsx.snap | 2 +- .../dashboard_empty_screen.test.tsx.snap | 8 +++ .../__snapshots__/no_results.test.js.snap | 4 ++ .../saved_objects_installer.test.js.snap | 5 +- .../__jest__/__snapshots__/table.test.js.snap | 3 +- .../__jest__/__snapshots__/table.test.js.snap | 1 - .../__jest__/__snapshots__/table.test.js.snap | 1 - .../__snapshots__/objects_table.test.js.snap | 1 - .../__snapshots__/flyout.test.js.snap | 4 -- .../__snapshots__/relationships.test.js.snap | 8 --- .../__snapshots__/new_vis_modal.test.tsx.snap | 72 ++++++++++++++----- .../visualization_noresults.test.js.snap | 1 + .../visualization_requesterror.test.js.snap | 1 + .../shard_failure_table.test.tsx.snap | 1 - .../__snapshots__/field_name.test.tsx.snap | 6 ++ .../exit_full_screen_button.test.js.snap | 2 + .../vislib_vis_legend.test.tsx.snap | 4 +- .../inspector_panel.test.tsx.snap | 6 +- .../exit_full_screen_button.test.tsx.snap | 4 ++ .../plugins/kbn_tp_run_pipeline/package.json | 2 +- .../kbn_tp_custom_visualizations/package.json | 2 +- .../kbn_tp_embeddable_explorer/package.json | 2 +- .../kbn_tp_sample_panel_action/package.json | 2 +- x-pack/package.json | 2 +- yarn.lock | 8 +-- 27 files changed, 107 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index fff85dfaf7c91..5d5460a2051cc 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "@elastic/charts": "^14.0.0", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "1.0.5", - "@elastic/eui": "17.1.0", + "@elastic/eui": "17.1.2", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.3.3", diff --git a/src/core/public/overlays/flyout/__snapshots__/flyout_service.test.tsx.snap b/src/core/public/overlays/flyout/__snapshots__/flyout_service.test.tsx.snap index 626c91b6a9668..9bd686776138f 100644 --- a/src/core/public/overlays/flyout/__snapshots__/flyout_service.test.tsx.snap +++ b/src/core/public/overlays/flyout/__snapshots__/flyout_service.test.tsx.snap @@ -31,7 +31,7 @@ Array [ ] `; -exports[`FlyoutService openFlyout() renders a flyout to the DOM 2`] = `"
Flyout content
"`; +exports[`FlyoutService openFlyout() renders a flyout to the DOM 2`] = `"
Flyout content
"`; exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 1`] = ` Array [ @@ -74,4 +74,4 @@ Array [ ] `; -exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 2`] = `"
Flyout content 2
"`; +exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 2`] = `"
Flyout content 2
"`; diff --git a/src/core/public/overlays/modal/__snapshots__/modal_service.test.tsx.snap b/src/core/public/overlays/modal/__snapshots__/modal_service.test.tsx.snap index 3928c54f90179..131ec836f5252 100644 --- a/src/core/public/overlays/modal/__snapshots__/modal_service.test.tsx.snap +++ b/src/core/public/overlays/modal/__snapshots__/modal_service.test.tsx.snap @@ -29,7 +29,7 @@ Array [ ] `; -exports[`ModalService openModal() renders a modal to the DOM 2`] = `"
Modal content
"`; +exports[`ModalService openModal() renders a modal to the DOM 2`] = `"
Modal content
"`; exports[`ModalService openModal() with a currently active modal replaces the current modal with a new one 1`] = ` Array [ diff --git a/src/legacy/core_plugins/kibana/public/dashboard/__tests__/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/legacy/core_plugins/kibana/public/dashboard/__tests__/__snapshots__/dashboard_empty_screen.test.tsx.snap index 8410040a0100d..6edda5118b1f0 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/__tests__/__snapshots__/dashboard_empty_screen.test.tsx.snap +++ b/src/legacy/core_plugins/kibana/public/dashboard/__tests__/__snapshots__/dashboard_empty_screen.test.tsx.snap @@ -230,14 +230,18 @@ exports[`DashboardEmptyScreen renders correctly with visualize paragraph 1`] = ` type="dashboardApp" > + diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/components/table/__jest__/__snapshots__/table.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/components/table/__jest__/__snapshots__/table.test.js.snap index ca04ac8fcfaab..f758511990d6f 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/components/table/__jest__/__snapshots__/table.test.js.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/components/table/__jest__/__snapshots__/table.test.js.snap @@ -93,7 +93,6 @@ exports[`Table should render normally 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { @@ -136,9 +135,11 @@ exports[`Table should render the boolean template (false) 1`] = ``; exports[`Table should render the boolean template (true) 1`] = ` `; diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/table/__jest__/__snapshots__/table.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/table/__jest__/__snapshots__/table.test.js.snap index f2a55649fe4d7..4716fb8f77633 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/table/__jest__/__snapshots__/table.test.js.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/table/__jest__/__snapshots__/table.test.js.snap @@ -55,7 +55,6 @@ exports[`Table should render normally 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/table/__jest__/__snapshots__/table.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/table/__jest__/__snapshots__/table.test.js.snap index 415bae7389e97..7856572373e79 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/table/__jest__/__snapshots__/table.test.js.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/table/__jest__/__snapshots__/table.test.js.snap @@ -78,7 +78,6 @@ exports[`Table should render normally 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/__jest__/__snapshots__/objects_table.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/__jest__/__snapshots__/objects_table.test.js.snap index 843c8207c88c3..731a3379491c1 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/__jest__/__snapshots__/objects_table.test.js.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/__jest__/__snapshots__/objects_table.test.js.snap @@ -54,7 +54,6 @@ exports[`ObjectsTable delete should show a confirm modal 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { diff --git a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__jest__/__snapshots__/flyout.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__jest__/__snapshots__/flyout.test.js.snap index a9175e7b2a63e..ace06e0420a7c 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__jest__/__snapshots__/flyout.test.js.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/__jest__/__snapshots__/flyout.test.js.snap @@ -90,7 +90,6 @@ exports[`Flyout conflicts should allow conflict resolution 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { @@ -116,7 +115,6 @@ exports[`Flyout conflicts should allow conflict resolution 1`] = ` } } responsive={true} - sorting={false} /> @@ -411,7 +409,6 @@ exports[`Flyout legacy conflicts should allow conflict resolution 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { @@ -448,7 +445,6 @@ exports[`Flyout legacy conflicts should allow conflict resolution 1`] = ` } } responsive={true} - sorting={false} /> diff --git a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__jest__/__snapshots__/relationships.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__jest__/__snapshots__/relationships.test.js.snap index 6060e96f3cfb6..941a0ffded820 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__jest__/__snapshots__/relationships.test.js.snap +++ b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/__jest__/__snapshots__/relationships.test.js.snap @@ -83,7 +83,6 @@ exports[`Relationships should render dashboards normally 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { @@ -155,7 +154,6 @@ exports[`Relationships should render dashboards normally 1`] = ` ], } } - sorting={false} />
@@ -294,7 +292,6 @@ exports[`Relationships should render index patterns normally 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { @@ -371,7 +368,6 @@ exports[`Relationships should render index patterns normally 1`] = ` ], } } - sorting={false} /> @@ -461,7 +457,6 @@ exports[`Relationships should render searches normally 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { @@ -538,7 +533,6 @@ exports[`Relationships should render searches normally 1`] = ` ], } } - sorting={false} /> @@ -628,7 +622,6 @@ exports[`Relationships should render visualizations normally 1`] = ` }, ] } - executeQueryOptions={Object {}} items={ Array [ Object { @@ -700,7 +693,6 @@ exports[`Relationships should render visualizations normally 1`] = ` ], } } - sorting={false} /> diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap b/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap index 04b7cddc75289..e436d2fd4befd 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/__snapshots__/new_vis_modal.test.tsx.snap @@ -169,6 +169,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -226,6 +227,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -268,6 +270,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -304,6 +307,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -437,6 +441,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -494,6 +499,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -536,6 +542,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -572,6 +579,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -644,6 +652,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -701,6 +710,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -743,6 +753,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -779,6 +790,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading" focusable="false" height="16" + role="img" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" @@ -860,16 +872,18 @@ exports[`NewVisModal filter for visualization types should render as expected 1` type="cross" >