-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
* [ML] wip recognize job * [ML] error handling * [ML] layout enhancements * [ML] errors handling * [ML] fix badges alignment and error message * [ML] components split * [ML] load module from the component, reset support * [ML] validators * [ML] check view route and resolver * [ML] validation * [ML] remove angular code * [ML] change layout, fix patterns * [ML] job response fix * [ML] directive test * [ML] directive test * [ML] remove lookbehind regexp * [ML] fix IE11 layout issues * [ML] remove form tag, refactor to formState * [ML] aria labels, remove unused i18n * [ML] align kibana objects and reset button * [ML] column layout for jobs response * [ML] align icons and buttons * [ML] check existing kibana objects * [ML] don't display kibana objects panel if empty * [ML] result and reset button order * [ML] add EuiHorizontalRule * [ML] use time range and full index dat * [ML] no check icon for existing objects * [ML] toast for exception during a jobs setup * [ML] disable panels growth, advanced settings with described form * [ML] fix timeRange for results url * [ML] fix i18n * [ML] use EuiSwitch * [ML] PR remarks * [ML] job settings form component * [ML] i18n * [ML] onChange fix * [ML] custom hook for partial state update * [ML] jobGroups update * [ML] PR remarks * [ML] fix imports
- Loading branch information
Showing
35 changed files
with
1,513 additions
and
1,486 deletions.
There are no files selected for viewing
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,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 { Datafeed, Job } from '../../public/jobs/new_job_new/common/job_creator/configs'; | ||
import { SavedObjectAttributes } from '../../../../../../target/types/core/server'; | ||
|
||
export interface ModuleJob { | ||
id: string; | ||
config: Omit<Job, 'job_id'>; | ||
} | ||
|
||
export interface KibanaObjectConfig extends SavedObjectAttributes { | ||
description: string; | ||
title: string; | ||
version: number; | ||
} | ||
|
||
export interface KibanaObject { | ||
id: string; | ||
title: string; | ||
config: KibanaObjectConfig; | ||
} | ||
|
||
export interface KibanaObjects { | ||
[objectType: string]: KibanaObject[] | undefined; | ||
} | ||
|
||
/** | ||
* Interface for get_module endpoint response. | ||
*/ | ||
export interface Module { | ||
id: string; | ||
title: string; | ||
description: string; | ||
type: string; | ||
logoFile: string; | ||
defaultIndexPattern: string; | ||
query: any; | ||
jobs: ModuleJob[]; | ||
datafeeds: Datafeed[]; | ||
kibana: KibanaObjects; | ||
} | ||
|
||
export interface KibanaObjectResponse { | ||
exists?: boolean; | ||
success?: boolean; | ||
id: string; | ||
} | ||
|
||
export interface SetupError { | ||
body: string; | ||
msg: string; | ||
path: string; | ||
query: {}; | ||
response: string; | ||
statusCode: number; | ||
} | ||
|
||
export interface DatafeedResponse { | ||
id: string; | ||
success: boolean; | ||
started: boolean; | ||
error?: SetupError; | ||
} | ||
|
||
export interface JobResponse { | ||
id: string; | ||
success: boolean; | ||
error?: SetupError; | ||
} | ||
|
||
export interface DataRecognizerConfigResponse { | ||
datafeeds: DatafeedResponse[]; | ||
jobs: JobResponse[]; | ||
kibana: { | ||
search: KibanaObjectResponse; | ||
visualization: KibanaObjectResponse; | ||
dashboard: KibanaObjectResponse; | ||
}; | ||
} |
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
21 changes: 21 additions & 0 deletions
21
x-pack/legacy/plugins/ml/public/components/custom_hooks/use_partial_state.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,21 @@ | ||
/* | ||
* 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 { useState } from 'react'; | ||
|
||
/** | ||
* Custom hook for partial state update. | ||
*/ | ||
export function usePartialState<T>(initialValue: T): [T, (update: Partial<T>) => void] { | ||
const [state, setState] = useState<T>(initialValue); | ||
const setFormStateCallback = (update: Partial<T>) => { | ||
setState({ | ||
...state, | ||
...update, | ||
}); | ||
}; | ||
return [state, setFormStateCallback]; | ||
} |
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
1 change: 0 additions & 1 deletion
1
x-pack/legacy/plugins/ml/public/jobs/new_job/simple/recognize/_index.scss
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
x-pack/legacy/plugins/ml/public/jobs/new_job/simple/recognize/check_module.js
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
...ins/ml/public/jobs/new_job/simple/recognize/create_job/__tests__/create_job_controller.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.