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

EUIfy Watcher #35301

Merged
merged 81 commits into from
Jun 29, 2019
Merged

EUIfy Watcher #35301

merged 81 commits into from
Jun 29, 2019

Conversation

cjcenizal
Copy link
Contributor

@cjcenizal cjcenizal commented Apr 18, 2019

Release notes

This feature improves the overall UI/UX of Watcher and better aligns it with the rest of the Kibana management apps.

The simulate watch functionality was redesigned, providing additional help context to form fields as well as improving the usability of the triggered and scheduled time fields. The threshold alert supports 4 new action types: index, webhook, Jira and PagerDuty. This is in addition to email, Slack and logging. Also, new comparators were added to the threshold alert, including is above or equals, is below or equals and is in between. A user can also view details of system-level watches, which previously was not possible.

In addition, several bugs were resolved. A user can now create an advanced watch with an ID that begins with a number. The overall experience of attempting to access Watcher with an invalid license was improved. Watcher UI works properly on Safari. Watcher no longer displays a 404 in the browser console when a new watch is created.

Bugs fixed

Screenshots

Before

Watch list

image

Delete confirmation modal:

image

Create threshold watch

image

Expression validation:

image

Actions list:

image

Action validation:

image

Create advanced watch

Edit tab:

image

Note: Doc link is broken.

Simulate tab:

image

Simulation results tab:

image

Watch details

image

Watch history detail:

image

After

Watch list Screen Shot 2019-06-20 at 1 04 31 PM

No watches:
Screen Shot 2019-06-20 at 1 11 31 PM

Delete confirmation modal:

Screen Shot 2019-06-20 at 1 04 55 PM
Create threshold watch Screen Shot 2019-06-20 at 1 06 05 PM

Expression validation:
Screen Shot 2019-06-20 at 1 23 58 PM

Actions dropdown:

Screen Shot 2019-06-20 at 1 06 11 PM

Email action:
Screen Shot 2019-06-20 at 1 06 23 PM

Logging action:
Screen Shot 2019-06-20 at 1 06 34 PM

Slack action:
Screen Shot 2019-06-20 at 1 06 45 PM

Index action:
Screen Shot 2019-06-20 at 1 07 14 PM

Webhook action:
Screen Shot 2019-06-20 at 1 06 58 PM

PagerDuty action:
Screen Shot 2019-06-20 at 1 07 23 PM

Jira action:
Screen Shot 2019-06-20 at 1 07 34 PM

Action validation example:
Screen Shot 2019-06-20 at 1 24 32 PM

Create advanced watch Screen Shot 2019-06-20 at 1 07 58 PM

Simulate:

Screen Shot 2019-06-20 at 1 08 14 PM

Simulation results:

Screen Shot 2019-06-20 at 1 08 35 PM
Watch details

Execution history:
Screen Shot 2019-06-20 at 1 08 58 PM

Action statuses:
Screen Shot 2019-06-20 at 1 09 18 PM

Execution history detail:

Screen Shot 2019-06-20 at 1 10 46 PM

bmcconaghy and others added 7 commits March 7, 2019 12:01
* replacing Angular watch list UI with React one

* fixing TS issues

* addressing PR feedback

* fixing TS issues

* more TS fixes

* TS fix

* addressing more PR feedback

* TS fixes

* removing unused/incompatible translations

* fixing functional test

* prettier fix

* fixing typp

* fixing missing comma

* fixing data-test-subject typo

* fixing functional test

* fixing functional tests

* fixing delete functional tests

* addressing PR feedback
* replacing Angular watch list UI with React one

* fixing TS issues

* addressing PR feedback

* fixing TS issues

* more TS fixes

* TS fix

* addressing more PR feedback

* TS fixes

* removing unused/incompatible translations

* fixing functional test

* prettier fix

* fixing typp

* fixing missing comma

* fixing data-test-subject typo

* fixing functional test

* fixing functional tests

* fixing delete functional tests

* addressing PR feedback

* progress on watch edit

* port advanced watcher to react (#34188)

* port advanced watcher to react

* fix i18n

* update execute trigger override text fields to number input and select fields

* fix page title for edit mode

* remove todo comments

* add license validity check; pass kbnUrl service as prop

* address review comments
* partial progress on threshold watch form including validation

* fixing tsc issues

* cleaning up some PR feedback
Get watch detail page ported to react.
)

* adding validation and UI feedback for threshold watch expression

* fixing tsc issues

* fixing inconsistent messages

* fixing some i18n labels

* addressing PR feedback

* fixing unused translations issue

* addressing PR feedback
* remove use of lodash map; persist state when toggling tabs

* text improvements

* add validation for watch action types

* fix actions table on simulation results flyout when in edit mode

* additional text improvements

* rework form validation

* update text based on feedback and fix ts errors

* fix i18n

* address pr feedback

* address pr feedback; i18n fix
@cjcenizal cjcenizal added Feature:Watcher v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.2.0 labels Apr 18, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

* turning it all into one React app

* removing dependency on kbnUrl

* fixing import

* fixing tsc issues

* fixing eslint issues

* fixing typo

* fixing import

* removing unused translations

* removing more missing translations

* removing unused style sheets

* deleting scss file

* fixing test

* fixing tests for reals

* test fix

* fix test

* fixing another test
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor Author

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

I've reviewed the deleted translations and traced them back to where they were used in the original UI. In most cases I think these deletions are legitimate. I found a couple possible exceptions and also found some other things we can dig into.

Forbidden state

We should make sure we're handling 403 Forbidden errors correctly, and notifying the user that they don't have sufficient permissions. Examples of how this was done in the original code:

//The initial load from watch_list_route will return null on a 403 error
if (this.watches === null) {
  this.watches = [];
  this.forbidden = true;
}
<forbidden-message ng-if="watchList.forbidden">
  {{ 'xpack.watcher.sections.watchList.noPermissionToManageWatchesText' | i18n: { defaultMessage: 'You do not have permission to manage watches.' } }}
</forbidden-message>

Action status table

We should check that the action status table contains these UI bits:

  • An "Acknowledge" button
  • It reports the number of errors
  • It has a "Show errors" modal

Table and chart states

We should make sure that all tables (watch history, watch list, etc) have both loading and empty states.

The chart should also have an empty state ("Your index and condition did not return any data", when !thresholdPreviewChart.isDataExists).

Validation and confirmation

I found a couple validation messages that I'd like to check:

  • ID validation ("ID must begin with a letter or underscore and contain only letters, underscores, dashes, and numbers.")
  • Invalid JSON error message
  • Validate Slack action ('This watch has a Slack action without a "to" property. This watch will only be valid if you specified the "to" property in the Slack "message_default" setting in Elasticsearch.')
  • Validate index pattern missing time field ("Your index query does not have an associated time field")

We also need to present a confirmation modal for overwriting a watch with an existing ID.

Form accessibility

I noticed a few aria labels removed from the translation file, and when I did a quick VoiceOver test with the original threshold form I noticed that labels and form inputs were correctly associated and read aloud. I tested the new form and it didn't sound like they were being read aloud correctly. We should do a deeper audit and see if we can make these forms more screen-reader-accessible.

image

image

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@alisonelizabeth
Copy link
Contributor

@cjcenizal thanks again for putting this together! I had a few comments based on your findings.

Note: The font of the firing state is affected by the flyout title. Consider moving it into the body, or below the title.

Good find! I also wanted to update this to leverage the watch_action_status.tsx component paul created.

Also, the ID column gets a bit cramped. We can customize the width of the state, last fired, and last triggered column sto give the ID column some more space.

So if you create an advanced watch, there is no name field. If you wanted to add it, you would have to specify it in the json as metadata. See: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/watcher-api-put-watch.html#_request_body_51

In most of the examples that I could find, the watch_id is a readable identifier, synonymous to what the name is used for in the threshold watch. I guess what I’m getting at here is, I wonder if it makes sense to remove the name field in the threshold watch, and let the user create their own id rather than generating a random one. This might also help alleviate the cramped columns.

  • ID validation ("ID must begin with a letter or underscore and contain only letters, underscores, dashes, and numbers.")

This should working. However, the logic was adjusted slightly based on this issue:
#18296

Screen Shot 2019-04-22 at 8 30 23 AM

  • Invalid JSON error message

This should also be working as expected, but please let me know if you run into any issues.

Screen Shot 2019-04-22 at 8 18 48 AM

  • Validate Slack action ('This watch has a Slack action without a "to" property. This watch will only be valid if you specified the "to" property in the Slack "message_default" setting in Elasticsearch.')

I worked with Gail on this and she came up with some alternative text to what existed previously.

Screen Shot 2019-04-22 at 8 18 20 AM

We also need to present a confirmation modal for overwriting a watch with an existing ID.

This was implemented.

Screen Shot 2019-04-22 at 8 04 49 AM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@cjcenizal
Copy link
Contributor Author

Thank you for that info @alisonelizabeth!

* adding watch visualization

* fixing tsc errors

* rendering multiple lines when a terms agg is used

* responding to PR feedback

* fixing React warning

* adding missing var
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

…rumbs (#35444)

* Add useRequest custom hook and convert WatchList, WatchHistory, and WatchDetail to consume it.
* Internationalize de/activate button and timespan select in WatchList.
* Add getPageErrorCode, PageError, and PageErrorNotExist, and use these to surface 403 and 404 errors.
* Fix breadcrumbs.
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

* Remove unnecessary itemId prop and highlight JSON as json.
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@cuff-links
Copy link
Contributor

retest

@alisonelizabeth
Copy link
Contributor

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@alisonelizabeth
Copy link
Contributor

@cjcenizal reverting the revert :) due to failing tests

also, on second thought, do you think it's necessary to edit the PR's backport? The only use of the xpack:defaultAdminEmail setting in watcher was providing it as the default "to email address" when adding an email action to a threshold alert. If it's already deprecated, I wonder if it makes sense to keep it for 7.3. Thoughts?

@cjcenizal
Copy link
Contributor Author

also, on second thought, do you think it's necessary to edit the PR's backport? The only use of the xpack:defaultAdminEmail setting in watcher was providing it as the default "to email address" when adding an email action to a threshold alert. If it's already deprecated, I wonder if it makes sense to keep it for 7.3. Thoughts?

@alisonelizabeth I think it's best to play it safe and edit the PR's backport so that it's still used as the default. To explain my line of thought, I can imagine an admin who has set this value, and has given users of the system instructions that when creating watches they should "just use the default email". They upgrade and suddenly their business process is thrown out of whack because Kibana's behavior has deviated from what they expected and depended upon. The change itself would be unexpected too because it occurs in a minor, so we'd have the perfect formula of breaking change + surprise = negative UX.

@alisonelizabeth
Copy link
Contributor

@cjcenizal makes sense, thanks for the explanation!

@elasticmachine
Copy link
Contributor

💔 Build Failed

@alisonelizabeth
Copy link
Contributor

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@cjcenizal
Copy link
Contributor Author

Retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@alisonelizabeth alisonelizabeth merged commit c2a14e7 into master Jun 29, 2019
@alisonelizabeth alisonelizabeth deleted the watcher-port branch June 29, 2019 11:06
alisonelizabeth pushed a commit that referenced this pull request Jun 29, 2019
alisonelizabeth added a commit that referenced this pull request Jun 29, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

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