forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Embeddables Rebuild] Migrate Visualize (elastic#183197)
## Summary Closes elastic#174958 This migrates the Visualize embeddable to the new React Embeddable framework. Migrated: - Edit visualization action - Convert to lens action - Extracting/injecting references on serialize and deserialize - Inspector adapters - Dashboard settings - Drilldown support - Timeslice/time slider support - Custom time ranges Also adds deprecation statements to legacy Embeddable factories **In a second PR, we'll move the `embeddable` folder to `legacy/embeddable` and rename `react_embeddable` to `embeddable`. I don't know if git will be able to diff that change in a comprehensible way in this PR, so I want to save it for the next one.** ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Devon Thomson <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Marta Bondyra <[email protected]>
- Loading branch information
1 parent
829c6ad
commit ee28e20
Showing
42 changed files
with
1,605 additions
and
126 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
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
24 changes: 24 additions & 0 deletions
24
src/plugins/visualizations/public/react_embeddable/create_vis_instance.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,24 @@ | ||
/* | ||
* 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 { SerializedVis } from '../vis'; | ||
import { createVisAsync } from '../vis_async'; | ||
import { getSavedSearch } from '../services'; | ||
|
||
export const createVisInstance = async (serializedVis: SerializedVis) => { | ||
const vis = await createVisAsync(serializedVis.type, serializedVis); | ||
if (serializedVis.data.savedSearchId) { | ||
const savedSearch = await getSavedSearch().get(serializedVis.data.savedSearchId); | ||
const indexPattern = savedSearch.searchSource.getField('index'); | ||
if (indexPattern) { | ||
vis.data.indexPattern = indexPattern; | ||
vis.data.searchSource?.setField('index', indexPattern); | ||
} | ||
} | ||
return vis; | ||
}; |
Oops, something went wrong.