Skip to content
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

Allow replacing visualizations on dashboard #45095

Merged
merged 34 commits into from
Oct 23, 2019
Merged

Conversation

friol
Copy link
Contributor

@friol friol commented Sep 7, 2019

Summary

As asked in Issue #43900, this PR adds the "Replace visualization" function to the Edit Menu when a Dashboard is in edit mode. The new visualization is chosen from a flyout, and replaces the old one with the same position and dimensions.

replaceViewScreenshot

@elasticmachine
Copy link
Contributor

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

1 similar comment
@elasticmachine
Copy link
Contributor

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@rayafratkina rayafratkina added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Sep 11, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@TinaHeiligers
Copy link
Contributor

jenkins test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@friol
Copy link
Contributor Author

friol commented Sep 18, 2019

@TinaHeiligers : can you please run the build again?

@ryankeairns ryankeairns self-requested a review September 18, 2019 14:58
Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

LGTM from the design side. A Kibana engineer will need to complete a code review / approval before merging.

This is a really nice addition, simple and very intuitive. The interaction does exactly what I would expect - clicking the action link opens the flyout, allowing me to choose as a new viz. Thanks for the PR!

@timroes
Copy link
Contributor

timroes commented Sep 18, 2019

@stacey-gammon Since the embeddable layer is still rather new, could we perhaps bother you for a review here?

@timroes
Copy link
Contributor

timroes commented Sep 18, 2019

Jenkins, test this

@stacey-gammon
Copy link
Contributor

This is awesome! You might have to update some things after #44707 is merged, hopefully today. I am out tomorrow and Friday and I'm not sure I'll be able to finish the review today but if not I'll get back around to it early next week.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@friol
Copy link
Contributor Author

friol commented Sep 18, 2019

@stacey-gammon : the type_check script fails for this error:

ERROR x-pack failed
src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/index.ts:20:42 - error TS2307: Cannot find module 'kibana/public'.
20 import { PluginInitializerContext } from 'kibana/public';

But the error is not in files I've touched. The same line of code is also on master:

https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/dashboard_embeddable_container/public/np_ready/public/index.ts

Edit: this was before the merge of #44707.

@timroes
Copy link
Contributor

timroes commented Sep 20, 2019

Jenkins, test this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@friol
Copy link
Contributor Author

friol commented Sep 20, 2019

@timroes : error is not in my code, is it?

@stacey-gammon
Copy link
Contributor

@friol , it's probably that something in jest is now importing that file that wasn't before. Those imports don't work in jenkins unfortunately so the recommendation is still relative file paths (discussed here: #40446). We eventually we want to move to support these short file imports, and they are still scattered about the code because they don't always cause failures. Short term fix is to just switch to a relative file path import.

@friol
Copy link
Contributor Author

friol commented Sep 23, 2019

@friol , it's probably that something in jest is now importing that file that wasn't before. Those imports don't work in jenkins unfortunately so the recommendation is still relative file paths (discussed here: #40446). We eventually we want to move to support these short file imports, and they are still scattered about the code because they don't always cause failures. Short term fix is to just switch to a relative file path import.

@stacey-gammon : ok, so, exactly, what should I do?

@friol
Copy link
Contributor Author

friol commented Oct 16, 2019

Thanks @friol ! Someone from the @elastic/kibana-app team should be picking this up soon to help with tests. It's got an LGTM from me for the embeddable part of it.

Oh one thing I did think of though this weekend - it should probably be displayed as "Replace panel" not "Replace visualization" since you could swap it out with different types of embeddables, and the term "visualization" is specific to the one type. We also have "map" and "saved search", may eventually have "input control", and others.

@stacey-gammon : I renamed the menu item to "Replace panel". To be honest, one would have to change all the file names and all the object names to "change_panel_something"... but I hope you won't need that :)

@nickofthyme
Copy link
Contributor

nickofthyme commented Oct 18, 2019

@friol Thanks for jumping on this so quickly I thought of this feature just a few months ago!

I updated the naming to replacePanel just to be consistent across the board.

I couldn't find any issue with the test you pointed out, tbd if the ci passes 🤞.

I also added some functional tests to your PR. Please let me know if you have any comments witht the changes and feel free to make any changes you'd like.

Copy link
Contributor

@nickofthyme nickofthyme 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, Thanks for this enhancement! I Love it!

@elasticmachine
Copy link
Contributor

💔 Build Failed

@friol
Copy link
Contributor Author

friol commented Oct 18, 2019

@friol Thanks for jumping on this so quickly I thought of this feature just a few months ago!

I updated the naming to replacePanel just to be consistent across the board.

I couldn't find any issue with the test you pointed out, tbd if the ci passes 🤞.

I also added some functional tests to your PR. Please let me know if you have any comments witht the changes and feel free to make any changes you'd like.

@nickofthyme : simply great! You had the patience to rename all the objects to "replacePanel*" :)
Many thanks - I don't have any comments, it's ok to me.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@nickofthyme
Copy link
Contributor

@elasticmachine merge upstream

@nickofthyme
Copy link
Contributor

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@friol
Copy link
Contributor Author

friol commented Oct 23, 2019

@nickofthyme : tell me we can finally merge this one! It's 1 month and 15 days old :)

@nickofthyme nickofthyme added Feature:Dashboard Dashboard related features and removed v7.5.0 labels Oct 23, 2019
@nickofthyme nickofthyme merged commit c718972 into elastic:master Oct 23, 2019
@nickofthyme
Copy link
Contributor

@friol Done! Thanks again for all the help!

@friol
Copy link
Contributor Author

friol commented Oct 24, 2019

@nickofthyme : there is another PR from me, dated 28 august, that got "lost" -> #35379 .
Would you mind reviewing it? I think that functionality would be quite useful.
Thanks

@timroes timroes added the v7.6.0 label Oct 24, 2019
timroes pushed a commit to timroes/kibana that referenced this pull request Oct 24, 2019
* First version of change view functionality

* Adds the 'replace view' functionality to dashboard edit mode

* Fixed type_check errors

* Make action part of dashboard_embeddable_container

* Fixed import paths for type check errors

* Fixed i18n errors

* Renamed action to 'Replace panel' and adjusted jest tests to pass type check

* test: add functional tests

Closes elastic#43900
@timroes timroes changed the title GUI enhancement: ability to replace a view on the fly Allow replacing visualizations on dashboard Oct 24, 2019
timroes pushed a commit that referenced this pull request Oct 24, 2019
…9173)

* First version of change view functionality

* Adds the 'replace view' functionality to dashboard edit mode

* Fixed type_check errors

* Make action part of dashboard_embeddable_container

* Fixed import paths for type check errors

* Fixed i18n errors

* Renamed action to 'Replace panel' and adjusted jest tests to pass type check

* test: add functional tests

Closes #43900
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nickofthyme
Copy link
Contributor

@friol I'll take a look at #35379.

FYI this feature will be in the 7.6.0 release, just missed 7.5.0 😞

@friol
Copy link
Contributor Author

friol commented Oct 24, 2019

@friol I'll take a look at #35379.

FYI this feature will be in the 7.6.0 release, just missed 7.5.0 😞

@nickofthyme : thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dashboard Dashboard related features release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants