Skip to content

Commit 222df2a

Browse files
committed
Move ml link button to common components dir
1 parent 3344f32 commit 222df2a

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import React from 'react';
8-
import url from 'url';
97
import { EuiButton } from '@elastic/eui';
108
import { FormattedMessage } from '@kbn/i18n/react';
9+
import React from 'react';
10+
import { encode } from 'rison-node';
1111
import chrome from 'ui/chrome';
1212
import { QueryString } from 'ui/utils/query_string';
13-
import { encode } from 'rison-node';
14-
import { TimeRange } from '../../../../../common/http_api/shared/time_range';
13+
import url from 'url';
14+
15+
import { TimeRange } from '../../../../common/http_api/shared/time_range';
1516

1617
export const AnalyzeInMlButton: React.FunctionComponent<{
1718
jobId: string;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
export * from './analyze_in_ml_button';

x-pack/legacy/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/expanded_row.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import React, { useMemo } from 'react';
8-
import { i18n } from '@kbn/i18n';
7+
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiStat } from '@elastic/eui';
98
import numeral from '@elastic/numeral';
10-
import { EuiFlexGroup, EuiFlexItem, EuiStat, EuiSpacer } from '@elastic/eui';
11-
import { AnomaliesChart } from './chart';
12-
import { LogEntryRateResults } from '../../use_log_entry_rate_results';
9+
import { i18n } from '@kbn/i18n';
10+
import React, { useMemo } from 'react';
11+
1312
import { TimeRange } from '../../../../../../common/http_api/shared/time_range';
13+
import { AnalyzeInMlButton } from '../../../../../components/logging/log_analysis_results';
14+
import { LogEntryRateResults } from '../../use_log_entry_rate_results';
1415
import {
15-
getLogEntryRateSeriesForPartition,
1616
getAnnotationsForPartition,
17+
getLogEntryRateSeriesForPartition,
1718
getTotalNumberOfLogEntriesForPartition,
1819
} from '../helpers/data_formatters';
19-
import { AnalyzeInMlButton } from '../analyze_in_ml_button';
20+
import { AnomaliesChart } from './chart';
2021

2122
export const AnomaliesTableExpandedRow: React.FunctionComponent<{
2223
partitionId: string;
@@ -28,14 +29,12 @@ export const AnomaliesTableExpandedRow: React.FunctionComponent<{
2829
}> = ({ results, timeRange, setTimeRange, partitionId, jobId }) => {
2930
const logEntryRateSeries = useMemo(
3031
() =>
31-
results && results.histogramBuckets
32-
? getLogEntryRateSeriesForPartition(results, partitionId)
33-
: [],
32+
results?.histogramBuckets ? getLogEntryRateSeriesForPartition(results, partitionId) : [],
3433
[results, partitionId]
3534
);
3635
const anomalyAnnotations = useMemo(
3736
() =>
38-
results && results.histogramBuckets
37+
results?.histogramBuckets
3938
? getAnnotationsForPartition(results, partitionId)
4039
: {
4140
warning: [],
@@ -47,7 +46,7 @@ export const AnomaliesTableExpandedRow: React.FunctionComponent<{
4746
);
4847
const totalNumberOfLogEntries = useMemo(
4948
() =>
50-
results && results.histogramBuckets
49+
results?.histogramBuckets
5150
? getTotalNumberOfLogEntriesForPartition(results, partitionId)
5251
: undefined,
5352
[results, partitionId]

x-pack/legacy/plugins/infra/public/pages/logs/log_entry_rate/sections/anomalies/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
import { AnomaliesChart } from './chart';
3131
import { AnomaliesTable } from './table';
3232
import { LogAnalysisJobProblemIndicator } from '../../../../../components/logging/log_analysis_job_status';
33-
import { AnalyzeInMlButton } from '../analyze_in_ml_button';
33+
import { AnalyzeInMlButton } from '../../../../../components/logging/log_analysis_results';
3434
import { LoadingOverlayWrapper } from '../../../../../components/loading_overlay_wrapper';
3535

3636
export const AnomaliesResults: React.FunctionComponent<{

0 commit comments

Comments
 (0)