-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lens] Query based annotations (#138753)
* ⚗️ Initial code for query based annotations * 🐛 Solved more conflicts * ⚗️ More scaffolding layout * ⚗️ Initial indexpatetrn move into frame * ⚗️ Make field selection work * 🚧 Fixed almost all dataViews occurrencies, but changeIndexPattern * 🚧 More work on change index pattern * Move lens dataViews state into main state * 🔥 Remove some old cruft from the code * 🐛 Fix dataViews layer change * 🐛 Fix datasourceLayers refs * 🔥 Remove more old cruft * 🐛 Fix bug when loading SO * 🐛 Fix initial existence flag * 🏷️ Fix type issues * 🏷️ Fix types and tests * 🏷️ Fix types issues * ✅ Fix more tests * ✅ Fix with new dataViews structure * ✅ Fix more test mocks * ✅ More tests fixed * 🔥 Removed unused prop * ✅ Down to single broken test suite * 🏷️ Fix type issue * 👌 Integrate selector feedback * ✅ Fix remaining unit tests * 🏷️ fix type issues * 🐛 Fix bug when creating dataview in place * ✨ Update with latest dataview state + fix dataviews picker for annotations * 🐛 Fix edit + remove field flow * Update x-pack/plugins/lens/public/visualizations/xy/types.ts * 📸 Fix snapshot * 🐛 Fix the dataViews switch bug * 🔥 remove old cruft * ♻️ Revert removal from dataviews state branch * ♻️ Load all at once * 🔧 working on persistent state + fix new layer bug * 🔥 remove unused stuff * 🏷️ Fix some typings * 🔧 Fix expression issue * ✅ Add service unit tests * 👌 Integrated feedback * ✨ Add migration code for manual annotations * 🏷️ Fix type issue * ✅ Add some other unit test * 🏷️ Fix more type issues * 🐛 Fix importing issue * ♻️ Make range default color dependant on opint one * 🐛 Fix duplicate fields selection in tooltip section * ✅ Add more unit tests * ✅ Fix broken test * 🏷️ Mute ts error for now * ✅ Fix tests * 🔥 Reduce plugin weight * 🐛 prevent layout shift on panel open * 🐛 Fix extract + inject visualization references * 🏷️ fix type issues * ✨ Add dataview reference migration for annotations * 🔧 Add migration to embedadble * 🏷️ Fix type export * 🐛 Fix more conflicts with main * ✅ Fix tests * 🏷️ Make textField optional * ♻️ Refactor query input to be a shared component * 🐛 Fix missing import * 🐛 fix more import issues * 🔥 remove duplicate code * 🐛 Fix dataView switch bug * 🏷️ Fix type issue * annotations with fetching_event_annotations * portal for kql input fix * timeField goes for default if not filled * limit changes * handle ad-hoc data view references correctly * fix types * adjust tests to datatable format (remove isHidden tests as it's filtered before) * small refactors * fix loading on dashboard * empty is invalid (?) tbd * new tooltip * emptyDatatable * ♻️ Flip field + query inputs * 🏷️ Fix type issue * ✨ Add field validation for text and tooltip fields * tooltip for single annotation * fix tests * fix for non--timefilter dataview * fix annotations test - the cause was that we now don't display label for aggregated annotations ever * use eui elements * newline problem solved * ✅ Add more error tests * 👌 Rename migration state version type * fix types for expression chart * 🐛 Fix i18n id * 🏷️ Fix type issue * fix hidden all annotations * ✅ Fix tests after ishidden removal * 🐛 Revert references migration to an in app solution Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Marta Bondyra <[email protected]> Co-authored-by: Marta Bondyra <[email protected]>
- Loading branch information
1 parent
e7a8c87
commit 1a1159b
Showing
118 changed files
with
3,357 additions
and
961 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
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
57 changes: 57 additions & 0 deletions
57
...s/chart_expressions/expression_xy/common/expression_functions/event_annotations_result.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,57 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; | ||
import { ExtendedAnnotationLayerConfigResult } from '../types'; | ||
import { strings } from '../i18n'; | ||
import { EXTENDED_ANNOTATION_LAYER } from '../constants'; | ||
|
||
export interface EventAnnotationResultArgs { | ||
layers?: ExtendedAnnotationLayerConfigResult[]; | ||
datatable: Datatable; | ||
} | ||
|
||
export interface EventAnnotationResultResult { | ||
type: 'event_annotations_result'; | ||
layers: ExtendedAnnotationLayerConfigResult[]; | ||
datatable: Datatable; | ||
} | ||
|
||
export function eventAnnotationsResult(): ExpressionFunctionDefinition< | ||
'event_annotations_result', | ||
null, | ||
EventAnnotationResultArgs, | ||
EventAnnotationResultResult | ||
> { | ||
return { | ||
name: 'event_annotations_result', | ||
aliases: [], | ||
type: 'event_annotations_result', | ||
inputTypes: ['null'], | ||
help: strings.getAnnotationLayerFnHelp(), | ||
args: { | ||
layers: { | ||
types: [EXTENDED_ANNOTATION_LAYER], | ||
multi: true, | ||
help: strings.getAnnotationLayerFnHelp(), | ||
}, | ||
datatable: { | ||
types: ['datatable'], | ||
help: strings.getAnnotationLayerFnHelp(), | ||
}, | ||
}, | ||
fn: (input, args) => { | ||
return { | ||
...args, | ||
type: 'event_annotations_result', | ||
layers: args.layers || [], | ||
datatable: args.datatable || {}, | ||
}; | ||
}, | ||
}; | ||
} |
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
Oops, something went wrong.