diff --git a/.eslintrc.js b/.eslintrc.js index f0b7d6864bef0..c33f4de15b919 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -758,10 +758,6 @@ module.exports = { 'react/jsx-no-target-blank': 'error', 'react/jsx-fragments': 'error', 'react/jsx-sort-default-props': 'error', - // might be introduced after the other warns are fixed - // 'react/jsx-sort-props': 'error', - // might be introduced after the other warns are fixed - 'react-hooks/exhaustive-deps': 'off', 'require-atomic-updates': 'error', 'symbol-description': 'error', 'vars-on-top': 'error', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 48d70910f9bf1..472d29ed29413 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -34,6 +34,7 @@ /src/legacy/core_plugins/kibana/public/home/np_ready/ @elastic/kibana-core-ui # App Architecture +/examples/developer_examples/ @elastic/kibana-app-arch /examples/url_generators_examples/ @elastic/kibana-app-arch /examples/url_generators_explorer/ @elastic/kibana-app-arch /packages/kbn-interpreter/ @elastic/kibana-app-arch diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md index 4159247bb7c32..6256709e2ee36 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern._constructor_.md @@ -9,7 +9,7 @@ Constructs a new instance of the `IndexPattern` class Signature: ```typescript -constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: any); +constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache); ``` ## Parameters @@ -20,5 +20,5 @@ constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObj | getConfig | any | | | savedObjectsClient | SavedObjectsClientContract | | | apiClient | IIndexPatternsApiClient | | -| patternCache | any | | +| patternCache | PatternCache | | diff --git a/examples/alerting_example/kibana.json b/examples/alerting_example/kibana.json index aa5b0dd45895e..a2691c5fdcab7 100644 --- a/examples/alerting_example/kibana.json +++ b/examples/alerting_example/kibana.json @@ -4,6 +4,6 @@ "kibanaVersion": "kibana", "server": true, "ui": true, - "requiredPlugins": ["triggers_actions_ui", "charts", "data", "alerts", "actions", "features"], + "requiredPlugins": ["triggers_actions_ui", "charts", "data", "alerts", "actions", "features", "developerExamples"], "optionalPlugins": [] } diff --git a/examples/alerting_example/public/plugin.tsx b/examples/alerting_example/public/plugin.tsx index 524ff18bd434e..f0635a1071f64 100644 --- a/examples/alerting_example/public/plugin.tsx +++ b/examples/alerting_example/public/plugin.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { Plugin, CoreSetup, AppMountParameters } from 'kibana/public'; +import { Plugin, CoreSetup, AppMountParameters, AppNavLinkStatus } from '../../../src/core/public'; import { PluginSetupContract as AlertingSetup } from '../../../x-pack/plugins/alerts/public'; import { ChartsPluginStart } from '../../../src/plugins/charts/public'; import { TriggersAndActionsUIPublicPluginSetup } from '../../../x-pack/plugins/triggers_actions_ui/public'; @@ -25,6 +25,7 @@ import { DataPublicPluginStart } from '../../../src/plugins/data/public'; import { getAlertType as getAlwaysFiringAlertType } from './alert_types/always_firing'; import { getAlertType as getPeopleInSpaceAlertType } from './alert_types/astros'; import { registerNavigation } from './alert_types'; +import { DeveloperExamplesSetup } from '../../developer_examples/public'; export type Setup = void; export type Start = void; @@ -32,6 +33,7 @@ export type Start = void; export interface AlertingExamplePublicSetupDeps { alerts: AlertingSetup; triggers_actions_ui: TriggersAndActionsUIPublicPluginSetup; + developerExamples: DeveloperExamplesSetup; } export interface AlertingExamplePublicStartDeps { @@ -44,11 +46,12 @@ export interface AlertingExamplePublicStartDeps { export class AlertingExamplePlugin implements Plugin { public setup( core: CoreSetup, - { alerts, triggers_actions_ui }: AlertingExamplePublicSetupDeps + { alerts, triggers_actions_ui, developerExamples }: AlertingExamplePublicSetupDeps ) { core.application.register({ id: 'AlertingExample', title: 'Alerting Example', + navLinkStatus: AppNavLinkStatus.hidden, async mount(params: AppMountParameters) { const [coreStart, depsStart] = await core.getStartServices(); const { renderApp } = await import('./application'); @@ -60,6 +63,21 @@ export class AlertingExamplePlugin implements Plugin Promise<{ num: number }>; @@ -27,6 +28,7 @@ export interface ExplorerService { export interface BfetchExplorerSetupPlugins { bfetch: BfetchPublicSetup; + developerExamples: DeveloperExamplesSetup; } export interface BfetchExplorerStartPlugins { @@ -36,9 +38,9 @@ export interface BfetchExplorerStartPlugins { export class BfetchExplorerPlugin implements Plugin { public setup( core: CoreSetup, - plugins: BfetchExplorerSetupPlugins + { bfetch, developerExamples }: BfetchExplorerSetupPlugins ) { - const double = plugins.bfetch.batchedFunction<{ num: number }, { num: number }>({ + const double = bfetch.batchedFunction<{ num: number }, { num: number }>({ url: '/bfetch_explorer/double', }); @@ -49,8 +51,25 @@ export class BfetchExplorerPlugin implements Plugin { core.application.register({ id: 'bfetch-explorer', title: 'bfetch explorer', + navLinkStatus: AppNavLinkStatus.hidden, mount: mount(core, explorer), }); + + developerExamples.register({ + appId: 'bfetch-explorer', + title: 'bfetch', + description: + 'bfetch is a service that allows to batch HTTP requests and streams responses back.', + links: [ + { + label: 'README', + href: 'https://github.com/elastic/kibana/blob/master/src/plugins/bfetch/README.md', + iconType: 'logoGithub', + size: 's', + target: '_blank', + }, + ], + }); } public start() {} diff --git a/examples/developer_examples/README.md b/examples/developer_examples/README.md new file mode 100644 index 0000000000000..1a57838c43d24 --- /dev/null +++ b/examples/developer_examples/README.md @@ -0,0 +1,36 @@ +## Developer examples + +Owner: Kibana application architecture team + +The developer examples app is a landing page where developers go to search for working, tested examples of various developer +services. Add your a link to your example using the developerExamples `register` function offered on the `setup` contract: + +```ts + setup(core, { developerExamples }) { + developerExamples.register({ + appId: 'myFooExampleApp', + title: 'Foo services', + description: `Foo services let you do bar and zed.`, + links: [ + { + label: 'README', + href: 'https://github.com/elastic/kibana/tree/master/src/plugins/foo/README.md', + iconType: 'logoGithub', + target: '_blank', + size: 's', + }, + ], + image: img, + }); + } +``` + +Run Kibana with developer examples via: + +``` +yarn start --run-examples +``` + +Then navigate to "Developer examples": + + diff --git a/examples/developer_examples/kibana.json b/examples/developer_examples/kibana.json new file mode 100644 index 0000000000000..8c9ec2e4dcbfc --- /dev/null +++ b/examples/developer_examples/kibana.json @@ -0,0 +1,9 @@ +{ + "id": "developerExamples", + "version": "0.0.1", + "kibanaVersion": "kibana", + "server": false, + "ui": true, + "requiredPlugins": [], + "optionalPlugins": [] +} diff --git a/examples/developer_examples/navigation.png b/examples/developer_examples/navigation.png new file mode 100644 index 0000000000000..ac72f697e5db0 Binary files /dev/null and b/examples/developer_examples/navigation.png differ diff --git a/examples/developer_examples/public/app.tsx b/examples/developer_examples/public/app.tsx new file mode 100644 index 0000000000000..2ce21bae75e21 --- /dev/null +++ b/examples/developer_examples/public/app.tsx @@ -0,0 +1,117 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React, { useState } from 'react'; +import ReactDOM from 'react-dom'; + +import { + EuiText, + EuiPageContent, + EuiCard, + EuiPageContentHeader, + EuiFlexGroup, + EuiFlexItem, + EuiFieldSearch, + EuiListGroup, + EuiHighlight, + EuiLink, + EuiButtonIcon, +} from '@elastic/eui'; +import { AppMountParameters } from '../../../src/core/public'; +import { ExampleDefinition } from './types'; + +interface Props { + examples: ExampleDefinition[]; + navigateToApp: (appId: string) => void; + getUrlForApp: (appId: string) => string; +} + +function DeveloperExamples({ examples, navigateToApp, getUrlForApp }: Props) { + const [search, setSearch] = useState(''); + + const lcSearch = search.toLowerCase(); + const filteredExamples = !lcSearch + ? examples + : examples.filter((def) => { + if (def.description.toLowerCase().indexOf(lcSearch) >= 0) return true; + if (def.title.toLowerCase().indexOf(lcSearch) >= 0) return true; + return false; + }); + + return ( + + + +

Developer examples

+

+ The following examples showcase services and APIs that are available to developers. + setSearch(e.target.value)} + isClearable={true} + aria-label="Search developer examples" + /> +

+
+
+ + {filteredExamples.map((def) => ( + + + {def.description} + + } + title={ + + { + navigateToApp(def.appId); + }} + > + + {def.title} + + + + window.open(getUrlForApp(def.appId), '_blank', 'noopener, noreferrer') + } + > + Open in new tab + + + } + image={def.image} + footer={def.links ? : undefined} + /> + + ))} + +
+ ); +} + +export const renderApp = (props: Props, element: AppMountParameters['element']) => { + ReactDOM.render(, element); + + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/public/index.ts b/examples/developer_examples/public/index.ts similarity index 82% rename from test/plugin_functional/plugins/kbn_tp_bfetch_explorer/public/index.ts rename to examples/developer_examples/public/index.ts index 547dfe2aa38d2..616fb011e3705 100644 --- a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/public/index.ts +++ b/examples/developer_examples/public/index.ts @@ -17,4 +17,8 @@ * under the License. */ -export * from '../../../../../examples/bfetch_explorer/public'; +import { DeveloperExamplesPlugin } from './plugin'; + +export const plugin = () => new DeveloperExamplesPlugin(); + +export { DeveloperExamplesSetup } from './plugin'; diff --git a/examples/developer_examples/public/plugin.ts b/examples/developer_examples/public/plugin.ts new file mode 100644 index 0000000000000..a0aa601660f37 --- /dev/null +++ b/examples/developer_examples/public/plugin.ts @@ -0,0 +1,68 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { + CoreSetup, + Plugin, + AppMountParameters, + DEFAULT_APP_CATEGORIES, +} from '../../../src/core/public'; + +import { ExampleDefinition } from './types'; + +export interface DeveloperExamplesSetup { + register: (def: ExampleDefinition) => void; +} + +export class DeveloperExamplesPlugin implements Plugin { + private examplesRegistry: ExampleDefinition[] = []; + + public setup(core: CoreSetup) { + const examples = this.examplesRegistry; + core.application.register({ + id: 'developerExamples', + title: 'Developer examples', + order: -2000, + category: DEFAULT_APP_CATEGORIES.kibana, + async mount(params: AppMountParameters) { + const { renderApp } = await import('./app'); + const [coreStart] = await core.getStartServices(); + return renderApp( + { + examples, + navigateToApp: (appId: string) => coreStart.application.navigateToApp(appId), + getUrlForApp: (appId: string) => coreStart.application.getUrlForApp(appId), + }, + params.element + ); + }, + }); + + const api: DeveloperExamplesSetup = { + register: (def) => { + this.examplesRegistry.push(def); + }, + }; + return api; + } + + public start() {} + + public stop() {} +} diff --git a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/server/index.ts b/examples/developer_examples/public/types.ts similarity index 68% rename from test/plugin_functional/plugins/kbn_tp_bfetch_explorer/server/index.ts rename to examples/developer_examples/public/types.ts index b4370eb53311e..0ef359ef64a23 100644 --- a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/server/index.ts +++ b/examples/developer_examples/public/types.ts @@ -17,4 +17,18 @@ * under the License. */ -export * from '../../../../../examples/bfetch_explorer/server'; +import { EuiListGroupItemProps } from '@elastic/eui'; + +export interface ExampleDefinition { + /** + * The application id that is the landing page for the example. + */ + appId: string; + title: string; + description: string; + image?: string; + /** + * Any additional links you want to show, for example to the github README. + */ + links?: EuiListGroupItemProps[]; +} diff --git a/examples/developer_examples/tsconfig.json b/examples/developer_examples/tsconfig.json new file mode 100644 index 0000000000000..d508076b33199 --- /dev/null +++ b/examples/developer_examples/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./target", + "skipLibCheck": true + }, + "include": [ + "index.ts", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../typings/**/*", + ], + "exclude": [] +} diff --git a/examples/embeddable_explorer/kibana.json b/examples/embeddable_explorer/kibana.json index 3e4b074fb6b12..aa14549d0460f 100644 --- a/examples/embeddable_explorer/kibana.json +++ b/examples/embeddable_explorer/kibana.json @@ -4,6 +4,6 @@ "kibanaVersion": "kibana", "server": false, "ui": true, - "requiredPlugins": ["uiActions", "inspector", "embeddable", "embeddableExamples"], + "requiredPlugins": ["uiActions", "inspector", "embeddable", "embeddableExamples", "developerExamples"], "optionalPlugins": [] } diff --git a/examples/embeddable_explorer/public/embeddables.png b/examples/embeddable_explorer/public/embeddables.png new file mode 100644 index 0000000000000..90b287962d248 Binary files /dev/null and b/examples/embeddable_explorer/public/embeddables.png differ diff --git a/examples/embeddable_explorer/public/plugin.tsx b/examples/embeddable_explorer/public/plugin.tsx index bba1b1748e207..2a5023d2dd63a 100644 --- a/examples/embeddable_explorer/public/plugin.tsx +++ b/examples/embeddable_explorer/public/plugin.tsx @@ -16,12 +16,13 @@ * specific language governing permissions and limitations * under the License. */ - -import { Plugin, CoreSetup, AppMountParameters } from 'kibana/public'; import { EmbeddableExamplesStart } from 'examples/embeddable_examples/public/plugin'; +import { Plugin, CoreSetup, AppMountParameters, AppNavLinkStatus } from '../../../src/core/public'; import { UiActionsService } from '../../../src/plugins/ui_actions/public'; import { EmbeddableStart } from '../../../src/plugins/embeddable/public'; import { Start as InspectorStart } from '../../../src/plugins/inspector/public'; +import { DeveloperExamplesSetup } from '../../developer_examples/public'; +import img from './embeddables.png'; interface StartDeps { uiActions: UiActionsService; @@ -30,11 +31,16 @@ interface StartDeps { embeddableExamples: EmbeddableExamplesStart; } +interface SetupDeps { + developerExamples: DeveloperExamplesSetup; +} + export class EmbeddableExplorerPlugin implements Plugin { - public setup(core: CoreSetup) { + public setup(core: CoreSetup, { developerExamples }: SetupDeps) { core.application.register({ id: 'embeddableExplorer', title: 'Embeddable explorer', + navLinkStatus: AppNavLinkStatus.hidden, async mount(params: AppMountParameters) { const [coreStart, depsStart] = await core.getStartServices(); const { renderApp } = await import('./app'); @@ -55,6 +61,25 @@ export class EmbeddableExplorerPlugin implements Plugin) { + public setup( + core: CoreSetup, + { developerExamples }: SetupDeps + ) { core.application.register({ id: 'searchExplorer', title: 'Search Explorer', + navLinkStatus: AppNavLinkStatus.hidden, async mount(params: AppMountParameters) { const [coreStart, depsStart] = await core.getStartServices(); const { renderApp } = await import('./application'); return renderApp(coreStart, depsStart, params); }, }); + + developerExamples.register({ + appId: 'searchExplorer', + title: 'Data search strategy services', + description: `Data search services can be used to query Elasticsearch in away that supports background search + and partial results, when available. It also automatically incorporates settings such as requestTimeout and includeFrozen. + Use the provided ES search strategy, or register your own. + `, + links: [ + { + label: 'README', + href: + 'https://github.com/elastic/kibana/blob/master/src/plugins/data/public/search/README.md', + iconType: 'logoGithub', + size: 's', + target: '_blank', + }, + ], + }); } public start() {} diff --git a/examples/state_containers_examples/kibana.json b/examples/state_containers_examples/kibana.json index 581b399e3ffba..66da207cb4e77 100644 --- a/examples/state_containers_examples/kibana.json +++ b/examples/state_containers_examples/kibana.json @@ -4,6 +4,6 @@ "kibanaVersion": "kibana", "server": true, "ui": true, - "requiredPlugins": ["navigation", "data"], + "requiredPlugins": ["navigation", "data", "developerExamples"], "optionalPlugins": [] } diff --git a/examples/state_containers_examples/public/plugin.ts b/examples/state_containers_examples/public/plugin.ts index 38ebf315789c0..a4cf7dfd798f3 100644 --- a/examples/state_containers_examples/public/plugin.ts +++ b/examples/state_containers_examples/public/plugin.ts @@ -17,15 +17,21 @@ * under the License. */ -import { AppMountParameters, CoreSetup, Plugin } from 'kibana/public'; +import { AppMountParameters, CoreSetup, Plugin, AppNavLinkStatus } from '../../../src/core/public'; import { AppPluginDependencies } from './with_data_services/types'; import { PLUGIN_ID, PLUGIN_NAME } from '../common'; +import { DeveloperExamplesSetup } from '../../developer_examples/public'; + +interface SetupDeps { + developerExamples: DeveloperExamplesSetup; +} export class StateContainersExamplesPlugin implements Plugin { - public setup(core: CoreSetup) { + public setup(core: CoreSetup, { developerExamples }: SetupDeps) { core.application.register({ id: 'stateContainersExampleBrowserHistory', title: 'State containers example - browser history routing', + navLinkStatus: AppNavLinkStatus.hidden, async mount(params: AppMountParameters) { const { renderApp, History } = await import('./todo/app'); return renderApp(params, { @@ -38,6 +44,7 @@ export class StateContainersExamplesPlugin implements Plugin { core.application.register({ id: 'stateContainersExampleHashHistory', title: 'State containers example - hash history routing', + navLinkStatus: AppNavLinkStatus.hidden, async mount(params: AppMountParameters) { const { renderApp, History } = await import('./todo/app'); return renderApp(params, { @@ -51,6 +58,7 @@ export class StateContainersExamplesPlugin implements Plugin { core.application.register({ id: PLUGIN_ID, title: PLUGIN_NAME, + navLinkStatus: AppNavLinkStatus.hidden, async mount(params: AppMountParameters) { // Load application bundle const { renderApp } = await import('./with_data_services/application'); @@ -60,6 +68,62 @@ export class StateContainersExamplesPlugin implements Plugin { return renderApp(coreStart, depsStart as AppPluginDependencies, params); }, }); + + developerExamples.register({ + appId: 'stateContainersExampleBrowserHistory', + title: 'State containers using browser history', + description: `An example todo app that uses browser history and state container utilities like createStateContainerReactHelpers, + createStateContainer, createKbnUrlStateStorage, createSessionStorageStateStorage, + syncStates and getStateFromKbnUrl to keep state in sync with the URL. Change some parameters, navigate away and then back, and the + state should be preserved.`, + links: [ + { + label: 'README', + href: + 'https://github.com/elastic/kibana/tree/master/src/plugins/kibana_utils/docs/state_containers/README.md', + iconType: 'logoGithub', + size: 's', + target: '_blank', + }, + ], + }); + + developerExamples.register({ + appId: 'stateContainersExampleHashHistory', + title: 'State containers using hash history', + description: `An example todo app that uses hash history and state container utilities like createStateContainerReactHelpers, + createStateContainer, createKbnUrlStateStorage, createSessionStorageStateStorage, + syncStates and getStateFromKbnUrl to keep state in sync with the URL. Change some parameters, navigate away and then back, and the + state should be preserved.`, + links: [ + { + label: 'README', + href: + 'https://github.com/elastic/kibana/tree/master/src/plugins/kibana_utils/docs/state_containers/README.md', + iconType: 'logoGithub', + size: 's', + target: '_blank', + }, + ], + }); + + developerExamples.register({ + appId: PLUGIN_ID, + title: 'Sync state from a query bar with the url', + description: `Shows how to use data.syncQueryStateWitUrl in combination with state container utilities from kibana_utils to + show a query bar that stores state in the url and is kept in sync. + `, + links: [ + { + label: 'README', + href: + 'https://github.com/elastic/kibana/blob/master/src/plugins/data/public/query/state_sync/README.md', + iconType: 'logoGithub', + size: 's', + target: '_blank', + }, + ], + }); } public start() {} diff --git a/examples/state_containers_examples/public/with_data_services/application.tsx b/examples/state_containers_examples/public/with_data_services/application.tsx index 67a2a8b791ae5..d09b77fbf25ee 100644 --- a/examples/state_containers_examples/public/with_data_services/application.tsx +++ b/examples/state_containers_examples/public/with_data_services/application.tsx @@ -27,7 +27,7 @@ import { createKbnUrlStateStorage } from '../../../../src/plugins/kibana_utils/p export const renderApp = ( { notifications, http }: CoreStart, { navigation, data }: AppPluginDependencies, - { appBasePath, element, history }: AppMountParameters + { element, history }: AppMountParameters ) => { const kbnUrlStateStorage = createKbnUrlStateStorage({ useHash: false, history }); diff --git a/examples/state_containers_examples/public/with_data_services/components/app.tsx b/examples/state_containers_examples/public/with_data_services/components/app.tsx index baf627fd62a32..04bdb53efa502 100644 --- a/examples/state_containers_examples/public/with_data_services/components/app.tsx +++ b/examples/state_containers_examples/public/with_data_services/components/app.tsx @@ -78,14 +78,7 @@ const { useContainer: useAppStateContainer, } = createStateContainerReactHelpers>(); -const App = ({ - notifications, - http, - navigation, - data, - history, - kbnUrlStateStorage, -}: StateDemoAppDeps) => { +const App = ({ navigation, data, history, kbnUrlStateStorage }: StateDemoAppDeps) => { const appStateContainer = useAppStateContainer(); const appState = useAppState(); diff --git a/examples/ui_actions_explorer/kibana.json b/examples/ui_actions_explorer/kibana.json index e88739a9e44d6..f57072e89b06d 100644 --- a/examples/ui_actions_explorer/kibana.json +++ b/examples/ui_actions_explorer/kibana.json @@ -4,6 +4,6 @@ "kibanaVersion": "kibana", "server": false, "ui": true, - "requiredPlugins": ["uiActions", "uiActionsExamples"], + "requiredPlugins": ["uiActions", "uiActionsExamples", "developerExamples"], "optionalPlugins": [] } diff --git a/examples/ui_actions_explorer/public/plugin.tsx b/examples/ui_actions_explorer/public/plugin.tsx index de86b51aee3a8..670138b43b9c4 100644 --- a/examples/ui_actions_explorer/public/plugin.tsx +++ b/examples/ui_actions_explorer/public/plugin.tsx @@ -17,8 +17,8 @@ * under the License. */ -import { Plugin, CoreSetup, AppMountParameters } from 'kibana/public'; -import { UiActionsStart, UiActionsSetup } from 'src/plugins/ui_actions/public'; +import { UiActionsStart, UiActionsSetup } from '../../../src/plugins/ui_actions/public'; +import { Plugin, CoreSetup, AppMountParameters, AppNavLinkStatus } from '../../../src/core/public'; import { PHONE_TRIGGER, USER_TRIGGER, @@ -39,6 +39,8 @@ import { ACTION_VIEW_IN_MAPS, ACTION_PHONE_USER, } from './actions/actions'; +import { DeveloperExamplesSetup } from '../../developer_examples/public'; +import image from './ui_actions.png'; interface StartDeps { uiActions: UiActionsStart; @@ -46,6 +48,7 @@ interface StartDeps { interface SetupDeps { uiActions: UiActionsSetup; + developerExamples: DeveloperExamplesSetup; } declare module '../../../src/plugins/ui_actions/public' { @@ -66,7 +69,7 @@ declare module '../../../src/plugins/ui_actions/public' { } export class UiActionsExplorerPlugin implements Plugin { - public setup(core: CoreSetup<{ uiActions: UiActionsStart }>, deps: SetupDeps) { + public setup(core: CoreSetup, deps: SetupDeps) { deps.uiActions.registerTrigger({ id: COUNTRY_TRIGGER, }); @@ -98,6 +101,7 @@ export class UiActionsExplorerPlugin implements Plugin { - public setup(core: CoreSetup) { +interface SetupDeps { + developerExamples: DeveloperExamplesSetup; +} + +export class AccessLinksExplorerPlugin implements Plugin { + public setup(core: CoreSetup, { developerExamples }: SetupDeps) { core.application.register({ id: 'urlGeneratorsExplorer', title: 'Access links explorer', + navLinkStatus: AppNavLinkStatus.hidden, async mount(params: AppMountParameters) { const depsStart = (await core.getStartServices())[1]; const { renderApp } = await import('./app'); @@ -40,6 +45,26 @@ export class AccessLinksExplorerPlugin implements Plugin nav, > navbar { z-index: 2 !important; diff --git a/src/plugins/dashboard/public/application/dashboard_app_controller.tsx b/src/plugins/dashboard/public/application/dashboard_app_controller.tsx index a59d1e8c546d4..206ef4f3d4313 100644 --- a/src/plugins/dashboard/public/application/dashboard_app_controller.tsx +++ b/src/plugins/dashboard/public/application/dashboard_app_controller.tsx @@ -19,8 +19,9 @@ import _, { uniq } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { EUI_MODAL_CANCEL_BUTTON } from '@elastic/eui'; -import React from 'react'; +import { EUI_MODAL_CANCEL_BUTTON, EuiCheckboxGroup } from '@elastic/eui'; +import { EuiCheckboxGroupIdToSelectedMap } from '@elastic/eui/src/components/form/checkbox/checkbox_group'; +import React, { useState, ReactElement } from 'react'; import ReactDOM from 'react-dom'; import angular from 'angular'; @@ -94,6 +95,25 @@ export interface DashboardAppControllerDependencies extends RenderDeps { navigation: NavigationStart; } +enum UrlParams { + SHOW_TOP_MENU = 'show-top-menu', + SHOW_QUERY_INPUT = 'show-query-input', + SHOW_TIME_FILTER = 'show-time-filter', + SHOW_FILTER_BAR = 'show-filter-bar', + HIDE_FILTER_BAR = 'hide-filter-bar', +} + +interface UrlParamsSelectedMap { + [UrlParams.SHOW_TOP_MENU]: boolean; + [UrlParams.SHOW_QUERY_INPUT]: boolean; + [UrlParams.SHOW_TIME_FILTER]: boolean; + [UrlParams.SHOW_FILTER_BAR]: boolean; +} + +interface UrlParamValues extends Omit { + [UrlParams.HIDE_FILTER_BAR]: boolean; +} + export class DashboardAppController { // Part of the exposed plugin API - do not remove without careful consideration. appStatus: { @@ -133,8 +153,16 @@ export class DashboardAppController { const filterManager = queryService.filterManager; const queryFilter = filterManager; const timefilter = queryService.timefilter.timefilter; - let showSearchBar = true; - let showQueryBar = true; + const isEmbeddedExternally = Boolean($routeParams.embed); + + // url param rules should only apply when embedded (e.g. url?embed=true) + const shouldForceDisplay = (param: string): boolean => + isEmbeddedExternally && Boolean($routeParams[param]); + + const forceShowTopNavMenu = shouldForceDisplay(UrlParams.SHOW_TOP_MENU); + const forceShowQueryInput = shouldForceDisplay(UrlParams.SHOW_QUERY_INPUT); + const forceShowDatePicker = shouldForceDisplay(UrlParams.SHOW_TIME_FILTER); + const forceHideFilterBar = shouldForceDisplay(UrlParams.HIDE_FILTER_BAR); let lastReloadRequestTime = 0; const dash = ($scope.dash = $route.current.locals.dash); @@ -251,9 +279,6 @@ export class DashboardAppController { } }; - const showFilterBar = () => - $scope.model.filters.length > 0 || !dashboardStateManager.getFullScreenMode(); - const getEmptyScreenProps = ( shouldShowEditHelp: boolean, isEmptyInReadOnlyMode: boolean @@ -299,6 +324,7 @@ export class DashboardAppController { viewMode: dashboardStateManager.getViewMode(), panels: embeddablesMap, isFullScreenMode: dashboardStateManager.getFullScreenMode(), + isEmbeddedExternally, isEmptyState: shouldShowEditHelp || shouldShowViewHelp || isEmptyInReadonlyMode, useMargins: dashboardStateManager.getUseMargins(), lastReloadRequestTime, @@ -590,17 +616,33 @@ export class DashboardAppController { dashboardStateManager.setSavedQueryId(savedQueryId); }; + const shouldShowFilterBar = (forceHide: boolean): boolean => + !forceHide && ($scope.model.filters.length > 0 || !dashboardStateManager.getFullScreenMode()); + + const shouldShowNavBarComponent = (forceShow: boolean): boolean => + (forceShow || $scope.isVisible) && !dashboardStateManager.getFullScreenMode(); + const getNavBarProps = () => { const isFullScreenMode = dashboardStateManager.getFullScreenMode(); const screenTitle = dashboardStateManager.getTitle(); + const showTopNavMenu = shouldShowNavBarComponent(forceShowTopNavMenu); + const showQueryInput = shouldShowNavBarComponent(forceShowQueryInput); + const showDatePicker = shouldShowNavBarComponent(forceShowDatePicker); + const showQueryBar = showQueryInput || showDatePicker; + const showFilterBar = shouldShowFilterBar(forceHideFilterBar); + const showSearchBar = showQueryBar || showFilterBar; + return { appName: 'dashboard', - config: $scope.isVisible ? $scope.topNavMenu : undefined, + config: showTopNavMenu ? $scope.topNavMenu : undefined, className: isFullScreenMode ? 'kbnTopNavMenu-isFullScreen' : undefined, screenTitle, + showTopNavMenu, showSearchBar, showQueryBar, - showFilterBar: showFilterBar(), + showQueryInput, + showDatePicker, + showFilterBar, indexPatterns: $scope.indexPatterns, showSaveQuery: $scope.showSaveQuery, query: $scope.model.query, @@ -798,7 +840,6 @@ export class DashboardAppController { } = {}; navActions[TopNavIds.FULL_SCREEN] = () => { dashboardStateManager.setFullScreenMode(true); - showQueryBar = false; updateNavBar(); }; navActions[TopNavIds.EXIT_EDIT_MODE] = () => onChangeViewMode(ViewMode.VIEW); @@ -923,6 +964,80 @@ export class DashboardAppController { if (share) { // the share button is only availabale if "share" plugin contract enabled navActions[TopNavIds.SHARE] = (anchorElement) => { + const EmbedUrlParamExtension = ({ + setParamValue, + }: { + setParamValue: (paramUpdate: UrlParamValues) => void; + }): ReactElement => { + const [urlParamsSelectedMap, setUrlParamsSelectedMap] = useState({ + [UrlParams.SHOW_TOP_MENU]: false, + [UrlParams.SHOW_QUERY_INPUT]: false, + [UrlParams.SHOW_TIME_FILTER]: false, + [UrlParams.SHOW_FILTER_BAR]: true, + }); + + const checkboxes = [ + { + id: UrlParams.SHOW_TOP_MENU, + label: i18n.translate('dashboard.embedUrlParamExtension.topMenu', { + defaultMessage: 'Top menu', + }), + }, + { + id: UrlParams.SHOW_QUERY_INPUT, + label: i18n.translate('dashboard.embedUrlParamExtension.query', { + defaultMessage: 'Query', + }), + }, + { + id: UrlParams.SHOW_TIME_FILTER, + label: i18n.translate('dashboard.embedUrlParamExtension.timeFilter', { + defaultMessage: 'Time filter', + }), + }, + { + id: UrlParams.SHOW_FILTER_BAR, + label: i18n.translate('dashboard.embedUrlParamExtension.filterBar', { + defaultMessage: 'Filter bar', + }), + }, + ]; + + const handleChange = (param: string): void => { + const urlParamsSelectedMapUpdate = { + ...urlParamsSelectedMap, + [param]: !urlParamsSelectedMap[param as keyof UrlParamsSelectedMap], + }; + setUrlParamsSelectedMap(urlParamsSelectedMapUpdate); + + const urlParamValues = { + [UrlParams.SHOW_TOP_MENU]: urlParamsSelectedMap[UrlParams.SHOW_TOP_MENU], + [UrlParams.SHOW_QUERY_INPUT]: urlParamsSelectedMap[UrlParams.SHOW_QUERY_INPUT], + [UrlParams.SHOW_TIME_FILTER]: urlParamsSelectedMap[UrlParams.SHOW_TIME_FILTER], + [UrlParams.HIDE_FILTER_BAR]: !urlParamsSelectedMap[UrlParams.SHOW_FILTER_BAR], + [param === UrlParams.SHOW_FILTER_BAR ? UrlParams.HIDE_FILTER_BAR : param]: + param === UrlParams.SHOW_FILTER_BAR + ? urlParamsSelectedMap[UrlParams.SHOW_FILTER_BAR] + : !urlParamsSelectedMap[param as keyof UrlParamsSelectedMap], + }; + setParamValue(urlParamValues); + }; + + return ( + + ); + }; + share.toggleShareContextMenu({ anchorElement, allowEmbed: true, @@ -935,6 +1050,12 @@ export class DashboardAppController { title: dash.title, }, isDirty: dashboardStateManager.getIsDirty(), + embedUrlParamExtensions: [ + { + paramName: 'embed', + component: EmbedUrlParamExtension, + }, + ], }); }; } @@ -955,8 +1076,6 @@ export class DashboardAppController { const visibleSubscription = chrome.getIsVisible$().subscribe((isVisible) => { $scope.$evalAsync(() => { $scope.isVisible = isVisible; - showSearchBar = isVisible || showFilterBar(); - showQueryBar = !dashboardStateManager.getFullScreenMode() && isVisible; updateNavBar(); }); }); diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index 5d4cc851cf455..2121ca4c784bd 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -57,6 +57,7 @@ export interface DashboardContainerInput extends ContainerInput { useMargins: boolean; title: string; description?: string; + isEmbeddedExternally: boolean; isFullScreenMode: boolean; panels: { [panelId: string]: DashboardPanelState; @@ -105,6 +106,7 @@ export class DashboardContainer extends Container { return { panels: {}, + isEmbeddedExternally: false, isFullScreenMode: false, useMargins: true, }; diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx index 429837583b648..9ee50426b19bb 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx @@ -36,6 +36,7 @@ interface State { title: string; description?: string; panels: { [key: string]: PanelState }; + isEmbeddedExternally?: boolean; isEmptyState?: boolean; } @@ -52,6 +53,7 @@ export class DashboardViewport extends React.Component {isFullScreenMode && ( )} {renderEmpty && renderEmpty()} @@ -116,7 +122,14 @@ export class DashboardViewport extends React.Component )} diff --git a/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts b/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts index 4ceac90672cb3..825a69155ba22 100644 --- a/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts +++ b/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts @@ -27,6 +27,7 @@ export function getSampleDashboardInput( id: '123', filters: [], useMargins: false, + isEmbeddedExternally: false, isFullScreenMode: false, title: 'My Dashboard', query: { diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index 0de3982039928..a3338ab3bbcbb 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -167,15 +167,26 @@ export class DashboardPlugin const getStartServices = async () => { const [coreStart, deps] = await core.getStartServices(); - const useHideChrome = () => { + const useHideChrome = ({ toggleChrome } = { toggleChrome: true }) => { React.useEffect(() => { - coreStart.chrome.setIsVisible(false); - return () => coreStart.chrome.setIsVisible(true); - }, []); + if (toggleChrome) { + coreStart.chrome.setIsVisible(false); + } + + return () => { + if (toggleChrome) { + coreStart.chrome.setIsVisible(true); + } + }; + }, [toggleChrome]); }; - const ExitFullScreenButton: React.FC = (props) => { - useHideChrome(); + const ExitFullScreenButton: React.FC< + ExitFullScreenButtonProps & { + toggleChrome: boolean; + } + > = ({ toggleChrome, ...props }) => { + useHideChrome({ toggleChrome }); return ; }; return { diff --git a/src/plugins/data/public/index_patterns/index_patterns/_pattern_cache.ts b/src/plugins/data/public/index_patterns/index_patterns/_pattern_cache.ts index eb6c69b414316..a3653bb529fa3 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/_pattern_cache.ts +++ b/src/plugins/data/public/index_patterns/index_patterns/_pattern_cache.ts @@ -19,7 +19,7 @@ import { IndexPattern } from './index_pattern'; -interface PatternCache { +export interface PatternCache { get: (id: string) => IndexPattern; set: (id: string, value: IndexPattern) => IndexPattern; clear: (id: string) => void; diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.test.ts b/src/plugins/data/public/index_patterns/index_patterns/index_pattern.test.ts index e4058007e0a57..84135bb5d1e2b 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.test.ts +++ b/src/plugins/data/public/index_patterns/index_patterns/index_pattern.test.ts @@ -85,6 +85,9 @@ const savedObjectsClient = { const patternCache = { clear: jest.fn(), + get: jest.fn(), + set: jest.fn(), + clearAll: jest.fn(), }; const config = { diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts b/src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts index 3d54009d0fdca..84ea12a1f684f 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts +++ b/src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts @@ -44,6 +44,7 @@ import { flattenHitWrapper } from './flatten_hit'; import { IIndexPatternsApiClient } from './index_patterns_api_client'; import { getNotifications, getFieldFormats } from '../../services'; import { TypeMeta } from './types'; +import { PatternCache } from './_pattern_cache'; const MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS = 3; const type = 'index-pattern'; @@ -65,12 +66,13 @@ export class IndexPattern implements IIndexPattern { private version: string | undefined; private savedObjectsClient: SavedObjectsClientContract; - private patternCache: any; + private patternCache: PatternCache; private getConfig: any; private sourceFilters?: []; private originalBody: { [key: string]: any } = {}; public fieldsFetcher: any; // probably want to factor out any direct usage and change to private private shortDotsEnable: boolean = false; + private apiClient: IIndexPatternsApiClient; private mapping: MappingObject = expandShorthand({ title: ES_FIELD_TYPES.TEXT, @@ -99,7 +101,7 @@ export class IndexPattern implements IIndexPattern { getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, - patternCache: any + patternCache: PatternCache ) { this.id = id; this.savedObjectsClient = savedObjectsClient; @@ -117,6 +119,7 @@ export class IndexPattern implements IIndexPattern { }); this.fields = this.createFieldList(this, [], this.shortDotsEnable); + this.apiClient = apiClient; this.fieldsFetcher = createFieldsFetcher( this, apiClient, @@ -396,8 +399,8 @@ export class IndexPattern implements IIndexPattern { duplicateId, this.getConfig, this.savedObjectsClient, - this.patternCache, - this.fieldsFetcher + this.apiClient, + this.patternCache ); await duplicatePattern.destroy(); } @@ -445,8 +448,8 @@ export class IndexPattern implements IIndexPattern { this.id, this.getConfig, this.savedObjectsClient, - this.patternCache, - this.fieldsFetcher + this.apiClient, + this.patternCache ); return samePattern.init().then(() => { // What keys changed from now and what the server returned @@ -489,7 +492,7 @@ export class IndexPattern implements IIndexPattern { this.version = samePattern.version; // Clear cache - this.patternCache.clear(this.id); + this.patternCache.clear(this.id!); // Try the save again return this.save(saveAttempts); @@ -545,8 +548,8 @@ export class IndexPattern implements IIndexPattern { } destroy() { - this.patternCache.clear(this.id); if (this.id) { + this.patternCache.clear(this.id); return this.savedObjectsClient.delete(type, this.id); } } diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index dcdb528ac8b7d..e6f6ba0c1bd12 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -842,7 +842,8 @@ export type IMetricAggType = MetricAggType; // @public (undocumented) export class IndexPattern implements IIndexPattern { // Warning: (ae-forgotten-export) The symbol "IIndexPatternsApiClient" needs to be exported by the entry point index.d.ts - constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: any); + // Warning: (ae-forgotten-export) The symbol "PatternCache" needs to be exported by the entry point index.d.ts + constructor(id: string | undefined, getConfig: any, savedObjectsClient: SavedObjectsClientContract, apiClient: IIndexPatternsApiClient, patternCache: PatternCache); // (undocumented) [key: string]: any; // (undocumented) diff --git a/src/plugins/data/public/ui/filter_bar/_global_filter_group.scss b/src/plugins/data/public/ui/filter_bar/_global_filter_group.scss index 1c47c28097454..731c9f4d7f18d 100644 --- a/src/plugins/data/public/ui/filter_bar/_global_filter_group.scss +++ b/src/plugins/data/public/ui/filter_bar/_global_filter_group.scss @@ -3,6 +3,10 @@ padding: 0px $euiSizeS $euiSizeS $euiSizeS; } +.globalQueryBar:first-child { + padding-top: $euiSizeS; +} + .globalQueryBar:not(:empty) { padding-bottom: $euiSizeS; } diff --git a/src/plugins/kibana_legacy/public/angular/kbn_top_nav.js b/src/plugins/kibana_legacy/public/angular/kbn_top_nav.js index a0faf4a6a071c..b3fbe8baadec3 100644 --- a/src/plugins/kibana_legacy/public/angular/kbn_top_nav.js +++ b/src/plugins/kibana_legacy/public/angular/kbn_top_nav.js @@ -94,11 +94,11 @@ export const createTopNavHelper = ({ TopNavMenu }) => (reactDirective) => { // All modifiers default to true. // Set to false to hide subcomponents. 'showSearchBar', - 'showFilterBar', 'showQueryBar', 'showQueryInput', - 'showDatePicker', 'showSaveQuery', + 'showDatePicker', + 'showFilterBar', 'appName', 'screenTitle', diff --git a/src/plugins/navigation/public/top_nav_menu/top_nav_menu.test.tsx b/src/plugins/navigation/public/top_nav_menu/top_nav_menu.test.tsx index 74cfd125c2e3a..46384fb3f27d5 100644 --- a/src/plugins/navigation/public/top_nav_menu/top_nav_menu.test.tsx +++ b/src/plugins/navigation/public/top_nav_menu/top_nav_menu.test.tsx @@ -29,6 +29,7 @@ const dataShim = { }; describe('TopNavMenu', () => { + const WRAPPER_SELECTOR = '.kbnTopNavMenu__wrapper'; const TOP_NAV_ITEM_SELECTOR = 'TopNavMenuItem'; const SEARCH_BAR_SELECTOR = 'SearchBar'; const menuItems: TopNavMenuData[] = [ @@ -51,18 +52,28 @@ describe('TopNavMenu', () => { it('Should render nothing when no config is provided', () => { const component = shallowWithIntl(); + expect(component.find(WRAPPER_SELECTOR).length).toBe(0); + expect(component.find(TOP_NAV_ITEM_SELECTOR).length).toBe(0); + expect(component.find(SEARCH_BAR_SELECTOR).length).toBe(0); + }); + + it('Should not render menu items when config is empty', () => { + const component = shallowWithIntl(); + expect(component.find(WRAPPER_SELECTOR).length).toBe(0); expect(component.find(TOP_NAV_ITEM_SELECTOR).length).toBe(0); expect(component.find(SEARCH_BAR_SELECTOR).length).toBe(0); }); it('Should render 1 menu item', () => { const component = shallowWithIntl(); + expect(component.find(WRAPPER_SELECTOR).length).toBe(1); expect(component.find(TOP_NAV_ITEM_SELECTOR).length).toBe(1); expect(component.find(SEARCH_BAR_SELECTOR).length).toBe(0); }); it('Should render multiple menu items', () => { const component = shallowWithIntl(); + expect(component.find(WRAPPER_SELECTOR).length).toBe(1); expect(component.find(TOP_NAV_ITEM_SELECTOR).length).toBe(menuItems.length); expect(component.find(SEARCH_BAR_SELECTOR).length).toBe(0); }); @@ -71,15 +82,25 @@ describe('TopNavMenu', () => { const component = shallowWithIntl( ); - + expect(component.find(WRAPPER_SELECTOR).length).toBe(1); expect(component.find(TOP_NAV_ITEM_SELECTOR).length).toBe(0); expect(component.find(SEARCH_BAR_SELECTOR).length).toBe(1); }); + it('Should render menu items and search bar', () => { + const component = shallowWithIntl( + + ); + expect(component.find(WRAPPER_SELECTOR).length).toBe(1); + expect(component.find(TOP_NAV_ITEM_SELECTOR).length).toBe(menuItems.length); + expect(component.find(SEARCH_BAR_SELECTOR).length).toBe(1); + }); + it('Should render with a class name', () => { const component = shallowWithIntl( { return ( + {renderItems()} + + ); + } + + function renderSearchBar(): ReactElement | null { // Validate presense of all required fields - if (!showSearchBar || !props.data) return; + if (!showSearchBar || !props.data) return null; const { SearchBar } = props.data.ui; return ; } @@ -70,16 +95,7 @@ export function TopNavMenu(props: TopNavMenuProps) { const className = classNames('kbnTopNavMenu', props.className); return ( - - {renderItems()} - + {renderMenu(className)} {renderSearchBar()} ); diff --git a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts b/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts index 952e9628d2846..79b8c33b84cfe 100644 --- a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts +++ b/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts @@ -27,6 +27,7 @@ import { IIndexPattern, injectSearchSourceReferences, } from '../../../data/public'; +import { FailedImport } from './process_import_response'; type SavedObjectsRawDoc = Record; @@ -277,7 +278,7 @@ export async function resolveSavedObjects( // Keep track of how many we actually import because the user // can cancel an override let importedObjectCount = 0; - const failedImports: any[] = []; + const failedImports: FailedImport[] = []; // Start with the index patterns since everything is dependent on them await awaitEachItemInParallel(docTypes.indexPatterns, async (indexPatternDoc) => { try { @@ -291,7 +292,7 @@ export async function resolveSavedObjects( importedObjectCount++; } } catch (error) { - failedImports.push({ indexPatternDoc, error }); + failedImports.push({ obj: indexPatternDoc as any, error }); } }); diff --git a/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap b/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap index 8787e0c027375..cae7aa96a7c0e 100644 --- a/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap +++ b/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap @@ -44,7 +44,9 @@ exports[`share url panel content render 1`] = ` gutterSize="none" responsive={false} > - + - + - + - + - + - + - + - + `; + +exports[`should show url param extensions 1`] = ` + + + + } + labelType="label" + > + + + + + + + } + position="bottom" + /> + + , + }, + Object { + "data-test-subj": "exportAsSavedObject", + "disabled": false, + "id": "savedObject", + "label": + + + + + + } + position="bottom" + /> + + , + }, + ] + } + /> + + + + + + + + + } + onChange={[Function]} + /> + + + + } + position="bottom" + /> + + + + + + + + + +`; diff --git a/src/plugins/share/public/components/share_context_menu.tsx b/src/plugins/share/public/components/share_context_menu.tsx index c12e9dabd1938..26426853ddabe 100644 --- a/src/plugins/share/public/components/share_context_menu.tsx +++ b/src/plugins/share/public/components/share_context_menu.tsx @@ -26,7 +26,7 @@ import { EuiContextMenu, EuiContextMenuPanelDescriptor } from '@elastic/eui'; import { HttpStart } from 'kibana/public'; import { UrlPanelContent } from './url_panel_content'; -import { ShareMenuItem, ShareContextMenuPanelItem } from '../types'; +import { ShareMenuItem, ShareContextMenuPanelItem, UrlParamExtension } from '../types'; interface Props { allowEmbed: boolean; @@ -39,6 +39,7 @@ interface Props { onClose: () => void; basePath: string; post: HttpStart['post']; + embedUrlParamExtensions?: UrlParamExtension[]; } export class ShareContextMenu extends Component { @@ -100,6 +101,7 @@ export class ShareContextMenu extends Component { basePath={this.props.basePath} post={this.props.post} shareableUrl={this.props.shareableUrl} + urlParamExtensions={this.props.embedUrlParamExtensions} /> ), }; diff --git a/src/plugins/share/public/components/url_panel_content.test.tsx b/src/plugins/share/public/components/url_panel_content.test.tsx index bd30dbf002df8..481f8312f4262 100644 --- a/src/plugins/share/public/components/url_panel_content.test.tsx +++ b/src/plugins/share/public/components/url_panel_content.test.tsx @@ -202,3 +202,13 @@ describe('share url panel content', () => { }); }); }); + +test('should show url param extensions', () => { + const TestExtension = () =>
; + const extensions = [{ paramName: 'testExtension', component: TestExtension }]; + const component = shallow( + + ); + expect(component.find('TestExtension').length).toBe(1); + expect(component).toMatchSnapshot(); +}); diff --git a/src/plugins/share/public/components/url_panel_content.tsx b/src/plugins/share/public/components/url_panel_content.tsx index 2ece2052c4b95..65a8538693a49 100644 --- a/src/plugins/share/public/components/url_panel_content.tsx +++ b/src/plugins/share/public/components/url_panel_content.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { Component } from 'react'; +import React, { Component, ReactElement } from 'react'; import { EuiButton, @@ -41,6 +41,7 @@ import { HttpStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { shortenUrl } from '../lib/url_shortener'; +import { UrlParamExtension } from '../types'; interface Props { allowShortUrl: boolean; @@ -50,6 +51,7 @@ interface Props { shareableUrl?: string; basePath: string; post: HttpStart['post']; + urlParamExtensions?: UrlParamExtension[]; } export enum ExportUrlAsType { @@ -57,12 +59,19 @@ export enum ExportUrlAsType { EXPORT_URL_AS_SNAPSHOT = 'snapshot', } +interface UrlParams { + [extensionName: string]: { + [queryParam: string]: boolean; + }; +} + interface State { exportUrlAs: ExportUrlAsType; useShortUrl: boolean; isCreatingShortUrl: boolean; url?: string; shortUrlErrorMsg?: string; + urlParams?: UrlParams; } export class UrlPanelContent extends Component { @@ -100,7 +109,7 @@ export class UrlPanelContent extends Component { {this.renderExportAsRadioGroup()} - + {this.renderUrlParamExtensions()} {this.renderShortUrlSwitch()} @@ -151,6 +160,13 @@ export class UrlPanelContent extends Component { } }; + private updateUrlParams = (url: string) => { + const embedUrl = this.props.isEmbedded ? this.makeUrlEmbeddable(url) : url; + const extendUrl = this.state.urlParams ? this.getUrlParamExtensions(embedUrl) : embedUrl; + + return extendUrl; + }; + private getSavedObjectUrl = () => { if (this.isNotSaved()) { return; @@ -166,7 +182,7 @@ export class UrlPanelContent extends Component { // Get the application route, after the hash, and remove the #. const parsedAppUrl = parseUrl(parsedUrl.hash.slice(1), true); - let formattedUrl = formatUrl({ + const formattedUrl = formatUrl({ protocol: parsedUrl.protocol, auth: parsedUrl.auth, host: parsedUrl.host, @@ -180,28 +196,42 @@ export class UrlPanelContent extends Component { }, }), }); - if (this.props.isEmbedded) { - formattedUrl = this.makeUrlEmbeddable(formattedUrl); - } - return formattedUrl; + return this.updateUrlParams(formattedUrl); }; private getSnapshotUrl = () => { - let url = this.props.shareableUrl || window.location.href; - if (this.props.isEmbedded) { - url = this.makeUrlEmbeddable(url); - } - return url; + const url = this.props.shareableUrl || window.location.href; + + return this.updateUrlParams(url); }; - private makeUrlEmbeddable = (url: string) => { - const embedQueryParam = '?embed=true'; + private makeUrlEmbeddable = (url: string): string => { + const embedParam = '?embed=true'; const urlHasQueryString = url.indexOf('?') !== -1; + if (urlHasQueryString) { - return url.replace('?', `${embedQueryParam}&`); + return url.replace('?', `${embedParam}&`); } - return `${url}${embedQueryParam}`; + + return `${url}${embedParam}`; + }; + + private getUrlParamExtensions = (url: string): string => { + const { urlParams } = this.state; + return urlParams + ? Object.keys(urlParams).reduce((urlAccumulator, key) => { + const urlParam = urlParams[key]; + return urlParam + ? Object.keys(urlParam).reduce((queryAccumulator, queryParam) => { + const isQueryParamEnabled = urlParam[queryParam]; + return isQueryParamEnabled + ? queryAccumulator + `&${queryParam}=true` + : queryAccumulator; + }, urlAccumulator) + : urlAccumulator; + }, url) + : url; }; private makeIframeTag = (url?: string) => { @@ -247,6 +277,10 @@ export class UrlPanelContent extends Component { } // "Use short URL" is checked but shortUrl has not been generated yet so one needs to be created. + this.createShortUrl(); + }; + + private createShortUrl = async () => { this.setState({ isCreatingShortUrl: true, shortUrlErrorMsg: undefined, @@ -262,7 +296,7 @@ export class UrlPanelContent extends Component { this.setState( { isCreatingShortUrl: false, - useShortUrl: isChecked, + useShortUrl: true, }, this.setUrl ); @@ -321,7 +355,7 @@ export class UrlPanelContent extends Component { private renderWithIconTip = (child: React.ReactNode, tipContent: React.ReactNode) => { return ( - {child} + {child} @@ -397,4 +431,34 @@ export class UrlPanelContent extends Component { ); }; + + private renderUrlParamExtensions = (): ReactElement | void => { + if (!this.props.urlParamExtensions) { + return; + } + + const setParamValue = (paramName: string) => ( + values: { [queryParam: string]: boolean } = {} + ): void => { + const stateUpdate = { + urlParams: { + ...this.state.urlParams, + [paramName]: { + ...values, + }, + }, + }; + this.setState(stateUpdate, this.state.useShortUrl ? this.createShortUrl : this.setUrl); + }; + + return ( + + {this.props.urlParamExtensions.map(({ paramName, component: UrlParamComponent }) => ( + + + + ))} + + ); + }; } diff --git a/src/plugins/share/public/services/share_menu_manager.tsx b/src/plugins/share/public/services/share_menu_manager.tsx index 35116efa85961..3325c5503fe89 100644 --- a/src/plugins/share/public/services/share_menu_manager.tsx +++ b/src/plugins/share/public/services/share_menu_manager.tsx @@ -67,6 +67,7 @@ export class ShareMenuManager { shareableUrl, post, basePath, + embedUrlParamExtensions, }: ShowShareMenuOptions & { menuItems: ShareMenuItem[]; post: HttpStart['post']; @@ -102,6 +103,7 @@ export class ShareMenuManager { onClose={this.onClose} post={post} basePath={basePath} + embedUrlParamExtensions={embedUrlParamExtensions} /> diff --git a/src/plugins/share/public/types.ts b/src/plugins/share/public/types.ts index 6b20f1f53a28c..8dda9f1195a39 100644 --- a/src/plugins/share/public/types.ts +++ b/src/plugins/share/public/types.ts @@ -17,6 +17,7 @@ * under the License. */ +import { ComponentType } from 'react'; import { EuiContextMenuPanelDescriptor, EuiContextMenuPanelItemDescriptor } from '@elastic/eui'; /** @@ -80,9 +81,19 @@ export interface ShareMenuProvider { getShareMenuItems: (context: ShareContext) => ShareMenuItem[]; } +interface UrlParamExtensionProps { + setParamValue: (values: {}) => void; +} + +export interface UrlParamExtension { + paramName: string; + component: ComponentType; +} + /** @public */ export interface ShowShareMenuOptions extends Omit { anchorElement: HTMLElement; allowEmbed: boolean; allowShortUrl: boolean; + embedUrlParamExtensions?: UrlParamExtension[]; } diff --git a/test/plugin_functional/test_suites/bfetch_explorer/batched_function.ts b/test/examples/bfetch_explorer/batched_function.ts similarity index 93% rename from test/plugin_functional/test_suites/bfetch_explorer/batched_function.ts rename to test/examples/bfetch_explorer/batched_function.ts index 25c5ba4a7ca3e..3fe17169dde7e 100644 --- a/test/plugin_functional/test_suites/bfetch_explorer/batched_function.ts +++ b/test/examples/bfetch_explorer/batched_function.ts @@ -18,15 +18,14 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../functional/ftr_provider_context'; +import { FtrProviderContext } from '../../functional/ftr_provider_context'; +// eslint-disable-next-line import/no-default-export export default function ({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); - const appsMenu = getService('appsMenu'); describe('batchedFunction', () => { beforeEach(async () => { - await appsMenu.clickLink('bfetch explorer'); await testSubjects.click('count-until'); await testSubjects.click('double-integers'); }); diff --git a/test/plugin_functional/test_suites/bfetch_explorer/index.ts b/test/examples/bfetch_explorer/index.ts similarity index 83% rename from test/plugin_functional/test_suites/bfetch_explorer/index.ts rename to test/examples/bfetch_explorer/index.ts index a68a5090b9bed..1f039a2ea415c 100644 --- a/test/plugin_functional/test_suites/bfetch_explorer/index.ts +++ b/test/examples/bfetch_explorer/index.ts @@ -17,18 +17,17 @@ * under the License. */ -import { FtrProviderContext } from '../../../functional/ftr_provider_context'; +import { FtrProviderContext } from '../../functional/ftr_provider_context'; +// eslint-disable-next-line import/no-default-export export default function ({ getService, getPageObjects, loadTestFile }: FtrProviderContext) { const browser = getService('browser'); - const appsMenu = getService('appsMenu'); const PageObjects = getPageObjects(['common', 'header']); describe('bfetch explorer', function () { before(async () => { await browser.setWindowSize(1300, 900); - await PageObjects.common.navigateToApp('settings'); - await appsMenu.clickLink('bfetch explorer'); + await PageObjects.common.navigateToApp('bfetch-explorer', { insertTimestamp: false }); }); loadTestFile(require.resolve('./batched_function')); diff --git a/test/examples/config.js b/test/examples/config.js index aedd06c31d413..228af71a1f5d0 100644 --- a/test/examples/config.js +++ b/test/examples/config.js @@ -27,6 +27,7 @@ export default async function ({ readConfigFile }) { testFiles: [ require.resolve('./search'), require.resolve('./embeddables'), + require.resolve('./bfetch_explorer'), require.resolve('./ui_actions'), require.resolve('./state_sync'), ], diff --git a/test/examples/embeddables/adding_children.ts b/test/examples/embeddables/adding_children.ts index 25fe7ee607f72..a26ce4c40e2ea 100644 --- a/test/examples/embeddables/adding_children.ts +++ b/test/examples/embeddables/adding_children.ts @@ -25,8 +25,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { const testSubjects = getService('testSubjects'); const flyout = getService('flyout'); - // FLAKY: https://github.com/elastic/kibana/issues/58692 - describe.skip('creating and adding children', () => { + describe('creating and adding children', () => { before(async () => { await testSubjects.click('embeddablePanelExamplae'); }); diff --git a/test/examples/embeddables/index.ts b/test/examples/embeddables/index.ts index 878b1b9277ba1..d0d7d4a01fbae 100644 --- a/test/examples/embeddables/index.ts +++ b/test/examples/embeddables/index.ts @@ -26,14 +26,12 @@ export default function ({ loadTestFile, }: PluginFunctionalProviderContext) { const browser = getService('browser'); - const appsMenu = getService('appsMenu'); const PageObjects = getPageObjects(['common', 'header']); describe('embeddable explorer', function () { before(async () => { await browser.setWindowSize(1300, 900); - await PageObjects.common.navigateToApp('settings'); - await appsMenu.clickLink('Embeddable explorer'); + await PageObjects.common.navigateToApp('embeddableExplorer'); }); loadTestFile(require.resolve('./hello_world_embeddable')); diff --git a/test/examples/search/index.ts b/test/examples/search/index.ts index 2fb37afd248e2..706e9659fc010 100644 --- a/test/examples/search/index.ts +++ b/test/examples/search/index.ts @@ -22,7 +22,6 @@ import { FtrProviderContext } from 'test/functional/ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function ({ getService, getPageObjects, loadTestFile }: FtrProviderContext) { const browser = getService('browser'); - const appsMenu = getService('appsMenu'); const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['common', 'header']); @@ -36,8 +35,7 @@ export default function ({ getService, getPageObjects, loadTestFile }: FtrProvid defaultIndex: 'logstash-*', }); await browser.setWindowSize(1300, 900); - await PageObjects.common.navigateToApp('settings'); - await appsMenu.clickLink('Search Explorer'); + await PageObjects.common.navigateToApp('searchExplorer'); }); after(async function () { diff --git a/test/examples/state_sync/index.ts b/test/examples/state_sync/index.ts index ea1c7692f64fe..297cd8f472b95 100644 --- a/test/examples/state_sync/index.ts +++ b/test/examples/state_sync/index.ts @@ -26,12 +26,10 @@ export default function ({ loadTestFile, }: PluginFunctionalProviderContext) { const browser = getService('browser'); - const PageObjects = getPageObjects(['common']); describe('state sync examples', function () { before(async () => { await browser.setWindowSize(1300, 900); - await PageObjects.common.navigateToApp('settings'); }); loadTestFile(require.resolve('./todo_app')); diff --git a/test/examples/state_sync/todo_app.ts b/test/examples/state_sync/todo_app.ts index 71b491a05ae2f..1ac5376b9ed8d 100644 --- a/test/examples/state_sync/todo_app.ts +++ b/test/examples/state_sync/todo_app.ts @@ -26,7 +26,6 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide const testSubjects = getService('testSubjects'); const find = getService('find'); const retry = getService('retry'); - const appsMenu = getService('appsMenu'); const browser = getService('browser'); const PageObjects = getPageObjects(['common']); const log = getService('log'); @@ -38,7 +37,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide before(async () => { base = await PageObjects.common.getHostPort(); - await appsMenu.clickLink('State containers example - browser history routing'); + await PageObjects.common.navigateToApp(appId, { insertTimestamp: false }); }); it('links are rendered correctly and state is preserved in links', async () => { @@ -119,7 +118,9 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide describe('TODO app with hash history ', async () => { before(async () => { - await appsMenu.clickLink('State containers example - hash history routing'); + await PageObjects.common.navigateToApp('stateContainersExampleHashHistory', { + insertTimestamp: false, + }); }); it('Links are rendered correctly and state is preserved in links', async () => { diff --git a/test/examples/ui_actions/index.ts b/test/examples/ui_actions/index.ts index 55137e2acc2b7..957cd0c46e1d0 100644 --- a/test/examples/ui_actions/index.ts +++ b/test/examples/ui_actions/index.ts @@ -26,14 +26,12 @@ export default function ({ loadTestFile, }: PluginFunctionalProviderContext) { const browser = getService('browser'); - const appsMenu = getService('appsMenu'); const PageObjects = getPageObjects(['common', 'header']); describe('ui actions explorer', function () { before(async () => { await browser.setWindowSize(1300, 900); - await PageObjects.common.navigateToApp('settings'); - await appsMenu.clickLink('Ui Actions Explorer'); + await PageObjects.common.navigateToApp('uiActionsExplorer'); }); loadTestFile(require.resolve('./ui_actions')); diff --git a/test/functional/apps/dashboard/embed_mode.js b/test/functional/apps/dashboard/embed_mode.js index 65ef75f3f65e1..a1828143555b0 100644 --- a/test/functional/apps/dashboard/embed_mode.js +++ b/test/functional/apps/dashboard/embed_mode.js @@ -20,6 +20,7 @@ import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { + const testSubjects = getService('testSubjects'); const retry = getService('retry'); const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); @@ -28,6 +29,13 @@ export default function ({ getService, getPageObjects }) { const globalNav = getService('globalNav'); describe('embed mode', () => { + const urlParamExtensions = [ + 'show-top-menu=true', + 'show-query-input=true', + 'show-time-filter=true', + 'hide-filter-bar=true', + ]; + before(async () => { await esArchiver.load('dashboard/current/kibana'); await kibanaServer.uiSettings.replace({ @@ -54,9 +62,28 @@ export default function ({ getService, getPageObjects }) { }); }); + it('shows or hides elements based on URL params', async () => { + await testSubjects.missingOrFail('top-nav'); + await testSubjects.missingOrFail('queryInput'); + await testSubjects.missingOrFail('superDatePickerToggleQuickMenuButton'); + await testSubjects.existOrFail('showFilterActions'); + + const currentUrl = await browser.getCurrentUrl(); + const newUrl = [currentUrl].concat(urlParamExtensions).join('&'); + // Embed parameter only works on a hard refresh. + const useTimeStamp = true; + await browser.get(newUrl.toString(), useTimeStamp); + + await testSubjects.existOrFail('top-nav'); + await testSubjects.existOrFail('queryInput'); + await testSubjects.existOrFail('superDatePickerToggleQuickMenuButton'); + await testSubjects.missingOrFail('showFilterActions'); + }); + after(async function () { const currentUrl = await browser.getCurrentUrl(); - const newUrl = currentUrl.replace('&embed=true', ''); + const replaceParams = ['', 'embed=true'].concat(urlParamExtensions).join('&'); + const newUrl = currentUrl.replace(replaceParams, ''); // First use the timestamp to cause a hard refresh so the new embed parameter works correctly. let useTimeStamp = true; await browser.get(newUrl.toString(), useTimeStamp); diff --git a/test/functional/apps/management/_import_objects.js b/test/functional/apps/management/_import_objects.js index 6b40837808387..6306d11eadb65 100644 --- a/test/functional/apps/management/_import_objects.js +++ b/test/functional/apps/management/_import_objects.js @@ -356,7 +356,6 @@ export default function ({ getService, getPageObjects }) { await PageObjects.settings.importFile( path.join(__dirname, 'exports', '_import_objects_with_index_patterns.json') ); - await PageObjects.settings.checkImportFailedWarning(); await PageObjects.settings.clickImportDone(); const objects = await PageObjects.settings.getSavedObjectsInTable(); diff --git a/test/plugin_functional/config.js b/test/plugin_functional/config.js index 9039f7e734a6e..74d52b842662b 100644 --- a/test/plugin_functional/config.js +++ b/test/plugin_functional/config.js @@ -37,7 +37,6 @@ export default async function ({ readConfigFile }) { require.resolve('./test_suites/embeddable_explorer'), require.resolve('./test_suites/core_plugins'), require.resolve('./test_suites/management'), - require.resolve('./test_suites/bfetch_explorer'), require.resolve('./test_suites/doc_views'), ], services: { diff --git a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/kibana.json b/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/kibana.json deleted file mode 100644 index 1acc7df871c94..0000000000000 --- a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/kibana.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "kbn_tp_bfetch_explorer", - "version": "0.0.1", - "kibanaVersion": "kibana", - "configPath": ["kbn_tp_bfetch_explorer"], - "server": true, - "ui": true, - "requiredPlugins": ["bfetch"], - "optionalPlugins": [] -} diff --git a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/package.json deleted file mode 100644 index e396489a1ffc4..0000000000000 --- a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "kbn_tp_bfetch_explorer", - "version": "1.0.0", - "main": "target/examples/kbn_tp_bfetch_explorer", - "kibana": { - "version": "kibana", - "templateVersion": "1.0.0" - }, - "license": "Apache-2.0", - "scripts": { - "kbn": "node ../../scripts/kbn.js", - "build": "rm -rf './target' && tsc" - }, - "devDependencies": { - "typescript": "3.7.2" - } -} diff --git a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/tsconfig.json b/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/tsconfig.json deleted file mode 100644 index 994f81e396763..0000000000000 --- a/test/plugin_functional/plugins/kbn_tp_bfetch_explorer/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "../../../tsconfig.json", - "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true, - "types": [ - "node", - "jest", - "react" - ] - }, - "include": [ - "index.ts", - "public/**/*.ts", - "public/**/*.tsx", - "server/**/*.ts", - "server/**/*.tsx", - "../../../../typings/**/*", - ], - "exclude": [] -} diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/app/dashboard_input.ts b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/app/dashboard_input.ts index 6f4e1f052f5e0..21b12e2134767 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/app/dashboard_input.ts +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/app/dashboard_input.ts @@ -92,6 +92,7 @@ export const dashboardInput: DashboardContainerInput = { }, }, }, + isEmbeddedExternally: false, isFullScreenMode: false, filters: [], useMargins: true, diff --git a/x-pack/package.json b/x-pack/package.json index c46d364e0ac46..227547ce15fd1 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -299,7 +299,7 @@ "oppsy": "^2.0.0", "p-retry": "^4.2.0", "papaparse": "^5.2.0", - "pdfmake": "^0.1.63", + "pdfmake": "^0.1.65", "pluralize": "3.1.0", "pngjs": "3.4.0", "polished": "^1.9.2", diff --git a/x-pack/plugins/apm/public/services/rest/watcher.ts b/x-pack/plugins/apm/public/services/rest/watcher.ts index 3027164e2863e..246ed061eb20e 100644 --- a/x-pack/plugins/apm/public/services/rest/watcher.ts +++ b/x-pack/plugins/apm/public/services/rest/watcher.ts @@ -19,6 +19,6 @@ export async function createWatch({ return callApi(http, { method: 'PUT', pathname: `/api/watcher/watch/${id}`, - body: { type: 'json', id, watch }, + body: { type: 'json', id, watch, isNew: true, isActive: true }, }); } diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_actions_column.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_actions_column.tsx index 1ac2e00abca70..e27de7fd6b5a8 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_actions_column.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/log_entry_actions_column.tsx @@ -5,19 +5,11 @@ */ import React, { useCallback } from 'react'; -import { EuiButtonIcon } from '@elastic/eui'; +import { EuiButtonIcon, EuiPopover, EuiContextMenuPanel, EuiContextMenuItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; import { LogEntryColumnContent } from './log_entry_column'; -import { - euiStyled, - ActionMenu, - Section, - SectionTitle, - SectionLinks, - SectionLink, -} from '../../../../../observability/public'; +import { euiStyled } from '../../../../../observability/public'; interface LogEntryActionsColumnProps { isHovered: boolean; @@ -78,29 +70,32 @@ export const LogEntryActionsColumn: React.FC = ({ ); + const items = [ + + {LOG_DETAILS_LABEL} + , + ]; + + if (onViewLogInContext !== undefined) { + items.push( + + {LOG_VIEW_IN_CONTEXT_LABEL} + + ); + } + return ( {isHovered || isMenuOpen ? ( - -
- - - - - - {onViewLogInContext !== undefined ? ( - - ) : null} - -
-
+ + +
) : null}
@@ -115,10 +110,11 @@ const ActionsColumnContent = euiStyled(LogEntryColumnContent)` const ButtonWrapper = euiStyled.div` background: ${(props) => props.theme.eui.euiColorPrimary}; border-radius: 50%; + padding: 4px; + transform: translateY(-6px); `; // this prevents the button from influencing the line height const AbsoluteWrapper = euiStyled.div` - overflow: hidden; position: absolute; `; diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx index cf3eae263ed59..3ef32c920e293 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx @@ -8,12 +8,13 @@ import { EuiFlexGroup, EuiFlexItem, EuiModal, - EuiModalBody, EuiOverlayMask, EuiText, EuiTextColor, EuiToolTip, + EuiSpacer, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; import { noop } from 'lodash'; import React, { useCallback, useContext, useMemo } from 'react'; import { LogEntry } from '../../../../common/http_api'; @@ -22,6 +23,7 @@ import { useLogSourceContext } from '../../../containers/logs/log_source'; import { LogViewConfiguration } from '../../../containers/logs/log_view_configuration'; import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; import { useViewportDimensions } from '../../../utils/use_viewport_dimensions'; +import { euiStyled } from '../../../../../observability/public'; const MODAL_MARGIN = 25; @@ -55,7 +57,7 @@ export const PageViewLogInContext: React.FC = () => { return ( - + { > + { /> - + ); }; +const LogInContextWrapper = euiStyled.div<{ width: number | string; height: number | string }>` + padding: 16px; + width: ${(props) => (typeof props.width === 'number' ? `${props.width}px` : props.width)}; + height: ${(props) => (typeof props.height === 'number' ? `${props.height}px` : props.height)}; +`; + const LogEntryContext: React.FC<{ context: LogEntry['context'] }> = ({ context }) => { + let text; if ('container.id' in context) { - return

Displayed logs are from container {context['container.id']}

; + text = ( + + ); } if ('host.name' in context) { @@ -105,21 +121,27 @@ const LogEntryContext: React.FC<{ context: LogEntry['context'] }> = ({ context } context['log.file.path'].length > 45 ? context['log.file.path'].slice(0, 20) + '...' + context['log.file.path'].slice(-25) : context['log.file.path']; - - return ( - -

- - Displayed logs are from file{' '} + text = ( + {shortenedFilePath} - {' '} - and host {context['host.name']} - -

-
+ + ), + host: context['host.name'], + }} + /> ); } - return null; + return ( + +

+ {text} +

+
+ ); }; diff --git a/x-pack/plugins/ml/public/application/components/data_grid/common.ts b/x-pack/plugins/ml/public/application/components/data_grid/common.ts index 44a2473f75937..7d0559c215114 100644 --- a/x-pack/plugins/ml/public/application/components/data_grid/common.ts +++ b/x-pack/plugins/ml/public/application/components/data_grid/common.ts @@ -29,6 +29,7 @@ import { FEATURE_IMPORTANCE, FEATURE_INFLUENCE, OUTLIER_SCORE, + TOP_CLASSES, } from '../../data_frame_analytics/common/constants'; import { formatHumanReadableDateTimeSeconds } from '../../util/date_utils'; import { getNestedProperty } from '../../util/object_utils'; @@ -110,7 +111,10 @@ export const getDataGridSchemasFromFieldTypes = (fieldTypes: FieldTypes, results schema = 'numeric'; } - if (field.includes(`${resultsField}.${FEATURE_IMPORTANCE}`)) { + if ( + field.includes(`${resultsField}.${FEATURE_IMPORTANCE}`) || + field.includes(`${resultsField}.${TOP_CLASSES}`) + ) { schema = 'json'; } diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts index 0b4e6d27b96e5..16d888a9da27b 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts @@ -228,6 +228,16 @@ export const getPredictionFieldName = ( return predictionFieldName; }; +export const getNumTopClasses = ( + analysis: AnalysisConfig +): ClassificationAnalysis['classification']['num_top_classes'] => { + let numTopClasses; + if (isClassificationAnalysis(analysis) && analysis.classification.num_top_classes !== undefined) { + numTopClasses = analysis.classification.num_top_classes; + } + return numTopClasses; +}; + export const getNumTopFeatureImportanceValues = ( analysis: AnalysisConfig ): diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/constants.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/constants.ts index 51b2918012c8d..2f14dfdfdfca3 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/constants.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/constants.ts @@ -7,4 +7,5 @@ export const DEFAULT_RESULTS_FIELD = 'ml'; export const FEATURE_IMPORTANCE = 'feature_importance'; export const FEATURE_INFLUENCE = 'feature_influence'; +export const TOP_CLASSES = 'top_classes'; export const OUTLIER_SCORE = 'outlier_score'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts index 8db349b395cfc..0a64886c80a63 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts @@ -5,6 +5,7 @@ */ import { + getNumTopClasses, getNumTopFeatureImportanceValues, getPredictedFieldName, getDependentVar, @@ -18,7 +19,7 @@ import { Field } from '../../../../common/types/fields'; import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '../../../../../../../src/plugins/data/public'; import { newJobCapsService } from '../../services/new_job_capabilities_service'; -import { FEATURE_IMPORTANCE, FEATURE_INFLUENCE, OUTLIER_SCORE } from './constants'; +import { FEATURE_IMPORTANCE, FEATURE_INFLUENCE, OUTLIER_SCORE, TOP_CLASSES } from './constants'; export type EsId = string; export type EsDocSource = Record; @@ -177,6 +178,7 @@ export const getDefaultFieldsFromJobCaps = ( const featureImportanceFields = []; const featureInfluenceFields = []; + const topClassesFields = []; const allFields: any = []; let type: ES_FIELD_TYPES | undefined; let predictedField: string | undefined; @@ -207,13 +209,14 @@ export const getDefaultFieldsFromJobCaps = ( type = newJobCapsService.getFieldById(dependentVariable)?.type; const predictionFieldName = getPredictionFieldName(jobConfig.analysis); const numTopFeatureImportanceValues = getNumTopFeatureImportanceValues(jobConfig.analysis); + const numTopClasses = getNumTopClasses(jobConfig.analysis); const defaultPredictionField = `${dependentVariable}_prediction`; predictedField = `${resultsField}.${ predictionFieldName ? predictionFieldName : defaultPredictionField }`; - if ((numTopFeatureImportanceValues ?? 0) > 0 && needsDestIndexFields === true) { + if ((numTopFeatureImportanceValues ?? 0) > 0) { featureImportanceFields.push({ id: `${resultsField}.${FEATURE_IMPORTANCE}`, name: `${resultsField}.${FEATURE_IMPORTANCE}`, @@ -221,6 +224,14 @@ export const getDefaultFieldsFromJobCaps = ( }); } + if ((numTopClasses ?? 0) > 0) { + topClassesFields.push({ + id: `${resultsField}.${TOP_CLASSES}`, + name: `${resultsField}.${TOP_CLASSES}`, + type: KBN_FIELD_TYPES.UNKNOWN, + }); + } + // Only need to add these fields if we didn't use dest index pattern to get the fields if (needsDestIndexFields === true) { allFields.push( @@ -234,7 +245,12 @@ export const getDefaultFieldsFromJobCaps = ( } } - allFields.push(...fields, ...featureImportanceFields, ...featureInfluenceFields); + allFields.push( + ...fields, + ...featureImportanceFields, + ...featureInfluenceFields, + ...topClassesFields + ); allFields.sort(({ name: a }: { name: string }, { name: b }: { name: string }) => sortExplorationResultsFields(a, b, jobConfig) ); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts index e391b90e6eb96..b8b5a16c84e85 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts @@ -19,7 +19,11 @@ import { import { SavedSearchQuery } from '../../../../../contexts/ml'; import { getIndexData, getIndexFields, DataFrameAnalyticsConfig } from '../../../../common'; -import { DEFAULT_RESULTS_FIELD, FEATURE_IMPORTANCE } from '../../../../common/constants'; +import { + DEFAULT_RESULTS_FIELD, + FEATURE_IMPORTANCE, + TOP_CLASSES, +} from '../../../../common/constants'; import { sortExplorationResultsFields, ML__ID_COPY } from '../../../../common/fields'; export const useExplorationResults = ( @@ -47,8 +51,9 @@ export const useExplorationResults = ( 25, // reduce default selected rows from 20 to 8 for performance reasons. 8, - // by default, hide feature-importance columns and the doc id copy - (d) => !d.includes(`.${FEATURE_IMPORTANCE}.`) && d !== ML__ID_COPY + // by default, hide feature-importance and top-classes columns and the doc id copy + (d) => + !d.includes(`.${FEATURE_IMPORTANCE}.`) && !d.includes(`.${TOP_CLASSES}.`) && d !== ML__ID_COPY ); useEffect(() => { diff --git a/x-pack/plugins/observability/public/pages/home/index.tsx b/x-pack/plugins/observability/public/pages/home/index.tsx index b9b567bef4ab4..072d3c47d3a55 100644 --- a/x-pack/plugins/observability/public/pages/home/index.tsx +++ b/x-pack/plugins/observability/public/pages/home/index.tsx @@ -113,7 +113,7 @@ export const Home = () => { {appsSection.map((app) => ( - + { + test('Returns 2 days that have passed from the current date', () => { + const pastDate = moment().subtract(2, 'days').startOf('day').toString(); + + expect(getPastDays(pastDate)).toEqual(2); + }); + + test('Returns 30 days that have passed from the current date', () => { + const pastDate = moment().subtract(30, 'days').startOf('day').toString(); + + expect(getPastDays(pastDate)).toEqual(30); + }); +}); diff --git a/x-pack/plugins/oss_telemetry/server/lib/get_past_days.ts b/x-pack/plugins/oss_telemetry/server/lib/get_past_days.ts new file mode 100644 index 0000000000000..4f25ef147ad43 --- /dev/null +++ b/x-pack/plugins/oss_telemetry/server/lib/get_past_days.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +export const getPastDays = (dateString: string): number => { + const date = new Date(dateString); + const today = new Date(); + const diff = Math.abs(date.getTime() - today.getTime()); + return Math.trunc(diff / (1000 * 60 * 60 * 24)); +}; diff --git a/x-pack/plugins/oss_telemetry/server/lib/tasks/visualizations/task_runner.test.ts b/x-pack/plugins/oss_telemetry/server/lib/tasks/visualizations/task_runner.test.ts index 6a47983a6f4d9..c064f39f4bc6a 100644 --- a/x-pack/plugins/oss_telemetry/server/lib/tasks/visualizations/task_runner.test.ts +++ b/x-pack/plugins/oss_telemetry/server/lib/tasks/visualizations/task_runner.test.ts @@ -13,6 +13,7 @@ import { import { visualizationsTaskRunner } from './task_runner'; import { TaskInstance } from '../../../../../task_manager/server'; import { getNextMidnight } from '../../get_next_midnight'; +import moment from 'moment'; describe('visualizationsTaskRunner', () => { let mockTaskInstance: TaskInstance; @@ -55,6 +56,9 @@ describe('visualizationsTaskRunner', () => { spaces_max: 1, spaces_min: 1, total: 1, + saved_7_days_total: 1, + saved_30_days_total: 1, + saved_90_days_total: 1, }, }, }, @@ -69,6 +73,7 @@ describe('visualizationsTaskRunner', () => { _source: { type: 'visualization', visualization: { visState: '{"type": "cave_painting"}' }, + updated_at: moment().subtract(7, 'days').startOf('day').toString(), }, }, { @@ -76,11 +81,16 @@ describe('visualizationsTaskRunner', () => { _source: { type: 'visualization', visualization: { visState: '{"type": "printing_press"}' }, + updated_at: moment().subtract(20, 'days').startOf('day').toString(), }, }, { _id: 'meat:visualization:coolviz-789', - _source: { type: 'visualization', visualization: { visState: '{"type": "floppy_disk"}' } }, + _source: { + type: 'visualization', + visualization: { visState: '{"type": "floppy_disk"}' }, + updated_at: moment().subtract(2, 'months').startOf('day').toString(), + }, }, // meat space { @@ -88,38 +98,99 @@ describe('visualizationsTaskRunner', () => { _source: { type: 'visualization', visualization: { visState: '{"type": "cave_painting"}' }, + updated_at: moment().subtract(89, 'days').startOf('day').toString(), }, }, { _id: 'meat:visualization:coolviz-789', - _source: { type: 'visualization', visualization: { visState: '{"type": "cuneiform"}' } }, + _source: { + type: 'visualization', + visualization: { visState: '{"type": "cuneiform"}' }, + updated_at: moment().subtract(5, 'months').startOf('day').toString(), + }, }, { _id: 'meat:visualization:coolviz-789', - _source: { type: 'visualization', visualization: { visState: '{"type": "cuneiform"}' } }, + _source: { + type: 'visualization', + visualization: { visState: '{"type": "cuneiform"}' }, + updated_at: moment().subtract(2, 'days').startOf('day').toString(), + }, }, { _id: 'meat:visualization:coolviz-789', - _source: { type: 'visualization', visualization: { visState: '{"type": "floppy_disk"}' } }, + _source: { + type: 'visualization', + visualization: { visState: '{"type": "floppy_disk"}' }, + updated_at: moment().subtract(7, 'days').startOf('day').toString(), + }, }, // cyber space { _id: 'cyber:visualization:coolviz-789', - _source: { type: 'visualization', visualization: { visState: '{"type": "floppy_disk"}' } }, + _source: { + type: 'visualization', + visualization: { visState: '{"type": "floppy_disk"}' }, + updated_at: moment().subtract(7, 'months').startOf('day').toString(), + }, }, { _id: 'cyber:visualization:coolviz-789', - _source: { type: 'visualization', visualization: { visState: '{"type": "floppy_disk"}' } }, + _source: { + type: 'visualization', + visualization: { visState: '{"type": "floppy_disk"}' }, + updated_at: moment().subtract(3, 'days').startOf('day').toString(), + }, }, { _id: 'cyber:visualization:coolviz-123', _source: { type: 'visualization', visualization: { visState: '{"type": "cave_painting"}' }, + updated_at: moment().subtract(15, 'days').startOf('day').toString(), }, }, ]); + const expectedStats = { + cave_painting: { + total: 3, + spaces_min: 1, + spaces_max: 1, + spaces_avg: 1, + saved_7_days_total: 1, + saved_30_days_total: 2, + saved_90_days_total: 3, + }, + printing_press: { + total: 1, + spaces_min: 1, + spaces_max: 1, + spaces_avg: 1, + saved_7_days_total: 0, + saved_30_days_total: 1, + saved_90_days_total: 1, + }, + cuneiform: { + total: 2, + spaces_min: 2, + spaces_max: 2, + spaces_avg: 2, + saved_7_days_total: 1, + saved_30_days_total: 1, + saved_90_days_total: 1, + }, + floppy_disk: { + total: 4, + spaces_min: 2, + spaces_max: 2, + spaces_avg: 2, + saved_7_days_total: 2, + saved_30_days_total: 2, + saved_90_days_total: 3, + }, + }; + const runner = visualizationsTaskRunner( mockTaskInstance, getMockConfig(), @@ -131,13 +202,10 @@ describe('visualizationsTaskRunner', () => { error: undefined, state: { runs: 1, - stats: { - cave_painting: { total: 3, spaces_min: 1, spaces_max: 1, spaces_avg: 1 }, - printing_press: { total: 1, spaces_min: 1, spaces_max: 1, spaces_avg: 1 }, - cuneiform: { total: 2, spaces_min: 2, spaces_max: 2, spaces_avg: 2 }, - floppy_disk: { total: 4, spaces_min: 2, spaces_max: 2, spaces_avg: 2 }, - }, + stats: expectedStats, }, }); + + expect(result.state.stats).toMatchObject(expectedStats); }); }); diff --git a/x-pack/plugins/oss_telemetry/server/lib/tasks/visualizations/task_runner.ts b/x-pack/plugins/oss_telemetry/server/lib/tasks/visualizations/task_runner.ts index b15ead36a75f6..5f7f70ee5d62a 100644 --- a/x-pack/plugins/oss_telemetry/server/lib/tasks/visualizations/task_runner.ts +++ b/x-pack/plugins/oss_telemetry/server/lib/tasks/visualizations/task_runner.ts @@ -10,12 +10,14 @@ import { first } from 'rxjs/operators'; import { APICaller, IClusterClient } from 'src/core/server'; import { getNextMidnight } from '../../get_next_midnight'; +import { getPastDays } from '../../get_past_days'; import { TaskInstance } from '../../../../../task_manager/server'; import { ESSearchHit } from '../../../../../apm/typings/elasticsearch'; interface VisSummary { type: string; space: string; + past_days: number; } /* @@ -26,7 +28,11 @@ async function getStats(callCluster: APICaller, index: string) { size: 10000, // elasticsearch index.max_result_window default value index, ignoreUnavailable: true, - filterPath: ['hits.hits._id', 'hits.hits._source.visualization'], + filterPath: [ + 'hits.hits._id', + 'hits.hits._source.visualization', + 'hits.hits._source.updated_at', + ], body: { query: { bool: { filter: { term: { type: 'visualization' } } }, @@ -43,13 +49,14 @@ async function getStats(callCluster: APICaller, index: string) { const visSummaries: VisSummary[] = esResponse.hits.hits.map( (hit: ESSearchHit<{ visState: string }>) => { const spacePhrases: string[] = hit._id.split(':'); + const lastUpdated: string = _.get(hit, '_source.updated_at'); const space = spacePhrases.length === 3 ? spacePhrases[0] : 'default'; // if in a custom space, the format of a saved object ID is space:type:id const visualization = _.get(hit, '_source.visualization', { visState: '{}' }); const visState: { type?: string } = JSON.parse(visualization.visState); - return { type: visState.type || '_na_', space, + past_days: getPastDays(lastUpdated), }; } ); @@ -68,6 +75,9 @@ async function getStats(callCluster: APICaller, index: string) { spaces_min: _.min(spaceCounts), spaces_max: _.max(spaceCounts), spaces_avg: total / spaceCounts.length, + saved_7_days_total: curr.filter((c) => c.past_days <= 7).length, + saved_30_days_total: curr.filter((c) => c.past_days <= 30).length, + saved_90_days_total: curr.filter((c) => c.past_days <= 90).length, }; }); } diff --git a/x-pack/plugins/oss_telemetry/server/test_utils/index.ts b/x-pack/plugins/oss_telemetry/server/test_utils/index.ts index 428909dc7feed..93bde69629fbd 100644 --- a/x-pack/plugins/oss_telemetry/server/test_utils/index.ts +++ b/x-pack/plugins/oss_telemetry/server/test_utils/index.ts @@ -7,6 +7,7 @@ import { APICaller } from 'kibana/server'; import { of } from 'rxjs'; +import moment from 'moment'; import { elasticsearchServiceMock } from '../../../../../src/core/server/mocks'; import { ConcreteTaskInstance, @@ -38,6 +39,7 @@ const defaultMockSavedObjects = [ _source: { type: 'visualization', visualization: { visState: '{"type": "shell_beads"}' }, + updated_at: moment().subtract(7, 'days').startOf('day').toString(), }, }, ]; diff --git a/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/index.tsx index 7451ea6ec0ca1..ed98a37775576 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/alerts_histogram_panel/index.tsx @@ -131,6 +131,7 @@ export const AlertsHistogramPanel = memo( totalAlertsObj.value, totalAlertsObj.relation === 'gte' ? '>' : totalAlertsObj.relation === 'lte' ? '<' : '' ), + // eslint-disable-next-line react-hooks/exhaustive-deps [totalAlertsObj] ); @@ -138,6 +139,7 @@ export const AlertsHistogramPanel = memo( setSelectedStackByOption( stackByOptions?.find((co) => co.value === event.target.value) ?? defaultStackByOption ); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const formattedAlertsData = useMemo(() => formatAlertsData(alertsData), [alertsData]); @@ -154,6 +156,7 @@ export const AlertsHistogramPanel = memo( value: bucket.key, })) : NO_LEGEND_DATA, + // eslint-disable-next-line react-hooks/exhaustive-deps [alertsData, selectedStackByOption.value] ); @@ -175,6 +178,7 @@ export const AlertsHistogramPanel = memo( deleteQuery({ id: uniqueQueryId }); } }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { @@ -189,6 +193,7 @@ export const AlertsHistogramPanel = memo( refetch, }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [setQuery, isLoadingAlerts, alertsData, response, request, refetch]); useEffect(() => { @@ -219,6 +224,7 @@ export const AlertsHistogramPanel = memo( !isEmpty(converted) ? [converted] : [] ) ); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedStackByOption.value, from, to, query, filters]); const linkButton = useMemo(() => { diff --git a/x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.tsx index 685e66e73ced2..2be20a9d47f67 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/alerts_table/index.tsx @@ -117,6 +117,7 @@ export const AlertsTableComponent: React.FC = ({ }); } return null; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [browserFields, globalFilters, globalQuery, indexPatterns, kibana, to, from]); // Callback for creating a new timeline -- utilized by row/batch actions @@ -143,6 +144,7 @@ export const AlertsTableComponent: React.FC = ({ ({ eventIds, isLoading }: SetEventsLoadingProps) => { setEventsLoading!({ id: ALERTS_TABLE_TIMELINE_ID, eventIds, isLoading }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [setEventsLoading, ALERTS_TABLE_TIMELINE_ID] ); @@ -150,6 +152,7 @@ export const AlertsTableComponent: React.FC = ({ ({ eventIds, isDeleted }: SetEventsDeletedProps) => { setEventsDeleted!({ id: ALERTS_TABLE_TIMELINE_ID, eventIds, isDeleted }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [setEventsDeleted, ALERTS_TABLE_TIMELINE_ID] ); @@ -210,7 +213,7 @@ export const AlertsTableComponent: React.FC = ({ }, [setSelectAll, setShowClearSelectionAction]); const updateAlertsStatusCallback: UpdateAlertsStatusCallback = useCallback( - async (refetchQuery: inputsModel.Refetch, { alertIds, status }: UpdateAlertsStatusProps) => { + async (refetchQuery: inputsModel.Refetch, { status }: UpdateAlertsStatusProps) => { await updateAlertStatusAction({ query: showClearSelectionAction ? getGlobalQuery()?.filterQuery : undefined, alertIds: Object.keys(selectedEventIds), @@ -314,6 +317,7 @@ export const AlertsTableComponent: React.FC = ({ title: i18n.ALERTS_TABLE_TITLE, selectAll: canUserCRUD ? selectAll : false, }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { setTimelineRowActions({ @@ -321,6 +325,7 @@ export const AlertsTableComponent: React.FC = ({ queryFields: requiredFieldsForActions, timelineRowActions: additionalActions, }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [additionalActions]); const headerFilterGroup = useMemo( () => , diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/add_item_form/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/add_item_form/index.tsx index c8eb6f69c95ba..b0098d62cc9e5 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/add_item_form/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/add_item_form/index.tsx @@ -126,6 +126,7 @@ export const AddItem = ({ inputsRef.current[haveBeenKeyboardDeleted].focus(); setHaveBeenKeyboardDeleted(-1); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [haveBeenKeyboardDeleted, inputsRef.current]); const values = field.value as string[]; diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/index.tsx index 88edd0e795531..e898a362c7771 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/mitre/index.tsx @@ -40,7 +40,7 @@ interface AddItemProps { isDisabled: boolean; } -export const AddMitreThreat = ({ dataTestSubj, field, idAria, isDisabled }: AddItemProps) => { +export const AddMitreThreat = ({ field, idAria, isDisabled }: AddItemProps) => { const [showValidation, setShowValidation] = useState(false); const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field); @@ -101,6 +101,7 @@ export const AddMitreThreat = ({ dataTestSubj, field, idAria, isDisabled }: AddI ...values.slice(index + 1), ]); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [field] ); diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/pick_timeline/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/pick_timeline/index.tsx index 0029e70e4edda..4b27daf3180ec 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/pick_timeline/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/pick_timeline/index.tsx @@ -39,6 +39,7 @@ export const PickTimeline = ({ setTimelineId(id); setTimelineTitle(title); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [field.value]); const handleOnTimelineChange = useCallback( @@ -49,6 +50,7 @@ export const PickTimeline = ({ field.setValue({ id, title }); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [field] ); diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/index.tsx index 82206b6ba5e3d..c53a9ccc22d8b 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/query_bar/index.tsx @@ -16,7 +16,6 @@ import { Query, FilterManager, SavedQuery, - SavedQueryTimeFilter, } from '../../../../../../../../src/plugins/data/public'; import { BrowserFields } from '../../../../common/containers/source'; @@ -111,6 +110,7 @@ export const QueryBarDefineRule = ({ isSubscribed = false; subscriptions.unsubscribe(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [field.value]); useEffect(() => { @@ -143,10 +143,11 @@ export const QueryBarDefineRule = ({ return () => { isSubscribed = false; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [field.value]); const onSubmitQuery = useCallback( - (newQuery: Query, timefilter?: SavedQueryTimeFilter) => { + (newQuery: Query) => { const { query } = field.value as FieldValueQueryBar; if (!deepEqual(query, newQuery)) { field.setValue({ ...(field.value as FieldValueQueryBar), query: newQuery }); @@ -179,6 +180,7 @@ export const QueryBarDefineRule = ({ } } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [field.value] ); @@ -214,7 +216,7 @@ export const QueryBarDefineRule = ({ [browserFields, field, indexPattern] ); - const onMutation = (event: unknown, observer: unknown) => { + const onMutation = () => { if (resizeParentContainer != null) { const suggestionContainer = document.getElementById('kbnTypeahead__items'); if (suggestionContainer != null) { diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/index.tsx index b77de683d5f20..c6ff25f311d9c 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_field/index.tsx @@ -56,6 +56,7 @@ export const RuleActionsField: ThrottleSelectField = ({ field, messageVariables updatedActions[index] = deepMerge(updatedActions[index], { id }); field.setValue(updatedActions); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [field.setValue, actions] ); @@ -71,6 +72,7 @@ export const RuleActionsField: ThrottleSelectField = ({ field, messageVariables updatedActions[index].params[key] = value; field.setValue(updatedActions); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [field.setValue, actions] ); @@ -82,6 +84,7 @@ export const RuleActionsField: ThrottleSelectField = ({ field, messageVariables ); setSupportedActionTypes(supportedTypes); })(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/index.tsx index 5a5156fa2b9a3..66f04c9bc6add 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_actions_overflow/index.tsx @@ -101,6 +101,7 @@ const RuleActionsOverflowComponent = ({ , ] : [], + // eslint-disable-next-line react-hooks/exhaustive-deps [rule, userHasNoPermissions] ); diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/index.tsx index 79a16bfb386ec..c85676ce51052 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/rule_switch/index.tsx @@ -94,6 +94,7 @@ export const RuleSwitchComponent = ({ } setMyIsLoading(false); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [dispatch, id] ); @@ -101,12 +102,14 @@ export const RuleSwitchComponent = ({ if (myEnabled !== enabled) { setMyEnabled(enabled); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [enabled]); useEffect(() => { if (myIsLoading !== isLoading) { setMyIsLoading(isLoading ?? false); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [isLoading]); return ( diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/index.tsx index 9a4f9b25e01f4..bb33767f4f5d5 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/schedule_item_form/index.tsx @@ -78,6 +78,7 @@ export const ScheduleItem = ({ setTimeType(e.target.value); field.setValue(`${timeVal}${e.target.value}`); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [timeVal] ); @@ -87,6 +88,7 @@ export const ScheduleItem = ({ setTimeVal(sanitizedValue); field.setValue(`${sanitizedValue}${timeType}`); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [timeType] ); @@ -111,6 +113,7 @@ export const ScheduleItem = ({ setTimeType(filterTimeType[0]); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [field.value]); // EUI missing some props diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/index.tsx index e41416f2a0ccb..f23c51e019f24 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_about_rule/index.tsx @@ -101,6 +101,7 @@ const StepAboutRuleComponent: FC = ({ setMyStepData({ ...data, isNew: false } as AboutStepRule); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form]); useEffect(() => { @@ -113,12 +114,14 @@ const StepAboutRuleComponent: FC = ({ setMyStepData(myDefaultValues); setFieldValue(form, schema, myDefaultValues); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [defaultValues]); useEffect(() => { if (setForm != null) { setForm(RuleStep.aboutRule, form); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form]); return isReadOnlyView && myStepData.name != null ? ( diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/index.tsx index fc875908bd4ef..b56e1794eef63 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_define_rule/index.tsx @@ -123,6 +123,7 @@ const StepDefineRuleComponent: FC = ({ setMyStepData({ ...data, isNew: false } as DefineStepRule); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form]); useEffect(() => { @@ -132,12 +133,14 @@ const StepDefineRuleComponent: FC = ({ setMyStepData(newValues); setFieldValue(form, schema, newValues); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [defaultValues, setMyStepData, setFieldValue]); useEffect(() => { if (setForm != null) { setForm(RuleStep.defineRule, form); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form]); const handleResetIndices = useCallback(() => { diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/index.tsx index 778c6bd92bc73..9334bd59bebf5 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_rule_actions/index.tsx @@ -99,6 +99,7 @@ const StepRuleActionsComponent: FC = ({ } } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [form] ); @@ -112,12 +113,14 @@ const StepRuleActionsComponent: FC = ({ setMyStepData(myDefaultValues); setFieldValue(form, schema, myDefaultValues); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [defaultValues]); useEffect(() => { if (setForm != null) { setForm(RuleStep.ruleActions, form); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form]); const updateThrottle = useCallback((throttle) => setMyStepData({ ...myStepData, throttle }), [ @@ -142,6 +145,7 @@ const StepRuleActionsComponent: FC = ({ options: throttleOptions, }, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [isLoading, updateThrottle] ); diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/index.tsx index fa49637a0c830..60855bc5fa25f 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/step_schedule_rule/index.tsx @@ -62,6 +62,7 @@ const StepScheduleRuleComponent: FC = ({ setMyStepData({ ...data, isNew: false } as ScheduleStepRule); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form]); useEffect(() => { @@ -74,12 +75,14 @@ const StepScheduleRuleComponent: FC = ({ setMyStepData(myDefaultValues); setFieldValue(form, schema, myDefaultValues); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [defaultValues]); useEffect(() => { if (setForm != null) { setForm(RuleStep.scheduleRule, form); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form]); return isReadOnlyView && myStepData != null ? ( diff --git a/x-pack/plugins/security_solution/public/alerts/components/rules/throttle_select_field/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/rules/throttle_select_field/index.tsx index 133f25ef3a03f..bf3498b28cd45 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/rules/throttle_select_field/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/rules/throttle_select_field/index.tsx @@ -31,6 +31,7 @@ export const ThrottleSelectField: ThrottleSelectField = (props) => { props.field.setValue(throttle); props.handleChange(throttle); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [props.field.setValue, props.handleChange] ); const newEuiFieldProps = { ...props.euiFieldProps, onChange }; diff --git a/x-pack/plugins/security_solution/public/alerts/components/user_info/index.tsx b/x-pack/plugins/security_solution/public/alerts/components/user_info/index.tsx index 8753064751f76..fc3fec7c29c1f 100644 --- a/x-pack/plugins/security_solution/public/alerts/components/user_info/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/components/user_info/index.tsx @@ -171,18 +171,21 @@ export const useUserInfo = (): State => { if (loading !== privilegeLoading || indexNameLoading) { dispatch({ type: 'updateLoading', loading: privilegeLoading || indexNameLoading }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, privilegeLoading, indexNameLoading]); useEffect(() => { if (!loading && hasIndexManage !== hasApiIndexManage && hasApiIndexManage != null) { dispatch({ type: 'updateHasIndexManage', hasIndexManage: hasApiIndexManage }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, hasIndexManage, hasApiIndexManage]); useEffect(() => { if (!loading && hasIndexWrite !== hasApiIndexWrite && hasApiIndexWrite != null) { dispatch({ type: 'updateHasIndexWrite', hasIndexWrite: hasApiIndexWrite }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, hasIndexWrite, hasApiIndexWrite]); useEffect(() => { @@ -193,30 +196,35 @@ export const useUserInfo = (): State => { ) { dispatch({ type: 'updateIsSignalIndexExists', isSignalIndexExists: isApiSignalIndexExists }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, isSignalIndexExists, isApiSignalIndexExists]); useEffect(() => { if (!loading && isAuthenticated !== isApiAuthenticated && isApiAuthenticated != null) { dispatch({ type: 'updateIsAuthenticated', isAuthenticated: isApiAuthenticated }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, isAuthenticated, isApiAuthenticated]); useEffect(() => { if (!loading && hasEncryptionKey !== isApiEncryptionKey && isApiEncryptionKey != null) { dispatch({ type: 'updateHasEncryptionKey', hasEncryptionKey: isApiEncryptionKey }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, hasEncryptionKey, isApiEncryptionKey]); useEffect(() => { if (!loading && canUserCRUD !== capabilitiesCanUserCRUD && capabilitiesCanUserCRUD != null) { dispatch({ type: 'updateCanUserCRUD', canUserCRUD: capabilitiesCanUserCRUD }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, canUserCRUD, capabilitiesCanUserCRUD]); useEffect(() => { if (!loading && signalIndexName !== apiSignalIndexName && apiSignalIndexName != null) { dispatch({ type: 'updateSignalIndexName', signalIndexName: apiSignalIndexName }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, signalIndexName, apiSignalIndexName]); useEffect(() => { diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_privilege_user.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_privilege_user.tsx index e67afd686a7ca..dda9b50239cde 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_privilege_user.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_privilege_user.tsx @@ -83,6 +83,7 @@ export const usePrivilegeUser = (): ReturnPrivilegeUser => { isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { loading, ...privilegeUser }; diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_signal_index.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_signal_index.tsx index 6c428bd9354ee..65a2721013b5e 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_signal_index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/alerts/use_signal_index.tsx @@ -103,6 +103,7 @@ export const useSignalIndex = (): ReturnSignalIndex => { isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { loading, ...signalIndex }; diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx index 157f1490971f1..640d6f9a17fd1 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx @@ -94,6 +94,7 @@ export const useFetchIndexPatterns = (defaultIndices: string[] = []): Return => isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [indices]); return [{ browserFields, isLoading, indices, indicesExists, indexPatterns }, setIndices]; diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/persist_rule.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/persist_rule.tsx index 03080bf68cbf5..fd139d59c0a27 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/persist_rule.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/persist_rule.tsx @@ -53,6 +53,7 @@ export const usePersistRule = (): ReturnPersistRule => { isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [rule]); return [{ isLoading, isSaved }, setRule]; diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx index de4037ce7134c..5f5ee53c29caf 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx @@ -185,6 +185,7 @@ export const usePrePackagedRules = ({ isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [canUserCRUD, hasIndexWrite, isAuthenticated, hasEncryptionKey, isSignalIndexExists]); return { diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule.tsx index 6ae5da3e56ff6..3256273fb8425 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule.tsx @@ -55,6 +55,7 @@ export const useRule = (id: string | undefined): ReturnRule => { isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [id]); return [loading, rule]; diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule_status.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule_status.tsx index b9f5e1f152c21..ec1da29de4ba8 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule_status.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rule_status.tsx @@ -64,6 +64,7 @@ export const useRuleStatus = (id: string | undefined | null): ReturnRuleStatus = isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [id]); return [loading, ruleStatus, fetchRuleStatus.current]; @@ -119,6 +120,7 @@ export const useRulesStatuses = (rules: Rules): ReturnRulesStatuses => { isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [rules]); return { loading, rulesStatuses }; diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rules.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rules.tsx index 3a074f2bc3785..1a1dbc6e2b368 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rules.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_rules.tsx @@ -46,7 +46,7 @@ export const useRules = ({ let isSubscribed = true; const abortCtrl = new AbortController(); - async function fetchData(forceReload: boolean = false) { + async function fetchData() { try { setLoading(true); const fetchRulesResult = await fetchRules({ @@ -80,7 +80,7 @@ export const useRules = ({ fetchData(); reFetchRules.current = (refreshPrePackagedRule: boolean = false) => { - fetchData(true); + fetchData(); if (refreshPrePackagedRule && refetchPrePackagedRulesStatus != null) { refetchPrePackagedRulesStatus(); } @@ -89,12 +89,14 @@ export const useRules = ({ isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ pagination.page, pagination.perPage, filterOptions.filter, filterOptions.sortField, filterOptions.sortOrder, + // eslint-disable-next-line react-hooks/exhaustive-deps filterOptions.tags?.sort().join(), filterOptions.showCustomRules, filterOptions.showElasticRules, diff --git a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_tags.tsx b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_tags.tsx index ebfe73f2f0863..038f974e1394e 100644 --- a/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_tags.tsx +++ b/x-pack/plugins/security_solution/public/alerts/containers/detection_engine/rules/use_tags.tsx @@ -53,6 +53,7 @@ export const useTags = (): ReturnTags => { isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return [loading, tags, reFetchTags.current]; diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/index.tsx index 9e61ec0eb3bcf..80ef5681189c5 100644 --- a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/index.tsx @@ -235,6 +235,7 @@ export const AllRules = React.memo( : [], reFetchRules: reFetchRulesData, }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ dispatch, dispatchToaster, @@ -313,6 +314,7 @@ export const AllRules = React.memo( ))} ), + // eslint-disable-next-line react-hooks/exhaustive-deps [allRulesTabs, allRulesTab, setAllRulesTab] ); diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx index 2bc19ae45a078..c65271c3cc014 100644 --- a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx @@ -45,6 +45,7 @@ const RulesTableFiltersComponent = ({ useEffect(() => { reFetchTags(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [rulesCustomInstalled, rulesInstalled]); // Propagate filter changes to parent diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/index.tsx index dd290ec1ae582..de7c99acee6e5 100644 --- a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/create/index.tsx @@ -114,6 +114,7 @@ const CreateRulePageComponent: React.FC = () => { const actionMessageParams = useMemo( () => getActionMessageParams((stepsData.current['define-rule'].data as DefineStepRule).ruleType), + // eslint-disable-next-line react-hooks/exhaustive-deps [stepsData.current['define-rule'].data] ); @@ -155,6 +156,7 @@ const CreateRulePageComponent: React.FC = () => { } } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [isStepRuleInReadOnlyView, openAccordionId, stepsData.current, setRule] ); @@ -171,6 +173,7 @@ const CreateRulePageComponent: React.FC = () => { } return 'passive'; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [openAccordionId, stepsData.current] ); diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx index ebd6ed118f937..43792e8bd19f4 100644 --- a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/details/index.tsx @@ -191,6 +191,7 @@ export const RuleDetailsPageComponent: FC = ({ ))} ), + // eslint-disable-next-line react-hooks/exhaustive-deps [ruleDetailTabs, ruleDetailTab, setRuleDetailTab] ); const ruleError = useMemo( @@ -203,6 +204,7 @@ export const RuleDetailsPageComponent: FC = ({ date={rule?.last_failure_at} /> ) : null, + // eslint-disable-next-line react-hooks/exhaustive-deps [rule, ruleDetailTab] ); diff --git a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/edit/index.tsx b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/edit/index.tsx index 8fc646c01b17c..73e76165183c5 100644 --- a/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/edit/index.tsx +++ b/x-pack/plugins/security_solution/public/alerts/pages/detection_engine/rules/edit/index.tsx @@ -104,6 +104,7 @@ const EditRulePageComponent: FC = () => { }); const [{ isLoading, isSaved }, setRule] = usePersistRule(); const [tabHasError, setTabHasError] = useState([]); + // eslint-disable-next-line react-hooks/exhaustive-deps const actionMessageParams = useMemo(() => getActionMessageParams(rule?.type), [rule]); const setStepsForm = useCallback( (step: RuleStep, form: FormHook) => { @@ -113,6 +114,7 @@ const EditRulePageComponent: FC = () => { form.submit(); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [initForm, selectedTab] ); const tabs = useMemo( @@ -206,6 +208,7 @@ const EditRulePageComponent: FC = () => { ), }, ], + // eslint-disable-next-line react-hooks/exhaustive-deps [ rule, loading, @@ -265,6 +268,7 @@ const EditRulePageComponent: FC = () => { } else { setTabHasError(invalidForms); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ stepsForm, myAboutRuleForm, @@ -320,6 +324,7 @@ const EditRulePageComponent: FC = () => { setInitForm(true); setSelectedTab(tab); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [selectedTab, stepsForm.current] ); @@ -338,6 +343,7 @@ const EditRulePageComponent: FC = () => { useEffect(() => { const tabIndex = rule?.immutable ? 3 : 0; setSelectedTab(tabs[tabIndex]); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [rule]); if (isSaved) { diff --git a/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx b/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx index 277352c39df65..a57fae8081bea 100644 --- a/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx @@ -59,6 +59,7 @@ export const AddComment = React.memo( `${comment}${comment.length > 0 ? '\n\n' : ''}${insertQuote}` ); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [insertQuote]); const onSubmit = useCallback(async () => { @@ -67,9 +68,10 @@ export const AddComment = React.memo( if (onCommentSaving != null) { onCommentSaving(); } - await postComment(data, onCommentPosted); + postComment(data, onCommentPosted); form.reset(); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form, onCommentPosted, onCommentSaving]); return ( diff --git a/x-pack/plugins/security_solution/public/cases/components/all_cases/index.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/index.tsx index 12f0d02eb10f6..32a7c4078071e 100644 --- a/x-pack/plugins/security_solution/public/cases/components/all_cases/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/all_cases/index.tsx @@ -134,6 +134,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { (refetchFilter: () => void) => { filterRefetch.current = refetchFilter; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [filterRefetch.current] ); const refreshCases = useCallback( @@ -146,6 +147,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { filterRefetch.current(); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [filterOptions, queryParams, filterRefetch.current] ); @@ -158,6 +160,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { refreshCases(); dispatchResetIsUpdated(); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [isDeleted, isUpdated]); const confirmDeleteModal = useMemo( () => ( @@ -172,12 +175,14 @@ export const AllCases = React.memo(({ userCanCrud }) => { )} /> ), + // eslint-disable-next-line react-hooks/exhaustive-deps [deleteBulk, deleteThisCase, isDisplayConfirmDeleteModal] ); const toggleDeleteModal = useCallback((deleteCase: Case) => { handleToggleModal(); setDeleteThisCase(deleteCase); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const toggleBulkDeleteModal = useCallback( @@ -192,6 +197,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { const convertToDeleteCases: DeleteCase[] = caseIds.map((id) => ({ id })); setDeleteBulk(convertToDeleteCases); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [selectedCases] ); @@ -199,6 +205,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { (status: string) => { updateBulkStatus(selectedCases, status); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [selectedCases] ); @@ -220,6 +227,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { })} /> ), + // eslint-disable-next-line react-hooks/exhaustive-deps [selectedCaseIds, filterOptions.status, toggleBulkDeleteModal] ); const handleDispatchUpdate = useCallback( @@ -261,6 +269,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { setQueryParams(newQueryParams); refreshCases(false); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [queryParams] ); @@ -274,6 +283,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { setFilters(newFilterOptions); refreshCases(false); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [filterOptions, queryParams] ); @@ -296,6 +306,7 @@ export const AllCases = React.memo(({ userCanCrud }) => { }; const euiBasicTableSelectionProps = useMemo>( () => ({ onSelectionChange: setSelectedCases }), + // eslint-disable-next-line react-hooks/exhaustive-deps [selectedCases] ); const isCasesLoading = useMemo( diff --git a/x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.tsx b/x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.tsx index 42340b455c3af..63172bd6ad6bb 100644 --- a/x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/all_cases/table_filters.tsx @@ -66,12 +66,14 @@ const CasesTableFiltersComponent = ({ const newReporters = selectedReporters.filter((r) => reporters.includes(r)); handleSelectedReporters(newReporters); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [reporters]); useEffect(() => { if (selectedTags.length) { const newTags = selectedTags.filter((t) => tags.includes(t)); handleSelectedTags(newTags); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [tags]); const handleSelectedReporters = useCallback( @@ -84,6 +86,7 @@ const CasesTableFiltersComponent = ({ onFilterChanged({ reporters: reportersObj }); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [selectedReporters, respReporters] ); @@ -94,6 +97,7 @@ const CasesTableFiltersComponent = ({ onFilterChanged({ tags: newTags }); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [selectedTags] ); const handleOnSearch = useCallback( @@ -104,6 +108,7 @@ const CasesTableFiltersComponent = ({ onFilterChanged({ search: trimSearch }); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [search] ); const handleToggleFilter = useCallback( @@ -113,6 +118,7 @@ const CasesTableFiltersComponent = ({ onFilterChanged({ status: showOpen ? 'open' : 'closed' }); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [showOpenCases] ); return ( diff --git a/x-pack/plugins/security_solution/public/cases/components/case_view/actions.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/actions.tsx index cd9318a355e3c..df1082ec48f91 100644 --- a/x-pack/plugins/security_solution/public/cases/components/case_view/actions.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/case_view/actions.tsx @@ -44,6 +44,7 @@ const CaseViewActionsComponent: React.FC = ({ onConfirm={handleOnDeleteConfirm.bind(null, [{ id: caseData.id, title: caseData.title }])} /> ), + // eslint-disable-next-line react-hooks/exhaustive-deps [isDisplayConfirmDeleteModal, caseData] ); const propertyActions = useMemo( diff --git a/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors.tsx index 947d68fd04f7b..b8151cb6fe18c 100644 --- a/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors.tsx @@ -68,6 +68,7 @@ const ConnectorsComponent: React.FC = ({ ), + // eslint-disable-next-line react-hooks/exhaustive-deps [connectorsName, updateConnectorDisabled] ); diff --git a/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors_dropdown.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors_dropdown.tsx index c5481f592e750..018d3a0fdb4e0 100644 --- a/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors_dropdown.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/configure_cases/connectors_dropdown.tsx @@ -91,6 +91,7 @@ const ConnectorsDropdownComponent: React.FC = ({ } return connectorsFormatted; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [connectors]); return ( diff --git a/x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping.tsx index 415faa96eeedd..fe5c0c19820a1 100644 --- a/x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/configure_cases/field_mapping.tsx @@ -95,6 +95,7 @@ const FieldMappingComponent: React.FC = ({ const myMapping = mapping ?? defaultMapping; onChangeMapping(setActionTypeToMapping(caseField, newActionType, myMapping)); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [mapping] ); @@ -103,6 +104,7 @@ const FieldMappingComponent: React.FC = ({ const myMapping = mapping ?? defaultMapping; onChangeMapping(setThirdPartyToMapping(caseField, newThirdPartyField, myMapping)); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [mapping] ); diff --git a/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx index 6e1ef293fd5c4..256c8893be941 100644 --- a/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx @@ -77,6 +77,7 @@ const ConfigureCasesComponent: React.FC = ({ userC // ActionsConnectorsContextProvider reloadConnectors prop expects a Promise. // TODO: Fix it if reloadConnectors type change. + // eslint-disable-next-line react-hooks/exhaustive-deps const reloadConnectors = useCallback(async () => refetchConnectors(), []); const isLoadingAny = isLoadingConnectors || persistLoading || loadingCaseConfigure; const updateConnectorDisabled = isLoadingAny || !connectorIsValid || connectorId === 'none'; @@ -89,6 +90,7 @@ const ConfigureCasesComponent: React.FC = ({ userC (isVisible: boolean) => { setAddFlyoutVisibility(isVisible); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [currentConfiguration, connectorId, closureType] ); @@ -96,6 +98,7 @@ const ConfigureCasesComponent: React.FC = ({ userC (isVisible: boolean) => { setEditFlyoutVisibility(isVisible); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [currentConfiguration, connectorId, closureType] ); @@ -113,6 +116,7 @@ const ConfigureCasesComponent: React.FC = ({ userC closureType, }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [connectorId, closureType, version] ); @@ -125,6 +129,7 @@ const ConfigureCasesComponent: React.FC = ({ userC closureType: type, }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [connectorId, closureType, version] ); @@ -141,6 +146,7 @@ const ConfigureCasesComponent: React.FC = ({ userC ) { setConnectorIsValid(true); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [connectors, connectorId]); useEffect(() => { @@ -149,6 +155,7 @@ const ConfigureCasesComponent: React.FC = ({ userC connectors.find((c) => c.id === connectorId) as ActionConnectorTableItem ); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [connectors, connectorId]); return ( diff --git a/x-pack/plugins/security_solution/public/cases/components/connector_selector/form.tsx b/x-pack/plugins/security_solution/public/cases/components/connector_selector/form.tsx index 9e058ee5cf09e..1706fa38bb8a0 100644 --- a/x-pack/plugins/security_solution/public/cases/components/connector_selector/form.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/connector_selector/form.tsx @@ -33,6 +33,7 @@ export const ConnectorSelector = ({ useEffect(() => { field.setValue(defaultValue); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [defaultValue]); const handleContentChange = useCallback( diff --git a/x-pack/plugins/security_solution/public/cases/components/create/index.tsx b/x-pack/plugins/security_solution/public/cases/components/create/index.tsx index ae0ffe498c391..1b65b2582c760 100644 --- a/x-pack/plugins/security_solution/public/cases/components/create/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/create/index.tsx @@ -91,8 +91,10 @@ export const Create = React.memo(() => { const onSubmit = useCallback(async () => { const { isValid, data } = await form.submit(); if (isValid) { + // `postCase`'s type is incorrect, it actually returns a promise await postCase(data); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [form]); const handleSetIsCancel = useCallback(() => { diff --git a/x-pack/plugins/security_solution/public/cases/components/open_closed_stats/index.tsx b/x-pack/plugins/security_solution/public/cases/components/open_closed_stats/index.tsx index b9dab13090aca..e7d5299842494 100644 --- a/x-pack/plugins/security_solution/public/cases/components/open_closed_stats/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/open_closed_stats/index.tsx @@ -24,6 +24,7 @@ export const OpenClosedStats = React.memo( description: isLoading ? : caseCount ?? 'N/A', }, ], + // eslint-disable-next-line react-hooks/exhaustive-deps [caseCount, caseStatus, isLoading, dataTestSubj] ); return ( diff --git a/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.tsx b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.tsx index 2e9e3cce4306a..f18870787ded1 100644 --- a/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/use_push_to_service/index.tsx @@ -141,6 +141,7 @@ export const usePushToService = ({ errors = [...errors, getKibanaConfigError()]; } return errors; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [actionLicense, caseStatus, connectors.length, caseConnectorId, loadingLicense, urlSearch]); const pushToServiceButton = useMemo(() => { @@ -160,6 +161,7 @@ export const usePushToService = ({ : i18n.PUSH_THIRD(caseConnectorName)} ); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ caseConnectorId, caseConnectorName, diff --git a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx index da49014eb0204..52c2779a93fc0 100644 --- a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx @@ -85,6 +85,7 @@ export const UserActionTree = React.memo( updateCase, }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [caseData, handleManageMarkdownEditId, patchComment, updateCase] ); @@ -109,6 +110,7 @@ export const UserActionTree = React.memo( window.clearTimeout(handlerTimeoutId.current); }, 2400); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [handlerTimeoutId.current] ); @@ -155,6 +157,7 @@ export const UserActionTree = React.memo( showLoading={false} /> ), + // eslint-disable-next-line react-hooks/exhaustive-deps [caseData.id, handleUpdate, insertQuote, userCanCrud] ); @@ -165,6 +168,7 @@ export const UserActionTree = React.memo( handleOutlineComment(commentId); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [commentId, initLoading, isLoadingUserActions, isLoadingIds]); return ( <> diff --git a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.tsx index 03dd599da88e5..b3a5f1e0158d8 100644 --- a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.tsx @@ -74,6 +74,7 @@ export const UserActionMarkdown = ({ updateTimeline: dispatchUpdateTimeline(dispatch), }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [apolloClient] ); @@ -114,6 +115,7 @@ export const UserActionMarkdown = ({ ); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [handleCancelAction, handleSaveAction] ); return isEditable ? ( diff --git a/x-pack/plugins/security_solution/public/cases/components/user_list/index.tsx b/x-pack/plugins/security_solution/public/cases/components/user_list/index.tsx index 0606da371d16a..86ff42561c409 100644 --- a/x-pack/plugins/security_solution/public/cases/components/user_list/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/user_list/index.tsx @@ -84,6 +84,7 @@ export const UserList = React.memo(({ email, headline, loading, users }: UserLis window.open(`mailto:${emailAddress}?subject=${email.subject}&body=${email.body}`, '_blank'); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [email.subject] ); return users.filter(({ username }) => username != null && username !== '').length > 0 ? ( diff --git a/x-pack/plugins/security_solution/public/cases/containers/configure/use_configure.tsx b/x-pack/plugins/security_solution/public/cases/containers/configure/use_configure.tsx index 5a85a3a0633bc..e89212036ec20 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/configure/use_configure.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/configure/use_configure.tsx @@ -253,6 +253,7 @@ export const useCaseConfigure = (): ReturnUseCaseConfigure => { didCancel = true; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [state.firstLoad]); const persistCaseConfigure = useCallback( @@ -311,11 +312,13 @@ export const useCaseConfigure = (): ReturnUseCaseConfigure => { abortCtrl.abort(); }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [state.version] ); useEffect(() => { refetchCaseConfigure(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { diff --git a/x-pack/plugins/security_solution/public/cases/containers/configure/use_connectors.tsx b/x-pack/plugins/security_solution/public/cases/containers/configure/use_connectors.tsx index 9cd755864d37b..812e580ad653f 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/configure/use_connectors.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/configure/use_connectors.tsx @@ -50,10 +50,12 @@ export const useConnectors = (): ReturnConnectors => { didCancel = true; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { refetchConnectors(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_bulk_update_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_bulk_update_case.tsx index ef68f4f48b1a0..c333ff4207833 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_bulk_update_case.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_bulk_update_case.tsx @@ -108,6 +108,7 @@ export const useUpdateCases = (): UseUpdateCases => { cancel = true; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const dispatchResetIsUpdated = useCallback(() => { @@ -121,6 +122,7 @@ export const useUpdateCases = (): UseUpdateCases => { version: theCase.version, })); dispatchUpdateCases(updateCasesStatus); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { ...state, updateBulkStatus, dispatchResetIsUpdated }; }; diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_delete_cases.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_delete_cases.tsx index 2e8c7dfae2313..f47e9e51f865a 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_delete_cases.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_delete_cases.tsx @@ -110,6 +110,7 @@ export const useDeleteCases = (): UseDeleteCase => { abortCtrl.abort(); cancel = true; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const dispatchToggleDeleteModal = useCallback(() => { @@ -118,6 +119,7 @@ export const useDeleteCases = (): UseDeleteCase => { const dispatchResetIsDeleted = useCallback(() => { dispatch({ type: 'RESET_IS_DELETED' }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [state.isDisplayConfirmDeleteModal]); const handleOnDeleteConfirm = useCallback( @@ -125,10 +127,12 @@ export const useDeleteCases = (): UseDeleteCase => { dispatchDeleteCases(cases); dispatchToggleDeleteModal(); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [state.isDisplayConfirmDeleteModal] ); const handleToggleModal = useCallback(() => { dispatchToggleDeleteModal(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [state.isDisplayConfirmDeleteModal]); return { ...state, dispatchResetIsDeleted, handleOnDeleteConfirm, handleToggleModal }; diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_get_action_license.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_action_license.tsx index 563e2a4a58c70..e289a1973cf6e 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_get_action_license.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_get_action_license.tsx @@ -65,10 +65,12 @@ export const useGetActionLicense = (): ActionLicenseState => { didCancel = true; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [actionLicenseState]); useEffect(() => { fetchActionLicense(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { ...actionLicenseState }; }; diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_get_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_case.tsx index 01ada00ba9b72..ea4da41151993 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_get_case.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_get_case.tsx @@ -118,10 +118,12 @@ export const useGetCase = (caseId: string): UseGetCase => { didCancel = true; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [caseId]); useEffect(() => { callFetch(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [caseId]); return { ...state, fetchCase: callFetch, updateCase }; }; diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_get_case_user_actions.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_case_user_actions.tsx index 050b2815dc511..76d939de06a0a 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_get_case_user_actions.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_get_case_user_actions.tsx @@ -210,6 +210,7 @@ export const useGetCaseUserActions = ( abortCtrl.abort(); }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [caseUserActionsState, caseConnectorId] ); @@ -217,6 +218,7 @@ export const useGetCaseUserActions = ( if (!isEmpty(caseId)) { fetchCaseUserActions(caseId); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [caseId, caseConnectorId]); return { ...caseUserActionsState, fetchCaseUserActions }; }; diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_get_cases.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_cases.tsx index 45b571a8fe7e2..fdf526a1e4d88 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_get_cases.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_get_cases.tsx @@ -184,8 +184,10 @@ export const useGetCases = (initialQueryParams?: QueryParams): UseGetCases => { abortCtrl.abort(); didCancel = true; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + // eslint-disable-next-line react-hooks/exhaustive-deps useEffect(() => fetchCases(state.filterOptions, state.queryParams), [ state.queryParams, state.filterOptions, @@ -224,11 +226,13 @@ export const useGetCases = (initialQueryParams?: QueryParams): UseGetCases => { didCancel = true; }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [state.filterOptions, state.queryParams] ); const refetchCases = useCallback(() => { fetchCases(state.filterOptions, state.queryParams); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [state.filterOptions, state.queryParams]); return { diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_get_cases_status.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_cases_status.tsx index 476462b7e4c28..5260b6d5cc283 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_get_cases_status.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_get_cases_status.tsx @@ -69,10 +69,12 @@ export const useGetCasesStatus = (): UseGetCasesStatus => { didCancel = true; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [casesStatusState]); useEffect(() => { fetchCasesStatus(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_get_reporters.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_reporters.tsx index d723b8cc37c23..b4ca775660910 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_get_reporters.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_get_reporters.tsx @@ -79,10 +79,12 @@ export const useGetReporters = (): UseGetReporters => { didCancel = true; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [reportersState]); useEffect(() => { fetchReporters(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { ...reportersState, fetchReporters }; }; diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_get_tags.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_get_tags.tsx index 14f5e35bc4976..eded326719e52 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_get_tags.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_get_tags.tsx @@ -89,6 +89,7 @@ export const useGetTags = (): UseGetTags => { }; useEffect(() => { callFetch(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { ...state, fetchTags: callFetch }; }; diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_post_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_case.tsx index 13cfc2738620f..0752fe9b2071c 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_post_case.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_post_case.tsx @@ -86,6 +86,7 @@ export const usePostCase = (): UsePostCase => { abortCtrl.abort(); cancel = true; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { ...state, postCase: postMyCase }; diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_post_comment.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_comment.tsx index 9a52eaaf0db6b..e6cb8a9c3d150 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_post_comment.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_post_comment.tsx @@ -79,6 +79,7 @@ export const usePostComment = (caseId: string): UsePostComment => { cancel = true; }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [caseId] ); diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_post_push_to_service.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_post_push_to_service.tsx index 4d25ac7fbf0db..0d8a4c04ca7cd 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_post_push_to_service.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_post_push_to_service.tsx @@ -146,6 +146,7 @@ export const usePostPushToService = (): UsePostPushToService => { abortCtrl.abort(); }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx index 77cf53165d914..18dd9f5278503 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_update_case.tsx @@ -118,6 +118,7 @@ export const useUpdateCase = ({ caseId }: { caseId: string }): UseUpdateCase => abortCtrl.abort(); }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/x-pack/plugins/security_solution/public/cases/containers/use_update_comment.tsx b/x-pack/plugins/security_solution/public/cases/containers/use_update_comment.tsx index 821fd5523a751..f896185dbccfb 100644 --- a/x-pack/plugins/security_solution/public/cases/containers/use_update_comment.tsx +++ b/x-pack/plugins/security_solution/public/cases/containers/use_update_comment.tsx @@ -111,6 +111,7 @@ export const useUpdateComment = (): UseUpdateComment => { abortCtrl.abort(); }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx index b19343a9f4a5c..bb6ba01821835 100644 --- a/x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx @@ -69,6 +69,7 @@ const AlertsTableComponent: React.FC = ({ endDate, startDate, pageFilters title: i18n.ALERTS_TABLE_TITLE, unit: i18n.UNIT, }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( { const isDarkMode = useUiSetting(DEFAULT_DARK_MODE); const defaultTheme = isDarkMode ? DARK_THEME : LIGHT_THEME; + // eslint-disable-next-line react-hooks/exhaustive-deps const themeValue = useMemo(() => mergeWithDefaultTheme(theme, defaultTheme), []); return themeValue; diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx index c33677e41db0e..32f05e7c837a7 100644 --- a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx @@ -126,6 +126,7 @@ export const DragDropContextWrapperComponent = React.memo( () => () => { unRegisterProvider(); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx index 998d18291f638..4eeefdbe2fca0 100644 --- a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.tsx @@ -63,6 +63,7 @@ const DraggableWrapperHoverContentComponent: React.FC = ({ onFilterAdded(); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [field, value, filterManager, onFilterAdded]); const filterOutValue = useCallback(() => { @@ -77,6 +78,7 @@ const DraggableWrapperHoverContentComponent: React.FC = ({ onFilterAdded(); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [field, value, filterManager, onFilterAdded]); return ( diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx index d0bd87188e541..6b4baac0ff26c 100644 --- a/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx +++ b/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx @@ -103,9 +103,11 @@ const EventsViewerComponent: React.FC = ({ } = useManageTimeline(); useEffect(() => { setIsTimelineLoading({ id, isLoading: isQueryLoading }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [isQueryLoading]); useEffect(() => { setTimelineFilterManager({ id, filterManager }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [filterManager]); const { queryFields, title, unit } = useMemo(() => getManageTimelineById(id), [ diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx b/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx index ec726cd603579..9f1d71108e2f1 100644 --- a/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx @@ -74,6 +74,7 @@ const StatefulEventsViewerComponent: React.FC = ({ return () => { deleteEventQuery({ id, inputId: 'global' }); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const onChangeItemsPerPage: OnChangeItemsPerPage = useCallback( diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_entries.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_entries.tsx index d0236adc27c6c..fa21d61b06ebe 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_entries.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_entries.tsx @@ -109,6 +109,7 @@ const ExceptionEntriesComponent = ({ }, }, ], + // eslint-disable-next-line react-hooks/exhaustive-deps [entries] ); diff --git a/x-pack/plugins/security_solution/public/common/components/generic_downloader/index.tsx b/x-pack/plugins/security_solution/public/common/components/generic_downloader/index.tsx index 2f68da0c18727..2e8d5f77afc83 100644 --- a/x-pack/plugins/security_solution/public/common/components/generic_downloader/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/generic_downloader/index.tsx @@ -95,6 +95,7 @@ export const GenericDownloaderComponent = ({ isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ids]); return ; diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/editable_title.tsx b/x-pack/plugins/security_solution/public/common/components/header_page/editable_title.tsx index 0c6f7258d09dc..6f6c94a0b1124 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_page/editable_title.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_page/editable_title.tsx @@ -57,6 +57,7 @@ const EditableTitleComponent: React.FC = ({ onSubmit(changedTitle); } setEditMode(false); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [changedTitle, title]); const handleOnChange = useCallback( diff --git a/x-pack/plugins/security_solution/public/common/components/help_menu/index.tsx b/x-pack/plugins/security_solution/public/common/components/help_menu/index.tsx index ba9c136445983..56f0c825aa59e 100644 --- a/x-pack/plugins/security_solution/public/common/components/help_menu/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/help_menu/index.tsx @@ -45,6 +45,7 @@ export const HelpMenu = React.memo(() => { }, ], }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return null; diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/index.tsx b/x-pack/plugins/security_solution/public/common/components/import_data_modal/index.tsx index c4e0a0de5ae81..a42628cecff8e 100644 --- a/x-pack/plugins/security_solution/public/common/components/import_data_modal/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/import_data_modal/index.tsx @@ -109,6 +109,7 @@ export const ImportDataModalComponent = ({ errorToToaster({ title: errorMessage, error, dispatchToaster }); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedFiles, overwrite]); const handleCloseModal = useCallback(() => { diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.tsx b/x-pack/plugins/security_solution/public/common/components/links/index.tsx index 8a41d4c36edbb..637f0d8d53057 100644 --- a/x-pack/plugins/security_solution/public/common/components/links/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links/index.tsx @@ -242,6 +242,7 @@ const ReputationLinkComponent: React.FC<{ name: isDefaultReputationLink(name) ? defaultNameMapping[name] : name, url_template: url_template.replace(`{{ip}}`, encodeURIComponent(domain)), })), + // eslint-disable-next-line react-hooks/exhaustive-deps [ipReputationLinksSetting, domain, defaultNameMapping, allItemsLimit] ); diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/index.tsx b/x-pack/plugins/security_solution/public/common/components/markdown_editor/index.tsx index b0df2b6b5b60f..d92952992d997 100644 --- a/x-pack/plugins/security_solution/public/common/components/markdown_editor/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/markdown_editor/index.tsx @@ -135,6 +135,7 @@ export const MarkdownEditor = React.memo<{ ), }, ], + // eslint-disable-next-line react-hooks/exhaustive-deps [content, isDisabled, placeholder] ); return ( diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.tsx b/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.tsx index 08edae208fefa..3e196c4b7bad4 100644 --- a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.tsx @@ -19,12 +19,7 @@ import { MatrixLoader } from './matrix_loader'; import { Panel } from '../panel'; import { getBarchartConfigs, getCustomChartData } from './utils'; import { useQuery } from '../../containers/matrix_histogram'; -import { - MatrixHistogramProps, - MatrixHistogramOption, - HistogramAggregation, - MatrixHistogramQueryProps, -} from './types'; +import { MatrixHistogramProps, MatrixHistogramOption, MatrixHistogramQueryProps } from './types'; import { InspectButtonContainer } from '../inspect'; import { State, inputsSelectors } from '../../store'; @@ -125,6 +120,7 @@ export const MatrixHistogramComponent: React.FC< yTickFormatter, showLegend, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [ chartHeight, startDate, @@ -145,21 +141,20 @@ export const MatrixHistogramComponent: React.FC< stackByOptions.find((co) => co.value === event.target.value) ?? defaultStackByOption ); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); - const { data, loading, inspect, totalCount, refetch = noop } = useQuery<{}, HistogramAggregation>( - { - endDate, - errorMessage, - filterQuery, - histogramType, - indexToAdd, - startDate, - isInspected, - stackByField: selectedStackByOption.value, - } - ); + const { data, loading, inspect, totalCount, refetch = noop } = useQuery({ + endDate, + errorMessage, + filterQuery, + histogramType, + indexToAdd, + startDate, + isInspected, + stackByField: selectedStackByOption.value, + }); const titleWithStackByField = useMemo( () => (title != null && typeof title === 'function' ? title(selectedStackByOption) : title), @@ -260,7 +255,7 @@ export const MatrixHistogram = React.memo(MatrixHistogramComponent); const makeMapStateToProps = () => { const getQuery = inputsSelectors.globalQueryByIdSelector(); - const mapStateToProps = (state: State, { type, id }: OwnProps) => { + const mapStateToProps = (state: State, { id }: OwnProps) => { const { isInspected } = getQuery(state, id); return { isInspected, diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/types.ts b/x-pack/plugins/security_solution/public/common/components/matrix_histogram/types.ts index e30f1e9374c26..a9e6cdd19bb20 100644 --- a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/types.ts +++ b/x-pack/plugins/security_solution/public/common/components/matrix_histogram/types.ts @@ -99,12 +99,6 @@ export interface GroupBucket { }; } -export interface HistogramAggregation { - histogramAgg: { - buckets: GroupBucket[]; - }; -} - export interface BarchartConfigs { series: { xScaleType: ScaleType; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts b/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts index a76c4c850b8d9..8568c7e6b5575 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts @@ -121,13 +121,17 @@ export const useAnomaliesTableData = ({ isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ + // eslint-disable-next-line react-hooks/exhaustive-deps influencersOrCriteriaToString(influencers), + // eslint-disable-next-line react-hooks/exhaustive-deps influencersOrCriteriaToString(criteriaFields), startDate, endDate, skip, userPermissions, + // eslint-disable-next-line react-hooks/exhaustive-deps siemJobIds.sort().join(), ]); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/permissions/ml_capabilities_provider.tsx b/x-pack/plugins/security_solution/public/common/components/ml/permissions/ml_capabilities_provider.tsx index 1d5c1b36e22af..c83271a56be5a 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/permissions/ml_capabilities_provider.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml/permissions/ml_capabilities_provider.tsx @@ -60,6 +60,7 @@ export const MlCapabilitiesProvider = React.memo<{ children: JSX.Element }>(({ c isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_siem_jobs.tsx b/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_siem_jobs.tsx index a84d88782926c..7f0a8dea1913e 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_siem_jobs.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_siem_jobs.tsx @@ -74,6 +74,7 @@ export const useSiemJobs = (refetchData: boolean): Return => { isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [refetchData, userPermissions]); return [loading, siemJobs]; diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx b/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx index dd6e2d3f47110..de4185c8644a7 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx @@ -46,6 +46,7 @@ export const GroupsFilterPopoverComponent = ({ useEffect(() => { onSelectedGroupsChanged(selectedGroups); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedGroups.sort().join()]); return ( diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/index.tsx b/x-pack/plugins/security_solution/public/common/components/navigation/index.tsx index e0a24a5fc083c..0cbff9e70eff7 100644 --- a/x-pack/plugins/security_solution/public/common/components/navigation/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/navigation/index.tsx @@ -54,6 +54,7 @@ export const SiemNavigationComponent: React.FC< chrome ); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [chrome, pathName, search, navTabs, urlState, state]); return ( diff --git a/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx b/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx index b0b9309b44c68..a182102329f05 100644 --- a/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx @@ -134,6 +134,7 @@ const SearchBarComponent = memo( window.setTimeout(() => updateSearch(updateSearchBar), 0); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [id, end, filterQuery, fromStr, queries, start, toStr] ); @@ -153,6 +154,7 @@ const SearchBarComponent = memo( queries.forEach((q) => q.refetch && (q.refetch as inputsModel.Refetch)()); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [id, queries, filterManager] ); @@ -160,6 +162,7 @@ const SearchBarComponent = memo( (newSavedQuery: SavedQuery) => { setSavedQuery({ id, savedQuery: newSavedQuery }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); @@ -196,6 +199,7 @@ const SearchBarComponent = memo( updateSearch(updateSearchBar); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [id, end, fromStr, start, toStr] ); @@ -218,6 +222,7 @@ const SearchBarComponent = memo( filterManager, }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [id, end, filterManager, fromStr, start, toStr, savedQuery]); useEffect(() => { @@ -241,6 +246,7 @@ const SearchBarComponent = memo( isSubscribed = false; subscriptions.unsubscribe(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const indexPatterns = useMemo(() => [indexPattern], [indexPattern]); return ( diff --git a/x-pack/plugins/security_solution/public/common/components/stat_items/index.tsx b/x-pack/plugins/security_solution/public/common/components/stat_items/index.tsx index ec9cfc62ebada..dee730059b03a 100644 --- a/x-pack/plugins/security_solution/public/common/components/stat_items/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/stat_items/index.tsx @@ -183,6 +183,7 @@ export const useKpiMatrixStatus = ( }; }) ); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [data]); return statItemsProps; diff --git a/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx b/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx index 6b979df653eb4..84ff1120f6496 100644 --- a/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx @@ -117,6 +117,7 @@ export const SuperDatePickerComponent = React.memo( refetchQuery(queries); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [end, id, isQuickSelection, kqlQuery, start, timelineId] ); @@ -136,6 +137,7 @@ export const SuperDatePickerComponent = React.memo( refetchQuery(queries); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [id, isQuickSelection, duration, policy, toStr] ); @@ -175,6 +177,7 @@ export const SuperDatePickerComponent = React.memo( setIsQuickSelection(newIsQuickSelection); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [recentlyUsedRanges, kqlQuery] ); diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx index 944e8f6d1fb39..35036ef4b16b5 100644 --- a/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx @@ -69,6 +69,7 @@ describe('Toaster', () => { if (toasts.length === 0) { dispatch({ type: 'addToaster', toast: mockToast }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( <> diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx b/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx index 3e83866c7cf62..c28f5ab8aa44f 100644 --- a/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx @@ -109,6 +109,7 @@ const StatefulTopNComponent: React.FC = ({ isManagedTimeline(ACTIVE_TIMELINE_REDUX_ID) ? getManageTimelineById(ACTIVE_TIMELINE_REDUX_ID) : { documentType: null, id: null, indexToAdd: null }, + // eslint-disable-next-line react-hooks/exhaustive-deps [getManageTimelineById] ); diff --git a/x-pack/plugins/security_solution/public/common/components/url_state/use_url_state.tsx b/x-pack/plugins/security_solution/public/common/components/url_state/use_url_state.tsx index b3436a7da8297..ef60967e70ac3 100644 --- a/x-pack/plugins/security_solution/public/common/components/url_state/use_url_state.tsx +++ b/x-pack/plugins/security_solution/public/common/components/url_state/use_url_state.tsx @@ -46,7 +46,6 @@ export const useUrlStateHooks = ({ pathName, search, setInitialStateFromUrl, - tabName, updateTimeline, updateTimelineIsLoading, urlState, @@ -206,10 +205,12 @@ export const useUrlStateHooks = ({ } else if (pathName !== prevProps.pathName) { handleInitialize(type, pageName === SiemPageName.detections); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [isInitializing, history, pathName, pageName, prevProps, urlState]); useEffect(() => { document.title = `${getTitle(pageName, detailName, navTabs)} - Kibana`; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [pageName]); return null; diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx b/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx index a5574bd2a57c7..0beecc500e722 100644 --- a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx @@ -35,6 +35,7 @@ export const AnomaliesQueryTabBody = ({ deleteQuery({ id: ID }); } }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const [, siemJobs] = useSiemJobs(true); diff --git a/x-pack/plugins/security_solution/public/common/containers/events/last_event_time/index.ts b/x-pack/plugins/security_solution/public/common/containers/events/last_event_time/index.ts index 260b13c23f39c..6050dafc0b191 100644 --- a/x-pack/plugins/security_solution/public/common/containers/events/last_event_time/index.ts +++ b/x-pack/plugins/security_solution/public/common/containers/events/last_event_time/index.ts @@ -33,7 +33,7 @@ export interface OwnProps extends QueryTemplateProps { indexKey: LastEventIndexKey; } -export function useLastEventTimeQuery( +export function useLastEventTimeQuery( indexKey: LastEventIndexKey, details: LastTimeDetails, sourceId: string @@ -84,6 +84,7 @@ export function useLastEventTimeQuery( const signal = abortCtrl.signal; fetchLastEventTime(signal); return () => abortCtrl.abort(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [apolloClient, indexKey, details.hostName, details.ip]); return { lastSeen, loading, errorMessage }; diff --git a/x-pack/plugins/security_solution/public/common/containers/global_time/index.tsx b/x-pack/plugins/security_solution/public/common/containers/global_time/index.tsx index 4632e9aee3fdd..9b9b5c5d815b9 100644 --- a/x-pack/plugins/security_solution/public/common/containers/global_time/index.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/global_time/index.tsx @@ -59,6 +59,7 @@ export const GlobalTimeComponent: React.FC = ({ return () => { deleteAllQuery({ id: 'global' }); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( diff --git a/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts b/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts index c675c2745c66a..8c7acfc18ece6 100644 --- a/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts +++ b/x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts @@ -17,7 +17,7 @@ import { inputsModel } from '../../store'; import { MatrixHistogramGqlQuery } from './index.gql_query'; import { GetMatrixHistogramQuery, MatrixOverTimeHistogramData } from '../../../graphql/types'; -export const useQuery = ({ +export const useQuery = ({ endDate, errorMessage, filterQuery, @@ -102,6 +102,7 @@ export const useQuery = ({ isSubscribed = false; abortCtrl.abort(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ defaultIndex, errorMessage, diff --git a/x-pack/plugins/security_solution/public/common/containers/source/index.tsx b/x-pack/plugins/security_solution/public/common/containers/source/index.tsx index 26fb14c6a9c1e..ad480ad2c496b 100644 --- a/x-pack/plugins/security_solution/public/common/containers/source/index.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/source/index.tsx @@ -75,7 +75,7 @@ export const getIndexFields = memoizeOne( ); export const getBrowserFields = memoizeOne( - (title: string, fields: IndexField[]): BrowserFields => + (_title: string, fields: IndexField[]): BrowserFields => fields && fields.length > 0 ? fields.reduce( (accumulator: BrowserFields, field: IndexField) => @@ -173,6 +173,7 @@ export const useWithSource = (sourceId: string, indices: string[]) => { const signal = abortCtrl.signal; fetchSource(signal); return () => abortCtrl.abort(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [apolloClient, sourceId, indices]); return { indicesExist, browserFields, indexPattern, loading, errorMessage }; diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_add_to_timeline.tsx b/x-pack/plugins/security_solution/public/common/hooks/use_add_to_timeline.tsx index b73c400bc0460..eba8d14d60538 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_add_to_timeline.tsx +++ b/x-pack/plugins/security_solution/public/common/hooks/use_add_to_timeline.tsx @@ -159,6 +159,7 @@ export const useAddToTimeline = ({ document.body.classList.remove(IS_DRAGGING_CLASS_NAME); // it was not possible to perform a drag and drop } }, 0); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [_sensorApiSingleton, draggableId]); return startDragToTimeline; diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_index_patterns.tsx b/x-pack/plugins/security_solution/public/common/hooks/use_index_patterns.tsx index 05b0521e35217..837d6d5f70b5d 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_index_patterns.tsx +++ b/x-pack/plugins/security_solution/public/common/hooks/use_index_patterns.tsx @@ -45,6 +45,7 @@ export const useIndexPatterns = (refreshToggle = false): Return => { return () => { isSubscribed = false; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [refreshToggle]); return [isLoading, indexPatterns]; diff --git a/x-pack/plugins/security_solution/public/common/lib/connectors/components/connector_flyout/index.tsx b/x-pack/plugins/security_solution/public/common/lib/connectors/components/connector_flyout/index.tsx index cb227563b697a..30e2c650a70cc 100644 --- a/x-pack/plugins/security_solution/public/common/lib/connectors/components/connector_flyout/index.tsx +++ b/x-pack/plugins/security_solution/public/common/lib/connectors/components/connector_flyout/index.tsx @@ -53,6 +53,7 @@ export const withConnectorFlyout = ({ if (!isEmpty(apiUrl)) { secretKeys.forEach((key: string) => editActionSecrets(key, '')); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); if (isEmpty(mapping)) { @@ -64,6 +65,7 @@ export const withConnectorFlyout = ({ const handleOnChangeActionConfig = useCallback( (key: string, value: string) => editActionConfig(key, value), + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); @@ -73,11 +75,13 @@ export const withConnectorFlyout = ({ editActionConfig(key, ''); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [action.config] ); const handleOnChangeSecretConfig = useCallback( (key: string, value: string) => editActionSecrets(key, value), + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); @@ -87,6 +91,7 @@ export const withConnectorFlyout = ({ editActionSecrets(key, ''); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [action.secrets] ); @@ -96,6 +101,7 @@ export const withConnectorFlyout = ({ ...action.config.casesConfiguration, mapping: newMapping, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [action.config] ); diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts index afd57cade5559..bc16e8334e81c 100644 --- a/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts +++ b/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts @@ -89,10 +89,12 @@ export const useCurrentUser = (): AuthenticatedElasticUser | null => { return () => { didCancel = true; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [security]); useEffect(() => { fetchUser(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return user; }; diff --git a/x-pack/plugins/security_solution/public/common/utils/route/spy_routes.tsx b/x-pack/plugins/security_solution/public/common/utils/route/spy_routes.tsx index 9030e2713548b..072bbcf31c900 100644 --- a/x-pack/plugins/security_solution/public/common/utils/route/spy_routes.tsx +++ b/x-pack/plugins/security_solution/public/common/utils/route/spy_routes.tsx @@ -32,6 +32,7 @@ export const SpyRouteComponent = memo( }); setIsInitializing(false); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [search]); useEffect(() => { if (pageName && !deepEqual(route.pathName, pathname)) { @@ -81,6 +82,7 @@ export const SpyRouteComponent = memo( }); } } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [pathname, search, pageName, detailName, tabName, flowTarget, state]); return null; } diff --git a/x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline.tsx b/x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline.tsx index 78f22a86c1893..37c6a6583f0fb 100644 --- a/x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline.tsx +++ b/x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline.tsx @@ -25,6 +25,7 @@ export const useShowTimeline = () => { } else if (!showTimeline) { setShowTimeline(true); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [currentLocation.pathname]); return [showTimeline]; diff --git a/x-pack/plugins/security_solution/public/endpoint_alerts/view/details/overview/index.tsx b/x-pack/plugins/security_solution/public/endpoint_alerts/view/details/overview/index.tsx index 937e3727ca613..86c8e00c0a56f 100644 --- a/x-pack/plugins/security_solution/public/endpoint_alerts/view/details/overview/index.tsx +++ b/x-pack/plugins/security_solution/public/endpoint_alerts/view/details/overview/index.tsx @@ -90,6 +90,7 @@ const AlertDetailsOverviewComponent = memo(() => { history.push(locationObject); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [alertDetailsTabId] ); diff --git a/x-pack/plugins/security_solution/public/hosts/containers/hosts/first_last_seen/index.ts b/x-pack/plugins/security_solution/public/hosts/containers/hosts/first_last_seen/index.ts index 55a3a4b060dad..a4f8fca23e8aa 100644 --- a/x-pack/plugins/security_solution/public/hosts/containers/hosts/first_last_seen/index.ts +++ b/x-pack/plugins/security_solution/public/hosts/containers/hosts/first_last_seen/index.ts @@ -79,6 +79,7 @@ export function useFirstLastSeenHostQuery( const signal = abortCtrl.signal; fetchFirstLastSeenHost(signal); return () => abortCtrl.abort(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { firstSeen, lastSeen, loading, errorMessage }; diff --git a/x-pack/plugins/security_solution/public/management/components/management_page_view.tsx b/x-pack/plugins/security_solution/public/management/components/management_page_view.tsx index 5b140a53a363b..4fbbcfc8d948a 100644 --- a/x-pack/plugins/security_solution/public/management/components/management_page_view.tsx +++ b/x-pack/plugins/security_solution/public/management/components/management_page_view.tsx @@ -35,6 +35,7 @@ export const ManagementPageView = memo>((options) => href: getManagementUrl({ name: 'policyList' }), }, ]; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [tabName]); return ; }); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx index b05cdfb3be840..6c447df618791 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx @@ -137,6 +137,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { description: details.agent.version, }, ]; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ details.agent.version, details.endpoint.policy.id, diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx index 5e0aa76e1d139..39b253439aff0 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx @@ -149,6 +149,7 @@ export const EmbeddedMapComponent = ({ return () => { isSubscribed = false; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loadingKibanaIndexPatterns, kibanaIndexPatterns]); // queryExpression updated useEffect @@ -156,12 +157,14 @@ export const EmbeddedMapComponent = ({ if (embeddable != null) { embeddable.updateInput({ query }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [query]); useEffect(() => { if (embeddable != null) { embeddable.updateInput({ filters }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [filters]); // DateRange updated useEffect @@ -173,6 +176,7 @@ export const EmbeddedMapComponent = ({ }; embeddable.updateInput({ timeRange }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [startDate, endDate]); return isError ? null : ( diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/map_tool_tip/map_tool_tip.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/map_tool_tip/map_tool_tip.tsx index 3472cb629b9fe..d2b8322c8121e 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/map_tool_tip/map_tool_tip.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/map_tool_tip/map_tool_tip.tsx @@ -20,10 +20,8 @@ import * as i18n from '../translations'; import { ITooltipProperty } from '../../../../../../maps/public'; export const MapToolTipComponent = ({ - addFilters, closeTooltip, features = [], - isLocked, getLayerName, loadFeatureProperties, loadFeatureGeometry, @@ -78,8 +76,10 @@ export const MapToolTipComponent = ({ }; fetchFeatureProps(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ featureIndex, + // eslint-disable-next-line react-hooks/exhaustive-deps features .map((f) => `${f.id}-${f.layerId}`) .sort() diff --git a/x-pack/plugins/security_solution/public/network/components/source_destination/country_flag.tsx b/x-pack/plugins/security_solution/public/network/components/source_destination/country_flag.tsx index b9c01826e9e74..cb1af5513c846 100644 --- a/x-pack/plugins/security_solution/public/network/components/source_destination/country_flag.tsx +++ b/x-pack/plugins/security_solution/public/network/components/source_destination/country_flag.tsx @@ -31,6 +31,7 @@ export const CountryFlag = memo<{ if (displayCountryNameOnHover && isEmpty(countries.getNames('en'))) { countries.registerLocale(countryJson); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const flag = getFlag(countryCode); diff --git a/x-pack/plugins/security_solution/public/network/components/tls_table/index.tsx b/x-pack/plugins/security_solution/public/network/components/tls_table/index.tsx index 0fc4629c95470..d0e001466518d 100644 --- a/x-pack/plugins/security_solution/public/network/components/tls_table/index.tsx +++ b/x-pack/plugins/security_solution/public/network/components/tls_table/index.tsx @@ -108,6 +108,7 @@ const TlsTableComponent = React.memo( [sort, type, tableType, updateNetworkTable] ); + // eslint-disable-next-line react-hooks/exhaustive-deps const columns = useMemo(() => getTlsColumns(tlsTableId), [tlsTableId]); return ( diff --git a/x-pack/plugins/security_solution/public/network/components/users_table/index.tsx b/x-pack/plugins/security_solution/public/network/components/users_table/index.tsx index 51634a784d4da..af9d2b0ffefe3 100644 --- a/x-pack/plugins/security_solution/public/network/components/users_table/index.tsx +++ b/x-pack/plugins/security_solution/public/network/components/users_table/index.tsx @@ -114,6 +114,7 @@ const UsersTableComponent = React.memo( [sort, type, updateNetworkTable] ); + // eslint-disable-next-line react-hooks/exhaustive-deps const columns = useMemo(() => getUsersColumns(flowTarget, usersTableId), [ flowTarget, usersTableId, diff --git a/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx b/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx index 574260a819071..fe66ae2624c2a 100644 --- a/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx @@ -71,6 +71,7 @@ const AlertsByCategoryComponent: React.FC = ({ deleteQuery({ id: ID }); } }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const kibana = useKibana(); @@ -98,6 +99,7 @@ const AlertsByCategoryComponent: React.FC = ({ `${SHOWING}: ${numeral(totalCount).format(defaultNumberFormat)} ${UNIT(totalCount)}`, legendPosition: Position.Right, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/index.tsx b/x-pack/plugins/security_solution/public/overview/components/recent_timelines/index.tsx index 75b157a282eeb..ab76219b3cc00 100644 --- a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/recent_timelines/index.tsx @@ -82,6 +82,7 @@ const StatefulRecentTimelinesComponent = React.memo( onlyUserFavorite: filterBy === 'favorites', timelineType: TimelineType.default, }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [filterBy]); return ( diff --git a/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx b/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx index f2ad45be93522..5010fd9c06eb7 100644 --- a/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx @@ -61,6 +61,7 @@ const SignalsByCategoryComponent: React.FC = ({ const [min, max] = x; setAbsoluteRangeDatePicker({ id: setAbsoluteRangeDatePickerTarget, from: min, to: max }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [setAbsoluteRangeDatePicker] ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/category_columns.tsx b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/category_columns.tsx index b0a8dc311228a..14c17b7262724 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/category_columns.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/category_columns.tsx @@ -50,6 +50,7 @@ interface ToolTipProps { const ToolTip = React.memo( ({ categoryId, browserFields, onUpdateColumns, timelineId }) => { const { getManageTimelineById } = useManageTimeline(); + // eslint-disable-next-line react-hooks/exhaustive-deps const { isLoading } = useMemo(() => getManageTimelineById(timelineId) ?? { isLoading: false }, [ timelineId, ]); diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_browser.tsx b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_browser.tsx index c255bd062bb4c..8f538e03835f8 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_browser.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_browser.tsx @@ -180,6 +180,7 @@ const FieldsBrowserComponent: React.FC = ({ useEffect(() => { scrollViews(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedCategoryId, timelineId]); return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.tsx index 11c44cce89956..a3e93ff3c90eb 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.tsx @@ -108,6 +108,7 @@ export const StatefulFieldsBrowserComponent = React.memo { onUpdateColumns(columns); // show the category columns in the timeline + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); /** Invoked when the field browser should be hidden */ diff --git a/x-pack/plugins/security_solution/public/timelines/components/flyout/pane/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/flyout/pane/index.tsx index 33aca80b940fe..fbe3c475c9fe6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/flyout/pane/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/flyout/pane/index.tsx @@ -50,7 +50,7 @@ const FlyoutPaneComponent: React.FC = ({ const dispatch = useDispatch(); const onResizeStop: ResizeCallback = useCallback( - (e, direction, ref, delta) => { + (_e, _direction, _ref, delta) => { const bodyClientWidthPixels = document.body.clientWidth; if (delta.width) { @@ -65,6 +65,7 @@ const FlyoutPaneComponent: React.FC = ({ ); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [dispatch] ); const resizableDefaultSize = useMemo( @@ -72,6 +73,7 @@ const FlyoutPaneComponent: React.FC = ({ width, height: '100%', }), + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); const resizableHandleComponent = useMemo( diff --git a/x-pack/plugins/security_solution/public/timelines/components/manage_timeline/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/manage_timeline/index.tsx index c82a8bd18e6f8..8856805e6b660 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/manage_timeline/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/manage_timeline/index.tsx @@ -190,6 +190,7 @@ const useTimelineManager = (manageTimelineForTesting?: ManageTimelineById): UseT initializeTimeline({ id }); return { ...timelineDefaults, id }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [state] ); const isManagedTimeline = useCallback((id: string): boolean => state[id] != null, [state]); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx index 112e73a47ce7d..f88690ccd8aef 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx @@ -16,6 +16,7 @@ export const useEditTimelineActions = () => { const onCloseDeleteTimelineModal = useCallback(() => { setIsDeleteTimelineModalOpen(false); setActionTimeline(null); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [actionItem]); const onOpenDeleteTimelineModal = useCallback((selectedActionItem?: OpenTimelineResult) => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx index 7fb03b98432d0..4d45b74e9b1b4 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx @@ -47,6 +47,7 @@ export const useEditTimelineBatchActions = ({ disableExportTimelineDownloader(); onCloseDeleteTimelineModal(); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [disableExportTimelineDownloader, onCloseDeleteTimelineModal, tableRef.current] ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.tsx index f9c9d28ad89e1..92a8fc9338877 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.tsx @@ -125,6 +125,7 @@ export const StatefulOpenTimelineComponent = React.memo( onlyUserFavorite: onlyFavorites, timelineType, }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [pageIndex, pageSize, search, sortField, sortDirection, timelineType, onlyFavorites]); /** Invoked when the user presses enters to submit the text in the search input */ @@ -177,6 +178,7 @@ export const StatefulOpenTimelineComponent = React.memo( const onDeleteOneTimeline: OnDeleteOneTimeline = useCallback( async (timelineIds: string[]) => { + // The type for `deleteTimelines` is incorrect, it returns a Promise await deleteTimelines(timelineIds); }, [deleteTimelines] @@ -184,6 +186,7 @@ export const StatefulOpenTimelineComponent = React.memo( /** Invoked when the user clicks the action to delete the selected timelines */ const onDeleteSelected: OnDeleteSelected = useCallback(async () => { + // The type for `deleteTimelines` is incorrect, it returns a Promise await deleteTimelines(getSelectedTimelineIds(selectedItems)); // NOTE: we clear the selection state below, but if the server fails to @@ -191,6 +194,7 @@ export const StatefulOpenTimelineComponent = React.memo( resetSelectionState(); // TODO: the query must re-execute to show the results of the deletion + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedItems, deleteTimelines]); /** Invoked when the user selects (or de-selects) timelines */ @@ -244,6 +248,7 @@ export const StatefulOpenTimelineComponent = React.memo( updateTimeline, }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [apolloClient, updateIsLoading, updateTimeline] ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx index f99d8c566c4a5..afc66e337d7b2 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx @@ -79,6 +79,7 @@ export const useTimelineTypes = (): { ); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [tabName]); const timelineFilters = useMemo(() => { @@ -95,6 +96,7 @@ export const useTimelineTypes = (): { ))} ); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [timelineType]); return { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx index 2d9f907cc7179..2bb78c0dcb0ad 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx @@ -108,7 +108,7 @@ export const ColumnHeadersComponent = ({ ); const renderClone: DraggableChildrenFn = useCallback( - (dragProvided, dragSnapshot, rubric) => { + (dragProvided, _dragSnapshot, rubric) => { // TODO: Remove after github.com/DefinitelyTyped/DefinitelyTyped/pull/43057 is merged // eslint-disable-next-line @typescript-eslint/no-explicit-any const index = (rubric as any).source.index; @@ -151,6 +151,7 @@ export const ColumnHeadersComponent = ({ sort={sort} /> )), + // eslint-disable-next-line react-hooks/exhaustive-deps [ columnHeaders, timelineId, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.tsx index 3808a10e851e6..a9ade7b34344e 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/event_column_view.tsx @@ -106,6 +106,7 @@ export const EventColumnView = React.memo( const onClickCb = useCallback((cb: () => void) => { cb(); closePopover(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const additionalActions = useMemo(() => { @@ -175,6 +176,7 @@ export const EventColumnView = React.memo( , ] : grouped.icon; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [button, ecsData, timelineActions, isPopoverOpen]); // , isPopoverOpen, closePopover, onButtonClick]); return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_event.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_event.tsx index 61c5809518928..cf76cd3ddb8d4 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_event.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_event.tsx @@ -174,6 +174,7 @@ const StatefulEventComponent: React.FC = ({ return () => { _isMounted = false; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); // Number of current columns plus one for actions. diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/stateful_body.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/stateful_body.tsx index 351465dd45137..2d5e64fb09ffc 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/stateful_body.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/stateful_body.tsx @@ -94,6 +94,7 @@ const StatefulBodyComponent = React.memo( const onAddNoteToEvent: AddNoteToEvent = useCallback( ({ eventId, noteId }: { eventId: string; noteId: string }) => addNoteToEvent!({ id, eventId, noteId }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); @@ -131,27 +132,34 @@ const StatefulBodyComponent = React.memo( (sorted) => { updateSort!({ id, sort: sorted }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); const onColumnRemoved: OnColumnRemoved = useCallback( (columnId) => removeColumn!({ id, columnId }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); const onColumnResized: OnColumnResized = useCallback( ({ columnId, delta }) => applyDeltaToColumnWidth!({ id, columnId, delta }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); + // eslint-disable-next-line react-hooks/exhaustive-deps const onPinEvent: OnPinEvent = useCallback((eventId) => pinEvent!({ id, eventId }), [id]); + // eslint-disable-next-line react-hooks/exhaustive-deps const onUnPinEvent: OnUnPinEvent = useCallback((eventId) => unPinEvent!({ id, eventId }), [id]); + // eslint-disable-next-line react-hooks/exhaustive-deps const onUpdateNote: UpdateNote = useCallback((note: Note) => updateNote!({ note }), []); const onUpdateColumns: OnUpdateColumns = useCallback( (columns) => updateColumns!({ id, columns }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); @@ -160,6 +168,7 @@ const StatefulBodyComponent = React.memo( if (selectAll) { onSelectAll({ isSelected: true }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectAll]); // onSelectAll dependency not necessary return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx index aaf73487c4878..1f6fe998a44e9 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx @@ -71,11 +71,13 @@ export const ProviderItemBadge = React.memo( const onToggleEnabledProvider = useCallback(() => { toggleEnabledProvider(); closePopover(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [toggleEnabledProvider]); const onToggleExcludedProvider = useCallback(() => { toggleExcludedProvider(); closePopover(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [toggleExcludedProvider]); const [providerRegistered, setProviderRegistered] = useState(false); @@ -100,6 +102,7 @@ export const ProviderItemBadge = React.memo( () => () => { unRegisterProvider(); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/fetch_kql_timeline.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/fetch_kql_timeline.tsx index 77bd9aeba3ed2..cec889fe6ee34 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/fetch_kql_timeline.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/fetch_kql_timeline.tsx @@ -39,6 +39,7 @@ const TimelineKqlFetchComponent = memo( timelineId: id, }), }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [kueryFilterQueryDraft, kueryFilterQuery, id]); return null; }, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx index 607e004a8294e..594bf6d43e285 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx @@ -266,6 +266,7 @@ export const FooterComponent = ({ if (updatedAt === null || !isLoading) { setUpdatedAt(getUpdatedAt()); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [isLoading]); if (isLoading && !paginationLoading) { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx index 42fd6422d3a38..b53a34041a689 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx @@ -78,6 +78,7 @@ const StatefulTimelineComponent = React.memo( const onDataProviderRemoved: OnDataProviderRemoved = useCallback( (providerId: string, andProviderId?: string) => removeProvider!({ id, providerId, andProviderId }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); @@ -89,6 +90,7 @@ const StatefulTimelineComponent = React.memo( providerId, andProviderId, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); @@ -100,6 +102,7 @@ const StatefulTimelineComponent = React.memo( providerId, andProviderId, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); @@ -114,11 +117,13 @@ const StatefulTimelineComponent = React.memo( providerId, value, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); const onChangeItemsPerPage: OnChangeItemsPerPage = useCallback( (itemsChangedPerPage) => updateItemsPerPage!({ id, itemsPerPage: itemsChangedPerPage }), + // eslint-disable-next-line react-hooks/exhaustive-deps [id] ); @@ -141,6 +146,7 @@ const StatefulTimelineComponent = React.memo( }); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [columns, id] ); @@ -148,6 +154,7 @@ const StatefulTimelineComponent = React.memo( if (createTimeline != null) { createTimeline({ id, columns: defaultHeaders, show: false }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/insert_timeline_popover/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/insert_timeline_popover/index.tsx index 2a673427d906c..ed4d742bb8b4d 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/insert_timeline_popover/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/insert_timeline_popover/index.tsx @@ -52,6 +52,7 @@ export const InsertTimelinePopoverComponent: React.FC = ({ ); setRouterState(null); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [routerState]); const handleClosePopover = useCallback(() => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/insert_timeline_popover/use_insert_timeline.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/insert_timeline_popover/use_insert_timeline.tsx index 1a81c131de015..0f9e64082a603 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/insert_timeline_popover/use_insert_timeline.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/insert_timeline_popover/use_insert_timeline.tsx @@ -28,12 +28,14 @@ export const useInsertTimeline = (form: FormHook, fieldNa ].join(''); form.setFieldValue(fieldName, newValue); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [form] ); const handleCursorChange = useCallback( (cp: CursorPosition) => { setCursorPosition(cp); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [cursorPosition] ); return { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.tsx index 3ef10d394bc7b..38a85a7a92631 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.tsx @@ -142,6 +142,7 @@ export const NewCase = React.memo( }, }, }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [onClosePopover, history, timelineId, timelineTitle]); return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/index.tsx index d8966a58748ed..1532a64e4083e 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/index.tsx @@ -87,6 +87,7 @@ export const Properties = React.memo( const onOpenTimelineModal = useCallback(() => { onClosePopover(); setShowTimelineModal(true); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const datePickerWidth = useMemo( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx index 9852fc7dd300a..80729eda051b1 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx @@ -120,6 +120,7 @@ export const QueryBarTimeline = memo( isSubscribed = false; subscriptions.unsubscribe(); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { @@ -129,6 +130,7 @@ export const QueryBarTimeline = memo( if (!deepEqual(filters, filterWithoutDropArea)) { filterManager.setFilters(filters); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [filters]); useEffect(() => { @@ -188,6 +190,7 @@ export const QueryBarTimeline = memo( return () => { isSubscribed = false; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [savedQueryId]); const onChangedQuery = useCallback( @@ -203,6 +206,7 @@ export const QueryBarTimeline = memo( ); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [filterQueryDraft] ); @@ -232,6 +236,7 @@ export const QueryBarTimeline = memo( }); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [filterQuery, timelineId] ); @@ -274,6 +279,7 @@ export const QueryBarTimeline = memo( setSavedQueryId(null); } }, + // eslint-disable-next-line react-hooks/exhaustive-deps [dataProvidersDsl, savedQueryId, savedQueryServices] ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx index 22fbaadf2e816..5f35bc5212d37 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx @@ -78,6 +78,7 @@ const StatefulSearchOrFilterComponent = React.memo( serializedQuery: convertKueryToElasticSearchQuery(expression, indexPattern), }, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [indexPattern, timelineId] ); @@ -90,6 +91,7 @@ const StatefulSearchOrFilterComponent = React.memo( expression, }, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [timelineId] ); @@ -99,6 +101,7 @@ const StatefulSearchOrFilterComponent = React.memo( id: timelineId, filters: newFilters, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [timelineId] ); @@ -108,6 +111,7 @@ const StatefulSearchOrFilterComponent = React.memo( id: timelineId, savedQueryId: newSavedQueryId, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [timelineId] ); @@ -117,6 +121,7 @@ const StatefulSearchOrFilterComponent = React.memo( id: timelineId, eventType: newEventType, }), + // eslint-disable-next-line react-hooks/exhaustive-deps [timelineId] ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.tsx index 2d215267d8382..2e12ebad2f99d 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.tsx @@ -258,6 +258,7 @@ const SelectableTimelineComponent: React.FC = ({ onlyUserFavorite: onlyFavorites, timelineType, }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [onlyFavorites, pageSize, searchTimelineValue, timelineType]); return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/timeline.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/timeline.tsx index 340818efa5514..884d693ca6ade 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/timeline.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/timeline.tsx @@ -171,12 +171,15 @@ export const TimelineComponent: React.FC = ({ } = useManageTimeline(); useEffect(() => { initializeTimeline({ id, indexToAdd }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { setIsTimelineLoading({ id, isLoading: isQueryLoading || loadingIndexName }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [loadingIndexName, isQueryLoading]); useEffect(() => { setTimelineFilterManager({ id, filterManager }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [filterManager]); return ( diff --git a/x-pack/plugins/security_solution/public/timelines/containers/all/index.tsx b/x-pack/plugins/security_solution/public/timelines/containers/all/index.tsx index 3bca7ce5f1c08..19112221cbfd0 100644 --- a/x-pack/plugins/security_solution/public/timelines/containers/all/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/containers/all/index.tsx @@ -48,7 +48,7 @@ export interface AllTimelinesVariables { export const ALL_TIMELINE_QUERY_ID = 'FETCH_ALL_TIMELINES'; export const getAllTimeline = memoizeOne( - (variables: string, timelines: TimelineResult[]): OpenTimelineResult[] => + (_variables: string, timelines: TimelineResult[]): OpenTimelineResult[] => timelines.map((timeline) => ({ created: timeline.created, description: timeline.description, @@ -168,6 +168,7 @@ export const useGetAllTimeline = (): AllTimelinesArgs => { abortCtrl.abort(); }; }, + // eslint-disable-next-line react-hooks/exhaustive-deps [apolloClient, allTimelines] ); diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 9d3bc008106c6..aa45fd4bcb292 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7605,7 +7605,6 @@ "xpack.infra.logs.lastUpdate": "前回の更新 {timestamp}", "xpack.infra.logs.loadingNewEntriesText": "新しいエントリーを読み込み中", "xpack.infra.logs.logEntryActionsDetailsButton": "詳細を表示", - "xpack.infra.logs.logEntryActionsMenuTitle": "行詳細のログ", "xpack.infra.logs.logEntryCategories.analyzeCategoryInMlButtonLabel": "ML で分析", "xpack.infra.logs.logEntryCategories.analyzeCategoryInMlTooltipDescription": "ML アプリでこのカテゴリーを分析します。", "xpack.infra.logs.logEntryCategories.categoryColumnTitle": "カテゴリー", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 6992d4004e24e..56d373a6fcd2f 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7609,7 +7609,6 @@ "xpack.infra.logs.lastUpdate": "上次更新时间 {timestamp}", "xpack.infra.logs.loadingNewEntriesText": "正在加载新条目", "xpack.infra.logs.logEntryActionsDetailsButton": "查看详情", - "xpack.infra.logs.logEntryActionsMenuTitle": "日志行详情", "xpack.infra.logs.logEntryCategories.analyzeCategoryInMlButtonLabel": "在 ML 中分析", "xpack.infra.logs.logEntryCategories.analyzeCategoryInMlTooltipDescription": "在 ML 应用中分析此类别。", "xpack.infra.logs.logEntryCategories.categoryColumnTitle": "类别", diff --git a/yarn.lock b/yarn.lock index 678ddfb052cd3..e47af2c6fe284 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5629,17 +5629,12 @@ acorn-walk@^6.0.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== -acorn-walk@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.0.0.tgz#c8ba6f0f1aac4b0a9e32d1f0af12be769528f36b" - integrity sha512-7Bv1We7ZGuU79zZbb6rRqcpxo3OY+zrdtloZWoyD8fmGX+FeXRjE+iuGkZjSXLVovLzrsvMGMy0EkwA0E0umxg== - -acorn-walk@^7.1.1: +acorn-walk@^7.0.0, acorn-walk@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.1.1.tgz#345f0dffad5c735e7373d2fec9a1023e6a44b83e" integrity sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ== -acorn@5.X, acorn@^5.0.0, acorn@^5.0.3, acorn@^5.1.2, acorn@^5.5.0: +acorn@5.X, acorn@^5.0.3, acorn@^5.1.2, acorn@^5.5.0: version "5.7.4" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e" integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== @@ -5659,7 +5654,12 @@ acorn@^6.0.1, acorn@^6.2.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== -acorn@^7.0.0, acorn@^7.1.0, acorn@^7.1.1: +acorn@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.2.0.tgz#17ea7e40d7c8640ff54a694c889c26f31704effe" + integrity sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ== + +acorn@^7.1.0, acorn@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== @@ -7426,7 +7426,7 @@ babel-preset-react-app@^9.0.0: babel-plugin-macros "2.6.1" babel-plugin-transform-react-remove-prop-types "0.4.24" -babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= @@ -7555,12 +7555,12 @@ base64-js@0.0.8: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978" integrity sha1-EQHpVE9KdrG8OybUUsqW16NeeXg= -base64-js@^1.0.2, base64-js@^1.1.2: +base64-js@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" integrity sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw== -base64-js@^1.2.1, base64-js@^1.3.1: +base64-js@^1.1.2, base64-js@^1.2.1, base64-js@^1.3.0, base64-js@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== @@ -7973,17 +7973,7 @@ breadth-filter@^2.0.0: dependencies: object.entries "^1.0.4" -brfs@^1.4.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/brfs/-/brfs-1.6.1.tgz#b78ce2336d818e25eea04a0947cba6d4fb8849c3" - integrity sha512-OfZpABRQQf+Xsmju8XE9bDjs+uU4vLREGolP7bDgcpsI17QREyZ4Bl+2KLxxx1kCgA0fAIhKQBaBYh+PEcCqYQ== - dependencies: - quote-stream "^1.0.1" - resolve "^1.1.5" - static-module "^2.2.0" - through2 "^2.0.0" - -brfs@^2.0.2: +brfs@^2.0.0, brfs@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/brfs/-/brfs-2.0.2.tgz#44237878fa82aa479ce4f5fe2c1796ec69f07845" integrity sha512-IrFjVtwu4eTJZyu8w/V2gxU7iLTtcHih67sgEdzrhjLBMHp2uYefUBfdM4k2UvcuWMgV7PQDZHSLeNWnLFKWVQ== @@ -8023,20 +8013,13 @@ browser-process-hrtime@^0.1.2: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" integrity sha1-Ql1opY00R/AqBKqJQYf86K+Le44= -browser-resolve@^1.11.3: +browser-resolve@^1.11.3, browser-resolve@^1.8.1: version "1.11.3" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== dependencies: resolve "1.1.7" -browser-resolve@^1.8.1: - version "1.11.2" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" - integrity sha1-j/CbCixCFxihBRwmCzLkj0QpOM4= - dependencies: - resolve "1.1.7" - browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" @@ -8072,7 +8055,7 @@ browserify-des@^1.0.0: des.js "^1.0.0" inherits "^2.0.1" -browserify-optional@^1.0.0: +browserify-optional@^1.0.0, browserify-optional@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/browserify-optional/-/browserify-optional-1.0.1.tgz#1e13722cfde0d85f121676c2a72ced533a018869" integrity sha1-HhNyLP3g2F8SFnbCpyztUzoBiGk= @@ -9269,7 +9252,7 @@ clone-stats@^1.0.0: resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= -clone@^1.0.0, clone@^1.0.1, clone@^1.0.2: +clone@^1.0.0, clone@^1.0.2, clone@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= @@ -9864,7 +9847,7 @@ contour_plot@^0.0.1: resolved "https://registry.yarnpkg.com/contour_plot/-/contour_plot-0.0.1.tgz#475870f032b8e338412aa5fc507880f0bf495c77" integrity sha1-R1hw8DK44zhBKqX8UHiA8L9JXHc= -convert-source-map@1.7.0, convert-source-map@^1.7.0: +convert-source-map@1.7.0, convert-source-map@^1.5.1, convert-source-map@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== @@ -9881,13 +9864,6 @@ convert-source-map@^0.3.3: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-0.3.5.tgz#f1d802950af7dd2631a1febe0596550c86ab3190" integrity sha1-8dgClQr33SYxof6+BZZVDIarMZA= -convert-source-map@^1.5.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== - dependencies: - safe-buffer "~5.1.1" - convex-hull@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/convex-hull/-/convex-hull-1.0.3.tgz#20a3aa6ce87f4adea2ff7d17971c9fc1c67e1fff" @@ -10878,6 +10854,11 @@ dargs@^5.1.0: resolved "https://registry.yarnpkg.com/dargs/-/dargs-5.1.0.tgz#ec7ea50c78564cd36c9d5ec18f66329fade27829" integrity sha1-7H6lDHhWTNNsnV7Bj2Yyn63ieCk= +dash-ast@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37" + integrity sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -11060,9 +11041,9 @@ decompress-unzip@^4.0.1: yauzl "^2.4.2" decompress@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d" - integrity sha1-eu3YVCflqS2s/lVnSnxQXpbQH50= + version "4.2.1" + resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.1.tgz#007f55cc6a62c055afa37c07eb6a4ee1b773f118" + integrity sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ== dependencies: decompress-tar "^4.0.0" decompress-tarbz2 "^4.0.0" @@ -11085,12 +11066,7 @@ deep-eql@^0.1.3: dependencies: type-detect "0.1.1" -deep-equal@^1.0.0, deep-equal@^1.0.1, deep-equal@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= - -deep-equal@^1.1.1, deep-equal@~1.1.1: +deep-equal@^1.0.0, deep-equal@^1.1.1, deep-equal@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== @@ -11102,6 +11078,11 @@ deep-equal@^1.1.1, deep-equal@~1.1.1: object-keys "^1.1.1" regexp.prototype.flags "^1.2.0" +deep-equal@^1.0.1, deep-equal@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= + deep-extend@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -11462,12 +11443,10 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" -dfa@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/dfa/-/dfa-1.1.0.tgz#d30218bd10d030fa421df3ebbc82285463a31781" - integrity sha1-0wIYvRDQMPpCHfPrvIIoVGOjF4E= - dependencies: - babel-runtime "^6.11.6" +dfa@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/dfa/-/dfa-1.2.0.tgz#96ac3204e2d29c49ea5b57af8d92c2ae12790657" + integrity sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q== di@^0.0.1: version "0.0.1" @@ -12502,7 +12481,7 @@ escodegen@1.8.x: optionalDependencies: source-map "~0.2.0" -escodegen@^1.11.1, escodegen@^1.8.1: +escodegen@^1.11.1: version "1.12.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541" integrity sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg== @@ -12549,18 +12528,6 @@ escodegen@~1.2.0: optionalDependencies: source-map "~0.1.30" -escodegen@~1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" - integrity sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q== - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -13422,16 +13389,6 @@ faker@1.1.0: resolved "https://registry.yarnpkg.com/faker/-/faker-1.1.0.tgz#230738ebd37edad9de4a421de12922bd8206a872" integrity sha1-Iwc469N+2tneSkId4SkivYIGqHI= -falafel@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.1.0.tgz#96bb17761daba94f46d001738b3cedf3a67fe06c" - integrity sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw= - dependencies: - acorn "^5.0.0" - foreach "^2.0.5" - isarray "0.0.1" - object-keys "^1.0.6" - fancy-log@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1" @@ -14066,20 +14023,20 @@ font-awesome@4.7.0: integrity sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM= fontkit@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/fontkit/-/fontkit-1.8.0.tgz#deb9351619e90ddc91707b6156a9f14c8ab11554" - integrity sha512-EFDRCca7khfQWYu1iFhsqeABpi87f03MBdkT93ZE6YhqCdMzb5Eojb6c4dlJikGv5liuhByyzA7ikpIPTSBWbQ== + version "1.8.1" + resolved "https://registry.yarnpkg.com/fontkit/-/fontkit-1.8.1.tgz#ae77485376f1096b45548bf6ced9a07af62a7846" + integrity sha512-BsNCjDoYRxmNWFdAuK1y9bQt+igIxGtTC9u/jSFjR9MKhmI00rP1fwSvERt+5ddE82544l0XH5mzXozQVUy2Tw== dependencies: - babel-runtime "^6.11.6" - brfs "^1.4.0" + babel-runtime "^6.26.0" + brfs "^2.0.0" brotli "^1.2.0" - browserify-optional "^1.0.0" - clone "^1.0.1" + browserify-optional "^1.0.1" + clone "^1.0.4" deep-equal "^1.0.0" - dfa "^1.0.0" + dfa "^1.2.0" restructure "^0.5.3" tiny-inflate "^1.0.2" - unicode-properties "^1.0.0" + unicode-properties "^1.2.2" unicode-trie "^0.3.0" for-each@^0.3.2: @@ -14120,11 +14077,6 @@ for-own@^1.0.0: dependencies: for-in "^1.0.1" -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - foreachasync@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/foreachasync/-/foreachasync-3.0.0.tgz#5502987dc8714be3392097f32e0071c9dee07cf6" @@ -16476,6 +16428,13 @@ iconv-lite@^0.5.0: dependencies: safer-buffer ">= 2.1.2 < 3" +iconv-lite@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.5.1.tgz#b2425d3c7b18f7219f2ca663d103bddb91718d64" + integrity sha512-ONHr16SQvKZNSqjQT9gy5z24Jw+uqfO02/ngBSBoqChZ+W8qXX7GPRa1RoUnzGADw8K63R1BXUMzarCVQBpY8Q== + dependencies: + safer-buffer ">= 2.1.2 < 3" + icss-utils@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-4.0.0.tgz#d52cf4bcdcfa1c45c2dbefb4ffdf6b00ef608098" @@ -20094,12 +20053,12 @@ madge@3.4.4: rc "^1.2.7" walkdir "^0.0.12" -magic-string@^0.22.4: - version "0.22.5" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e" - integrity sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w== +magic-string@0.25.1: + version "0.25.1" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.1.tgz#b1c248b399cd7485da0fe7385c2fc7011843266e" + integrity sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg== dependencies: - vlq "^0.2.2" + sourcemap-codec "^1.4.1" majo@^0.4.1: version "0.4.1" @@ -21956,16 +21915,11 @@ object-identity-map@^1.0.2: dependencies: object.entries "^1.1.0" -object-inspect@^1.7.0, object-inspect@~1.7.0: +object-inspect@^1.6.0, object-inspect@^1.7.0, object-inspect@~1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== -object-inspect@~1.4.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.4.1.tgz#37ffb10e71adaf3748d05f713b4c9452f402cbc4" - integrity sha512-wqdhLpfCUbEsoEwl3FXwGyv8ief1k/1aUdIPCqVnupM6e8l63BEJdiF/0swtn04/8p05tG/T0FrpTlfwvljOdw== - object-inspect@~1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" @@ -21976,7 +21930,7 @@ object-is@^1.0.1, object-is@^1.0.2: resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.2.tgz#6b80eb84fe451498f65007982f035a5b445edec4" integrity sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ== -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1: +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -23049,12 +23003,12 @@ pdfkit@>=0.8.1, pdfkit@^0.11.0: linebreak "^1.0.2" png-js "^1.0.0" -pdfmake@^0.1.63: - version "0.1.63" - resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.1.63.tgz#0001ecffe4ab30843485ce08744393315721e3f1" - integrity sha512-TjchyLVDzaEmtaDNUrceNrm0QvNIFERYOeDwHwMUQ1twGy68Uhjd1MKsb9DGAh8SuB8MCWQXB7m4k7cUevLjoA== +pdfmake@^0.1.65: + version "0.1.65" + resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.1.65.tgz#09c4cf796809ec5fce789343560a36780ff47e37" + integrity sha512-MgzRyiKSP3IEUH7vm4oj3lpikmk5oCD9kYxiJM6Z2Xf6CP9EcikeSDey2rGd4WVvn79Y0TGqz2+to8FtWP8MrA== dependencies: - iconv-lite "^0.5.0" + iconv-lite "^0.5.1" linebreak "^1.0.2" pdfkit "^0.11.0" svg-to-pdfkit "^0.1.8" @@ -24096,7 +24050,7 @@ quickselect@^2.0.0: resolved "https://registry.yarnpkg.com/quickselect/-/quickselect-2.0.0.tgz#f19680a486a5eefb581303e023e98faaf25dd018" integrity sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw== -quote-stream@^1.0.1, quote-stream@~1.0.2: +quote-stream@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-1.0.2.tgz#84963f8c9c26b942e153feeb53aae74652b7e0b2" integrity sha1-hJY/jJwmuULhU/7rU6rnRlK34LI= @@ -25173,7 +25127,7 @@ read-pkg@^5.1.1, read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -"readable-stream@1 || 2": +"readable-stream@1 || 2", readable-stream@~2.3.3: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -25205,7 +25159,7 @@ readable-stream@1.0, "readable-stream@>=1.0.33-1 <1.1.0-0": string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.3, readable-stream@~2.3.6: +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -26166,7 +26120,14 @@ resolve@1.8.1, resolve@^1.3.2, resolve@^1.8.1: dependencies: path-parse "^1.0.5" -resolve@^1.1.5, resolve@^1.1.6, resolve@^1.1.7: +resolve@^1.1.5: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@^1.1.6, resolve@^1.1.7: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" integrity sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw== @@ -26743,11 +26704,12 @@ schema-utils@^2.4.1, schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6 ajv-keywords "^3.4.1" scope-analyzer@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/scope-analyzer/-/scope-analyzer-2.0.5.tgz#72c9c6770c3e66984f84c7d3c7045998a1a7db8a" - integrity sha512-+U5H0417mnTEstCD5VwOYO7V4vYuSqwqjFap40ythe67bhMFL5C3UgPwyBv7KDJsqUBIKafOD57xMlh1rN7eaw== + version "2.1.1" + resolved "https://registry.yarnpkg.com/scope-analyzer/-/scope-analyzer-2.1.1.tgz#5156c27de084d74bf75af9e9506aaf95c6e73dd6" + integrity sha512-azEAihtQ9mEyZGhfgTJy3IbOWEzeOrYbg7NcYEshPKnKd+LZmC3TNd5dmDxbLBsTG/JVWmCp+vDJ03vJjeXMHg== dependencies: array-from "^2.1.1" + dash-ast "^1.0.0" es6-map "^0.1.5" es6-set "^0.1.5" es6-symbol "^3.1.1" @@ -27842,20 +27804,13 @@ statehood@6.x.x: iron "5.x.x" joi "13.x.x" -static-eval@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.3.tgz#cb62fc79946bd4d5f623a45ad428233adace4d72" - integrity sha512-zsxDGucfAh8T339sSKgpFbvg15Fms2IVaJGC+jqp0bVsxhcpM+iMeAI8weNo8dmf4OblgifTBUoyk1vGVtYw2w== +static-eval@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.5.tgz#f0782e66999c4b3651cda99d9ce59c507d188f71" + integrity sha512-nNbV6LbGtMBgv7e9LFkt5JV8RVlRsyJrphfAt9tOtBBW/SfnzZDf2KnS72an8e434A+9e/BmJuTxeGPvrAK7KA== dependencies: escodegen "^1.11.1" -static-eval@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.2.tgz#2d1759306b1befa688938454c546b7871f806a42" - integrity sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg== - dependencies: - escodegen "^1.8.1" - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -27864,44 +27819,24 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -static-module@^2.2.0: - version "2.2.5" - resolved "https://registry.yarnpkg.com/static-module/-/static-module-2.2.5.tgz#bd40abceae33da6b7afb84a0e4329ff8852bfbbf" - integrity sha512-D8vv82E/Kpmz3TXHKG8PPsCPg+RAX6cbCOyvjM6x04qZtQ47EtJFVwRsdov3n5d6/6ynrOY9XB4JkaZwB2xoRQ== - dependencies: - concat-stream "~1.6.0" - convert-source-map "^1.5.1" - duplexer2 "~0.1.4" - escodegen "~1.9.0" - falafel "^2.1.0" - has "^1.0.1" - magic-string "^0.22.4" - merge-source-map "1.0.4" - object-inspect "~1.4.0" - quote-stream "~1.0.2" - readable-stream "~2.3.3" - shallow-copy "~0.0.1" - static-eval "^2.0.0" - through2 "~2.0.3" - static-module@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/static-module/-/static-module-3.0.3.tgz#cc2301ed3fe353e2d2a2195137013853676f9960" - integrity sha512-RDaMYaI5o/ym0GkCqL/PlD1Pn216omp8fY81okxZ6f6JQxWW5tptOw9reXoZX85yt/scYvbWIt6uoszeyf+/MQ== + version "3.0.4" + resolved "https://registry.yarnpkg.com/static-module/-/static-module-3.0.4.tgz#bfbd1d1c38dd1fbbf0bb4af0c1b3ae18a93a2b68" + integrity sha512-gb0v0rrgpBkifXCa3yZXxqVmXDVE+ETXj6YlC/jt5VzOnGXR2C15+++eXuMDUYsePnbhf+lwW0pE1UXyOLtGCw== dependencies: acorn-node "^1.3.0" concat-stream "~1.6.0" convert-source-map "^1.5.1" duplexer2 "~0.1.4" - escodegen "~1.9.0" + escodegen "^1.11.1" has "^1.0.1" - magic-string "^0.22.4" + magic-string "0.25.1" merge-source-map "1.0.4" - object-inspect "~1.4.0" + object-inspect "^1.6.0" readable-stream "~2.3.3" scope-analyzer "^2.0.1" shallow-copy "~0.0.1" - static-eval "^2.0.2" + static-eval "^2.0.5" through2 "~2.0.3" stats-lite@^2.2.0: @@ -29098,9 +29033,9 @@ tiny-emitter@^2.0.0: integrity sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow== tiny-inflate@^1.0.0, tiny-inflate@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/tiny-inflate/-/tiny-inflate-1.0.2.tgz#93d9decffc8805bd57eae4310f0b745e9b6fb3a7" - integrity sha1-k9nez/yIBb1X6uQxDwt0Xptvs6c= + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-inflate/-/tiny-inflate-1.0.3.tgz#122715494913a1805166aaf7c93467933eea26c4" + integrity sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw== tiny-invariant@^1.0.2: version "1.0.4" @@ -30321,13 +30256,13 @@ unicode-match-property-value-ecmascript@^1.2.0: resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz#0d91f600eeeb3096aa962b1d6fc88876e64ea531" integrity sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ== -unicode-properties@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/unicode-properties/-/unicode-properties-1.1.0.tgz#7a96eef49f75682ea69d2315eec9ac43ffdf00c1" - integrity sha1-epbu9J91aC6mnSMV7smsQ//fAME= +unicode-properties@^1.2.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/unicode-properties/-/unicode-properties-1.3.1.tgz#cc642b6314bde2c691d65dd94cece09ed84f1282" + integrity sha512-nIV3Tf3LcUEZttY/2g4ZJtGXhWwSkuLL+rCu0DIAMbjyVPj+8j5gNVz4T/sVbnQybIsd5SFGkPKg/756OY6jlA== dependencies: - brfs "^1.4.0" - unicode-trie "^0.3.0" + base64-js "^1.3.0" + unicode-trie "^2.0.0" unicode-property-aliases-ecmascript@^1.0.4: version "1.0.4" @@ -30355,6 +30290,14 @@ unicode-trie@^1.0.0: pako "^0.2.5" tiny-inflate "^1.0.0" +unicode-trie@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-2.0.0.tgz#8fd8845696e2e14a8b67d78fa9e0dd2cad62fec8" + integrity sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ== + dependencies: + pako "^0.2.5" + tiny-inflate "^1.0.0" + unified@^6.1.5: version "6.1.6" resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.6.tgz#5ea7f807a0898f1f8acdeefe5f25faa010cc42b1" @@ -31360,11 +31303,6 @@ vision@^5.3.3: items "2.x.x" joi "13.x.x" -vlq@^0.2.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" - integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== - vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73"