-
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
[TSVB][Lens] Navigate to Lens with your current configuration #114794
Merged
Merged
Changes from 136 commits
Commits
Show all changes
137 commits
Select commit
Hold shift + click to select a range
76628e0
[Lens][TSVB] Convert to Lens
stratoula 74f262a
Add logic for multiple series
stratoula 065a9b1
Basic formula
stratoula 6da7fac
Fix circular dependencies
stratoula b62ef23
Minor cleanup
stratoula 502036f
Fix types
stratoula f132aad
fix jest tests
stratoula 6e17315
Merge branch 'master' into convert-to-lens
kibanamachine 8dd3b87
Fix test
stratoula e70ab64
Change the schema, add more styling options, fix bugs
stratoula 089163d
Supports time shift and custom date interval
stratoula ff1cf81
Merge branch 'master' into convert-to-lens
kibanamachine 5976aee
Merge branch 'master' into convert-to-lens
kibanamachine 313871b
Merge branch 'master' into convert-to-lens
kibanamachine 1a0959d
Merge branch 'master' into convert-to-lens
kibanamachine 5ecaa0f
Merge with master and resolve conflicts
stratoula ea05e70
Fix types
stratoula 40b8b36
Merge branch 'master' into convert-to-lens
kibanamachine 99a4a70
Merge branch 'master' into convert-to-lens
kibanamachine 5d67077
Merge branch 'master' into convert-to-lens
kibanamachine 3e9b1c5
Merge branch 'main' into convert-to-lens
kibanamachine f7ca582
Merge branch 'main' into convert-to-lens
kibanamachine 580ec72
Merge with main and resolve conflicts
stratoula fd38926
Fix some types
stratoula c784cbe
Move edit in lens button to top nav menu
stratoula 5a0d721
Cleanup
stratoula b35a5b5
Further cleanup
stratoula 0ce5f89
Add try it badge in menu, controlled by localStorage
stratoula d44bbea
Merge branch 'main' into convert-to-lens
kibanamachine 0f1b990
Add go back to app button
stratoula ef6d4b5
Discard changes modal and go back to TSVB
stratoula da1e2c8
Update by value and by reference visualizations, delete existing by ref
stratoula 73fcb51
Fix bug
stratoula 528f05c
Apply some changes
stratoula 9d86330
Merge branch 'main' into convert-to-lens
kibanamachine 4272ef1
get title and description only if has context
stratoula 956d942
Merge branch 'main' into convert-to-lens
kibanamachine 31162dc
Pass originating app, title and description from the savedVis
stratoula a5e8a23
By ref TSVB to by ref Lens
stratoula 62ee1a0
Merge branch 'main' into convert-to-lens
kibanamachine 8794034
Match TSVB cardinality with Lens unique_count function
stratoula d4f7ccc
Support moving average
stratoula 2716076
Fix test
stratoula 9f6e116
Support derivative
stratoula 9b3da9c
Support cumulative_sum
stratoula 11932e5
Add overall functions
stratoula 79df1fc
Merge branch 'main' into convert-to-lens
kibanamachine 7ed8901
Support filter ratio
stratoula 84ece5f
Refactor code for easier testing
stratoula 0773170
Fix bug with auto interval
stratoula 60f50d7
Fetch types from visualizations plugin
stratoula d1e3fb2
Pipeline aggs compatible with percentile
stratoula ad4c2fd
Add some bugs
stratoula 7c74b98
Support nesred aggs
stratoula a581dd5
Merge branch 'main' into convert-to-lens
kibanamachine ba02a9f
Merge branch 'main' into convert-to-lens
kibanamachine 6433b30
Mini refactor and support all aggregations to Math
stratoula e13b1c2
Transfer terms sorting options
stratoula 7311e67
Transfer axis position
stratoula 99d9211
Merge branch 'main' into convert-to-lens
kibanamachine e2024b7
Merge branch 'main' into convert-to-lens
kibanamachine 51de080
Merge branch 'main' into convert-to-lens
kibanamachine 03c4383
Merge with main and resolve conflicts
stratoula ae62c6c
Fix translations keys
stratoula 3aa983c
Merge with main, resolve conflicts, use isLensEqual instead
stratoula 26e842b
Revert
stratoula 20b91ce
Fix redirectToOrigin buttion when the there is no embeddableId but co…
stratoula 429ed12
Improve context identification
stratoula 7040f38
Support yExtents
stratoula b039c0a
Merge branch 'main' into convert-to-lens
kibanamachine 465f7db
Merge branch 'main' into convert-to-lens
stratoula 331b965
Fix bug in formula caused by changes in the main branch
stratoula a3e57cb
Support formatters
stratoula 467d4e0
Support custom label
stratoula 8a1065e
Cleaning up
stratoula ede6341
Fix terms bugs
stratoula a6ce30d
Support filter breakdown by
stratoula 185df2e
Merge branch 'main' into convert-to-lens
kibanamachine d870fb6
Fixes math bug and escapes filter ratio query
stratoula 4202ff5
Merge branch 'main' into convert-to-lens
kibanamachine 68c6274
Add some unit tests
stratoula d45e5ba
Testing triggerOptions payload
stratoula a7fc4fe
Fix console warning
stratoula 943df02
Add more unit tests on TSVB function helpers
stratoula 2d7cafc
Adds a unit test on the vis top nav menu testing the new menu item
stratoula 3f50a21
Add unit tests
stratoula 5126fc1
Merge branch 'main' into convert-to-lens
stratoula 29c9a9f
Fix unsupported palette bug, clean up, add a unit test case
stratoula 3c015da
Merge branch 'main' into convert-to-lens
kibanamachine 3b3a25c
Add final unit tests
stratoula 274b139
Support timeScale in derivative
stratoula 5124288
Add functional tests
stratoula 91bcecc
Cleanup
stratoula c210669
Fix jest test
stratoula f08fa3c
Merge branch 'main' into convert-to-lens
kibanamachine b655f4e
Fix some bugs
stratoula c49bc52
Fix some math agg bugs
stratoula 3ff4105
Merge branch 'main' into convert-to-lens
stratoula 1dd2d87
Fix more bugs
stratoula 06f1ac1
Merge branch 'main' into convert-to-lens
kibanamachine 27af228
Merge branch 'main' into convert-to-lens
kibanamachine 25f6ced
Fixes jest test
stratoula 4d65168
Fix the problem with the dashboard state
stratoula cde3576
Hides the badge and link instead of disabling it
stratoula 208d1f5
Changes the text
stratoula 0454f91
Merge with master and resolve conflicts
stratoula a8d8fa5
Merge branch 'main' into convert-to-lens
kibanamachine 2f8a4e6
Merge branch 'main' into convert-to-lens
kibanamachine dc703f0
Merge branch 'main' into convert-to-lens
kibanamachine 0e3644f
Adds menu item vertical separator
stratoula 5afd257
Enhance the appLeace confirm modal to change the confirm button text …
stratoula 879fd21
Fixes CI
stratoula b71296e
Adress code review comments
stratoula 3f2d615
Address some of the comments
stratoula f2268b5
Fix more bugs
stratoula 5f10a22
Fix more bugs
stratoula c01d3d7
Zero decimals for formatting
stratoula df9eaa0
fix tests
stratoula cce1e32
Merge branch 'main' into convert-to-lens
stratoula 0f305b3
Navigate from dashboard to TSVB to Lens hides the appLeave modal
stratoula 878c83f
Adds support for terms on a date field
stratoula 2423d2b
Support filter by
stratoula 7701b58
Move the trigger to the visualizations plugin
stratoula 93f7449
Minor
stratoula fca4ebc
Fix CI
stratoula 5d85886
Support percentage charts
stratoula 70237f9
Merge with main and resolve conflicts
stratoula 59d3183
Improve the vertical separator
stratoula c5f3124
Fixes on the appLeave logic
stratoula de999b5
Remove unecessary import
stratoula be11016
Add badge to the nav item level
stratoula 8065703
Fix jest test
stratoula 82deb26
Fi filter ratio and filter by bug
stratoula c47ffae
Merge branch 'main' into convert-to-lens
kibanamachine 068b077
Replace all occurences of a variable
stratoula 6047c9d
Nest badge into the button level
stratoula bd9340d
Design improvements
stratoula 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
11 changes: 11 additions & 0 deletions
11
...ment/core/public/kibana-plugin-core-public.appleaveconfirmaction.buttoncolor.md
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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppLeaveConfirmAction](./kibana-plugin-core-public.appleaveconfirmaction.md) > [buttonColor](./kibana-plugin-core-public.appleaveconfirmaction.buttoncolor.md) | ||
|
||
## AppLeaveConfirmAction.buttonColor property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
buttonColor?: ButtonColor; | ||
``` |
11 changes: 11 additions & 0 deletions
11
...ore/public/kibana-plugin-core-public.appleaveconfirmaction.confirmbuttontext.md
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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppLeaveConfirmAction](./kibana-plugin-core-public.appleaveconfirmaction.md) > [confirmButtonText](./kibana-plugin-core-public.appleaveconfirmaction.confirmbuttontext.md) | ||
|
||
## AppLeaveConfirmAction.confirmButtonText property | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
confirmButtonText?: string; | ||
``` |
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
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
69 changes: 69 additions & 0 deletions
69
src/plugins/vis_types/timeseries/public/trigger_action/get_datasource_info.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,69 @@ | ||
/* | ||
* 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 { DataView } from '../../../../data/common'; | ||
import { getDataSourceInfo } from './get_datasource_info'; | ||
const dataViewsMap: Record<string, DataView> = { | ||
test1: { id: 'test1', title: 'test1', timeFieldName: 'timeField1' } as DataView, | ||
test2: { | ||
id: 'test2', | ||
title: 'test2', | ||
timeFieldName: 'timeField2', | ||
} as DataView, | ||
test3: { id: 'test3', title: 'test3', timeFieldName: 'timeField3' } as DataView, | ||
}; | ||
|
||
const getDataview = (id: string): DataView | undefined => dataViewsMap[id]; | ||
jest.mock('../services', () => { | ||
return { | ||
getDataStart: jest.fn(() => { | ||
return { | ||
dataViews: { | ||
getDefault: jest.fn(() => { | ||
return { id: '12345', title: 'default', timeFieldName: '@timestamp' }; | ||
}), | ||
get: getDataview, | ||
}, | ||
}; | ||
}), | ||
}; | ||
}); | ||
|
||
describe('getDataSourceInfo', () => { | ||
test('should return the default dataview if model_indexpattern is string', async () => { | ||
const { indexPatternId, timeField } = await getDataSourceInfo( | ||
'test', | ||
undefined, | ||
false, | ||
undefined | ||
); | ||
expect(indexPatternId).toBe('12345'); | ||
expect(timeField).toBe('@timestamp'); | ||
}); | ||
|
||
test('should return the correct dataview if model_indexpattern is object', async () => { | ||
const { indexPatternId, timeField } = await getDataSourceInfo( | ||
{ id: 'dataview-1-id' }, | ||
'timeField-1', | ||
false, | ||
undefined | ||
); | ||
expect(indexPatternId).toBe('dataview-1-id'); | ||
expect(timeField).toBe('timeField-1'); | ||
}); | ||
|
||
test('should fetch the correct data if overwritten dataview is provided', async () => { | ||
const { indexPatternId, timeField } = await getDataSourceInfo( | ||
{ id: 'dataview-1-id' }, | ||
'timeField-1', | ||
true, | ||
{ id: 'test2' } | ||
); | ||
expect(indexPatternId).toBe('test2'); | ||
expect(timeField).toBe('timeField2'); | ||
}); | ||
}); |
46 changes: 46 additions & 0 deletions
46
src/plugins/vis_types/timeseries/public/trigger_action/get_datasource_info.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,46 @@ | ||
/* | ||
* 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 { fetchIndexPattern, isStringTypeIndexPattern } from '../../common/index_patterns_utils'; | ||
import type { IndexPatternValue } from '../../common/types'; | ||
import { getDataStart } from '../services'; | ||
|
||
export const getDataSourceInfo = async ( | ||
modelIndexPattern: IndexPatternValue, | ||
modelTimeField: string | undefined, | ||
isOverwritten: boolean, | ||
overwrittenIndexPattern: IndexPatternValue | undefined | ||
) => { | ||
const { dataViews } = getDataStart(); | ||
let indexPatternId = | ||
modelIndexPattern && !isStringTypeIndexPattern(modelIndexPattern) ? modelIndexPattern.id : ''; | ||
|
||
let timeField = modelTimeField; | ||
// handle override index pattern | ||
if (isOverwritten) { | ||
const { indexPattern } = await fetchIndexPattern(overwrittenIndexPattern, dataViews); | ||
if (indexPattern) { | ||
indexPatternId = indexPattern.id ?? ''; | ||
timeField = indexPattern.timeFieldName; | ||
} | ||
} | ||
|
||
if (!indexPatternId) { | ||
const defaultIndex = await dataViews.getDefault(); | ||
indexPatternId = defaultIndex?.id ?? ''; | ||
timeField = defaultIndex?.timeFieldName; | ||
} | ||
if (!timeField) { | ||
const indexPattern = await dataViews.get(indexPatternId); | ||
timeField = indexPattern.timeFieldName; | ||
} | ||
|
||
return { | ||
indexPatternId, | ||
timeField, | ||
}; | ||
}; |
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.
ℹ️ Not needed, allows a TSVB library panel to be replaced by a Lens by value panel