,
field: IFieldType | string,
query: string,
diff --git a/src/plugins/discover/README.md b/src/plugins/discover/README.md
new file mode 100644
index 0000000000000..a914d651eef35
--- /dev/null
+++ b/src/plugins/discover/README.md
@@ -0,0 +1 @@
+Contains the Discover application and the saved search embeddable.
\ No newline at end of file
diff --git a/src/plugins/discover/public/application/angular/context.js b/src/plugins/discover/public/application/angular/context.js
index a6f591eebb52d..6223090aa9f97 100644
--- a/src/plugins/discover/public/application/angular/context.js
+++ b/src/plugins/discover/public/application/angular/context.js
@@ -83,6 +83,7 @@ function ContextAppRouteController($routeParams, $scope, $route) {
timeFieldName: indexPattern.timeFieldName,
storeInSessionStorage: getServices().uiSettings.get('state:storeInSessionStorage'),
history: getServices().history(),
+ toasts: getServices().core.notifications.toasts,
});
this.state = { ...appState.getState() };
this.anchorId = $routeParams.id;
diff --git a/src/plugins/discover/public/application/angular/context_state.ts b/src/plugins/discover/public/application/angular/context_state.ts
index 7a92a6ace125b..5b05d8729c41d 100644
--- a/src/plugins/discover/public/application/angular/context_state.ts
+++ b/src/plugins/discover/public/application/angular/context_state.ts
@@ -18,11 +18,13 @@
*/
import _ from 'lodash';
import { History } from 'history';
+import { NotificationsStart } from 'kibana/public';
import {
createStateContainer,
createKbnUrlStateStorage,
syncStates,
BaseStateContainer,
+ withNotifyOnErrors,
} from '../../../../kibana_utils/public';
import { esFilters, FilterManager, Filter, Query } from '../../../../data/public';
@@ -74,6 +76,13 @@ interface GetStateParams {
* History instance to use
*/
history: History;
+
+ /**
+ * Core's notifications.toasts service
+ * In case it is passed in,
+ * kbnUrlStateStorage will use it notifying about inner errors
+ */
+ toasts?: NotificationsStart['toasts'];
}
interface GetStateReturn {
@@ -123,10 +132,12 @@ export function getState({
timeFieldName,
storeInSessionStorage = false,
history,
+ toasts,
}: GetStateParams): GetStateReturn {
const stateStorage = createKbnUrlStateStorage({
useHash: storeInSessionStorage,
history,
+ ...(toasts && withNotifyOnErrors(toasts)),
});
const globalStateInitial = stateStorage.get(GLOBAL_STATE_URL_KEY) as GlobalState;
diff --git a/src/plugins/discover/public/application/angular/discover.js b/src/plugins/discover/public/application/angular/discover.js
index 4a27f261a6220..22da3e877054a 100644
--- a/src/plugins/discover/public/application/angular/discover.js
+++ b/src/plugins/discover/public/application/angular/discover.js
@@ -220,6 +220,7 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise
defaultAppState: getStateDefaults(),
storeInSessionStorage: config.get('state:storeInSessionStorage'),
history,
+ toasts: core.notifications.toasts,
});
if (appStateContainer.getState().index !== $scope.indexPattern.id) {
//used index pattern is different than the given by url/state which is invalid
diff --git a/src/plugins/discover/public/application/angular/discover_state.ts b/src/plugins/discover/public/application/angular/discover_state.ts
index 46500d9fdf85e..ff8fb9f80a723 100644
--- a/src/plugins/discover/public/application/angular/discover_state.ts
+++ b/src/plugins/discover/public/application/angular/discover_state.ts
@@ -18,12 +18,14 @@
*/
import { isEqual } from 'lodash';
import { History } from 'history';
+import { NotificationsStart } from 'kibana/public';
import {
createStateContainer,
createKbnUrlStateStorage,
syncState,
ReduxLikeStateContainer,
IKbnUrlStateStorage,
+ withNotifyOnErrors,
} from '../../../../kibana_utils/public';
import { esFilters, Filter, Query } from '../../../../data/public';
import { migrateLegacyQuery } from '../../../../kibana_legacy/public';
@@ -68,6 +70,13 @@ interface GetStateParams {
* Browser history
*/
history: History;
+
+ /**
+ * Core's notifications.toasts service
+ * In case it is passed in,
+ * kbnUrlStateStorage will use it notifying about inner errors
+ */
+ toasts?: NotificationsStart['toasts'];
}
export interface GetStateReturn {
@@ -122,10 +131,12 @@ export function getState({
defaultAppState = {},
storeInSessionStorage = false,
history,
+ toasts,
}: GetStateParams): GetStateReturn {
const stateStorage = createKbnUrlStateStorage({
useHash: storeInSessionStorage,
history,
+ ...(toasts && withNotifyOnErrors(toasts)),
});
const appStateFromUrl = stateStorage.get(APP_STATE_URL_KEY) as AppState;
diff --git a/src/plugins/discover/public/application/angular/doc_table/components/table_row.ts b/src/plugins/discover/public/application/angular/doc_table/components/table_row.ts
index 7b862ec518a04..e7fafde2e68d0 100644
--- a/src/plugins/discover/public/application/angular/doc_table/components/table_row.ts
+++ b/src/plugins/discover/public/application/angular/doc_table/components/table_row.ts
@@ -17,13 +17,10 @@
* under the License.
*/
-import _ from 'lodash';
+import { find, template } from 'lodash';
import $ from 'jquery';
-// @ts-ignore
import rison from 'rison-node';
import '../../doc_viewer';
-// @ts-ignore
-import { noWhiteSpace } from '../../../../../../../legacy/core_plugins/kibana/common/utils/no_white_space';
import openRowHtml from './table_row/open.html';
import detailsHtml from './table_row/details.html';
@@ -35,6 +32,16 @@ import truncateByHeightTemplateHtml from '../components/table_row/truncate_by_he
import { esFilters } from '../../../../../../data/public';
import { getServices } from '../../../../kibana_services';
+const TAGS_WITH_WS = />\s+<');
+}
+
// guesstimate at the minimum number of chars wide cells in the table should be
const MIN_LINE_LENGTH = 20;
@@ -43,8 +50,8 @@ interface LazyScope extends ng.IScope {
}
export function createTableRowDirective($compile: ng.ICompileService, $httpParamSerializer: any) {
- const cellTemplate = _.template(noWhiteSpace(cellTemplateHtml));
- const truncateByHeightTemplate = _.template(noWhiteSpace(truncateByHeightTemplateHtml));
+ const cellTemplate = template(noWhiteSpace(cellTemplateHtml));
+ const truncateByHeightTemplate = template(noWhiteSpace(truncateByHeightTemplateHtml));
return {
restrict: 'A',
@@ -169,7 +176,7 @@ export function createTableRowDirective($compile: ng.ICompileService, $httpParam
const $cell = $cells.eq(i);
if ($cell.data('discover:html') === html) return;
- const reuse = _.find($cells.slice(i + 1), function (cell: any) {
+ const reuse = find($cells.slice(i + 1), function (cell: any) {
return $.data(cell, 'discover:html') === html;
});
diff --git a/src/plugins/discover/public/application/components/table/table_row.tsx b/src/plugins/discover/public/application/components/table/table_row.tsx
index abb6e149b1bfd..5f7dd9f37dcd3 100644
--- a/src/plugins/discover/public/application/components/table/table_row.tsx
+++ b/src/plugins/discover/public/application/components/table/table_row.tsx
@@ -60,6 +60,7 @@ export function DocViewTableRow({
valueRaw,
}: Props) {
const valueClassName = classNames({
+ // eslint-disable-next-line @typescript-eslint/naming-convention
kbnDocViewer__value: true,
'truncate-by-height': isCollapsible && isCollapsed,
});
diff --git a/src/plugins/discover/public/url_generator.test.ts b/src/plugins/discover/public/url_generator.test.ts
index cf9beb246fea2..a18ee486ab007 100644
--- a/src/plugins/discover/public/url_generator.test.ts
+++ b/src/plugins/discover/public/url_generator.test.ts
@@ -19,7 +19,6 @@
import { DiscoverUrlGenerator } from './url_generator';
import { hashedItemStore, getStatesFromKbnUrl } from '../../kibana_utils/public';
-// eslint-disable-next-line
import { mockStorage } from '../../kibana_utils/public/storage/hashed_item_store/mock';
import { FilterStateStore } from '../../data/common';
diff --git a/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx b/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx
index e29e941e898fb..aa0b504b63fbe 100644
--- a/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx
+++ b/src/plugins/embeddable/public/lib/containers/embeddable_child_panel.test.tsx
@@ -28,7 +28,6 @@ import {
ContactCardEmbeddableOutput,
ContactCardEmbeddable,
} from '../test_samples/embeddables/contact_card/contact_card_embeddable';
-// eslint-disable-next-line
import { inspectorPluginMock } from '../../../../inspector/public/mocks';
import { mount } from 'enzyme';
import { embeddablePluginMock, createEmbeddablePanelMock } from '../../mocks';
diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx
index ff9f466a8d553..341a51d7348b2 100644
--- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx
+++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx
@@ -40,7 +40,6 @@ import {
ContactCardEmbeddableInput,
ContactCardEmbeddableOutput,
} from '../test_samples/embeddables/contact_card/contact_card_embeddable';
-// eslint-disable-next-line
import { inspectorPluginMock } from '../../../../inspector/public/mocks';
import { EuiBadge } from '@elastic/eui';
import { embeddablePluginMock } from '../../mocks';
diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx
index 74b08535bf27a..d8def3147e52c 100644
--- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx
+++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.test.tsx
@@ -26,7 +26,6 @@ import {
} from '../../../../test_samples/embeddables/filterable_embeddable';
import { FilterableEmbeddableFactory } from '../../../../test_samples/embeddables/filterable_embeddable_factory';
import { FilterableContainer } from '../../../../test_samples/embeddables/filterable_container';
-// eslint-disable-next-line
import { coreMock } from '../../../../../../../../core/public/mocks';
import { ContactCardEmbeddable } from '../../../../test_samples';
import { esFilters, Filter } from '../../../../../../../../plugins/data/public';
diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx
index 491eaad9faefa..eb83641448986 100644
--- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx
+++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/inspect_panel_action.test.tsx
@@ -26,7 +26,6 @@ import {
FilterableEmbeddable,
ContactCardEmbeddable,
} from '../../../test_samples';
-// eslint-disable-next-line
import { inspectorPluginMock } from '../../../../../../../plugins/inspector/public/mocks';
import { EmbeddableOutput, isErrorEmbeddable, ErrorEmbeddable } from '../../../embeddables';
import { of } from '../../../../tests/helpers';
diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx
index 7b66f29cc2726..2f086a3fb2c0c 100644
--- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx
+++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_header.tsx
@@ -132,6 +132,7 @@ export function PanelHeader({
const showTitle = !isViewMode || (title && !hidePanelTitles) || viewDescription !== '';
const showPanelBar = badges.length > 0 || showTitle;
const classes = classNames('embPanel__header', {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
'embPanel__header--floater': !showPanelBar,
});
diff --git a/src/plugins/embeddable/public/mocks.tsx b/src/plugins/embeddable/public/mocks.tsx
index 6b451e71522c5..94aa980e446ca 100644
--- a/src/plugins/embeddable/public/mocks.tsx
+++ b/src/plugins/embeddable/public/mocks.tsx
@@ -33,9 +33,7 @@ import { CoreStart } from '../../../core/public';
import { Start as InspectorStart } from '../../inspector/public';
import { dataPluginMock } from '../../data/public/mocks';
-// eslint-disable-next-line
import { inspectorPluginMock } from '../../inspector/public/mocks';
-// eslint-disable-next-line
import { uiActionsPluginMock } from '../../ui_actions/public/mocks';
export type Setup = jest.Mocked
;
diff --git a/src/plugins/embeddable/public/tests/apply_filter_action.test.ts b/src/plugins/embeddable/public/tests/apply_filter_action.test.ts
index ec92f334267f5..9d765c9906443 100644
--- a/src/plugins/embeddable/public/tests/apply_filter_action.test.ts
+++ b/src/plugins/embeddable/public/tests/apply_filter_action.test.ts
@@ -30,7 +30,6 @@ import {
FilterableContainerFactory,
FilterableEmbeddableInput,
} from '../lib/test_samples';
-// eslint-disable-next-line
import { esFilters } from '../../../data/public';
test('ApplyFilterAction applies the filter to the root of the container tree', async () => {
diff --git a/src/plugins/embeddable/public/tests/container.test.ts b/src/plugins/embeddable/public/tests/container.test.ts
index e6162748fdb68..621ffe4c9dad6 100644
--- a/src/plugins/embeddable/public/tests/container.test.ts
+++ b/src/plugins/embeddable/public/tests/container.test.ts
@@ -43,7 +43,6 @@ import {
FilterableContainer,
FilterableContainerInput,
} from '../lib/test_samples/embeddables/filterable_container';
-// eslint-disable-next-line
import { coreMock } from '../../../../core/public/mocks';
import { testPlugin } from './test_plugin';
import { of } from './helpers';
diff --git a/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx b/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx
index 311efae49f735..e094afe528498 100644
--- a/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx
+++ b/src/plugins/embeddable/public/tests/customize_panel_modal.test.tsx
@@ -31,7 +31,6 @@ import {
ContactCardEmbeddableFactory,
} from '../lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory';
import { HelloWorldContainer } from '../lib/test_samples/embeddables/hello_world_container';
-// eslint-disable-next-line
import { coreMock } from '../../../../core/public/mocks';
import { testPlugin } from './test_plugin';
import { CustomizePanelModal } from '../lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal';
diff --git a/src/plugins/embeddable/public/tests/explicit_input.test.ts b/src/plugins/embeddable/public/tests/explicit_input.test.ts
index cfddeec25b3b4..24785dd50a032 100644
--- a/src/plugins/embeddable/public/tests/explicit_input.test.ts
+++ b/src/plugins/embeddable/public/tests/explicit_input.test.ts
@@ -33,7 +33,6 @@ import {
import { FilterableContainer } from '../lib/test_samples/embeddables/filterable_container';
import { isErrorEmbeddable } from '../lib';
import { HelloWorldContainer } from '../lib/test_samples/embeddables/hello_world_container';
-// eslint-disable-next-line
import { coreMock } from '../../../../core/public/mocks';
import { esFilters, Filter } from '../../../../plugins/data/public';
import { createEmbeddablePanelMock } from '../mocks';
diff --git a/src/plugins/embeddable/public/tests/test_plugin.ts b/src/plugins/embeddable/public/tests/test_plugin.ts
index bb12e3d7b9011..2c298b437a118 100644
--- a/src/plugins/embeddable/public/tests/test_plugin.ts
+++ b/src/plugins/embeddable/public/tests/test_plugin.ts
@@ -19,9 +19,7 @@
import { CoreSetup, CoreStart } from 'src/core/public';
import { UiActionsStart } from '../../../ui_actions/public';
-// eslint-disable-next-line
import { uiActionsPluginMock } from '../../../ui_actions/public/mocks';
-// eslint-disable-next-line
import { inspectorPluginMock } from '../../../inspector/public/mocks';
import { dataPluginMock } from '../../../data/public/mocks';
import { coreMock } from '../../../../core/public/mocks';
diff --git a/src/plugins/es_ui_shared/__packages_do_not_import__/ace/use_ui_ace_keyboard_mode.tsx b/src/plugins/es_ui_shared/__packages_do_not_import__/ace/use_ui_ace_keyboard_mode.tsx
index d0d1aa1d8db15..4abb78c3bbc90 100644
--- a/src/plugins/es_ui_shared/__packages_do_not_import__/ace/use_ui_ace_keyboard_mode.tsx
+++ b/src/plugins/es_ui_shared/__packages_do_not_import__/ace/use_ui_ace_keyboard_mode.tsx
@@ -27,7 +27,6 @@ const OverlayText = () => (
// The point of this element is for accessibility purposes, so ignore eslint error
// in this case
//
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<>
Press Enter to start editing.
When you’re done, press Escape to stop editing.
diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts
index b2f00610a3d33..15ea99eb6cc3a 100644
--- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts
+++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_field.ts
@@ -41,6 +41,7 @@ export const useField = (
serializer,
deserializer,
} = config;
+
const { getFormData, __removeField, __updateFormDataAt, __validateFields } = form;
const initialValue = useMemo(() => {
diff --git a/src/plugins/expressions/common/execution/container.ts b/src/plugins/expressions/common/execution/container.ts
index 6302c0adb550b..d0867e7ec6b57 100644
--- a/src/plugins/expressions/common/execution/container.ts
+++ b/src/plugins/expressions/common/execution/container.ts
@@ -58,7 +58,6 @@ const executionDefaultState: ExecutionState = {
},
};
-// eslint-disable-next-line
export interface ExecutionPureTransitions