Skip to content

removing check for vis type on saved visualizations - #14093

Merged
ppisljar merged 2 commits into
elastic:masterfrom
ppisljar:enh/savedVisTypeCheck
Oct 2, 2017
Merged

ppisljar merged 2 commits into
elastic:masterfrom
ppisljar:enh/savedVisTypeCheck

Conversation

@ppisljar

Copy link
Copy Markdown
Contributor

Resolves #14028

@ppisljar ppisljar added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) review labels Sep 21, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm worried that we are hiding an invalid state from the user, with no error message and hiding the bad visualizations. There is no way to view their contents, to change the type, or to delete them.

What if we kept the notify.error, maybe changing it something like:

      if (!typeName) {
        notify.error(`Visualization ${source.title} is missing type. Please add a type, or delete this visualization.`, source);
      } else {
        notify.error(`Visualization ${source.title} with type of "${typeName}" is invalid. Please change to a valid type or delete the visualization.`, source);
      }

Then we return source instead of null (and skip the filtering on null)? Then you'll get the error message, but you can still delete the invalid visualizations, or ignore the error for the time being (instead of the previous redirect which forced you to handle the error before doing anything else).

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.

wouldn't that generate 100s of errors (in case you have 100 invalid visualizations?)
also the notification would keep coming back everytime you went to visualize ( i am guessing here ).

however you are right, they should not just disappear

rethinking the behaviour (let me know if you agree):

  • on existing dashboards the panel should show the error, like "invalid visualization type"
  • on creating new dashboards, visualization should not show in the list of visualizations
  • on visualize page, should the visualization be visible ? probably yes, but somehow indicated that its broken at the moment? or maybe we should completely hide it here as well ?
  • opening a visualization should redirect back to visualize home page (as we cant open it)
  • visualization should be visible under saved object , where it can be edited/deleted

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.

on visualize page, should the visualization be visible ? probably yes, but somehow indicated that its broken at the moment? or maybe we should completely hide it here as well ?

fwiw, I have slight preference for hiding.

Def in agreement with your other recommendations.

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.

Thinking about it more i agree we should hide it on visualizations page. This is a page that every user hits, it would probably be confusing for some to see visualizations they can't open.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I defer to you both. If people become confused we can always reconsider. Probably not something that many people will run into anyway.

@ppisljar
ppisljar force-pushed the enh/savedVisTypeCheck branch from 342e7cb to c288b76 Compare September 27, 2017 13:17
@ppisljar

Copy link
Copy Markdown
Contributor Author

ok, updated ...

in addition to points above:

  • when on dashboard in edit mode you click to edit a visualization with unknown type it redirects to visualize home page and gives you an error.

@stacey-gammon

Copy link
Copy Markdown

@ppisljar re: "on existing dashboards the panel should show the error, like "invalid visualization type""

What is the behavior prior to this PR? I thought this was handled naturally, and that I broke it with my react-grid-layout PR, but when I have a bad type in 6.0, I see just a blank space with no error:

screen shot 2017-09-27 at 3 37 01 pm

Not sure how pre 6.0 handled it, just want to make sure it isn't a 6.0 bug.

@thomasneirynck thomasneirynck left a comment

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 believe this is consistent with pre 6.0 behaviour. just an error to the console, and removed from dashboard.

@ppisljar

Copy link
Copy Markdown
Contributor Author

before it would actually show the error:

screenshot-localhost-5601 2017-09-28 07-59-55-718

however that behaviour was not introduced with my PR .... rebasing

@ppisljar
ppisljar force-pushed the enh/savedVisTypeCheck branch from c288b76 to 788c190 Compare September 28, 2017 06:01
@stacey-gammon

stacey-gammon commented Sep 28, 2017 •

Copy link
Copy Markdown

@thomasneirynck - it's actually a little different than pre 6.0 behavior, though given that this is unlikely to happen, I'm not that concerned about how it works in 6.0. You're right, it works the same, i just didn't notice the panel still existed in 5.6 (just essentially hidden in view mode).

For master and 6.1 I have a fix out here: #14206

if (!(err instanceof SavedObjectNotFound)) throw err;
const savedObjectNotFound = err instanceof SavedObjectNotFound;
const unknownVisType = err.message.indexOf('Invalid type') === 0;
if (unknownVisType) err.savedObjectType = 'visualization';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

minor nit - adding { }'s would make this a bit easier to read.

@ppisljar
ppisljar merged commit 3721a43 into elastic:master Oct 2, 2017
ppisljar added a commit to ppisljar/kibana that referenced this pull request Oct 2, 2017
* removing check for vis type on saved visualizations

* updating based on review
ppisljar added a commit to ppisljar/kibana that referenced this pull request Oct 2, 2017
* removing check for vis type on saved visualizations

* updating based on review
ppisljar added a commit that referenced this pull request Oct 2, 2017
* removing check for vis type on saved visualizations

* updating based on review
ppisljar added a commit that referenced this pull request Oct 2, 2017
* removing check for vis type on saved visualizations

* updating based on review
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
* removing check for vis type on saved visualizations

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

Labels

Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v6.0.0 v6.1.0 v7.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants