-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] Decouple edit-anomaly-swimlane UI action #179073
Merged
darnautov
merged 9 commits into
elastic:main
from
darnautov:ml-decouple-edit-swim-lane-action
Mar 22, 2024
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5e292f5
update edit swim lane action
darnautov ac4b184
fix register action
darnautov 77896c0
update apply-time-range-selection action, refactor
darnautov 9be954f
fix jobIds input
darnautov f5b5414
edit panel title
darnautov 9ea9402
set title on init
darnautov 8309256
adjust apply_influencer_filters_action, refactor
darnautov 517e8a8
replace embeddable api types with interfaces
darnautov 89cc3dc
fix types, refactor type guards
darnautov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
21 changes: 21 additions & 0 deletions
21
x-pack/plugins/ml/public/embeddables/anomaly_charts/types.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 | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { MlEntityField } from '@kbn/ml-anomaly-utils'; | ||
import type { HasType, PublishingSubject } from '@kbn/presentation-publishing'; | ||
import type { JobId } from '../../shared'; | ||
import type { AnomalyExplorerChartsEmbeddableType } from '../constants'; | ||
import type { MlEmbeddableBaseApi } from '../types'; | ||
|
||
export interface AnomalyChartsFieldSelectionApi { | ||
jobIds: PublishingSubject<JobId[]>; | ||
entityFields: PublishingSubject<MlEntityField[] | undefined>; | ||
} | ||
|
||
export type AnomalyChartsEmbeddableApi = HasType<AnomalyExplorerChartsEmbeddableType> & | ||
MlEmbeddableBaseApi & | ||
AnomalyChartsFieldSelectionApi; |
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
31 changes: 31 additions & 0 deletions
31
x-pack/plugins/ml/public/embeddables/anomaly_swimlane/types.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,31 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { | ||
HasType, | ||
PublishesWritablePanelTitle, | ||
PublishingSubject, | ||
} from '@kbn/presentation-publishing'; | ||
import type { SwimlaneType } from '../../application/explorer/explorer_constants'; | ||
import type { JobId } from '../../shared'; | ||
import type { AnomalySwimLaneEmbeddableType } from '../constants'; | ||
import type { AnomalySwimlaneEmbeddableUserInput, MlEmbeddableBaseApi } from '../types'; | ||
|
||
export interface AnomalySwimLaneComponentApi { | ||
jobIds: PublishingSubject<JobId[]>; | ||
swimlaneType: PublishingSubject<SwimlaneType>; | ||
viewBy: PublishingSubject<string>; | ||
perPage: PublishingSubject<number>; | ||
fromPage: PublishingSubject<number>; | ||
interval: PublishingSubject<number | undefined>; | ||
updateUserInput: (input: AnomalySwimlaneEmbeddableUserInput) => void; | ||
} | ||
|
||
export type AnomalySwimLaneEmbeddableApi = HasType<AnomalySwimLaneEmbeddableType> & | ||
PublishesWritablePanelTitle & | ||
MlEmbeddableBaseApi & | ||
AnomalySwimLaneComponentApi; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is really clean and straightforward. Nice work!
This is not necessary, but interfaces have slightly better editor time performance than types, so we're starting to recommend using the
interface
syntax whenever possible. This could be rewritten like:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 517e8a8