-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixes support for different types of analysis in the data frame analytics jobs list. - A new column Type lists the analysis type. - Adds a check to enable the View action only for outlier_detection jobs. - Fixing missing translations for the View button.
- Loading branch information
Showing
11 changed files
with
117 additions
and
34 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* 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 { getAnalysisType, isOutlierAnalysis } from './analytics'; | ||
|
||
describe('Data Frame Analytics: Analytics utils', () => { | ||
test('getAnalysisType()', () => { | ||
const outlierAnalysis = { outlier_detection: {} }; | ||
expect(getAnalysisType(outlierAnalysis)).toBe('outlier_detection'); | ||
|
||
const regressionAnalysis = { regression: {} }; | ||
expect(getAnalysisType(regressionAnalysis)).toBe('regression'); | ||
|
||
// test against a job type that does not exist yet. | ||
const otherAnalysis = { other: {} }; | ||
expect(getAnalysisType(otherAnalysis)).toBe('other'); | ||
|
||
// if the analysis object has a shape that is not just a single property, | ||
// the job type will be returned as 'unknown'. | ||
const unknownAnalysis = { outlier_detection: {}, regression: {} }; | ||
expect(getAnalysisType(unknownAnalysis)).toBe('unknown'); | ||
}); | ||
|
||
test('isOutlierAnalysis()', () => { | ||
const outlierAnalysis = { outlier_detection: {} }; | ||
expect(isOutlierAnalysis(outlierAnalysis)).toBe(true); | ||
|
||
const regressionAnalysis = { regression: {} }; | ||
expect(isOutlierAnalysis(regressionAnalysis)).toBe(false); | ||
|
||
const unknownAnalysis = { outlier_detection: {}, regression: {} }; | ||
expect(isOutlierAnalysis(unknownAnalysis)).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters