-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Explore vis]add data transformation panel #11944
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
Changes from 5 commits
848449b
e4b09e6
a9e4214
5766222
ec60b3e
1fe50fd
13501e0
a6f9deb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ export const SaveVisButton = () => { | |
| const { queryEditorState, datasetView } = useQueryBuilderState(); | ||
| const { visualizationBuilderForEditor: visualizationBuilder } = useVisualizationBuilder(); | ||
| const visConfig = visualizationBuilder.visConfig$.value; | ||
| const transformationService = visualizationBuilder.getTransformationService(); | ||
|
|
||
| const { services } = useOpenSearchDashboards<ExploreServices>(); | ||
|
|
||
|
|
@@ -125,6 +126,14 @@ export const SaveVisButton = () => { | |
| isTitleDuplicateConfirmed, | ||
| onTitleDuplicate, | ||
| }: OnSaveProps) => { | ||
| const pipeline = transformationService.pipeline$.getValue(); | ||
| const serializedPipeline = pipeline.map((instance) => ({ | ||
| definitionId: instance.definition_id, | ||
| instanceId: instance.instance_id, | ||
| config: instance.config, | ||
| hide: instance.hide, | ||
| })); | ||
|
|
||
| const axesMapping = visConfig?.axesMapping; | ||
| const currentTitle = savedExploreToSave.title; | ||
| savedExploreToSave.title = newTitle; | ||
|
|
@@ -137,6 +146,7 @@ export const SaveVisButton = () => { | |
| splitField: visConfig?.splitField, | ||
| splitLayout: visConfig?.splitLayout, | ||
| showSplitLabel: visConfig?.showSplitLabel, | ||
| dataTransformationJSON: JSON.stringify(serializedPipeline), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious why does it need
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don’t need to double-stringify this, I assume it is the leftover code from the initial changes. |
||
| }); | ||
| savedExploreToSave.version = 1; | ||
|
|
||
|
|
@@ -196,6 +206,7 @@ export const SaveVisButton = () => { | |
| toastNotifications, | ||
| isPromptMode, | ||
| queryEditorState.lastExecutedTranslatedQuery, | ||
| transformationService, | ||
| ] | ||
| ); | ||
|
|
||
|
|
||
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.
why need to persist
instance_id? It seems it's purely a runtime identifierThere 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.
Yes, we don't need to save it, will delete it