diff --git a/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/flyout_body.tsx b/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/flyout_body.tsx
index 3f493ef7d4355..f7de84a9c1ad0 100644
--- a/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/flyout_body.tsx
+++ b/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/flyout_body.tsx
@@ -9,7 +9,6 @@ import { EuiButtonEmpty, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { LayerWizardSelect } from './layer_wizard_select';
import { LayerWizard, RenderWizardArguments } from '../../../classes/layers/layer_wizard_registry';
-/* eslint-disable @typescript-eslint/consistent-type-definitions */
type Props = RenderWizardArguments & {
layerWizard: LayerWizard | null;
diff --git a/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.test.tsx b/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.test.tsx
index e802c5259e5ed..d64e38cf49dea 100644
--- a/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.test.tsx
+++ b/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.test.tsx
@@ -17,6 +17,7 @@ const defaultProps = {
describe('LayerWizardSelect', () => {
beforeAll(() => {
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
require('../../../classes/layers/layer_wizard_registry').getLayerWizards = async () => {
return [
{
diff --git a/x-pack/plugins/maps/public/index_pattern_util.test.ts b/x-pack/plugins/maps/public/index_pattern_util.test.ts
index 27b0a4aac9bf7..ffcc6da52677a 100644
--- a/x-pack/plugins/maps/public/index_pattern_util.test.ts
+++ b/x-pack/plugins/maps/public/index_pattern_util.test.ts
@@ -68,6 +68,7 @@ describe('Gold+ licensing', () => {
describe('basic license', () => {
beforeEach(() => {
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
require('./kibana_services').getIsGoldPlus = () => false;
});
@@ -90,6 +91,7 @@ describe('Gold+ licensing', () => {
describe('gold license', () => {
beforeEach(() => {
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
require('./kibana_services').getIsGoldPlus = () => true;
});
describe('getAggregatableGeoFieldTypes', () => {
diff --git a/x-pack/plugins/maps_legacy_licensing/public/plugin.ts b/x-pack/plugins/maps_legacy_licensing/public/plugin.ts
index 69c25efd96e75..eaf527f856bc5 100644
--- a/x-pack/plugins/maps_legacy_licensing/public/plugin.ts
+++ b/x-pack/plugins/maps_legacy_licensing/public/plugin.ts
@@ -13,7 +13,6 @@ import { LicensingPluginSetup, ILicense } from '../../licensing/public';
* @public
*/
-// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface MapsLegacyLicensingSetupDependencies {
licensing: LicensingPluginSetup;
mapsLegacy: any;
diff --git a/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx b/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx
index a354612a348dc..07e33a43d3ff9 100644
--- a/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx
+++ b/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx
@@ -69,7 +69,7 @@ const Tooltip: FC<{ service: ChartTooltipService }> = React.memo(({ service }) =
.slice(1)
.map(({ label, value, color, isHighlighted, seriesIdentifier, valueAccessor }) => {
const classes = classNames('mlChartTooltip__item', {
- /* eslint @typescript-eslint/camelcase:0 */
+ // eslint-disable-next-line @typescript-eslint/naming-convention
echTooltip__rowHighlighted: isHighlighted,
});
return (
diff --git a/x-pack/plugins/ml/public/application/components/data_grid/column_chart.tsx b/x-pack/plugins/ml/public/application/components/data_grid/column_chart.tsx
index 00e2d5b14a96b..a3a67fbb8bb75 100644
--- a/x-pack/plugins/ml/public/application/components/data_grid/column_chart.tsx
+++ b/x-pack/plugins/ml/public/application/components/data_grid/column_chart.tsx
@@ -61,6 +61,7 @@ export const ColumnChart: FC
= ({ chartData, columnType, dataTestSubj })
)}
{
setVisibleColumns(defaultVisibleColumns);
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [defaultVisibleColumns.join()]);
const [invalidSortingColumnns, setInvalidSortingColumnns] = useState
([]);
diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts b/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts
index 3bc3b8c2c6dfd..e3da9b509e620 100644
--- a/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts
+++ b/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts
@@ -23,6 +23,5 @@ interface StartPlugins {
}
export type StartServices = CoreStart &
StartPlugins & { kibanaVersion: string } & MlServicesContext;
-// eslint-disable-next-line react-hooks/rules-of-hooks
export const useMlKibana = () => useKibana();
export type MlKibanaReactContextValue = KibanaReactContextValue;
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss
index 140593cb17f6e..231d0f6a0d8c5 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss
@@ -1,3 +1,4 @@
@import 'pages/analytics_exploration/components/regression_exploration/index';
@import 'pages/analytics_management/components/analytics_list/index';
@import 'pages/analytics_management/components/create_analytics_button/index';
+@import 'pages/analytics_creation/components/index';
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 1b28875a624f8..1b99aac812fcd 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
@@ -47,6 +47,7 @@ export const EXTENDED_NUMERICAL_TYPES = new Set([
ES_FIELD_TYPES.SCALED_FLOAT,
]);
+// eslint-disable-next-line @typescript-eslint/naming-convention
export const ML__ID_COPY = 'ml__id_copy';
export const isKeywordAndTextType = (fieldName: string): boolean => {
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/_index.scss b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/_index.scss
new file mode 100644
index 0000000000000..28d0928eb4d35
--- /dev/null
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/_index.scss
@@ -0,0 +1,3 @@
+.dfAnalyticsCreationWizard__card {
+ width: 300px;
+}
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/back_to_list_panel/back_to_list_panel.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/back_to_list_panel/back_to_list_panel.tsx
index 183cbe084f9b3..babb557105270 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/back_to_list_panel/back_to_list_panel.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/back_to_list_panel/back_to_list_panel.tsx
@@ -5,7 +5,7 @@
*/
import React, { FC, Fragment } from 'react';
-import { EuiCard, EuiHorizontalRule, EuiIcon } from '@elastic/eui';
+import { EuiCard, EuiIcon } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useNavigateToPath } from '../../../../../contexts/kibana';
@@ -18,10 +18,8 @@ export const BackToListPanel: FC = () => {
return (
-
}
title={i18n.translate('xpack.ml.dataframe.analytics.create.analyticsListCardTitle', {
defaultMessage: 'Data Frame Analytics',
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx
index a229a79d316d7..a52cbb99d7f48 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx
@@ -54,7 +54,7 @@ const columns = [
id: 'is_included',
alignment: LEFT_ALIGNMENT,
isSortable: true,
- // eslint-disable-next-line @typescript-eslint/camelcase
+ // eslint-disable-next-line @typescript-eslint/naming-convention
render: ({ is_included }: { is_included: boolean }) => (is_included ? 'Yes' : 'No'),
},
{
@@ -64,7 +64,7 @@ const columns = [
id: 'is_required',
alignment: LEFT_ALIGNMENT,
isSortable: true,
- // eslint-disable-next-line @typescript-eslint/camelcase
+ // eslint-disable-next-line @typescript-eslint/naming-convention
render: ({ is_required }: { is_required: boolean }) => (is_required ? 'Yes' : 'No'),
},
{
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step/create_step.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step/create_step.tsx
index 8ad49b84134cb..dc9f1bd586d9f 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step/create_step.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step/create_step.tsx
@@ -18,8 +18,7 @@ import { i18n } from '@kbn/i18n';
import { CreateAnalyticsFormProps } from '../../../analytics_management/hooks/use_create_analytics_form';
import { Messages } from '../shared';
import { ANALYTICS_STEPS } from '../../page';
-import { BackToListPanel } from '../back_to_list_panel';
-import { ProgressStats } from './progress_stats';
+import { CreateStepFooter } from '../create_step_footer';
interface Props extends CreateAnalyticsFormProps {
step: ANALYTICS_STEPS;
@@ -28,7 +27,7 @@ interface Props extends CreateAnalyticsFormProps {
export const CreateStep: FC = ({ actions, state, step }) => {
const { createAnalyticsJob, startAnalyticsJob } = actions;
const { isAdvancedEditorValidJson, isJobCreated, isJobStarted, isValid, requestMessages } = state;
- const { jobId } = state.form;
+ const { jobId, jobType } = state.form;
const [checked, setChecked] = useState(true);
const [showProgress, setShowProgress] = useState(false);
@@ -86,8 +85,9 @@ export const CreateStep: FC = ({ actions, state, step }) => {
)}
- {isJobCreated === true && showProgress && }
- {isJobCreated === true && }
+ {isJobCreated === true && (
+
+ )}
);
};
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step/progress_stats.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/create_step_footer.tsx
similarity index 55%
rename from x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step/progress_stats.tsx
rename to x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/create_step_footer.tsx
index c87f0f4206feb..93d88ebc0b5ac 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step/progress_stats.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/create_step_footer.tsx
@@ -4,38 +4,43 @@
* you may not use this file except in compliance with the Elastic License.
*/
-import React, { FC, useState, useEffect } from 'react';
-import {
- EuiCallOut,
- EuiFlexGroup,
- EuiFlexItem,
- EuiProgress,
- EuiSpacer,
- EuiText,
-} from '@elastic/eui';
+import React, { FC, useEffect, useState } from 'react';
+import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { useMlKibana } from '../../../../../contexts/kibana';
+
import {
getDataFrameAnalyticsProgressPhase,
DATA_FRAME_TASK_STATE,
} from '../../../analytics_management/components/analytics_list/common';
import { isGetDataFrameAnalyticsStatsResponseOk } from '../../../analytics_management/services/analytics_service/get_analytics';
+import { useMlKibana } from '../../../../../contexts/kibana';
import { ml } from '../../../../../services/ml_api_service';
-import { DataFrameAnalyticsId } from '../../../../common/analytics';
+import { BackToListPanel } from '../back_to_list_panel';
+import { ViewResultsPanel } from '../view_results_panel';
+import { ProgressStats } from './progress_stats';
+import { ANALYSIS_CONFIG_TYPE } from '../../../../common/analytics';
export const PROGRESS_REFRESH_INTERVAL_MS = 1000;
-export const ProgressStats: FC<{ jobId: DataFrameAnalyticsId }> = ({ jobId }) => {
+interface Props {
+ jobId: string;
+ jobType: ANALYSIS_CONFIG_TYPE;
+ showProgress: boolean;
+}
+
+export interface AnalyticsProgressStats {
+ currentPhase: number;
+ progress: number;
+ totalPhases: number;
+}
+
+export const CreateStepFooter: FC = ({ jobId, jobType, showProgress }) => {
const [initialized, setInitialized] = useState(false);
const [failedJobMessage, setFailedJobMessage] = useState(undefined);
- const [currentProgress, setCurrentProgress] = useState<
- | {
- currentPhase: number;
- progress: number;
- totalPhases: number;
- }
- | undefined
- >(undefined);
+ const [jobFinished, setJobFinished] = useState(false);
+ const [currentProgress, setCurrentProgress] = useState(
+ undefined
+ );
const {
services: { notifications },
@@ -77,6 +82,7 @@ export const ProgressStats: FC<{ jobId: DataFrameAnalyticsId }> = ({ jobId }) =>
jobStats.state === DATA_FRAME_TASK_STATE.STOPPED
) {
clearInterval(interval);
+ setJobFinished(true);
}
} else {
clearInterval(interval);
@@ -95,62 +101,26 @@ export const ProgressStats: FC<{ jobId: DataFrameAnalyticsId }> = ({ jobId }) =>
return () => clearInterval(interval);
}, [initialized]);
- if (currentProgress === undefined) return null;
-
return (
- <>
-
- {failedJobMessage !== undefined && (
- <>
-
- {failedJobMessage}
-
-
- >
- )}
-
-
- {i18n.translate('xpack.ml.dataframe.analytics.create.analyticsProgressTitle', {
- defaultMessage: 'Progress',
- })}
-
-
-
-
-
-
-
- {i18n.translate('xpack.ml.dataframe.analytics.create.analyticsProgressPhaseTitle', {
- defaultMessage: 'Phase',
- })}{' '}
- {currentProgress.currentPhase}/{currentProgress.totalPhases}
-
-
-
-
-
-
-
- {`${currentProgress.progress}%`}
-
-
- >
+
+
+ {showProgress && (
+
+ )}
+
+
+
+
+
+
+
+ {jobFinished === true && (
+
+
+
+ )}
+
+
+
);
};
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/index.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/index.ts
new file mode 100644
index 0000000000000..fc4e230ba1034
--- /dev/null
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/index.ts
@@ -0,0 +1,7 @@
+/*
+ * 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 { CreateStepFooter } from './create_step_footer';
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/progress_stats.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/progress_stats.tsx
new file mode 100644
index 0000000000000..522bafa54a270
--- /dev/null
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/progress_stats.tsx
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+import React, { FC } from 'react';
+import {
+ EuiCallOut,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiProgress,
+ EuiSpacer,
+ EuiText,
+} from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import { AnalyticsProgressStats } from './create_step_footer';
+
+interface Props {
+ currentProgress?: AnalyticsProgressStats;
+ failedJobMessage: string | undefined;
+}
+
+export const ProgressStats: FC = ({ currentProgress, failedJobMessage }) => {
+ if (currentProgress === undefined) return null;
+
+ return (
+ <>
+
+ {failedJobMessage !== undefined && (
+ <>
+
+ {failedJobMessage}
+
+
+ >
+ )}
+
+
+ {i18n.translate('xpack.ml.dataframe.analytics.create.analyticsProgressTitle', {
+ defaultMessage: 'Progress',
+ })}
+
+
+
+
+
+
+
+ {i18n.translate('xpack.ml.dataframe.analytics.create.analyticsProgressPhaseTitle', {
+ defaultMessage: 'Phase',
+ })}{' '}
+ {currentProgress.currentPhase}/{currentProgress.totalPhases}
+
+
+
+
+
+
+
+ {`${currentProgress.progress}%`}
+
+
+ >
+ );
+};
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/view_results_panel/index.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/view_results_panel/index.ts
new file mode 100644
index 0000000000000..ef3c0cce38652
--- /dev/null
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/view_results_panel/index.ts
@@ -0,0 +1,7 @@
+/*
+ * 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 { ViewResultsPanel } from './view_results_panel';
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/view_results_panel/view_results_panel.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/view_results_panel/view_results_panel.tsx
new file mode 100644
index 0000000000000..13706eb548ec8
--- /dev/null
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/view_results_panel/view_results_panel.tsx
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+import React, { FC, Fragment } from 'react';
+import { EuiCard, EuiIcon } from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import { useNavigateToPath } from '../../../../../contexts/kibana';
+import { getResultsUrl } from '../../../analytics_management/components/analytics_list/common';
+import { ANALYSIS_CONFIG_TYPE } from '../../../../common/analytics';
+
+interface Props {
+ jobId: string;
+ analysisType: ANALYSIS_CONFIG_TYPE;
+}
+
+export const ViewResultsPanel: FC = ({ jobId, analysisType }) => {
+ const navigateToPath = useNavigateToPath();
+
+ const redirectToAnalyticsManagementPage = async () => {
+ const path = getResultsUrl(jobId, analysisType);
+ await navigateToPath(path);
+ };
+
+ return (
+
+ }
+ title={i18n.translate('xpack.ml.dataframe.analytics.create.viewResultsCardTitle', {
+ defaultMessage: 'View Results',
+ })}
+ description={i18n.translate(
+ 'xpack.ml.dataframe.analytics.create.viewResultsCardDescription',
+ {
+ defaultMessage: 'View results for the analytics job.',
+ }
+ )}
+ onClick={redirectToAnalyticsManagementPage}
+ data-test-subj="analyticsWizardViewResultsCard"
+ />
+
+ );
+};
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts
index 2cecffc993257..eab5165a42137 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts
@@ -63,7 +63,6 @@ export const useIndexData = (
useEffect(() => {
resetPagination();
// custom comparison
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [JSON.stringify(query)]);
const getIndexData = async function () {
@@ -103,7 +102,6 @@ export const useIndexData = (
useEffect(() => {
getIndexData();
// custom comparison
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [indexPattern.title, JSON.stringify([query, pagination, sortingColumns])]);
const dataLoader = useMemo(() => new DataLoader(indexPattern, toastNotifications), [
@@ -132,7 +130,6 @@ export const useIndexData = (
fetchColumnChartsData();
}
// custom comparison
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [
dataGrid.chartsVisible,
indexPattern.title,
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 98dd40986e32b..8d53214d23d47 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
@@ -70,7 +70,6 @@ export const useExplorationResults = (
useEffect(() => {
getIndexData(jobConfig, dataGrid, searchQuery);
// custom comparison
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [jobConfig && jobConfig.id, dataGrid.pagination, searchQuery, dataGrid.sortingColumns]);
const dataLoader = useMemo(
@@ -103,7 +102,6 @@ export const useExplorationResults = (
fetchColumnChartsData();
}
// custom comparison
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [
dataGrid.chartsVisible,
jobConfig?.dest.index,
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx
index 4c4731d0dad5f..2b1c40f0eb734 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx
@@ -56,7 +56,6 @@ export const OutlierExploration: FC = React.memo(({ jobId }) =
const { columnsWithCharts, errorMessage, status, tableItems } = outlierData;
- /* eslint-disable-next-line react-hooks/rules-of-hooks */
const colorRange = useColorRange(
COLOR_RANGE.BLUE,
COLOR_RANGE_SCALE.INFLUENCER,
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts
index 90294a09c0adc..24649ae5f1e71 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts
@@ -77,7 +77,6 @@ export const useOutlierData = (
useEffect(() => {
getIndexData(jobConfig, dataGrid, searchQuery);
// custom comparison
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [jobConfig && jobConfig.id, dataGrid.pagination, searchQuery, dataGrid.sortingColumns]);
const dataLoader = useMemo(
@@ -112,7 +111,6 @@ export const useOutlierData = (
fetchColumnChartsData();
}
// custom comparison
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [
dataGrid.chartsVisible,
jobConfig?.dest.index,
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
index 75c41c097192e..895d217555ef4 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx
@@ -94,6 +94,7 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery })
genErrorEval.eval &&
isRegressionEvaluateResponse(genErrorEval.eval)
) {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { mse, msle, huber, r_squared } = getValuesFromResponse(genErrorEval.eval);
setGeneralizationEval({
mse,
@@ -131,6 +132,7 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery })
trainingErrorEval.eval &&
isRegressionEvaluateResponse(trainingErrorEval.eval)
) {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { mse, msle, huber, r_squared } = getValuesFromResponse(trainingErrorEval.eval);
setTrainingEval({
mse,
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_button.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_button.tsx
index 010aa7b8513b5..d78e1bcc1a913 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_button.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_button.tsx
@@ -314,6 +314,7 @@ export type CloneDataFrameAnalyticsConfig = Omit<
export function extractCloningConfig({
id,
version,
+ // eslint-disable-next-line @typescript-eslint/naming-convention
create_time,
...configToClone
}: DeepReadonly): CloneDataFrameAnalyticsConfig {
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_edit/edit_button_flyout.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_edit/edit_button_flyout.tsx
index 86b1c879417bb..14b743997f30a 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_edit/edit_button_flyout.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_edit/edit_button_flyout.tsx
@@ -133,7 +133,7 @@ export const EditButtonFlyout: FC> = ({ closeFlyout, item }
onClose={closeFlyout}
hideCloseButton
aria-labelledby="analyticsEditFlyoutTitle"
- data-test-subj="analyticsEditFlyout"
+ data-test-subj="mlAnalyticsEditFlyout"
>
@@ -297,7 +297,7 @@ export const EditButtonFlyout: FC> = ({ closeFlyout, item }
= ({
return (
<>
{i18n.translate('xpack.ml.dataFrame.analyticsList.emptyPromptTitle', {
- defaultMessage: 'No data frame analytics jobs found',
+ defaultMessage: 'Create your first data frame analytics job',
})}
}
actions={
!isManagementTable
? [
- setIsSourceIndexModalVisible(true)}
isDisabled={disabled}
+ color="primary"
+ iconType="plusInCircle"
+ fill
data-test-subj="mlAnalyticsCreateFirstButton"
>
{i18n.translate('xpack.ml.dataFrame.analyticsList.emptyPromptButtonText', {
- defaultMessage: 'Create your first data frame analytics job',
+ defaultMessage: 'Create job',
})}
- ,
+ ,
]
: []
}
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common.ts
index e2d9ecccf0626..cc52138d7c7b7 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common.ts
@@ -130,6 +130,6 @@ export function isCompletedAnalyticsJob(stats: DataFrameAnalyticsStats) {
return stats.state === DATA_FRAME_TASK_STATE.STOPPED && progress === 100;
}
-export function getResultsUrl(jobId: string, analysisType: string) {
+export function getResultsUrl(jobId: string, analysisType: ANALYSIS_CONFIG_TYPE | string) {
return `#/data_frame_analytics/exploration?_g=(ml:(jobId:${jobId},analysisType:${analysisType}))`;
}
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx
index 5276fedff0fde..645c6c276a6f9 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx
@@ -95,6 +95,7 @@ export const ExpandedRow: FC = ({ item }) => {
genErrorEval.eval &&
isRegressionEvaluateResponse(genErrorEval.eval)
) {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { mse, msle, huber, r_squared } = getValuesFromResponse(genErrorEval.eval);
setGeneralizationEval({
mse,
@@ -129,6 +130,7 @@ export const ExpandedRow: FC = ({ item }) => {
trainingErrorEval.eval &&
isRegressionEvaluateResponse(trainingErrorEval.eval)
) {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { mse, msle, huber, r_squared } = getValuesFromResponse(trainingErrorEval.eval);
setTrainingEval({
mse,
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_columns.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_columns.tsx
index 123fdada44866..1b115496c2091 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_columns.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_columns.tsx
@@ -258,6 +258,7 @@ export const useColumns = (
}),
actions,
width: isManagementTable === true ? '100px' : '150px',
+ 'data-test-subj': 'mlAnalyticsTableColumnActions',
},
];
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state.ts
index 69599f43ef297..f932e4d0db7d7 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state.ts
@@ -18,7 +18,6 @@ import { CloneDataFrameAnalyticsConfig } from '../../components/action_clone';
export enum DEFAULT_MODEL_MEMORY_LIMIT {
regression = '100mb',
- // eslint-disable-next-line @typescript-eslint/camelcase
outlier_detection = '50mb',
classification = '100mb',
}
diff --git a/x-pack/plugins/ml/public/application/services/results_service/index.ts b/x-pack/plugins/ml/public/application/services/results_service/index.ts
index 6c508422e7063..5547c4096e3de 100644
--- a/x-pack/plugins/ml/public/application/services/results_service/index.ts
+++ b/x-pack/plugins/ml/public/application/services/results_service/index.ts
@@ -10,9 +10,9 @@ import { ml, MlApiServices } from '../ml_api_service';
export type MlResultsService = typeof mlResultsService;
-type time = string;
+type Time = string;
export interface ModelPlotOutputResults {
- results: Record
);
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.test.tsx
index a3c5d09a0fb64..04ab9ee7216f7 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.test.tsx
@@ -161,10 +161,7 @@ describe('Exception builder helpers', () => {
const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry();
const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem, 'detection');
const expected: IIndexPattern = {
- fields: [
- { ...getField('nestedField.child') },
- { ...getField('nestedField.nestedChild.doublyNestedChild') },
- ],
+ fields: [{ ...getField('nestedField.child'), name: 'child' }],
id: '1234',
title: 'logstash-*',
};
@@ -243,7 +240,7 @@ describe('Exception builder helpers', () => {
};
const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem, 'endpoint');
const expected: IIndexPattern = {
- fields: [getEndpointField('file.Ext.code_signature.status')],
+ fields: [{ ...getEndpointField('file.Ext.code_signature.status'), name: 'status' }],
id: '1234',
title: 'logstash-*',
};
@@ -405,7 +402,7 @@ describe('Exception builder helpers', () => {
aggregatable: false,
count: 0,
esTypes: ['text'],
- name: 'nestedField.child',
+ name: 'child',
readFromDocValues: false,
scripted: false,
searchable: true,
@@ -600,7 +597,7 @@ describe('Exception builder helpers', () => {
aggregatable: false,
count: 0,
esTypes: ['text'],
- name: 'nestedField.child',
+ name: 'child',
readFromDocValues: false,
scripted: false,
searchable: true,
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.tsx
index f6b703b7e622e..2fda14dfa04d7 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.tsx
@@ -33,7 +33,6 @@ import {
EmptyNestedEntry,
} from '../types';
import { getEntryValue, getExceptionOperatorSelect } from '../helpers';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import exceptionableFields from '../exceptionable_fields.json';
/**
@@ -61,13 +60,20 @@ export const getFilteredIndexPatterns = (
// when user has selected a nested entry, only fields with the common parent are shown
return {
...indexPatterns,
- fields: indexPatterns.fields.filter(
- (field) =>
- field.subType != null &&
- field.subType.nested != null &&
- item.parent != null &&
- field.subType.nested.path.startsWith(item.parent.parent.field)
- ),
+ fields: indexPatterns.fields
+ .filter((indexField) => {
+ const fieldHasCommonParentPath =
+ indexField.subType != null &&
+ indexField.subType.nested != null &&
+ item.parent != null &&
+ indexField.subType.nested.path === item.parent.parent.field;
+
+ return fieldHasCommonParentPath;
+ })
+ .map((f) => {
+ const fieldNameWithoutParentPath = f.name.split('.').slice(-1)[0];
+ return { ...f, name: fieldNameWithoutParentPath };
+ }),
};
} else if (item.nested === 'parent' && item.field != null) {
// when user has selected a nested entry, right above it we show the common parent
@@ -146,7 +152,10 @@ export const getFormattedBuilderEntry = (
if (parent != null && parentIndex != null) {
return {
- field: foundField,
+ field:
+ foundField != null
+ ? { ...foundField, name: foundField.name.split('.').slice(-1)[0] }
+ : foundField,
correspondingKeywordField,
operator: getExceptionOperatorSelect(item),
value: getEntryValue(item),
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx
index 2b526ede12acf..18d2130dd3811 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx
@@ -226,6 +226,7 @@ export const filterExceptionItems = (
export const formatExceptionItemForUpdate = (
exceptionItem: ExceptionListItemSchema
): UpdateExceptionListItemSchema => {
+ /* eslint-disable @typescript-eslint/naming-convention */
const {
created_at,
created_by,
@@ -233,6 +234,7 @@ export const formatExceptionItemForUpdate = (
tie_breaker_id,
updated_at,
updated_by,
+ /* eslint-enable @typescript-eslint/naming-convention */
...fieldsToUpdate
} = exceptionItem;
return {
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.stories.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.stories.tsx
index fec7354855935..a540a34b70677 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.stories.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item/index.stories.tsx
@@ -118,6 +118,7 @@ storiesOf('Components|ExceptionItem', module)
);
})
.add('with loadingItemIds', () => {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { id, namespace_type, ...rest } = getExceptionListItemSchemaMock();
return (
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx
index 84613d1c73536..4c60f3ba5ccce 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.test.tsx
@@ -17,6 +17,7 @@ import {
useApi,
} from '../../../../../public/lists_plugin_deps';
import { getExceptionListSchemaMock } from '../../../../../../lists/common/schemas/response/exception_list_schema.mock';
+import { getFoundExceptionListItemSchemaMock } from '../../../../../../lists/common/schemas/response/found_exception_list_item_schema.mock';
jest.mock('../../../../common/lib/kibana');
jest.mock('../../../../../public/lists_plugin_deps');
@@ -36,6 +37,7 @@ describe('ExceptionsViewer', () => {
(useApi as jest.Mock).mockReturnValue({
deleteExceptionItem: jest.fn().mockResolvedValue(true),
+ getExceptionListsItems: jest.fn().mockResolvedValue(getFoundExceptionListItemSchemaMock()),
});
(useExceptionList as jest.Mock).mockReturnValue([
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 4a9ad94d8f36d..2f7aa1b14cfda 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
@@ -311,9 +311,11 @@ const ReputationLinkComponent: React.FC<{
ipReputationLinksSetting
?.slice(0, allItemsLimit)
.filter(
+ // eslint-disable-next-line @typescript-eslint/naming-convention
({ url_template, name }) =>
!isNil(url_template) && !isNil(name) && !isUrlInvalid(url_template)
)
+ // eslint-disable-next-line @typescript-eslint/naming-convention
.map(({ name, url_template }: { name: string; url_template: string }) => ({
name: isDefaultReputationLink(name) ? defaultNameMapping[name] : name,
url_template: url_template.replace(`{{ip}}`, encodeURIComponent(domain)),
diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts
index 845ef580ddbe2..a10e4cf568dd1 100644
--- a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts
+++ b/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts
@@ -6,7 +6,6 @@
import { getOr, omit } from 'lodash/fp';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ChromeBreadcrumb } from '../../../../../../../../src/core/public';
import { APP_NAME } from '../../../../../common/constants';
import { StartServices } from '../../../../types';
diff --git a/x-pack/plugins/security_solution/public/common/hooks/types.ts b/x-pack/plugins/security_solution/public/common/hooks/types.ts
index 36b626b0ba9f1..301b8bd655333 100644
--- a/x-pack/plugins/security_solution/public/common/hooks/types.ts
+++ b/x-pack/plugins/security_solution/public/common/hooks/types.ts
@@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { SimpleSavedObject } from '../../../../../../src/core/public';
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
diff --git a/x-pack/plugins/security_solution/public/common/lib/compose/kibana_compose.tsx b/x-pack/plugins/security_solution/public/common/lib/compose/kibana_compose.tsx
index 342db7f43943d..30d3311a40b61 100644
--- a/x-pack/plugins/security_solution/public/common/lib/compose/kibana_compose.tsx
+++ b/x-pack/plugins/security_solution/public/common/lib/compose/kibana_compose.tsx
@@ -8,7 +8,6 @@ import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemo
import ApolloClient from 'apollo-client';
import { ApolloLink } from 'apollo-link';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import introspectionQueryResultData from '../../../graphql/introspection.json';
import { AppFrontendLibs } from '../lib';
import { getLinks } from './helpers';
diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/services.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/services.ts
index 8a8138691ba17..00f53ae273b4b 100644
--- a/x-pack/plugins/security_solution/public/common/lib/kibana/services.ts
+++ b/x-pack/plugins/security_solution/public/common/lib/kibana/services.ts
@@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { CoreStart } from '../../../../../../../src/core/public';
type GlobalServices = Pick;
diff --git a/x-pack/plugins/security_solution/public/common/mock/kibana_core.ts b/x-pack/plugins/security_solution/public/common/mock/kibana_core.ts
index e82c37e3a5b66..13b3c4b249bfe 100644
--- a/x-pack/plugins/security_solution/public/common/mock/kibana_core.ts
+++ b/x-pack/plugins/security_solution/public/common/mock/kibana_core.ts
@@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { coreMock } from '../../../../../../src/core/public/mocks';
import { dataPluginMock } from '../../../../../../src/plugins/data/public/mocks';
diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/helpers.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/helpers.tsx
index 0cbed86f18768..bb8cc2267249f 100644
--- a/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/helpers.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/helpers.tsx
@@ -18,6 +18,7 @@ export const formatAlertsData = (alertsData: AlertSearchResponse<{}, AlertsAggre
return [
...acc,
+ // eslint-disable-next-line @typescript-eslint/naming-convention
...alertsBucket.map(({ key, doc_count }: AlertsBucket) => ({
x: key,
y: doc_count,
diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx
index be9725dac5ff3..5bab2e3c78970 100644
--- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable react/display-name */
-
import React from 'react';
import ApolloClient from 'apollo-client';
import { Dispatch } from 'redux';
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.test.tsx
index 4a2d17ec126fb..8b3d05ce5a574 100644
--- a/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.test.tsx
@@ -23,7 +23,6 @@ import {
mockAboutStepRule,
mockDefineStepRule,
} from '../../../pages/detection_engine/rules/all/__mocks__/mock';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { coreMock } from '../../../../../../../../src/core/public/mocks';
import { DEFAULT_TIMELINE_TITLE } from '../../../../timelines/components/timeline/translations';
import * as i18n from './translations';
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/index.tsx
index 0f16cb99862a5..a0384ef52a841 100644
--- a/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/index.tsx
@@ -179,7 +179,7 @@ export const RiskScoreField = ({
error={'errorMessage'}
isInvalid={false}
fullWidth
- data-test-subj={dataTestSubj}
+ data-test-subj={`${dataTestSubj}-riskOverride`}
describedByIds={idAria ? [idAria] : undefined}
>
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx
index 54d505a4d867f..733e701cff204 100644
--- a/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx
@@ -220,7 +220,7 @@ export const SeverityField = ({
error={'errorMessage'}
isInvalid={false}
fullWidth
- data-test-subj={dataTestSubj}
+ data-test-subj={`${dataTestSubj}-severityOverride`}
describedByIds={idAria ? [idAria] : undefined}
>
@@ -245,7 +245,11 @@ export const SeverityField = ({
{(field.value as AboutStepSeverity).mapping.map(
(severityMappingItem: SeverityMappingItem, index) => (
-
+
= ({
path="severity"
component={SeverityField}
componentProps={{
- 'data-test-subj': 'detectionEngineStepAboutRuleSeverityField',
+ dataTestSubj: 'detectionEngineStepAboutRuleSeverityField',
idAria: 'detectionEngineStepAboutRuleSeverityField',
isDisabled: isLoading || indexPatternLoading,
options: severityOptions,
@@ -158,7 +158,7 @@ const StepAboutRuleComponent: FC = ({
path="riskScore"
component={RiskScoreField}
componentProps={{
- 'data-test-subj': 'detectionEngineStepAboutRuleRiskScore',
+ dataTestSubj: 'detectionEngineStepAboutRuleRiskScore',
idAria: 'detectionEngineStepAboutRuleRiskScore',
isDisabled: isLoading || indexPatternLoading,
indices: indexPatterns,
diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts
index 1f75ff0210bd5..78d2e2a5b0c2f 100644
--- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts
+++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts
@@ -7,7 +7,6 @@
import * as t from 'io-ts';
import { RuleTypeSchema } from '../../../../../common/detection_engine/types';
-/* eslint-disable @typescript-eslint/camelcase */
import {
author,
building_block_type,
@@ -18,7 +17,6 @@ import {
timestamp_override,
threshold,
} from '../../../../../common/detection_engine/schemas/common/schemas';
-/* eslint-enable @typescript-eslint/camelcase */
import {
listArray,
listArrayOrUndefined,
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/index.tsx
index 6ba65ceca8fe9..70f278197b005 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/index.tsx
@@ -234,7 +234,6 @@ const CreateRulePageComponent: React.FC = () => {
}
};
- // eslint-disable-next-line react-hooks/rules-of-hooks
const manageAccordions = useCallback(
(id: RuleStep, isOpen: boolean) => {
const activeRuleIdx = stepsRuleOrder.findIndex((step) => step === openAccordionId);
@@ -256,7 +255,6 @@ const CreateRulePageComponent: React.FC = () => {
[isStepRuleInReadOnlyView, openAccordionId, stepsData]
);
- // eslint-disable-next-line react-hooks/rules-of-hooks
const manageIsEditable = useCallback(
async (id: RuleStep) => {
const activeForm = await stepsForm.current[openAccordionId]?.submit();
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx
index 4327ef96c93a7..016d0c7c67a9e 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable react-hooks/rules-of-hooks, complexity */
+/* eslint-disable complexity */
// TODO: Disabling complexity is temporary till this component is refactored as part of lists UI integration
import {
@@ -247,7 +247,6 @@ export const RuleDetailsPageComponent: FC = ({
))}
),
- // eslint-disable-next-line react-hooks/exhaustive-deps
[ruleDetailTabs, ruleDetailTab, setRuleDetailTab]
);
const ruleError = useMemo(
@@ -318,13 +317,13 @@ export const RuleDetailsPageComponent: FC = ({
lists: ExceptionIdentifiers[];
allowedExceptionListTypes: ExceptionListTypeEnum[];
}>(
- (acc, { id, list_id, namespace_type, type }) => {
+ (acc, { id, list_id: listId, namespace_type: namespaceType, type }) => {
const { allowedExceptionListTypes, lists } = acc;
const shouldAddEndpoint =
type === ExceptionListTypeEnum.ENDPOINT &&
!allowedExceptionListTypes.includes(ExceptionListTypeEnum.ENDPOINT);
return {
- lists: [...lists, { id, listId: list_id, namespaceType: namespace_type, type }],
+ lists: [...lists, { id, listId, namespaceType, type }],
allowedExceptionListTypes: shouldAddEndpoint
? [...allowedExceptionListTypes, ExceptionListTypeEnum.ENDPOINT]
: allowedExceptionListTypes,
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx
index 3cc874b85ecf3..13855a4b81494 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable react-hooks/rules-of-hooks */
-
import {
EuiButton,
EuiCallOut,
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/utils.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/utils.ts
index c1b4fa3e2b7d9..f862a06807e6f 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/utils.ts
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/utils.ts
@@ -6,7 +6,6 @@
import { isEmpty } from 'lodash/fp';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ChromeBreadcrumb } from '../../../../../../../../src/core/public';
import {
getDetectionEngineTabUrl,
diff --git a/x-pack/plugins/security_solution/public/hosts/pages/details/utils.ts b/x-pack/plugins/security_solution/public/hosts/pages/details/utils.ts
index 5c5c7283eee47..9a24c61ae103d 100644
--- a/x-pack/plugins/security_solution/public/hosts/pages/details/utils.ts
+++ b/x-pack/plugins/security_solution/public/hosts/pages/details/utils.ts
@@ -6,7 +6,6 @@
import { get, isEmpty } from 'lodash/fp';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ChromeBreadcrumb } from '../../../../../../../src/core/public';
import { hostsModel } from '../../store';
import { HostsTableType } from '../../store/model';
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 109392cb7a929..6a0a0cbb1014e 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
@@ -82,6 +82,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => {
}, [details]);
const [policyResponseUri, policyResponseRoutePath] = useMemo(() => {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { selected_host, show, ...currentUrlParams } = queryParams;
return [
formatUrl(
@@ -189,7 +190,6 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => {
description: details.agent.version,
},
];
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [details.agent.version, details.host.hostname, details.host.ip]);
return (
diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/index.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/index.tsx
index b22ff406a1605..69dabeeb616a0 100644
--- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/index.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/index.tsx
@@ -70,7 +70,12 @@ export const HostDetailsFlyout = memo(() => {
}, [error, toasts]);
return (
-
+
diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx
index 3e00a5cc33db1..bb6003f73714d 100644
--- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx
@@ -313,6 +313,7 @@ describe('when on the hosts page', () => {
beforeEach(async () => {
const {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
host_status,
metadata: { host, ...details },
} = mockHostDetailsApiResult();
diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx
index f91bba3e3125a..cdea4bfcf9f86 100644
--- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx
+++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx
@@ -259,7 +259,6 @@ export const HostList = () => {
name: i18n.translate('xpack.securitySolution.endpointList.policyStatus', {
defaultMessage: 'Configuration Status',
}),
- // eslint-disable-next-line react/display-name
render: (policy: HostInfo['metadata']['Endpoint']['policy']['applied'], item: HostInfo) => {
const toRoutePath = getHostDetailsPath({
name: 'hostPolicyResponse',
diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/models/policy_details_config.ts b/x-pack/plugins/security_solution/public/management/pages/policy/models/policy_details_config.ts
index 7c67dffb8a663..4d32a9fbec694 100644
--- a/x-pack/plugins/security_solution/public/management/pages/policy/models/policy_details_config.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/policy/models/policy_details_config.ts
@@ -48,12 +48,12 @@ export function clone(policyDetailsConfig: UIPolicyConfig): UIPolicyConfig {
* Returns value from `configuration`
*/
export const getIn = (a: UIPolicyConfig) => (key: Key) => <
- subKey extends keyof UIPolicyConfig[Key]
+ SubKey extends keyof UIPolicyConfig[Key]
>(
- subKey: subKey
-) => (
+ subKey: SubKey
+) => (
leafKey: LeafKey
-): UIPolicyConfig[Key][subKey][LeafKey] => {
+): UIPolicyConfig[Key][SubKey][LeafKey] => {
return a[key][subKey][leafKey];
};
@@ -61,11 +61,11 @@ export const getIn = (a: UIPolicyConfig) => (k
* Returns cloned `configuration` with `value` set by the `keyPath`.
*/
export const setIn = (a: UIPolicyConfig) => (key: Key) => <
- subKey extends keyof UIPolicyConfig[Key]
+ SubKey extends keyof UIPolicyConfig[Key]
>(
- subKey: subKey
-) => (leafKey: LeafKey) => <
- V extends UIPolicyConfig[Key][subKey][LeafKey]
+ subKey: SubKey
+) => (leafKey: LeafKey) => <
+ V extends UIPolicyConfig[Key][SubKey][LeafKey]
>(
v: V
): UIPolicyConfig => {
diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors.ts b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors.ts
index cce0adf36bcce..d780828fc8833 100644
--- a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors.ts
+++ b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors.ts
@@ -29,6 +29,7 @@ export const policyDetails = (state: Immutable) => state.pol
export const getPolicyDataForUpdate = (
policy: PolicyData | Immutable
): NewPolicyData | Immutable => {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { id, revision, created_by, created_at, updated_by, updated_at, ...newPolicy } = policy;
return newPolicy;
};
diff --git a/x-pack/plugins/security_solution/public/network/pages/ip_details/utils.ts b/x-pack/plugins/security_solution/public/network/pages/ip_details/utils.ts
index 640b9d9818cdd..9284a808625a5 100644
--- a/x-pack/plugins/security_solution/public/network/pages/ip_details/utils.ts
+++ b/x-pack/plugins/security_solution/public/network/pages/ip_details/utils.ts
@@ -6,7 +6,6 @@
import { get, isEmpty } from 'lodash/fp';
-// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ChromeBreadcrumb } from '../../../../../../../src/core/public';
import { decodeIpv6 } from '../../../common/lib/helpers';
import { getIPDetailsUrl } from '../../../common/components/link_to/redirect_to_network';
diff --git a/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.test.tsx b/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.test.tsx
index f7f1fbc30aeb7..a35d85d1321f5 100644
--- a/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.test.tsx
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable react/display-name */
-
import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json';
import { mount, ReactWrapper } from 'enzyme';
import React from 'react';
diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/one_ancestor_two_children.ts b/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/one_ancestor_two_children.ts
index be0bc1b812a0b..94c176d343d17 100644
--- a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/one_ancestor_two_children.ts
+++ b/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/one_ancestor_two_children.ts
@@ -10,7 +10,10 @@ import {
ResolverEntityIndex,
} from '../../../../common/endpoint/types';
import { mockEndpointEvent } from '../../store/mocks/endpoint_event';
-import { mockTreeWithNoAncestorsAnd2Children } from '../../store/mocks/resolver_tree';
+import {
+ mockTreeWithNoAncestorsAnd2Children,
+ withRelatedEventsOnOrigin,
+} from '../../store/mocks/resolver_tree';
import { DataAccessLayer } from '../../types';
interface Metadata {
@@ -40,11 +43,24 @@ interface Metadata {
/**
* A simple mock dataAccessLayer possible that returns a tree with 0 ancestors and 2 direct children. 1 related event is returned. The parameter to `entities` is ignored.
*/
-export function oneAncestorTwoChildren(): { dataAccessLayer: DataAccessLayer; metadata: Metadata } {
+export function oneAncestorTwoChildren(
+ { withRelatedEvents }: { withRelatedEvents: Iterable<[string, string]> | null } = {
+ withRelatedEvents: null,
+ }
+): { dataAccessLayer: DataAccessLayer; metadata: Metadata } {
const metadata: Metadata = {
databaseDocumentID: '_id',
entityIDs: { origin: 'origin', firstChild: 'firstChild', secondChild: 'secondChild' },
};
+ const baseTree = mockTreeWithNoAncestorsAnd2Children({
+ originID: metadata.entityIDs.origin,
+ firstChildID: metadata.entityIDs.firstChild,
+ secondChildID: metadata.entityIDs.secondChild,
+ });
+ const composedTree = withRelatedEvents
+ ? withRelatedEventsOnOrigin(baseTree, withRelatedEvents)
+ : baseTree;
+
return {
metadata,
dataAccessLayer: {
@@ -54,13 +70,17 @@ export function oneAncestorTwoChildren(): { dataAccessLayer: DataAccessLayer; me
relatedEvents(entityID: string): Promise {
return Promise.resolve({
entityID,
- events: [
- mockEndpointEvent({
- entityID,
- name: 'event',
- timestamp: 0,
- }),
- ],
+ events:
+ /* Respond with the mocked related events when the origin's related events are fetched*/ withRelatedEvents &&
+ entityID === metadata.entityIDs.origin
+ ? composedTree.relatedEvents.events
+ : [
+ mockEndpointEvent({
+ entityID,
+ name: 'event',
+ timestamp: 0,
+ }),
+ ],
nextEvent: null,
});
},
@@ -69,13 +89,7 @@ export function oneAncestorTwoChildren(): { dataAccessLayer: DataAccessLayer; me
* Fetch a ResolverTree for a entityID
*/
resolverTree(): Promise {
- return Promise.resolve(
- mockTreeWithNoAncestorsAnd2Children({
- originID: metadata.entityIDs.origin,
- firstChildID: metadata.entityIDs.firstChild,
- secondChildID: metadata.entityIDs.secondChild,
- })
- );
+ return Promise.resolve(composedTree);
},
/**
diff --git a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts b/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts
index 628d0267754f2..060a014b8730f 100644
--- a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts
+++ b/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable no-shadow */
-
import { uniquePidForProcess, uniqueParentPidForProcess, orderByTime } from '../process_event';
import { IndexedProcessTree } from '../../types';
import { ResolverEvent } from '../../../../common/endpoint/types';
diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts b/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts
index 10ace895b3267..272d0aae7eef4 100644
--- a/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts
+++ b/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts
@@ -486,12 +486,7 @@ export const ariaFlowtoCandidate: (
const spatiallyIndexedLayout: (state: DataState) => rbush = createSelector(
layout,
- function ({
- /* eslint-disable no-shadow */
- processNodePositions,
- edgeLineSegments,
- /* eslint-enable no-shadow */
- }) {
+ function ({ processNodePositions, edgeLineSegments }) {
const spatialIndex: rbush = new rbush();
const processesToIndex: IndexedProcessNode[] = [];
const edgeLineSegmentsToIndex: IndexedEdgeLineSegment[] = [];
diff --git a/x-pack/plugins/security_solution/public/resolver/store/middleware/resolver_tree_fetcher.ts b/x-pack/plugins/security_solution/public/resolver/store/middleware/resolver_tree_fetcher.ts
index 2c98059d420e8..0ec340efbdac9 100644
--- a/x-pack/plugins/security_solution/public/resolver/store/middleware/resolver_tree_fetcher.ts
+++ b/x-pack/plugins/security_solution/public/resolver/store/middleware/resolver_tree_fetcher.ts
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable no-duplicate-imports */
-
import { Dispatch, MiddlewareAPI } from 'redux';
import { ResolverTree, ResolverEntityIndex } from '../../../../common/endpoint/types';
diff --git a/x-pack/plugins/security_solution/public/resolver/store/mocks/related_event.ts b/x-pack/plugins/security_solution/public/resolver/store/mocks/related_event.ts
new file mode 100644
index 0000000000000..1e0c460a3a711
--- /dev/null
+++ b/x-pack/plugins/security_solution/public/resolver/store/mocks/related_event.ts
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+import { EndpointEvent } from '../../../../common/endpoint/types';
+
+/**
+ * Simple mock related event.
+ */
+export function mockRelatedEvent({
+ entityID,
+ timestamp,
+ category,
+ type,
+ id,
+}: {
+ entityID: string;
+ timestamp: number;
+ category: string;
+ type: string;
+ id?: string;
+}): EndpointEvent {
+ return {
+ '@timestamp': timestamp,
+ event: {
+ kind: 'event',
+ type,
+ category,
+ id: id ?? 'xyz',
+ },
+ process: {
+ entity_id: entityID,
+ },
+ } as EndpointEvent;
+}
diff --git a/x-pack/plugins/security_solution/public/resolver/store/mocks/resolver_tree.ts b/x-pack/plugins/security_solution/public/resolver/store/mocks/resolver_tree.ts
index 6a8ab61ccf9b6..21d0309501aa8 100644
--- a/x-pack/plugins/security_solution/public/resolver/store/mocks/resolver_tree.ts
+++ b/x-pack/plugins/security_solution/public/resolver/store/mocks/resolver_tree.ts
@@ -5,6 +5,7 @@
*/
import { mockEndpointEvent } from './endpoint_event';
+import { mockRelatedEvent } from './related_event';
import { ResolverTree, ResolverEvent } from '../../../../common/endpoint/types';
export function mockTreeWith2AncestorsAndNoChildren({
@@ -109,6 +110,58 @@ export function mockTreeWithAllProcessesTerminated({
} as unknown) as ResolverTree;
}
+/**
+ * A valid category for a related event. E.g. "registry", "network", "file"
+ */
+type RelatedEventCategory = string;
+/**
+ * A valid type for a related event. E.g. "start", "end", "access"
+ */
+type RelatedEventType = string;
+
+/**
+ * Add/replace related event info (on origin node) for any mock ResolverTree
+ *
+ * @param treeToAddRelatedEventsTo the ResolverTree to modify
+ * @param relatedEventsToAddByCategoryAndType Iterable of `[category, type]` pairs describing related events. e.g. [['dns','info'],['registry','access']]
+ */
+export function withRelatedEventsOnOrigin(
+ treeToAddRelatedEventsTo: ResolverTree,
+ relatedEventsToAddByCategoryAndType: Iterable<[RelatedEventCategory, RelatedEventType]>
+): ResolverTree {
+ const events = [];
+ const byCategory: Record = {};
+ const stats = {
+ totalAlerts: 0,
+ events: {
+ total: 0,
+ byCategory,
+ },
+ };
+ for (const [category, type] of relatedEventsToAddByCategoryAndType) {
+ events.push(
+ mockRelatedEvent({
+ entityID: treeToAddRelatedEventsTo.entityID,
+ timestamp: 1,
+ category,
+ type,
+ })
+ );
+ stats.events.total++;
+ stats.events.byCategory[category] = stats.events.byCategory[category]
+ ? stats.events.byCategory[category] + 1
+ : 1;
+ }
+ return {
+ ...treeToAddRelatedEventsTo,
+ stats,
+ relatedEvents: {
+ events,
+ nextEvent: null,
+ },
+ };
+}
+
export function mockTreeWithNoAncestorsAnd2Children({
originID,
firstChildID,
diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx
index 2a2354921a3d4..ed30643ed871e 100644
--- a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx
+++ b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx
@@ -220,6 +220,28 @@ export class Simulator {
);
}
+ /**
+ * Dump all contents of the outer ReactWrapper (to be `console.log`ged as appropriate)
+ * This will include both DOM (div, span, etc.) and React/JSX (MyComponent, MyGrid, etc.)
+ */
+ public debugWrapper() {
+ return this.wrapper.debug();
+ }
+
+ /**
+ * Return an Enzyme ReactWrapper that includes the Related Events host button for a given process node
+ *
+ * @param entityID The entity ID of the proocess node to select in
+ */
+ public processNodeRelatedEventButton(entityID: string): ReactWrapper {
+ return this.processNodeElements({ entityID }).findWhere(
+ (wrapper) =>
+ // Filter out React components
+ typeof wrapper.type() === 'string' &&
+ wrapper.prop('data-test-subj') === 'resolver:submenu:button'
+ );
+ }
+
/**
* Return the selected node query string values.
*/
diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx
index 36bb2a5ffc9fe..7de7cf48e6039 100644
--- a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx
+++ b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx
@@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable no-duplicate-imports */
/* eslint-disable react/display-name */
import React, { useMemo, useEffect, useState, useCallback } from 'react';
diff --git a/x-pack/plugins/security_solution/public/resolver/types.ts b/x-pack/plugins/security_solution/public/resolver/types.ts
index 38e0cd0483559..c2871fdceb20a 100644
--- a/x-pack/plugins/security_solution/public/resolver/types.ts
+++ b/x-pack/plugins/security_solution/public/resolver/types.ts
@@ -245,14 +245,14 @@ export type Matrix3 = readonly [
number
];
-type eventSubtypeFull =
+type EventSubtypeFull =
| 'creation_event'
| 'fork_event'
| 'exec_event'
| 'already_running'
| 'termination_event';
-type eventTypeFull = 'process_event';
+type EventTypeFull = 'process_event';
/**
* The 'events' which contain process data and are used to model Resolver.
@@ -263,8 +263,8 @@ export interface ProcessEvent {
readonly machine_id: string;
readonly data_buffer: {
timestamp_utc: string;
- event_subtype_full: eventSubtypeFull;
- event_type_full: eventTypeFull;
+ event_subtype_full: EventSubtypeFull;
+ event_type_full: EventTypeFull;
node_id: number;
source_id?: number;
process_name: string;
diff --git a/x-pack/plugins/security_solution/public/resolver/view/clickthrough.test.tsx b/x-pack/plugins/security_solution/public/resolver/view/clickthrough.test.tsx
index f339d128944cc..c819491dd28f0 100644
--- a/x-pack/plugins/security_solution/public/resolver/view/clickthrough.test.tsx
+++ b/x-pack/plugins/security_solution/public/resolver/view/clickthrough.test.tsx
@@ -9,14 +9,14 @@ import { Simulator } from '../test_utilities/simulator';
// Extend jest with a custom matcher
import '../test_utilities/extend_jest';
-describe('Resolver, when analyzing a tree that has 1 ancestor and 2 children', () => {
- let simulator: Simulator;
- let databaseDocumentID: string;
- let entityIDs: { origin: string; firstChild: string; secondChild: string };
+let simulator: Simulator;
+let databaseDocumentID: string;
+let entityIDs: { origin: string; firstChild: string; secondChild: string };
- // the resolver component instance ID, used by the react code to distinguish piece of global state from those used by other resolver instances
- const resolverComponentInstanceID = 'resolverComponentInstanceID';
+// the resolver component instance ID, used by the react code to distinguish piece of global state from those used by other resolver instances
+const resolverComponentInstanceID = 'resolverComponentInstanceID';
+describe('Resolver, when analyzing a tree that has 1 ancestor and 2 children', () => {
beforeEach(async () => {
// create a mock data access layer
const { metadata: dataAccessLayerMetadata, dataAccessLayer } = oneAncestorTwoChildren();
@@ -79,6 +79,7 @@ describe('Resolver, when analyzing a tree that has 1 ancestor and 2 children', (
simulator
.processNodeElements({ entityID: entityIDs.secondChild })
.find('button')
+ .first()
.simulate('click');
});
it('should render the second child node as selected, and the first child not as not selected, and the query string should indicate that the second child is selected', async () => {
@@ -107,3 +108,52 @@ describe('Resolver, when analyzing a tree that has 1 ancestor and 2 children', (
});
});
});
+
+describe('Resolver, when analyzing a tree that has some related events', () => {
+ beforeEach(async () => {
+ // create a mock data access layer with related events
+ const { metadata: dataAccessLayerMetadata, dataAccessLayer } = oneAncestorTwoChildren({
+ withRelatedEvents: [
+ ['registry', 'access'],
+ ['registry', 'access'],
+ ],
+ });
+
+ // save a reference to the entity IDs exposed by the mock data layer
+ entityIDs = dataAccessLayerMetadata.entityIDs;
+
+ // save a reference to the `_id` supported by the mock data layer
+ databaseDocumentID = dataAccessLayerMetadata.databaseDocumentID;
+
+ // create a resolver simulator, using the data access layer and an arbitrary component instance ID
+ simulator = new Simulator({ databaseDocumentID, dataAccessLayer, resolverComponentInstanceID });
+ });
+
+ describe('when it has loaded', () => {
+ beforeEach(async () => {
+ await expect(
+ simulator.mapStateTransitions(() => ({
+ graphElements: simulator.graphElement().length,
+ graphLoadingElements: simulator.graphLoadingElement().length,
+ graphErrorElements: simulator.graphErrorElement().length,
+ originNode: simulator.processNodeElements({ entityID: entityIDs.origin }).length,
+ }))
+ ).toYieldEqualTo({
+ graphElements: 1,
+ graphLoadingElements: 0,
+ graphErrorElements: 0,
+ originNode: 1,
+ });
+ });
+
+ it('should render a related events button', async () => {
+ await expect(
+ simulator.mapStateTransitions(() => ({
+ relatedEventButtons: simulator.processNodeRelatedEventButton(entityIDs.origin).length,
+ }))
+ ).toYieldEqualTo({
+ relatedEventButtons: 1,
+ });
+ });
+ });
+});
diff --git a/x-pack/plugins/security_solution/public/resolver/view/map.tsx b/x-pack/plugins/security_solution/public/resolver/view/map.tsx
index 0ca71c5bf60ce..a965f06c04926 100644
--- a/x-pack/plugins/security_solution/public/resolver/view/map.tsx
+++ b/x-pack/plugins/security_solution/public/resolver/view/map.tsx
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable no-duplicate-imports */
-
/* eslint-disable react/display-name */
import React, { useContext } from 'react';
diff --git a/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx b/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx
index f444d5a25e1ef..e74502243ffc8 100644
--- a/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx
+++ b/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable no-duplicate-imports */
-
/* eslint-disable react/display-name */
import React, { useContext, useCallback } from 'react';
diff --git a/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx b/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx
index 6a9ab184e9bab..7f0ba244146fd 100644
--- a/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx
+++ b/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx
@@ -233,6 +233,7 @@ const NodeSubMenuComponents = React.memo(
iconType={menuIsOpen ? 'arrowUp' : 'arrowDown'}
iconSide="right"
tabIndex={-1}
+ data-test-subj="resolver:submenu:button"
>
{count ? : ''} {menuTitle}
diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx
index 3384165392dc8..a0678fb4a437a 100644
--- a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx
+++ b/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx
@@ -114,7 +114,7 @@ const AddressLinksComponent: React.FC<{
fieldName,
address,
})}`}
- render={(_, __, snapshot) =>
+ render={(_props, _provided, snapshot) =>
snapshot.isDragging ? (
({
fetchPolicy: 'no-cache',
variables: { id: timelineId },
})
- // eslint-disable-next-line
.then((result) => {
const timelineToOpen: TimelineResult = omitTypenameInTimeline(
getOr({}, 'data.getOneTimeline', result)
diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.tsx
index aa4bb3f1e0467..b0e1eab25e7c7 100644
--- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.tsx
+++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.tsx
@@ -4,8 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable react/display-name */
-
import {
ActionTimelineToShow,
DeleteTimelines,
diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity.ts b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity.ts
index c79bcda71de9b..bcac559d61f79 100644
--- a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity.ts
+++ b/x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity.ts
@@ -87,6 +87,7 @@ export function handleEntities(): RequestHandler 0 && newPackageConfig.inputs[0].config !== undefined) {
const oldManifest = newPackageConfig.inputs[0].config.artifact_manifest ?? {
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts
index 5f62ff426ecd0..3ab4775f890ac 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts
@@ -28,13 +28,13 @@ export const querySignalsRoute = (router: IRouter) => {
},
},
async (context, request, response) => {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { query, aggs, _source, track_total_hits, size } = request.body;
const siemResponse = buildSiemResponse(response);
if (
query == null &&
aggs == null &&
_source == null &&
- // eslint-disable-next-line @typescript-eslint/camelcase
track_total_hits == null &&
size == null
) {
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts
index c36f6ca831c57..f469aa8634c5a 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts
@@ -26,6 +26,7 @@ export const getRuleActionsSavedObject = async ({
ruleAlertId,
savedObjectsClient,
}: GetRuleActionsSavedObject): Promise => {
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { saved_objects } = await savedObjectsClient.find<
IRuleActionsAttributesSavedObjectAttributes
>({
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/bulk_create_threshold_signals.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/bulk_create_threshold_signals.ts
index e2f3d16bd6d03..bdcddbf2ed21b 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/bulk_create_threshold_signals.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/bulk_create_threshold_signals.ts
@@ -134,6 +134,7 @@ const getTransformedHits = (
}
return results.aggregations.threshold.buckets.map(
+ // eslint-disable-next-line @typescript-eslint/naming-convention
({ key, doc_count }: { key: string; doc_count: number }) => {
const source = {
'@timestamp': new Date().toISOString(),
diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts
index bfc72a169566e..dd0698b8d1124 100644
--- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts
+++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts
@@ -12,6 +12,7 @@ import { RuleTypeParams } from '../types';
import { SearchResponse } from '../../types';
// used for gap detection code
+// eslint-disable-next-line @typescript-eslint/naming-convention
export type unitType = 's' | 'm' | 'h';
export const isValidUnit = (unitParam: string): unitParam is unitType =>
['s', 'm', 'h'].includes(unitParam);
diff --git a/x-pack/plugins/security_solution/server/lib/framework/types.ts b/x-pack/plugins/security_solution/server/lib/framework/types.ts
index 03c82ceb02e68..68b40b72866b1 100644
--- a/x-pack/plugins/security_solution/server/lib/framework/types.ts
+++ b/x-pack/plugins/security_solution/server/lib/framework/types.ts
@@ -40,7 +40,7 @@ export interface FrameworkAdapter {
callWithRequest(
req: FrameworkRequest,
method: 'indices.getMapping',
- options?: IndicesGetMappingParams // eslint-disable-line
+ options?: IndicesGetMappingParams
): Promise;
getIndexPatternsService(req: FrameworkRequest): FrameworkIndexPatternsService;
}
diff --git a/x-pack/plugins/security_solution/server/lib/matrix_histogram/utils.ts b/x-pack/plugins/security_solution/server/lib/matrix_histogram/utils.ts
index 67568b96fee90..4a6a38421f42a 100644
--- a/x-pack/plugins/security_solution/server/lib/matrix_histogram/utils.ts
+++ b/x-pack/plugins/security_solution/server/lib/matrix_histogram/utils.ts
@@ -16,6 +16,7 @@ export const getDnsParsedData = (
data.forEach((bucketData: unknown) => {
const time = get('key', bucketData);
const histData = getOr([], keyBucket, bucketData).map(
+ // eslint-disable-next-line @typescript-eslint/naming-convention
({ key, doc_count }: DnsHistogramSubBucket) => ({
x: time,
y: doc_count,
@@ -35,6 +36,7 @@ export const getGenericData = (
data.forEach((bucketData: unknown) => {
const group = get('key', bucketData);
const histData = getOr([], keyBucket, bucketData).map(
+ // eslint-disable-next-line @typescript-eslint/naming-convention
({ key, doc_count }: HistogramBucket) => ({
x: key,
y: doc_count,
diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/utils/create_timelines.ts b/x-pack/plugins/security_solution/server/lib/timeline/routes/utils/create_timelines.ts
index 6bdecb5d80ecc..dc0caaf67d738 100644
--- a/x-pack/plugins/security_solution/server/lib/timeline/routes/utils/create_timelines.ts
+++ b/x-pack/plugins/security_solution/server/lib/timeline/routes/utils/create_timelines.ts
@@ -191,7 +191,6 @@ export const getTemplateTimeline = async (
frameworkRequest,
templateTimelineId
);
- // eslint-disable-next-line no-empty
} catch (e) {
return null;
}
diff --git a/x-pack/plugins/security_solution/server/lib/tls/elasticsearch_adapter.ts b/x-pack/plugins/security_solution/server/lib/tls/elasticsearch_adapter.ts
index 10929c3d03641..ab9175951a8f5 100644
--- a/x-pack/plugins/security_solution/server/lib/tls/elasticsearch_adapter.ts
+++ b/x-pack/plugins/security_solution/server/lib/tls/elasticsearch_adapter.ts
@@ -69,7 +69,7 @@ export const formatTlsEdges = (buckets: TlsBuckets[]): TlsEdges[] => {
subjects: bucket.subjects.buckets.map(({ key }) => key),
ja3: bucket.ja3.buckets.map(({ key }) => key),
issuers: bucket.issuers.buckets.map(({ key }) => key),
- // eslint-disable-next-line @typescript-eslint/camelcase
+ // eslint-disable-next-line @typescript-eslint/naming-convention
notAfter: bucket.not_after.buckets.map(({ key_as_string }) => key_as_string),
},
cursor: {
diff --git a/x-pack/plugins/security_solution/server/usage/detections/detections.mocks.ts b/x-pack/plugins/security_solution/server/usage/detections/detections.mocks.ts
index e59b1092978da..7afc185ae07fd 100644
--- a/x-pack/plugins/security_solution/server/usage/detections/detections.mocks.ts
+++ b/x-pack/plugins/security_solution/server/usage/detections/detections.mocks.ts
@@ -41,7 +41,7 @@ export const getMockJobSummaryResponse = () => [
{
id: 'other_job',
description: 'a job that is custom',
- groups: ['auditbeat', 'process'],
+ groups: ['auditbeat', 'process', 'security'],
processed_record_count: 0,
memory_status: 'ok',
jobState: 'closed',
@@ -54,6 +54,19 @@ export const getMockJobSummaryResponse = () => [
{
id: 'another_job',
description: 'another job that is custom',
+ groups: ['auditbeat', 'process', 'security'],
+ processed_record_count: 0,
+ memory_status: 'ok',
+ jobState: 'opened',
+ hasDatafeed: true,
+ datafeedId: 'datafeed-another',
+ datafeedIndices: ['auditbeat-*'],
+ datafeedState: 'started',
+ isSingleMetricViewerJob: true,
+ },
+ {
+ id: 'irrelevant_job',
+ description: 'a non-security job',
groups: ['auditbeat', 'process'],
processed_record_count: 0,
memory_status: 'ok',
diff --git a/x-pack/plugins/security_solution/server/usage/detections/detections_helpers.ts b/x-pack/plugins/security_solution/server/usage/detections/detections_helpers.ts
index 80a9dba26df8e..a6d4dc7a38e14 100644
--- a/x-pack/plugins/security_solution/server/usage/detections/detections_helpers.ts
+++ b/x-pack/plugins/security_solution/server/usage/detections/detections_helpers.ts
@@ -15,6 +15,7 @@ import { MlPluginSetup } from '../../../../ml/server';
import { SIGNALS_ID, INTERNAL_IMMUTABLE_KEY } from '../../../common/constants';
import { DetectionRulesUsage, MlJobsUsage } from './index';
import { isJobStarted } from '../../../common/machine_learning/helpers';
+import { isSecurityJob } from '../../../common/machine_learning/is_security_job';
interface DetectionsMetric {
isElastic: boolean;
@@ -182,11 +183,9 @@ export const getMlJobsUsage = async (ml: MlPluginSetup | undefined): Promise module.jobs);
- const jobs = await ml
- .jobServiceProvider(internalMlClient, fakeRequest)
- .jobsSummary(['siem', 'security']);
+ const jobs = await ml.jobServiceProvider(internalMlClient, fakeRequest).jobsSummary();
- jobsUsage = jobs.reduce((usage, job) => {
+ jobsUsage = jobs.filter(isSecurityJob).reduce((usage, job) => {
const isElastic = moduleJobs.some((moduleJob) => moduleJob.id === job.id);
const isEnabled = isJobStarted(job.jobState, job.datafeedState);
diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts
index bff66b7068145..917c41b998dec 100644
--- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts
+++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts
@@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable @kbn/eslint/no-restricted-paths */
import { act } from 'react-dom/test-utils';
import {
diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts
index bdc2f76224361..e8528889eb231 100644
--- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts
+++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts
@@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable @kbn/eslint/no-restricted-paths */
import { registerTestBed, TestBedConfig } from '../../../../../test_utils';
import { PolicyAdd } from '../../../public/application/sections/policy_add';
diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts
index ca53f9306445e..f009afbb2eacc 100644
--- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts
+++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts
@@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable @kbn/eslint/no-restricted-paths */
import { registerTestBed, TestBedConfig } from '../../../../../test_utils';
import { PolicyEdit } from '../../../public/application/sections/policy_edit';
diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts
index 2f7c47dbf544c..fa4421988740b 100644
--- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts
+++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts
@@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable @kbn/eslint/no-restricted-paths */
import { registerTestBed, TestBed } from '../../../../../test_utils';
import { RepositoryType } from '../../../common/types';
diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts
index 4127fd0546580..043b21270cc8d 100644
--- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts
+++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts
@@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable @kbn/eslint/no-restricted-paths */
import { registerTestBed, TestBedConfig } from '../../../../../test_utils';
import { RepositoryEdit } from '../../../public/application/sections/repository_edit';
diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts
index 0cfb6fbc97975..cfe3027b6d43f 100644
--- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts
+++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts
@@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable @kbn/eslint/no-restricted-paths */
import { registerTestBed, TestBed, TestBedConfig } from '../../../../../test_utils';
import { RestoreSnapshot } from '../../../public/application/sections/restore_snapshot';
import { WithAppDependencies } from './setup_environment';
diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/setup_environment.tsx
index 2cfffb3572dde..c7ee0648b5c3b 100644
--- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/setup_environment.tsx
+++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/setup_environment.tsx
@@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable @kbn/eslint/no-restricted-paths */
import React from 'react';
import axios from 'axios';
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_table/policy_table.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_table/policy_table.tsx
index 5f0a208348785..d55bbf0b324cf 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_table/policy_table.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_table/policy_table.tsx
@@ -64,7 +64,6 @@ export const PolicyTable: React.FunctionComponent = ({
return (
- {/* eslint-disable-next-line @elastic/eui/href-or-on-click */}
uiMetricService.trackUiMetric(UIM_POLICY_SHOW_DETAILS_CLICK)
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_table/repository_table.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_table/repository_table.tsx
index 70d83846cd74e..d435ff4524ea2 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_table/repository_table.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_table/repository_table.tsx
@@ -55,7 +55,6 @@ export const RepositoryTable: React.FunctionComponent = ({
render: (name: Repository['name']) => {
return (
- {/* eslint-disable-next-line @elastic/eui/href-or-on-click */}
uiMetricService.trackUiMetric(UIM_REPOSITORY_SHOW_DETAILS_CLICK)
diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_table/snapshot_table.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_table/snapshot_table.tsx
index 4910bf909ce3a..46bd5bab53d2b 100644
--- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_table/snapshot_table.tsx
+++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_table/snapshot_table.tsx
@@ -74,7 +74,6 @@ export const SnapshotTable: React.FunctionComponent = ({
truncateText: true,
sortable: true,
render: (snapshotId: string, snapshot: SnapshotDetails) => (
- /* eslint-disable-next-line @elastic/eui/href-or-on-click */
{
- const { reason, caused_by } = causedBy; // eslint-disable-line @typescript-eslint/camelcase
+ const { reason, caused_by } = causedBy; // eslint-disable-line @typescript-eslint/naming-convention
if (reason) {
accumulator.push(reason);
}
- // eslint-disable-next-line @typescript-eslint/camelcase
if (caused_by) {
return extractCausedByChain(caused_by, accumulator);
}
@@ -31,8 +30,8 @@ export const wrapEsError = (err: any, statusCodeToMessageMap: any = {}) => {
const {
error: {
- root_cause = [], // eslint-disable-line @typescript-eslint/camelcase
- caused_by = {}, // eslint-disable-line @typescript-eslint/camelcase
+ root_cause = [], // eslint-disable-line @typescript-eslint/naming-convention
+ caused_by = {}, // eslint-disable-line @typescript-eslint/naming-convention
} = {},
} = JSON.parse(response);
diff --git a/x-pack/plugins/snapshot_restore/test/fixtures/policy.ts b/x-pack/plugins/snapshot_restore/test/fixtures/policy.ts
index 435ae27e8dd46..a293f505147e4 100644
--- a/x-pack/plugins/snapshot_restore/test/fixtures/policy.ts
+++ b/x-pack/plugins/snapshot_restore/test/fixtures/policy.ts
@@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-/* eslint-disable @kbn/eslint/no-restricted-paths */
import { getRandomString, getRandomNumber } from '../../../../test_utils';
import { SlmPolicy } from '../../common/types';
diff --git a/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts b/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts
index b4b0057a2f5a5..dd2e0d40f31ed 100644
--- a/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts
+++ b/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts
@@ -66,6 +66,7 @@ export class SpacesClient {
if (this.useRbac()) {
const privilegeFactory = PURPOSE_PRIVILEGE_MAP[purpose];
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { saved_objects } = await this.internalSavedObjectRepository.find({
type: 'space',
page: 1,
@@ -111,6 +112,7 @@ export class SpacesClient {
} else {
this.debugLogger(`SpacesClient.getAll(), NOT USING RBAC. querying all spaces`);
+ // eslint-disable-next-line @typescript-eslint/naming-convention
const { saved_objects } = await this.callWithRequestSavedObjectRepository.find({
type: 'space',
page: 1,
diff --git a/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts b/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts
index 4ab309cc6015c..3ea4693d9e9d7 100644
--- a/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts
+++ b/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts
@@ -92,6 +92,7 @@ async function getSpacesUsage(
);
const disabledFeatures: Record = disabledFeatureBuckets.reduce(
+ // eslint-disable-next-line @typescript-eslint/naming-convention
(acc, { key, doc_count }) => {
return {
...acc,
diff --git a/x-pack/plugins/task_manager/server/task_events.ts b/x-pack/plugins/task_manager/server/task_events.ts
index b17a3636c1730..e1dd85f868cdd 100644
--- a/x-pack/plugins/task_manager/server/task_events.ts
+++ b/x-pack/plugins/task_manager/server/task_events.ts
@@ -4,6 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/
+import { Option } from 'fp-ts/lib/Option';
+
import { ConcreteTaskInstance } from './task';
import { Result, Err } from './lib/result_type';
@@ -22,7 +24,7 @@ export interface TaskEvent {
}
export type TaskMarkRunning = TaskEvent;
export type TaskRun = TaskEvent;
-export type TaskClaim = TaskEvent;
+export type TaskClaim = TaskEvent>;
export type TaskRunRequest = TaskEvent;
export function asTaskMarkRunningEvent(
@@ -46,7 +48,7 @@ export function asTaskRunEvent(id: string, event: Result
+ event: Result>
): TaskClaim {
return {
id,
diff --git a/x-pack/plugins/task_manager/server/task_manager.test.ts b/x-pack/plugins/task_manager/server/task_manager.test.ts
index 80215ffa7abba..7035971ad6061 100644
--- a/x-pack/plugins/task_manager/server/task_manager.test.ts
+++ b/x-pack/plugins/task_manager/server/task_manager.test.ts
@@ -7,6 +7,7 @@
import _ from 'lodash';
import sinon from 'sinon';
import { Subject } from 'rxjs';
+import { none } from 'fp-ts/lib/Option';
import {
asTaskMarkRunningEvent,
@@ -297,7 +298,9 @@ describe('TaskManager', () => {
events$.next(asTaskMarkRunningEvent(id, asOk(task)));
events$.next(asTaskRunEvent(id, asErr(new Error('some thing gone wrong'))));
- return expect(result).rejects.toEqual(new Error('some thing gone wrong'));
+ return expect(result).rejects.toMatchInlineSnapshot(
+ `[Error: Failed to run task "01ddff11-e88a-4d13-bc4e-256164e755e2": Error: some thing gone wrong]`
+ );
});
test('rejects when the task mark as running fails', () => {
@@ -311,7 +314,9 @@ describe('TaskManager', () => {
events$.next(asTaskClaimEvent(id, asOk(task)));
events$.next(asTaskMarkRunningEvent(id, asErr(new Error('some thing gone wrong'))));
- return expect(result).rejects.toEqual(new Error('some thing gone wrong'));
+ return expect(result).rejects.toMatchInlineSnapshot(
+ `[Error: Failed to run task "01ddff11-e88a-4d13-bc4e-256164e755e2": Error: some thing gone wrong]`
+ );
});
test('when a task claim fails we ensure the task exists', async () => {
@@ -321,7 +326,7 @@ describe('TaskManager', () => {
const result = awaitTaskRunResult(id, events$, getLifecycle);
- events$.next(asTaskClaimEvent(id, asErr(new Error('failed to claim'))));
+ events$.next(asTaskClaimEvent(id, asErr(none)));
await expect(result).rejects.toEqual(
new Error(`Failed to run task "${id}" as it does not exist`)
@@ -337,7 +342,7 @@ describe('TaskManager', () => {
const result = awaitTaskRunResult(id, events$, getLifecycle);
- events$.next(asTaskClaimEvent(id, asErr(new Error('failed to claim'))));
+ events$.next(asTaskClaimEvent(id, asErr(none)));
await expect(result).rejects.toEqual(
new Error(`Failed to run task "${id}" as it is currently running`)
@@ -353,7 +358,7 @@ describe('TaskManager', () => {
const result = awaitTaskRunResult(id, events$, getLifecycle);
- events$.next(asTaskClaimEvent(id, asErr(new Error('failed to claim'))));
+ events$.next(asTaskClaimEvent(id, asErr(none)));
await expect(result).rejects.toEqual(
new Error(`Failed to run task "${id}" as it is currently running`)
@@ -386,9 +391,11 @@ describe('TaskManager', () => {
const result = awaitTaskRunResult(id, events$, getLifecycle);
- events$.next(asTaskClaimEvent(id, asErr(new Error('failed to claim'))));
+ events$.next(asTaskClaimEvent(id, asErr(none)));
- await expect(result).rejects.toEqual(new Error('failed to claim'));
+ await expect(result).rejects.toMatchInlineSnapshot(
+ `[Error: Failed to run task "01ddff11-e88a-4d13-bc4e-256164e755e2" for unknown reason (Current Task Lifecycle is "idle")]`
+ );
expect(getLifecycle).toHaveBeenCalledWith(id);
});
@@ -400,9 +407,11 @@ describe('TaskManager', () => {
const result = awaitTaskRunResult(id, events$, getLifecycle);
- events$.next(asTaskClaimEvent(id, asErr(new Error('failed to claim'))));
+ events$.next(asTaskClaimEvent(id, asErr(none)));
- await expect(result).rejects.toEqual(new Error('failed to claim'));
+ await expect(result).rejects.toMatchInlineSnapshot(
+ `[Error: Failed to run task "01ddff11-e88a-4d13-bc4e-256164e755e2" for unknown reason (Current Task Lifecycle is "failed")]`
+ );
expect(getLifecycle).toHaveBeenCalledWith(id);
});
@@ -424,7 +433,9 @@ describe('TaskManager', () => {
events$.next(asTaskRunEvent(id, asErr(new Error('some thing gone wrong'))));
- return expect(result).rejects.toEqual(new Error('some thing gone wrong'));
+ return expect(result).rejects.toMatchInlineSnapshot(
+ `[Error: Failed to run task "01ddff11-e88a-4d13-bc4e-256164e755e2": Error: some thing gone wrong]`
+ );
});
});
});
diff --git a/x-pack/plugins/task_manager/server/task_manager.ts b/x-pack/plugins/task_manager/server/task_manager.ts
index 35ca439bb9130..7165fd28678c1 100644
--- a/x-pack/plugins/task_manager/server/task_manager.ts
+++ b/x-pack/plugins/task_manager/server/task_manager.ts
@@ -9,13 +9,14 @@ import { filter } from 'rxjs/operators';
import { performance } from 'perf_hooks';
import { pipe } from 'fp-ts/lib/pipeable';
-import { Option, some, map as mapOptional } from 'fp-ts/lib/Option';
+import { Option, some, map as mapOptional, getOrElse } from 'fp-ts/lib/Option';
+
import {
SavedObjectsSerializer,
ILegacyScopedClusterClient,
ISavedObjectsRepository,
} from '../../../../src/core/server';
-import { Result, asErr, either, map, mapErr, promiseResult } from './lib/result_type';
+import { Result, asOk, asErr, either, map, mapErr, promiseResult } from './lib/result_type';
import { TaskManagerConfig } from './config';
import { Logger } from './types';
@@ -405,7 +406,9 @@ export async function claimAvailableTasks(
if (docs.length !== claimedTasks) {
logger.warn(
- `[Task Ownership error]: (${claimedTasks}) tasks were claimed by Kibana, but (${docs.length}) tasks were fetched`
+ `[Task Ownership error]: ${claimedTasks} tasks were claimed by Kibana, but ${
+ docs.length
+ } task(s) were fetched (${docs.map((doc) => doc.id).join(', ')})`
);
}
return docs;
@@ -437,48 +440,65 @@ export async function awaitTaskRunResult(
// listen for all events related to the current task
.pipe(filter(({ id }: TaskLifecycleEvent) => id === taskId))
.subscribe((taskEvent: TaskLifecycleEvent) => {
- either(
- taskEvent.event,
- (taskInstance: ConcreteTaskInstance) => {
- // resolve if the task has run sucessfully
- if (isTaskRunEvent(taskEvent)) {
- subscription.unsubscribe();
- resolve({ id: taskInstance.id });
- }
- },
- async (error: Error) => {
+ if (isTaskClaimEvent(taskEvent)) {
+ mapErr(async (error: Option) => {
// reject if any error event takes place for the requested task
subscription.unsubscribe();
- if (isTaskRunRequestEvent(taskEvent)) {
- return reject(
- new Error(
- `Failed to run task "${taskId}" as Task Manager is at capacity, please try again later`
- )
- );
- } else if (isTaskClaimEvent(taskEvent)) {
- reject(
- map(
- // if the error happened in the Claim phase - we try to provide better insight
- // into why we failed to claim by getting the task's current lifecycle status
- await promiseResult(getLifecycle(taskId)),
- (taskLifecycleStatus: TaskLifecycle) => {
- if (taskLifecycleStatus === TaskLifecycleResult.NotFound) {
- return new Error(`Failed to run task "${taskId}" as it does not exist`);
- } else if (
- taskLifecycleStatus === TaskStatus.Running ||
- taskLifecycleStatus === TaskStatus.Claiming
- ) {
- return new Error(`Failed to run task "${taskId}" as it is currently running`);
- }
- return error;
- },
- () => error
- )
- );
+ return reject(
+ map(
+ await pipe(
+ error,
+ mapOptional(async (taskReturnedBySweep) => asOk(taskReturnedBySweep.status)),
+ getOrElse(() =>
+ // if the error happened in the Claim phase - we try to provide better insight
+ // into why we failed to claim by getting the task's current lifecycle status
+ promiseResult(getLifecycle(taskId))
+ )
+ ),
+ (taskLifecycleStatus: TaskLifecycle) => {
+ if (taskLifecycleStatus === TaskLifecycleResult.NotFound) {
+ return new Error(`Failed to run task "${taskId}" as it does not exist`);
+ } else if (
+ taskLifecycleStatus === TaskStatus.Running ||
+ taskLifecycleStatus === TaskStatus.Claiming
+ ) {
+ return new Error(`Failed to run task "${taskId}" as it is currently running`);
+ }
+ return new Error(
+ `Failed to run task "${taskId}" for unknown reason (Current Task Lifecycle is "${taskLifecycleStatus}")`
+ );
+ },
+ (getLifecycleError: Error) =>
+ new Error(
+ `Failed to run task "${taskId}" and failed to get current Status:${getLifecycleError}`
+ )
+ )
+ );
+ }, taskEvent.event);
+ } else {
+ either>(
+ taskEvent.event,
+ (taskInstance: ConcreteTaskInstance) => {
+ // resolve if the task has run sucessfully
+ if (isTaskRunEvent(taskEvent)) {
+ subscription.unsubscribe();
+ resolve({ id: taskInstance.id });
+ }
+ },
+ async (error: Error | Option) => {
+ // reject if any error event takes place for the requested task
+ subscription.unsubscribe();
+ if (isTaskRunRequestEvent(taskEvent)) {
+ return reject(
+ new Error(
+ `Failed to run task "${taskId}" as Task Manager is at capacity, please try again later`
+ )
+ );
+ }
+ return reject(new Error(`Failed to run task "${taskId}": ${error}`));
}
- return reject(error);
- }
- );
+ );
+ }
});
});
}
diff --git a/x-pack/plugins/task_manager/server/task_store.test.ts b/x-pack/plugins/task_manager/server/task_store.test.ts
index 771b4e2d7d9cb..d65c39f4f454d 100644
--- a/x-pack/plugins/task_manager/server/task_store.test.ts
+++ b/x-pack/plugins/task_manager/server/task_store.test.ts
@@ -8,6 +8,7 @@ import _ from 'lodash';
import sinon from 'sinon';
import uuid from 'uuid';
import { filter } from 'rxjs/operators';
+import { Option, some, none } from 'fp-ts/lib/Option';
import {
TaskDictionary,
@@ -972,7 +973,7 @@ if (doc['task.runAt'].size()!=0) {
const runAt = new Date();
const tasks = [
{
- _id: 'aaa',
+ _id: 'claimed-by-id',
_source: {
type: 'task',
task: {
@@ -980,7 +981,7 @@ if (doc['task.runAt'].size()!=0) {
taskType: 'foo',
schedule: undefined,
attempts: 0,
- status: 'idle',
+ status: 'claiming',
params: '{ "hello": "world" }',
state: '{ "baby": "Henhen" }',
user: 'jimbo',
@@ -996,7 +997,31 @@ if (doc['task.runAt'].size()!=0) {
sort: ['a', 1],
},
{
- _id: 'bbb',
+ _id: 'claimed-by-schedule',
+ _source: {
+ type: 'task',
+ task: {
+ runAt,
+ taskType: 'bar',
+ schedule: { interval: '5m' },
+ attempts: 2,
+ status: 'claiming',
+ params: '{ "shazm": 1 }',
+ state: '{ "henry": "The 8th" }',
+ user: 'dabo',
+ scope: ['reporting', 'ceo'],
+ ownerId: taskManagerId,
+ startedAt: null,
+ retryAt: null,
+ scheduledAt: new Date(),
+ },
+ },
+ _seq_no: 3,
+ _primary_term: 4,
+ sort: ['b', 2],
+ },
+ {
+ _id: 'already-running',
_source: {
type: 'task',
task: {
@@ -1045,19 +1070,24 @@ if (doc['task.runAt'].size()!=0) {
});
const sub = store.events
- .pipe(filter((event: TaskEvent) => event.id === 'aaa'))
+ .pipe(
+ filter(
+ (event: TaskEvent>) =>
+ event.id === 'claimed-by-id'
+ )
+ )
.subscribe({
- next: (event: TaskEvent) => {
+ next: (event: TaskEvent>) => {
expect(event).toMatchObject(
asTaskClaimEvent(
- 'aaa',
+ 'claimed-by-id',
asOk({
- id: 'aaa',
+ id: 'claimed-by-id',
runAt,
taskType: 'foo',
schedule: undefined,
attempts: 0,
- status: 'idle' as TaskStatus,
+ status: 'claiming' as TaskStatus,
params: { hello: 'world' },
state: { baby: 'Henhen' },
user: 'jimbo',
@@ -1075,7 +1105,7 @@ if (doc['task.runAt'].size()!=0) {
});
await store.claimAvailableTasks({
- claimTasksById: ['aaa'],
+ claimTasksById: ['claimed-by-id'],
claimOwnershipUntil: new Date(),
size: 10,
});
@@ -1102,19 +1132,24 @@ if (doc['task.runAt'].size()!=0) {
});
const sub = store.events
- .pipe(filter((event: TaskEvent) => event.id === 'bbb'))
+ .pipe(
+ filter(
+ (event: TaskEvent>) =>
+ event.id === 'claimed-by-schedule'
+ )
+ )
.subscribe({
- next: (event: TaskEvent) => {
+ next: (event: TaskEvent