Skip to content

[Dashboard] Add visualization by value to Dashboard#68902

Closed
majagrubic wants to merge 21 commits intoelastic:masterfrom
majagrubic:add-vis-to-dashboard
Closed

[Dashboard] Add visualization by value to Dashboard#68902
majagrubic wants to merge 21 commits intoelastic:masterfrom
majagrubic:add-vis-to-dashboard

Conversation

@majagrubic
Copy link
Copy Markdown
Contributor

@majagrubic majagrubic commented Jun 11, 2020

Summary

This is the first pass in adding Visualization to Dashboard by value. It should be fully functional. However, this solution is based on passing dashboard input to visualize editor, and then using this input to pass visualization data back to dashboard, which is a bit hacky (and won't work in case of a page reload). I will change this logic after #67064 is merged.

I'm hiding the new flow behind a "feature flag" by utilizing the server-side config. The current flow should remain unaffected. In order to test this locally, the value of the showNewVisualizeFlow flag needs to be set to "true" in src/plugins/visualize/config.ts and src/plugins/visualize/server/index.ts.

Checklist

Delete any items that are not applicable to this PR.

- [] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
- [ ] Documentation was added for features that require explanation or tutorials

For maintainers

@majagrubic
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@majagrubic majagrubic force-pushed the add-vis-to-dashboard branch from bece04b to cd6735d Compare June 12, 2020 10:19
@majagrubic majagrubic changed the title [Dashboard] Add visualization as a reference to Dashboard [Dashboard] Add visualization as value to Dashboard Jun 12, 2020
@majagrubic majagrubic changed the title [Dashboard] Add visualization as value to Dashboard [Dashboard] Add visualization by value to Dashboard Jun 12, 2020
@majagrubic majagrubic marked this pull request as ready for review June 17, 2020 09:25
@majagrubic majagrubic requested a review from a team June 17, 2020 09:25
@majagrubic majagrubic requested a review from a team as a code owner June 17, 2020 09:25
@majagrubic majagrubic added v7.1.0 v8.0.0 release_note:roadmap Feature:Dashboard Dashboard related features Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// labels Jun 17, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Copy link
Copy Markdown
Contributor

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool! i think we should throw some things around but its very close.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we navigate to empty dashboard if one was not loaded ? should we allow for passing dashboardId to navigateToDashboard function ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we rather say that input can also be undefined, and if its undefined we show the modal else we create from the input

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input won't be undefined in case of a "regular save", it contains timeRange and query and a few other parameters:

export interface VisualizeInput extends EmbeddableInput {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should not be loading the dashboard and manipulating it in visualize (this requires internal knowledge about dashboard structure)

rather we should navigate to dashboard and let dashboard take care of that:

navigateToApp('dashboard', { newVis: vis.serialize(); })

and then dashboard should check for newVis on its state, if its there it can append it to its panels

Copy link
Copy Markdown
Contributor Author

@majagrubic majagrubic Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. The problem here is that we started working on a better inter-app communication logic and the PR hasn't been merged yet. As I mentioned in the description, this code is definitely going to change after #67064 is merged, and what you're describing is pretty similar to how it is going to work. We'll navigate to dashboard and pass the serialized vis as input, and the dashboard is going to render.

I did not want to base this PR off an unmerged PR, but I also didn't want to be blocked by that change.

I think this way of communicating between dashboard and visualization is good enough for now.

@majagrubic majagrubic force-pushed the add-vis-to-dashboard branch from 12addcd to 0bb50b9 Compare June 17, 2020 11:39
Copy link
Copy Markdown
Contributor

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM, looking forward to improved communication between visualize and dashboard as well.

@majagrubic majagrubic requested review from stratoula and removed request for flash1293 June 23, 2020 13:11
Copy link
Copy Markdown
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. I was more thorough on the vis editor code. Tested it on Chrome and it works as expected.

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

Failed CI Steps

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
dashboard 111 +1 110

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@majagrubic
Copy link
Copy Markdown
Contributor Author

Thanks @ppisljar , @stratoula and @ThomThomson for your reviews. I'm closing this PR in favor of: #69898

and will ping you for another review there 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Dashboard Dashboard related features Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.1.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants