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

[Lens] Disable saving visualization until there are no changes to the document #52982

Merged
merged 6 commits into from
Dec 24, 2019

Conversation

majagrubic
Copy link
Contributor

@majagrubic majagrubic commented Dec 13, 2019

Summary

Don't allow "Save" on empty Lens visualization if there is nothing to save.
Fixes: #52801
(Note: if there were embeddables with an empty visualization already created, they will stay empty.)

lens-vis

Really small change, but had to update a few specs, to mock Document properly.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@majagrubic majagrubic changed the title [Lens] Disable saving visualization until there are no changes to the… [Lens] Disable saving visualization until there are no changes to the document Dec 13, 2019
@majagrubic majagrubic force-pushed the lens-do-not-save branch 2 times, most recently from 469c829 to ce39b99 Compare December 13, 2019 12:05
… document

Adding unit test for new functionality

Fixing type error

Removing unnecessary act statements

Removing unnecessary assertion
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

History

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

@majagrubic majagrubic marked this pull request as ready for review December 13, 2019 16:28
@majagrubic majagrubic added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens release_note:enhancement v7.6.0 v8.0.0 labels Dec 13, 2019
@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

@majagrubic
Copy link
Contributor Author

majagrubic commented Dec 13, 2019

I think the CI fails due to some Github error:
Could not update status of the pull request on Github and further down the line there's a socket timeout exception. All the checks seem to pass successfully.

@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

@majagrubic
Copy link
Contributor Author

Jenkins, test this

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

Change LGTM, although I did not actually run the code

const isSaveable = lastKnownDoc && core.application.capabilities.visualize.save;
const isSaveable =
lastKnownDoc &&
lastKnownDoc.expression.length > 0 &&
Copy link
Contributor

Choose a reason for hiding this comment

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

This test looks like it could throw if expression is null instead of ""

Copy link
Contributor Author

@majagrubic majagrubic Dec 20, 2019

Choose a reason for hiding this comment

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

According to the type definition, it will never be null, only string:

It doesn't make sense to add a null check here without changing the type definition, and I wasn't feeling confident doing so. Thoughts?

@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@elastic elastic deleted a comment from elasticmachine Dec 23, 2019
@majagrubic majagrubic merged commit c433c6e into elastic:master Dec 24, 2019
@majagrubic majagrubic deleted the lens-do-not-save branch December 24, 2019 08:21
jloleysens added a commit to jloleysens/kibana that referenced this pull request Dec 30, 2019
…le-saved-objects

* 'master' of github.com:elastic/kibana: (250 commits)
  Allow chromeless applications to render via non-/app routes (elastic#51527)
  Add server rendering service to enable standalone route rendering (elastic#52161)
  Possibility to filter when testing scripted fields (elastic#35379) (elastic#44220)
  Update maps telemetry mappings to account for recent updates (elastic#53803)
  [Maps] Only show legend when layer is visible (elastic#53781)
  remove use of experimental fs.promises api (elastic#53346)
  [APM] Add log statements for flaky test (elastic#53775)
  [APM] Transaction page throws unhandled exception if transactions doesn't have  `http.request` (elastic#53760)
  Licensing plugin functional tests (elastic#53580)
  [Lens] Disable saving visualization until there are no changes to the document (elastic#52982)
  [Monitoring] Added safeguard for some EUI components (elastic#53318)
  [Vega] Shim new platform - cleanup vega_visualization dependencies (elastic#53605)
  Display changed field formats without requiring hard page refresh. (elastic#53746)
  Upgrade EUI to v17.3.1 (elastic#53655)
  [APM] Fix missing apm indicies (elastic#53541)
  Disable inspector for timelion (elastic#53747)
  Clean up search servie (elastic#53701)
  [Dashboard] Grid: removing double handler (elastic#53707)
  Remove SavedObjectRegistryProvider from codebase (elastic#53455)
  Move ui/courier into data shim plugin (elastic#52359)
  ...
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Jan 3, 2020
… document (elastic#52982)

Adding unit test for new functionality

Fixing type error

Removing unnecessary act statements

Removing unnecessary assertion

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
majagrubic pushed a commit that referenced this pull request Jan 3, 2020
… document (#52982) (#53947)

Adding unit test for new functionality

Fixing type error

Removing unnecessary act statements

Removing unnecessary assertion

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 8, 2020
… document (elastic#52982)

Adding unit test for new functionality

Fixing type error

Removing unnecessary act statements

Removing unnecessary assertion

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens 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.

[Lens] Adding empty Lens visualization to Dashboard fails
4 participants