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

add error callout on watch details page #36139

Merged

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented May 6, 2019

Changes in this PR include:

  • update tables to use pagination constant
  • add error callout on watch detail page when any of the actions contain errors.
  • fixed some missing validation checks with jira action type

Note: I switched to the callout instead of a modal, since EUI docs seem to discourage using a modal for this type of usage. Let me know if you have any feedback regarding this.

Testing:

  1. Go to the dev console and create a watch with an invalid action.

For example, this watch adds an email watch without the to property (Email action attributes).

PUT _xpack/watcher/watch/my_test_watch
{
  "trigger": {
    "schedule": {
      "interval": "1h"
    }
  },
  "input": {
    "simple": {}
  },
  "actions": {
    "my_email_action": {
      "email": {
      }
    }
  }
}
  1. Go back to the watch list table and select the newly created watch.

Screenshots:

w/ changes:

Screen Shot 2019-05-06 at 4 08 00 PM

old UI (for reference):
Screen Shot 2019-05-06 at 4 12 04 PM

Screen Shot 2019-05-06 at 4 12 09 PM

@alisonelizabeth alisonelizabeth added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more Feature:Watcher non-issue Indicates to automation that a pull request should not appear in the release notes labels May 6, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Code looks great, tested locally and had a few UX suggestions.

});
}

if (json.jira.fields.project && !json.jira.fields.project.key) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can imagine a user getting frustrated if they fix json.jira.fields only to be yelled at for not having json.jira.fields.project, and then fix json.jira.fields.project only to be yelled at for not having json.jira.fields.project.key. I think it might be a better UX if we just check for get(json, 'actionJson.jira.fields.project.key') and then tell them they need json.jira.fields.project.key. WDYT?

This comment applies to the issuetype validation below, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point :) Fixed!

@@ -134,6 +133,34 @@ const WatchDetailUi = ({ watchId }: { watchId: string }) => {

<EuiSpacer size="s" />

{actionErrors && (
<EuiCallOut
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice call! I think this is a big improvement over the modal. Is it possible for there to be a lot of actions, and they could all have errors? In this case, the callout would become very tall, and it would be difficult to correlate an error in the callout with a row in the actions table.

If you agree, then I think a more usable solution would be to make each "Config error" status a link which, when clicked, opens a flyout containing a danger callout like this one, except it only contains the errors for that specific action.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I thought of that as well. That's a good point.

Latest changes:

Screen Shot 2019-05-06 at 10 40 49 PM

Screen Shot 2019-05-06 at 10 40 58 PM

>
{Object.keys(actionErrors).map((action: string) => (
<Fragment key={action}>
<EuiText size="xs">
Copy link
Contributor

@cjcenizal cjcenizal May 6, 2019

Choose a reason for hiding this comment

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

If we go with the flyout solution, we can put this content in the title of the callout.

image

You could even add logic to wrap the error message in a <p> if there's only one error, or to use a list if there's more than one. This would avoid the strange appearance of a single bullet.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Tested locally, code LGTM

@alisonelizabeth alisonelizabeth merged commit 4598964 into elastic:watcher-port May 8, 2019
@alisonelizabeth alisonelizabeth deleted the watch-config-error branch May 8, 2019 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Watcher non-issue Indicates to automation that a pull request should not appear in the release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants