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

[Visualize] Allows editing broken visualizations caused by runtime fields changes #94798

Merged
merged 22 commits into from
Apr 8, 2021

Conversation

VladLasitsa
Copy link
Contributor

@VladLasitsa VladLasitsa commented Mar 17, 2021

Closes: #93921, #93924, #93928

Summary

Adds possibility to open visualization when a user deleted the field or changed its type so that user can fix it.

Now user can open visualization and see error. Also editor will be in invalid state. Moreover I added error message in validation by focus leaving from combobox if user doesn't select another field.

In case when we delete field

image

In case when we change type of field

image

@timroes
Copy link
Contributor

timroes commented Mar 18, 2021

A note to the current way this is designed: I don't think we should link the user to the saved object page. There are several reasons this is a bad idea: (a) it needs different permissions than saving (and opening) visualizations, (b) we're anyway considering making that page a read only page potentially, so you could not necessarily edit the saved obejct in the future there.

If we load a visualization in a state where a field doesn't exist or has a wrong type, we should completely stay in the editor and just have the editor be in an invalid state, the same as you'd see if you selected an aggregation but not a field yet. Thus the user needs to change the field to bring the editor in the valid state again and then can save the visualization.

@VladLasitsa
Copy link
Contributor Author

A note to the current way this is designed: I don't think we should link the user to the saved object page. There are several reasons this is a bad idea: (a) it needs different permissions than saving (and opening) visualizations, (b) we're anyway considering making that page a read only page potentially, so you could not necessarily edit the saved obejct in the future there.

If we load a visualization in a state where a field doesn't exist or has a wrong type, we should completely stay in the editor and just have the editor be in an invalid state, the same as you'd see if you selected an aggregation but not a field yet. Thus the user needs to change the field to bring the editor in the valid state again and then can save the visualization.

Okay, got it. I removed link from error message and update editor so that it will be in invalid state in these cases.

@VladLasitsa VladLasitsa self-assigned this Mar 18, 2021
@VladLasitsa VladLasitsa changed the title [Visualize] User should be able to edit a broken visualization from a runtime field that doesn't exist anymore [Visualize] Support runtime fields editor Mar 18, 2021
@VladLasitsa
Copy link
Contributor Author

@elasticmachine merge upstream

@alexwizp
Copy link
Contributor

@elasticmachine merge upstream

@stratoula
Copy link
Contributor

@elasticmachine merge upstream

Copy link
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.

Some initial comments:

  1. When I delete the field and refresh my viz, I can see the toast twice. Moreove I would expect to be an error message when I open the split series accordion.
    image
  2. The toasts do not disappear, as a result they "follow" me and if I open the visualization again I can see 4 toasts etc.
  3. For a broken visualization on a dashboard I see an error label and only when I hover it it visible what the problem is. I suggest to be minimal for users with no edit permissions and more explanatory for the users who can actually edit and fix it. @ThomThomson wdyt?
    image

The above applies to fields that their type changes too.

@ThomThomson
Copy link
Contributor

@stratoula I like the idea to have the tooltip less descriptive for users without edit permissions, but having a small error label like that doesn't match particularly well with the error reporting for lens. It would be ideal if it was possible to match this errorEmbeddable like design from #90668

@stratoula
Copy link
Contributor

Thank you @ThomThomson, I agree. This is what I meant with more explanatory 😄 We should def match with Lens

@VladLasitsa
Copy link
Contributor Author

@elasticmachine merge upstream

@stratoula stratoula requested a review from a team April 8, 2021 08:39
@stratoula stratoula requested a review from a team as a code owner April 8, 2021 08:39
@stratoula stratoula added release_note:feature Makes this part of the condensed release notes v7.13.0 v8.0.0 Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Apr 8, 2021
@elasticmachine
Copy link
Contributor

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

@stratoula stratoula added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement and removed release_note:feature Makes this part of the condensed release notes labels Apr 8, 2021
@stratoula stratoula changed the title [Visualize] Support runtime fields editor [Visualize] Allows editing broken visualizations caused by runtime fields changes Apr 8, 2021
Copy link
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.

Just one comment of a change that we no need anymore. Other than that it seems fine to me.
@ppisljar do you want to also check it?

@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Apr 8, 2021
Copy link
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.

Kibana App code LGTM. I tested it locally and it works fine. I can now edit my broken visualizations and I see a warning icon on the aggregation that causes the problem.

I would like to display the error as in Lens for consistency but I think it is fine for now

@ppisljar
Copy link
Member

ppisljar commented Apr 8, 2021

is the error still visible on dashboard ? i think it should be. my reasoning would be that:

  • on dashboard we are rendering an embeddable ... something wen't wrong, let the user know
  • in visualize we are editing a visualization. if configuration is broken we should not even attempt to render as we know that it will fail. The current solution will hide specific errors, but it will actually try to render, so this probably has edge cases it doesn't cover (theoretically it could be something else in the configuration that's broken, not related to saved fields, not sure if it ever really happens).

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
visDefaultEditor 225.7KB 226.7KB +1004.0B
visualize 91.3KB 91.7KB +416.0B
total +1.4KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 783.8KB 784.5KB +756.0B
embeddable 179.0KB 179.0KB -65.0B
kibanaUtils 143.1KB 143.8KB +687.0B
visualizations 91.8KB 91.8KB +3.0B
visualize 26.7KB 27.0KB +238.0B
total +1.6KB

History

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

cc @VladLasitsa

@stratoula
Copy link
Contributor

Yes Peter the error is displayed as:

image

Copy link
Member

@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.

appservices code LGTM

@stratoula
Copy link
Contributor

@elasticmachine run elasticsearch-ci/docs

@stratoula stratoula merged commit e3f31ea into elastic:master Apr 8, 2021
VladLasitsa added a commit to VladLasitsa/kibana that referenced this pull request Apr 8, 2021
…elds changes (elastic#94798)

* Add possibility to open visualization when saved field doesn't exists anymore

* Fix tests

* Fix some remarks

* Remove unneeded code

* Fix tests

* Fix tests

* Fix some remarks

* Fixed problem with double error popover in visualizations

* Fix CI

* Fix type

* Fix API docs

* Don't show error popup for error related to runtime fields

* Fix some remarks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
stratoula pushed a commit to stratoula/kibana that referenced this pull request Apr 8, 2021
…elds changes (elastic#94798)

* Add possibility to open visualization when saved field doesn't exists anymore

* Fix tests

* Fix some remarks

* Remove unneeded code

* Fix tests

* Fix tests

* Fix some remarks

* Fixed problem with double error popover in visualizations

* Fix CI

* Fix type

* Fix API docs

* Don't show error popup for error related to runtime fields

* Fix some remarks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
stratoula added a commit that referenced this pull request Apr 8, 2021
…elds changes (#94798) (#96580)

* Add possibility to open visualization when saved field doesn't exists anymore

* Fix tests

* Fix some remarks

* Remove unneeded code

* Fix tests

* Fix tests

* Fix some remarks

* Fixed problem with double error popover in visualizations

* Fix CI

* Fix type

* Fix API docs

* Don't show error popup for error related to runtime fields

* Fix some remarks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Uladzislau Lasitsa <Uladzislau_Lasitsa@epam.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Embedding Embedding content via iFrame Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Visualize] Support runtime fields editor
8 participants