-
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
[Embeddable] Always send value input from edit panel action #155283
[Embeddable] Always send value input from edit panel action #155283
Conversation
…-ref HEAD~1..HEAD --fix'
…sfer/alwaysSendValueInput' into embeddableStateTransfer/alwaysSendValueInput
@stratoula, I went through and did some testing with this on and everything seems to work properly. Here's what I tested:
Hopefully this helps solve the weirdness you were encountering in #147646 |
Pinging @elastic/kibana-presentation (Team:Presentation) |
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.
Thanx Devon! I also did some tests and everything works fine! Also it unblocks me from carrying the custom timerange to the converted panel 🎉 Much appreciated!
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.
This change requires some cleanup in Maps render_app. That was written assuming either savedObjectId would be used for valueInput, not both
let mapEmbeddableInput;
if (routeProps.match.params.savedMapId) {
mapEmbeddableInput = {
savedObjectId: routeProps.match.params.savedMapId,
} as MapByReferenceInput;
}
if (valueInput) {
mapEmbeddableInput = valueInput as MapByValueInput;
}
Looking at that logic, it's very strange that on Correct me if I'm wrong, but it seems to me that we just need to use an |
value input does contain savedObjectId. I think its more then just an if/else. The first case should may also need to include value input if provided but that could be done later. |
It's only really valuable to hold onto the provided valueInput if you're expecting to change types. On save and return if it's the same type, the previous input is spread back on top. |
…bleStateTransfer/alwaysSendValueInput
@nreese, I updated the maps I also verified that the other editors determine |
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.
LGTM
code review and tested in chrome
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Information for the Presentation team reviewer
During the Time to Visualize project we began to pass input state around between the dashboard and editors with an embeddable
state transfer service
.save and return
to the dashboard, the by reference panel would be re-fetched from the saved object in order to reflect the updates that were made in the editor.save and return
we combine the dashboard's old state for that panel with whatever new input was returned from the editor, the input from the editor taking precedence.This worked great because panels never changed type. Any state that the editor didn't return would be repopulated from the dashboard's state.
When the visualize team started the project to upgrade TSVB / Visualize panels to Lens, we could no longer guarantee that the panel had not changed type, so we added a new statement to only spread the dashboard's previous panel state if the types were the same. This caused problems where some state would get left behind, like Drilldowns and custom time ranges.
@stratoula started work on #155113 to ensure that this state was not lost by taking it from the dashboard and propagating it back on
save and return
. But this did not work forby reference
visualizations, because of the decision we made to pass only the id to by reference visualizations.This PR fixes that by ensuring that the by value input is passed into the editors regardless of whether the panel is by value or by reference.