forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lens][Event annotations] Move logic into packages (elastic#161500)
- Loading branch information
1 parent
d0aa8aa
commit a6fdda7
Showing
198 changed files
with
840 additions
and
628 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @kbn/event-annotation-common | ||
|
||
A few core annotation-related types and utilities that are available in both server and browser contexts. |
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,52 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const AvailableAnnotationIcons = { | ||
ASTERISK: 'asterisk', | ||
ALERT: 'alert', | ||
BELL: 'bell', | ||
BOLT: 'bolt', | ||
BUG: 'bug', | ||
CIRCLE: 'circle', | ||
EDITOR_COMMENT: 'editorComment', | ||
FLAG: 'flag', | ||
HEART: 'heart', | ||
MAP_MARKER: 'mapMarker', | ||
PIN_FILLED: 'pinFilled', | ||
STAR_EMPTY: 'starEmpty', | ||
STAR_FILLED: 'starFilled', | ||
TAG: 'tag', | ||
TRIANGLE: 'triangle', | ||
} as const; | ||
|
||
export const EVENT_ANNOTATION_GROUP_TYPE = 'event-annotation-group'; | ||
|
||
export { | ||
defaultAnnotationColor, | ||
defaultAnnotationRangeColor, | ||
defaultAnnotationLabel, | ||
getDefaultManualAnnotation, | ||
getDefaultQueryAnnotation, | ||
createCopiedAnnotation, | ||
isRangeAnnotationConfig, | ||
isManualPointAnnotationConfig, | ||
isQueryAnnotationConfig, | ||
} from './util'; | ||
|
||
export type { | ||
EventAnnotationGroupContent, | ||
AvailableAnnotationIcon, | ||
PointStyleProps, | ||
EventAnnotationConfig, | ||
EventAnnotationGroupConfig, | ||
RangeStyleProps, | ||
ManualAnnotationType, | ||
PointInTimeEventAnnotationConfig, | ||
RangeEventAnnotationConfig, | ||
QueryPointEventAnnotationConfig, | ||
} from './types'; |
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,13 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
module.exports = { | ||
preset: '@kbn/test/jest_node', | ||
rootDir: '../..', | ||
roots: ['<rootDir>/packages/kbn-event-annotation-common'], | ||
}; |
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,5 @@ | ||
{ | ||
"type": "shared-common", | ||
"id": "@kbn/event-annotation-common", | ||
"owner": "@elastic/kibana-visualizations" | ||
} |
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,7 @@ | ||
{ | ||
"name": "@kbn/event-annotation-common", | ||
"private": true, | ||
"version": "1.0.0", | ||
"license": "SSPL-1.0 OR Elastic License 2.0", | ||
"sideEffects": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "target/types", | ||
"types": [ | ||
"jest", | ||
"node" | ||
] | ||
}, | ||
"include": [ | ||
"**/*.ts", | ||
], | ||
"exclude": [ | ||
"target/**/*" | ||
], | ||
"kbn_references": [ | ||
"@kbn/data-plugin", | ||
"@kbn/content-management-table-list-view-table", | ||
"@kbn/visualization-ui-components", | ||
"@kbn/ui-theme", | ||
"@kbn/i18n", | ||
] | ||
} |
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,89 @@ | ||
/* | ||
* 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 { $Values } from 'utility-types'; | ||
import { DataViewSpec, KibanaQueryOutput } from '@kbn/data-plugin/common'; | ||
import { UserContentCommonSchema } from '@kbn/content-management-table-list-view-table'; | ||
import type { LineStyle } from '@kbn/visualization-ui-components'; | ||
import { AvailableAnnotationIcons } from '.'; | ||
|
||
export type AvailableAnnotationIcon = $Values<typeof AvailableAnnotationIcons>; | ||
|
||
export type PointStyleProps = StyleSharedProps & { | ||
icon?: AvailableAnnotationIcon; | ||
lineWidth?: number; | ||
lineStyle?: LineStyle; | ||
textVisibility?: boolean; | ||
}; | ||
|
||
export type PointInTimeEventAnnotationConfig = { | ||
id: string; | ||
type: ManualAnnotationType; | ||
key: { | ||
type: 'point_in_time'; | ||
timestamp: string; | ||
}; | ||
} & PointStyleProps; | ||
|
||
export type Fill = 'inside' | 'outside' | 'none'; | ||
export type ManualAnnotationType = 'manual'; | ||
export type QueryAnnotationType = 'query'; | ||
export type KeyType = 'point_in_time' | 'range'; | ||
|
||
interface StyleSharedProps { | ||
label: string; | ||
color?: string; | ||
isHidden?: boolean; | ||
} | ||
|
||
export type RangeStyleProps = StyleSharedProps & { | ||
outside?: boolean; | ||
}; | ||
|
||
export type RangeEventAnnotationConfig = { | ||
type: ManualAnnotationType; | ||
id: string; | ||
key: { | ||
type: 'range'; | ||
timestamp: string; | ||
endTimestamp: string; | ||
}; | ||
} & RangeStyleProps; | ||
|
||
export type StyleProps = PointStyleProps & RangeStyleProps; | ||
|
||
export type QueryPointEventAnnotationConfig = { | ||
id: string; | ||
type: QueryAnnotationType; | ||
filter: KibanaQueryOutput; | ||
timeField?: string; | ||
textField?: string; | ||
extraFields?: string[]; | ||
key: { | ||
type: 'point_in_time'; | ||
}; | ||
} & PointStyleProps; | ||
|
||
export type EventAnnotationConfig = | ||
| PointInTimeEventAnnotationConfig | ||
| RangeEventAnnotationConfig | ||
| QueryPointEventAnnotationConfig; | ||
|
||
export interface EventAnnotationGroupConfig { | ||
annotations: EventAnnotationConfig[]; | ||
indexPatternId: string; | ||
ignoreGlobalFilters: boolean; | ||
title: string; | ||
description: string; | ||
tags: string[]; | ||
dataViewSpec?: DataViewSpec; | ||
} | ||
|
||
export type EventAnnotationGroupContent = UserContentCommonSchema & { | ||
attributes: { indexPatternId: string; dataViewSpec?: DataViewSpec }; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @kbn/event-annotation-components | ||
|
||
A collection of static components used for interacting with event annotations. |
File renamed without changes.
Oops, something went wrong.