-
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
[Embeddables Rebuild] Migrate Visualize #183197
Merged
Zacqary
merged 243 commits into
elastic:main
from
Zacqary:visualize-embeddable-react-converstion
Aug 30, 2024
Merged
Changes from 236 commits
Commits
Show all changes
243 commits
Select commit
Hold shift + click to select a range
98ef1fd
Initial commit, register react visualize embeddable based on EUI mark…
Zacqary 7d2c26f
Get initial expression updater logic working
Zacqary 2ca806b
WIP
Zacqary 1d86a45
Get visualizations rendering in embeddable
Zacqary 806a98c
Add types to expression renderer props
Zacqary a9633f4
Add types and fix visualization saving
Zacqary 9c7377a
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary d08e1f7
Implement actions
Zacqary 48e51e6
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 8afa840
Get state serialization/deserialization working
Zacqary d655091
Deprecate legacy embeddable
Zacqary f87d0ac
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 6910163
Revert services reorg
Zacqary e39ca14
Revert dataViews dep
Zacqary 0fa4d8f
Use existing apiPublishesSettings
Zacqary 4add2da
Remove embeddable debugger flag
Zacqary 1ca2ce3
Use existing start getter
Zacqary 6b6e8ec
Remove unused savedObjects dep
Zacqary a590306
Add viewMode subject
Zacqary b9cc3a4
Merge branch 'main' into visualize-embeddable-react-converstion
kibanamachine 3708ab0
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 347f066
Revert extractReferences type change
Zacqary 5501a96
Revert injectReferences type change
Zacqary 8b5bfe9
Merge remote-tracking branch 'origin/visualize-embeddable-react-conve…
Zacqary c1d56e3
Add savedobject deserialization
Zacqary 3587f7c
Merge branch 'main' into visualize-embeddable-react-converstion
kibanamachine db5c257
WIP
Zacqary 6c915cc
Port TSVB editor to React embeddable
Zacqary eae8f8d
Handle undefined state in deserializeState
Zacqary 8a8c375
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary 818f433
Use React embeddable in Default Editor, sidebar not yet migrated
Zacqary 1997b37
Fix reference injection
Zacqary d4a3fec
Implement triggers in react embeddable
Zacqary 6a57013
Implement inspector button in tsvb editor
Zacqary b3b5e22
Implement inspector on default editor
Zacqary 7d1d93b
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 027bd97
Remove legacy visualizeembeddable
Zacqary 8ab5b31
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 36ebfb1
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary 0720581
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 5eee91d
Run i18n fix
Zacqary 10da106
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 108003e
Update visualize editor parentApis
Zacqary 5473d35
Typecheck fix
Zacqary 76cdc32
Fix missing test subjs
Zacqary 160e34d
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 2603dd7
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary dee7dde
Clean up subjects and move async deserialize logic into deserializeState
Zacqary 0e80a0a
Fix markdown editor
Zacqary 300686f
Add error prompt to broken vis loaders
Zacqary 3a9aa48
Fix index pattern saving in agg embeddables
Zacqary aac4b63
Fetch index pattern from savedSearch
Zacqary 57e2c57
Reinstate data-shared-item attr
Zacqary cf772ea
Fix missing data-shared-item props
Zacqary 1921e9d
Fix emitting visdata
Zacqary 714987c
Fix FTR 3 - data-rendering-complete
Zacqary 06e4aa5
Fix reference migration
Zacqary fe39bd4
Reimplement hasInspector
Zacqary c377731
Fix navigate to lens from visualize
Zacqary b42a21b
Fix updating aggregation vis in editor
Zacqary 46567d2
Force empty data-title and data-description
Zacqary 986c432
Clear data-title when hidePanelTitle is true
Zacqary 6cd153e
Catch error when searchSource ref is missing
Zacqary d52b1a6
Fix tag cloud test
Zacqary e3840c1
Move waitForVisualization into clickGo
Zacqary 13f85f7
Implement add from library
Zacqary 95eed5e
Fix saving title from visualize app
Zacqary 270b560
Fix i18n
Zacqary 149443d
Pass navigateToLensFn directly to visualize topnav
Zacqary c2d4582
Skip tag cloud tests
Zacqary aaa078c
Add library linking actions
Zacqary 8e1cd68
Import index pattern references in default editor
Zacqary eb41aa2
WIP Visualize Editor refactor
Zacqary 7f4f55f
Clean up top nav saving
Zacqary dd49ca4
Fix save and load from savedobject editor
Zacqary 7ab95f3
Fix editor breadcrumbs for savedobject editor
Zacqary ec52b76
Commit breadcrumbs hook
Zacqary 7a0bf7e
Restore working legacy tsvb editors
Zacqary 20562a1
Fix imports
Zacqary 9444ebe
Fix saving and loading on byvalue and default editors
Zacqary 19cc33e
Cleanup types
Zacqary 7a14da7
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 9fb5586
Add uiState url parser
Zacqary 3fd9d67
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary afdd40a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine ed65afe
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine b087b94
Typecheck fix
Zacqary aa9f9d2
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary feae461
Fix save from visualize editor
Zacqary 6f67794
Remove references from byValue dashboard panels
Zacqary c998350
Fix routing for editing library vis panels
Zacqary 5078d5b
Fix saving tags and managed vis
Zacqary 6c71992
Fix extracting savedObjectProperties in editor
Zacqary ca17fb4
Fix handleLinkedSearch
Zacqary 7a83962
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 7cecf04
Fix navigate to lens link
Zacqary 730a602
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary fd37567
Fix TSVB setVis
Zacqary 55d61ea
Begin implementing saveToLibrary action
Zacqary 88c9679
WIP fix references
Zacqary c50fa14
make runtime state serializable
ThomThomson 99c1c09
runtime state fixes
ThomThomson 4c28c43
Merge pull request #5 from ThomThomson/visualizeEmbeddable/runtimeSta…
Zacqary 107ea3e
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary b07454a
Fix saved object loading
Zacqary 78b2968
Implement add/unlink from library successfully
Zacqary 4604cf8
Fix TSVB editor api imports
Zacqary 7112b8d
Fix saved searches
Zacqary 1159f06
Fix link/unlink/load saved search
Zacqary 6b4b45c
Fix vis without saved search and editing TSVB vis
Zacqary ad5d4cc
Fix TSVB serialization
Zacqary 4c4fe34
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary a851d7d
Fix bad merge
Zacqary aa85125
Fix save to library
Zacqary 249d088
Fix save TSVB to dashboard
Zacqary 6443d14
Add search source serialization comment
Zacqary 8446bc0
undo changes
ThomThomson aa61d4b
Fix add from library titles
Zacqary 4a0e3b6
Merge remote-tracking branch 'refs/remotes/Zacqary/visualize-embeddab…
ThomThomson 87d4db5
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary b7825cd
Merge pull request #6 from ThomThomson/visualizeEmbeddable/removeChanges
Zacqary faabc35
Fix i18n
Zacqary f246104
Fix saved vis instance jest
Zacqary 98d070b
Fix bad merge
Zacqary d804991
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary deaffdd
Fix bad merge
Zacqary 3678bb5
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary 8fe79a3
Fix editor breadcrumb title sync
Zacqary 07c702d
Refactor url app state tracking
Zacqary 9e8808a
Update byvalue editor with appstate changes
Zacqary a671353
Fix byvalue editor
Zacqary d03cd46
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine b1bd42b
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 2d8df0b
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary bc3920d
Add getInspectorAdapters to visualize embeddable
Zacqary fe312f4
Fully encode app state rison
Zacqary 100cd7c
Add data views and default title to visualize embeddable. Re-set chan…
ThomThomson defa900
Merge remote-tracking branch 'refs/remotes/Zacqary/visualize-embeddab…
ThomThomson 97d2199
Fix legacy code typechecks
Zacqary 337b7d4
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary 362a544
Add missing test file
Zacqary 476cca9
Wait for vis update before calling updateExpressionParams
Zacqary 4594c83
Restore legacy embeddable to visualize app
Zacqary 2bc47d0
Fix state transfer from visualize
Zacqary 7cbb415
begin separating visualize embeddable class from legacy embeddable fr…
ThomThomson 40636fe
Fix quick check
Zacqary 36faec7
Merge remote-tracking branch 'refs/remotes/Zacqary/visualize-embeddab…
ThomThomson f6ecba6
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 4c9775f
remove attribute service from legacy embeddable and clean up types
ThomThomson 4852cd9
Merge remote-tracking branch 'refs/remotes/Zacqary/visualize-embeddab…
ThomThomson 2decc19
Remove unused hooks
Zacqary 4222f35
Remove unused legacy components
Zacqary 1c76810
Typecheck fix, remove unused api methods
Zacqary 4790a72
make Canvas store runtime state of react embeddables.
ThomThomson 6671dc4
Add drilldown action
Zacqary 39d5532
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary c7c0b2e
add time range api
ThomThomson 334d6d0
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 49f8a6a
Merge remote-tracking branch 'refs/remotes/Zacqary/visualize-embeddab…
ThomThomson 79720c8
Fix visualize render count tests
Zacqary fb18006
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary 18c94dd
Revert "begin separating visualize embeddable class from legacy embed…
Zacqary 4617626
Fix quick check
Zacqary 31bed0a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 9295992
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary e68fe77
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary eabfcdc
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 117b983
Fix comparators
Zacqary 51765ce
Fix empty title/description comparator
Zacqary c532778
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary be1f6e8
Update screenshot waitForRender to watch attribute change
Zacqary 88df0ab
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary bd35717
Increase PNG baseline threshold, pdf timeout length
Zacqary 446afb6
Restore runtime state changes to react_embeddable_renderer
Zacqary fa5a295
Add embeddableError data-test-subj to react vis errors
Zacqary 975c5ed
Skip flaky Vega test
Zacqary 7d7789c
Fix lint
Zacqary a05cb41
Increase screenshot diff threshold to 0.1
Zacqary 722dc35
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 1bb1c29
Fix serializing enhancements
Zacqary a59642e
Fix loading drilldowns on panels linked to library
Zacqary 60e2b68
Remove console error
Zacqary 510796e
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 54b89ba
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 4bf09da
Fix tsvb serverless test
Zacqary c1136be
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary 8fd77a0
Fix missing index pattern test
Zacqary d642aff
Add trigger for go to dashboard drilldown
Zacqary 75fdbeb
Fix editing permissions
Zacqary eb79469
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary f4d4df0
Fix i18n
Zacqary eb7789e
Restore embeddable api context for action triggers
Zacqary 19e8786
Remove cosole logs
Zacqary d8e66ad
Fix tsvb lens convert tests
Zacqary b643f94
Fix UI state save/load
Zacqary 0ce26fe
Fix byvalue save permissions
Zacqary 38874c0
Fix save permissions again
Zacqary bd3fd14
Add select range trigger to embeddable supportedTriggers
Zacqary 3d5b8c4
Fix type import linting
Zacqary 0e46782
Fix custom time range saving
Zacqary 2662dcf
Fix loading custom timerange on linked panels
Zacqary 3d29ae2
Fix panel action test
Zacqary 7830ff6
Fix telemetry tests
Zacqary 0ca480f
Fix reference jest
Zacqary dd2fc2c
Fix type import
Zacqary 5c145b0
Skip directly modifying url tests
Zacqary 05936a5
Remove console logs
Zacqary f7de7e7
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary ea32301
Use string ViewModes instead of enum
Zacqary a0da8fb
Fix lint
Zacqary 7ffbea5
Typecheck fix
Zacqary 69990c8
Revert canvas runtime state changes
Zacqary ad8eab0
Type fix
Zacqary 0d54a90
Restore saved_visualization_references changes
Zacqary 0fef75e
Fix importing pre-passed runtime state into canvas
Zacqary 5e9b594
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary b4cb319
Typecheck fix
Zacqary 63c6b14
Add timeslice support
Zacqary 0d9a723
Add deprecation statements to legacy embeddable
Zacqary 465e97f
Clean up and comment embeddable code
Zacqary 813d8ca
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary ee65895
Remove extraneous legacy edit path
Zacqary 71476ee
Merge branch 'main' into visualize-embeddable-react-converstion
elasticmachine 990185e
Revert unneeded canvas type change; comment dashboard state test skip
Zacqary 08861d8
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary 7a0a88e
Remove PublishesDataView
Zacqary 5ac4c77
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 0a2f67c
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine 7728b34
Merge branch 'main' into visualize-embeddable-react-converstion
mbondyra a6603b6
Merge branch 'main' into visualize-embeddable-react-converstion
mbondyra b8b9550
Remove convertSavedObjectAttributesToReferences export
Zacqary d09c0d8
Convert updateExpressionParams to getExpressionParams
Zacqary 656120a
Convert switchMap to async instead of IIFE
Zacqary 4be626d
Merge branch 'visualize-embeddable-react-converstion' of https://gith…
Zacqary d701179
Async import createVisEmbeddableFromObject
Zacqary b02a3ba
Use pipe/switchMap for serializedVis subscription
Zacqary 7003cf3
Reinstate uiStateChange unsubscribe
Zacqary 924d105
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary af5012d
Emit renderComplete from visualize embeddable on render
Zacqary f1ff79d
Remove savedObjectToRuntimeState
Zacqary 48e9897
Add initialState to onAdd
Zacqary bbf95fb
Use util to dispatch renderComplete
Zacqary 2f8f46f
Merge remote-tracking branch 'upstream/main' into visualize-embeddabl…
Zacqary 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
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.
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.
Shouldn't
container.addNewPanel
get passed serializedState? Why are you converting the state to runtime state? What happens if you removesavedObjectToRuntimeState
?The reason I ask is that this PR adds 10KB to the page load size and am trying to track down all possible increases. It would be great if we could avoid importing
savedObjectToRuntimeState
into the page load bundle size. I don't think this is needed.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.
Just tested it and the following works.
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.
At one point this was necessary after a merge with
main
broke the embeddable, but I guess something with the panel handling changed and now it's no longer necessary? Still works without passing this in. I'll remove.