From 4c45ff35192b31246cd15a80238d3f2ed7c96186 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Fri, 20 Mar 2020 14:07:04 -0600 Subject: [PATCH 1/2] Upgrade EUI to 21.0.1 (#60282) * update to eui 21.0.1 * most changes needed for search bar ts changes * Passing types * snapshots * jest tests * Removed IQuery placeholder types * Updated functional test to only look at table headers with content * Moved 'filters' definition around in api docs * Update types * update snapshot * typo * Move DATA_FRAME_TASK_STATE enum to its own file to fix x-pack functional test config imports * merge public api 'changes' Co-authored-by: patrykkopycinski Co-authored-by: Patryk Kopycinski --- ...na-plugin-plugins-data-public.filterbar.md | 2 +- ...na-plugin-plugins-data-public.searchbar.md | 4 +- package.json | 2 +- packages/kbn-ui-shared-deps/package.json | 2 +- .../__snapshots__/agg.test.tsx.snap | 1 + .../value_axes_panel.test.tsx.snap | 2 + .../value_axis_options.test.tsx.snap | 1 + .../management_app/advanced_settings.tsx | 15 +- .../components/search/search.tsx | 19 +- .../public/management_app/types.ts | 6 - src/plugins/data/public/public.api.md | 6 +- .../_index_pattern_create_delete.js | 1 - .../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 | 4 - .../__test__/__snapshots__/List.test.tsx.snap | 8 +- .../__snapshots__/Stackframe.test.tsx.snap | 1 + .../canvas/.storybook/storyshots.test.js | 6 + .../custom_element_modal.examples.storyshot | 8 + .../file_upload.stories.storyshot | 2 + .../__snapshots__/view.test.js.snap | 1 + .../__snapshots__/ccr_shard.test.js.snap | 1 + .../note_card_body.test.tsx.snap | 47 +- .../timelines_table/common_columns.test.tsx | 6 +- .../timelines_table/extended_columns.test.tsx | 2 +- .../timelines_table/index.test.tsx | 2 +- .../__snapshots__/index.test.tsx.snap | 4 + .../__snapshots__/index.test.tsx.snap | 3 + .../__snapshots__/index.test.tsx.snap | 47 +- .../modal_all_errors.test.tsx.snap | 1 + .../__snapshots__/monitor_list.test.tsx.snap | 4 +- x-pack/package.json | 2 +- .../endpoint/view/alerts/index.test.tsx | 11 + .../template_table/template_table.tsx | 33 +- .../request_trial_extension.test.js.snap | 8 +- .../upload_license.test.tsx.snap | 18 +- .../analytics_list/analytics_list.tsx | 10 +- .../components/analytics_list/common.ts | 31 +- .../analytics_list/data_frame_task_state.ts | 17 + .../components/fields_panel/fields_panel.tsx | 2 +- .../remote_cluster_form.test.js.snap | 1730 ++++++++--------- .../report_listing.test.tsx.snap | 3 +- .../public/components/report_listing.tsx | 2 +- .../components/transform_list/common.ts | 20 +- .../transform_list/transform_list.tsx | 16 +- .../watch_list/components/watch_list.tsx | 45 +- .../machine_learning/data_frame_analytics.ts | 2 +- x-pack/typings/@elastic/eui/index.d.ts | 4 - yarn.lock | 23 +- 51 files changed, 1112 insertions(+), 1081 deletions(-) create mode 100644 x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/data_frame_task_state.ts diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filterbar.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filterbar.md index 016adffd0d7f4..6d8862323792a 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filterbar.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.filterbar.md @@ -7,7 +7,7 @@ Signature: ```typescript -FilterBar: React.ComponentClass, any> & { +FilterBar: React.ComponentClass, any> & { WrappedComponent: React.ComponentType; } ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md index 89c5ca800a4d4..a0b879673e553 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md @@ -7,7 +7,7 @@ Signature: ```typescript -SearchBar: React.ComponentClass, "query" | "isLoading" | "indexPatterns" | "filters" | "refreshInterval" | "screenTitle" | "dataTestSubj" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, any> & { - WrappedComponent: React.ComponentType & ReactIntl.InjectedIntlProps>; +SearchBar: React.ComponentClass, "query" | "isLoading" | "filters" | "indexPatterns" | "refreshInterval" | "screenTitle" | "dataTestSubj" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, any> & { + WrappedComponent: React.ComponentType & ReactIntl.InjectedIntlProps>; } ``` diff --git a/package.json b/package.json index 7b6e3a7e77d29..b1abcc88a38ce 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "@elastic/charts": "^17.1.1", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "7.7.0", - "@elastic/eui": "20.0.2", + "@elastic/eui": "21.0.1", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.4.0", diff --git a/packages/kbn-ui-shared-deps/package.json b/packages/kbn-ui-shared-deps/package.json index 1728ae762d9b1..915d0fee4e07e 100644 --- a/packages/kbn-ui-shared-deps/package.json +++ b/packages/kbn-ui-shared-deps/package.json @@ -10,7 +10,7 @@ }, "devDependencies": { "abortcontroller-polyfill": "^1.4.0", - "@elastic/eui": "20.0.2", + "@elastic/eui": "21.0.1", "@kbn/babel-preset": "1.0.0", "@elastic/charts": "^17.1.1", "@kbn/dev-utils": "1.0.0", diff --git a/src/legacy/core_plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap b/src/legacy/core_plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap index ba5f2ae975cbe..5200fee45d6b3 100644 --- a/src/legacy/core_plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap +++ b/src/legacy/core_plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap @@ -3,6 +3,7 @@ exports[`DefaultEditorAgg component should init with the default set of props 1`] = ` diff --git a/src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axes_panel.test.tsx.snap b/src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axes_panel.test.tsx.snap index 0b673a819f666..ab3e273f99c05 100644 --- a/src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axes_panel.test.tsx.snap +++ b/src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axes_panel.test.tsx.snap @@ -46,6 +46,7 @@ exports[`ValueAxesPanel component should init with the default set of props 1`] /> @@ -226,6 +227,7 @@ exports[`ValueAxesPanel component should init with the default set of props 1`] diff --git a/src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axis_options.test.tsx.snap b/src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axis_options.test.tsx.snap index 00e1b1cce5ea8..b89d193c7c751 100644 --- a/src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axis_options.test.tsx.snap +++ b/src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/value_axis_options.test.tsx.snap @@ -118,6 +118,7 @@ exports[`ValueAxisOptions component should init with the default set of props 1` /> ; } @@ -156,7 +149,7 @@ export class AdvancedSettingsComponent extends Component< }, {}); } - onQueryChange = ({ query }: { query: IQuery }) => { + onQueryChange = ({ query }: { query: Query }) => { this.setState({ query, filteredSettings: this.mapSettings(Query.execute(query, this.settings)), diff --git a/src/plugins/advanced_settings/public/management_app/components/search/search.tsx b/src/plugins/advanced_settings/public/management_app/components/search/search.tsx index 51402296a44a2..74e4894a27a6d 100644 --- a/src/plugins/advanced_settings/public/management_app/components/search/search.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/search/search.tsx @@ -19,19 +19,14 @@ import React, { Fragment, PureComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { - // @ts-ignore - EuiSearchBar, - EuiFormErrorText, -} from '@elastic/eui'; -import { IQuery } from '../../types'; +import { EuiSearchBar, EuiFormErrorText, Query } from '@elastic/eui'; import { getCategoryName } from '../../lib'; interface SearchProps { categories: string[]; - query: IQuery; - onQueryChange: ({ query }: { query: IQuery }) => void; + query: Query; + onQueryChange: ({ query }: { query: Query }) => void; } export class Search extends PureComponent { @@ -53,7 +48,7 @@ export class Search extends PureComponent { parseErrorMessage: null, }; - onChange = ({ query, error }: { query: IQuery; error: { message: string } }) => { + onChange = ({ query, error }: { query: Query | null; error: { message: string } | null }) => { if (error) { this.setState({ isSearchTextValid: false, @@ -66,7 +61,7 @@ export class Search extends PureComponent { isSearchTextValid: true, parseErrorMessage: null, }); - this.props.onQueryChange({ query }); + this.props.onQueryChange({ query: query! }); }; render() { @@ -82,12 +77,12 @@ export class Search extends PureComponent { const filters = [ { - type: 'field_value_selection', + type: 'field_value_selection' as const, field: 'category', name: i18n.translate('advancedSettings.categorySearchLabel', { defaultMessage: 'Category', }), - multiSelect: 'or', + multiSelect: 'or' as const, options: this.categories, }, ]; diff --git a/src/plugins/advanced_settings/public/management_app/types.ts b/src/plugins/advanced_settings/public/management_app/types.ts index ee9b9b0535b79..6e243926f7d7d 100644 --- a/src/plugins/advanced_settings/public/management_app/types.ts +++ b/src/plugins/advanced_settings/public/management_app/types.ts @@ -54,9 +54,3 @@ export interface FieldState { isInvalid?: boolean; error?: string | null; } - -export interface IQuery { - ast: any; // incomplete - text: string; - syntax: any; // incomplete -} diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 00aa52b859465..848044217767e 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -513,7 +513,7 @@ export interface Filter { // Warning: (ae-missing-release-tag) "FilterBar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const FilterBar: React.ComponentClass, any> & { +export const FilterBar: React.ComponentClass, any> & { WrappedComponent: React.ComponentType; }; @@ -1541,8 +1541,8 @@ export const search: { // Warning: (ae-missing-release-tag) "SearchBar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const SearchBar: React.ComponentClass, "query" | "isLoading" | "indexPatterns" | "filters" | "refreshInterval" | "screenTitle" | "dataTestSubj" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, any> & { - WrappedComponent: React.ComponentType & ReactIntl.InjectedIntlProps>; +export const SearchBar: React.ComponentClass, "query" | "isLoading" | "filters" | "indexPatterns" | "refreshInterval" | "screenTitle" | "dataTestSubj" | "customSubmitButton" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, any> & { + WrappedComponent: React.ComponentType & ReactIntl.InjectedIntlProps>; }; // Warning: (ae-forgotten-export) The symbol "SearchBarOwnProps" needs to be exported by the entry point index.d.ts diff --git a/test/functional/apps/management/_index_pattern_create_delete.js b/test/functional/apps/management/_index_pattern_create_delete.js index 61228744adcdc..4661c9b4d53b8 100644 --- a/test/functional/apps/management/_index_pattern_create_delete.js +++ b/test/functional/apps/management/_index_pattern_create_delete.js @@ -94,7 +94,6 @@ export default function({ getService, getPageObjects }) { 'Searchable', 'Aggregatable', 'Excluded', - '', ]; expect(headers.length).to.be(expectedHeaders.length); 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 594823ad047a7..611e16e5a942d 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": "20.0.2", + "@elastic/eui": "21.0.1", "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 56f5719b5dbef..344aae30b5bbc 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": "20.0.2", + "@elastic/eui": "21.0.1", "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 d12c15d0688b2..3b3d69c06ff3e 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": "20.0.2", + "@elastic/eui": "21.0.1", "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 eb24035f9acbe..8bc9afbc803a5 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": "20.0.2", + "@elastic/eui": "21.0.1", "react": "^16.12.0" }, "scripts": { diff --git a/typings/@elastic/eui/index.d.ts b/typings/@elastic/eui/index.d.ts index db07861d63cfe..30c96ba91d405 100644 --- a/typings/@elastic/eui/index.d.ts +++ b/typings/@elastic/eui/index.d.ts @@ -19,7 +19,3 @@ import { Direction } from '@elastic/eui/src/services/sort/sort_direction'; // TODO: Remove once typescript definitions are in EUI - -declare module '@elastic/eui' { - export const Query: any; -} diff --git a/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap b/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap index b3abc8c436b6a..205a303bcf47b 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap +++ b/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupOverview/List/__test__/__snapshots__/List.test.tsx.snap @@ -161,7 +161,7 @@ exports[`ErrorGroupOverview -> List should render empty state 1`] = ` - List should render empty state 1`] = ` className="euiTableCellContent__text" /> - + List should render with data 1`] = ` - List should render with data 1`] = ` className="euiTableCellContent__text" /> - + { }; }); +jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => { + return { + htmlIdGenerator: () => () => `generated-id`, + }; +}); + jest.mock('plugins/interpreter/registries', () => ({})); // Disabling this test due to https://github.com/elastic/eui/issues/2242 diff --git a/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/__examples__/__snapshots__/custom_element_modal.examples.storyshot b/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/__examples__/__snapshots__/custom_element_modal.examples.storyshot index 61ffc33cd9dde..eb82d1b63fdc2 100644 --- a/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/__examples__/__snapshots__/custom_element_modal.examples.storyshot +++ b/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/__examples__/__snapshots__/custom_element_modal.examples.storyshot @@ -193,6 +193,7 @@ Array [ >
+ +
+ + @@ -1384,26 +1345,21 @@ Array [
-
-
- - - +

+ Name +

@@ -1462,27 +1418,22 @@ Array [
-
-
+
-
- - - +

+ Connection mode +

@@ -1665,27 +1616,22 @@ Array [
-
-
+
-
- - - +

+ Make remote cluster optional +

@@ -1762,7 +1708,7 @@ Array [
-
+
,
{ private renderDeleteButton = () => { const { selectedJobs } = this.state; - if (selectedJobs.length === 0) return null; + if (selectedJobs.length === 0) return undefined; const performDelete = async () => { for (const record of selectedJobs) { diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/common.ts b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/common.ts index a6d69dd655c0c..f42c9afb7ed00 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/common.ts +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/common.ts @@ -4,18 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -export interface Clause { - type: string; - value: string; - match: string; -} +import { Query, Ast } from '@elastic/eui'; -export interface Query { - ast: { - clauses: Clause[]; - }; - text: string; - syntax: any; -} +export { Query }; +export type Clause = Parameters[0]; + +type ExtractClauseType = T extends (x: any) => x is infer Type ? Type : never; +export type TermClause = ExtractClauseType; +export type FieldClause = ExtractClauseType; +export type Value = Parameters[0]; export type ItemIdToExpandedRowMap = Record; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_list.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_list.tsx index 3393aada8b69d..6736a79d62a3f 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_list.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/transform_list.tsx @@ -18,6 +18,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiInMemoryTable, + EuiSearchBarProps, EuiPopover, EuiTitle, } from '@elastic/eui'; @@ -39,7 +40,7 @@ import { DeleteAction } from './action_delete'; import { StartAction } from './action_start'; import { StopAction } from './action_stop'; -import { ItemIdToExpandedRowMap, Query, Clause } from './common'; +import { ItemIdToExpandedRowMap, Clause, TermClause, FieldClause, Value } from './common'; import { getColumns } from './columns'; import { ExpandedRow } from './expanded_row'; @@ -56,7 +57,7 @@ function getItemIdToExpandedRowMap( }, {} as ItemIdToExpandedRowMap); } -function stringMatch(str: string | undefined, substr: string) { +function stringMatch(str: string | undefined, substr: any) { return ( typeof str === 'string' && typeof substr === 'string' && @@ -104,7 +105,10 @@ export const TransformList: FC = ({ !capabilities.canPreviewTransform || !capabilities.canStartStopTransform; - const onQueryChange = ({ query, error }: { query: Query; error: any }) => { + const onQueryChange = ({ + query, + error, + }: Parameters>[0]) => { if (error) { setSearchError(error.message); } else { @@ -114,7 +118,7 @@ export const TransformList: FC = ({ } if (clauses.length > 0) { setFilterActive(true); - filterTransforms(clauses); + filterTransforms(clauses as Array); } else { setFilterActive(false); } @@ -122,7 +126,7 @@ export const TransformList: FC = ({ } }; - const filterTransforms = (clauses: Clause[]) => { + const filterTransforms = (clauses: Array) => { setIsLoading(true); // keep count of the number of matches we make as we're looping over the clauses // we only want to return transforms which match all clauses, i.e. each search term is ANDed @@ -161,7 +165,7 @@ export const TransformList: FC = ({ // filter other clauses, i.e. the mode and status filters if (Array.isArray(c.value)) { // the status value is an array of string(s) e.g. ['failed', 'stopped'] - ts = transforms.filter(transform => c.value.includes(transform.stats.state)); + ts = transforms.filter(transform => (c.value as Value[]).includes(transform.stats.state)); } else { ts = transforms.filter(transform => transform.mode === c.value); } diff --git a/x-pack/plugins/watcher/public/application/sections/watch_list/components/watch_list.tsx b/x-pack/plugins/watcher/public/application/sections/watch_list/components/watch_list.tsx index 54f4209a137b9..5be17ab2d7ed2 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_list/components/watch_list.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_list/components/watch_list.tsx @@ -380,27 +380,30 @@ export const WatchList = () => { box: { incremental: true, }, - toolsLeft: selection.length && ( - { - setWatchesToDelete(selection.map((selected: any) => selected.id)); - }} - color="danger" - > - {selection.length > 1 ? ( - - ) : ( - - )} - - ), + toolsLeft: + selection.length > 0 ? ( + { + setWatchesToDelete(selection.map((selected: any) => selected.id)); + }} + color="danger" + > + {selection.length > 1 ? ( + + ) : ( + + )} + + ) : ( + undefined + ), toolsRight: createWatchContextMenu, }; diff --git a/x-pack/test/functional/services/machine_learning/data_frame_analytics.ts b/x-pack/test/functional/services/machine_learning/data_frame_analytics.ts index eed7db48af460..bada1d42b564a 100644 --- a/x-pack/test/functional/services/machine_learning/data_frame_analytics.ts +++ b/x-pack/test/functional/services/machine_learning/data_frame_analytics.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { MlApi } from './api'; -import { DATA_FRAME_TASK_STATE } from '../../../../plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common'; +import { DATA_FRAME_TASK_STATE } from '../../../../plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/data_frame_task_state'; export function MachineLearningDataFrameAnalyticsProvider( { getService }: FtrProviderContext, diff --git a/x-pack/typings/@elastic/eui/index.d.ts b/x-pack/typings/@elastic/eui/index.d.ts index ea7a81fa986ce..7306f1f1af138 100644 --- a/x-pack/typings/@elastic/eui/index.d.ts +++ b/x-pack/typings/@elastic/eui/index.d.ts @@ -6,10 +6,6 @@ // TODO: Remove once typescript definitions are in EUI -declare module '@elastic/eui' { - export const Query: any; -} - declare module '@elastic/eui/lib/services' { export const RIGHT_ALIGNMENT: any; } diff --git a/yarn.lock b/yarn.lock index 0eca5e896a490..08ce29f198046 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2623,10 +2623,10 @@ tabbable "^1.1.0" uuid "^3.1.0" -"@elastic/eui@20.0.2": - version "20.0.2" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-20.0.2.tgz#c64b16fef15da6aa9e627d45cdd372f1fc676359" - integrity sha512-8TtazI7RO1zJH4Qkl6TZKvAxaFG9F8BEdwyGmbGhyvXOJbkvttRzoaEg9jSQpKr+z7w2vsjGNbza/fEAE41HOA== +"@elastic/eui@21.0.1": + version "21.0.1" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-21.0.1.tgz#7cf6846ed88032aebd72f75255298df2fbe26554" + integrity sha512-Hf8ZGRI265qpOKwnnqhZkaMQvali+Xg6FAaNZSskkpXvdLhwGtUGC4YU7HW2vb7svq6IpNUuz+5XWrMLLzVY9w== dependencies: "@types/chroma-js" "^1.4.3" "@types/enzyme" "^3.1.13" @@ -5708,14 +5708,7 @@ dependencies: "@types/react" "*" -"@types/react-dom@*": - version "16.9.4" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.4.tgz#0b58df09a60961dcb77f62d4f1832427513420df" - integrity sha512-fya9xteU/n90tda0s+FtN5Ym4tbgxpq/hb/Af24dvs6uYnYn+fspaxw5USlw0R8apDNwxsqumdRoCoKitckQqw== - dependencies: - "@types/react" "*" - -"@types/react-dom@^16.9.5": +"@types/react-dom@*", "@types/react-dom@^16.9.5": version "16.9.5" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.5.tgz#5de610b04a35d07ffd8f44edad93a71032d9aaa7" integrity sha512-BX6RQ8s9D+2/gDhxrj8OW+YD4R+8hj7FEM/OJHGNR0KipE1h1mSsf39YeyC81qafkq+N3rU3h3RFbLSwE5VqUg== @@ -5830,9 +5823,9 @@ "@types/react" "*" "@types/react@*", "@types/react@^16.8.23", "@types/react@^16.9.19": - version "16.9.19" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.19.tgz#c842aa83ea490007d29938146ff2e4d9e4360c40" - integrity sha512-LJV97//H+zqKWMms0kvxaKYJDG05U2TtQB3chRLF8MPNs+MQh/H1aGlyDUxjaHvu08EAGerdX2z4LTBc7ns77A== + version "16.9.23" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.23.tgz#1a66c6d468ba11a8943ad958a8cb3e737568271c" + integrity sha512-SsGVT4E7L2wLN3tPYLiF20hmZTPGuzaayVunfgXzUn1x4uHVsKH6QDJQ/TdpHqwsTLd4CwrmQ2vOgxN7gE24gw== dependencies: "@types/prop-types" "*" csstype "^2.2.0" From cf3513b45d265239d09361c3e27b874d7bc25c92 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Fri, 20 Mar 2020 21:06:45 -0600 Subject: [PATCH 2/2] unit test update --- .../components/open_timeline/timelines_table/index.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.test.tsx index aebe49d451f56..a972b7392c248 100644 --- a/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/index.test.tsx @@ -151,7 +151,7 @@ describe('TimelinesTable', () => { expect( wrapper .find('thead tr th') - .at(5) + .at(4) .find('[data-test-subj="notes-count-header-icon"]') .first() .exists()