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

Update alert type selection layout to rows instead of grid #73665

Merged
merged 31 commits into from
Nov 9, 2020

Conversation

mdefazio
Copy link
Contributor

@mdefazio mdefazio commented Jul 29, 2020

Summary

Changes the alert type selection screen to use rows with search bar and filter by solutions instead of the KeypadMenuItem for better scanning and alignment.

image

Resolves #67139

@mdefazio mdefazio added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Jul 29, 2020
@mdefazio mdefazio self-assigned this Jul 29, 2020
@mdefazio mdefazio marked this pull request as ready for review August 3, 2020 18:58
@mdefazio mdefazio requested a review from a team as a code owner August 3, 2020 18:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@mdefazio
Copy link
Contributor Author

mdefazio commented Aug 3, 2020

I have a placeholder for a short description on each one of these. If we don't think we can get those together, then perhaps we can just move towards using a combo box instead as the component. Though I do think eventually we will the descriptions regardless the component we use.

@YulNaumenko
Copy link
Contributor

YulNaumenko commented Aug 4, 2020

Code LGTM. But from the UX prospective I think it might be better to have a combobox with a search and maybe grouping by an AlertType producer.
As we discussed before, view with cards is looking pretty, but till we meet the big number of alert types. As an alternative it could be an endless scroll with the search, but I believe that combobox list with the search tool is the best solution.

Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

Wondering if it would make more sense to keep the EuiKeyPadMenuItem items and adjust height/alignment until we're able to move "alert type selection" to its own screen? I don't think this layout works well for the current flyout, lots of scrolling needed to find the type furthest down the list. If we do keep this new layout I agree that we need some sort of search functionality. How would using a combobox look?

@mdefazio
Copy link
Contributor Author

mdefazio commented Aug 5, 2020

Wondering if it would make more sense to keep the EuiKeyPadMenuItem items and adjust height/alignment until we're able to move "alert type selection" to its own screen? I don't think this layout works well for the current flyout, lots of scrolling needed to find the type furthest down the list. If we do keep this new layout I agree that we need some sort of search functionality. How would using a combobox look?

I think we should move toward getting the descriptions in there. I know the longer scrolling isn't ideal (perhaps we shrink the size/spacing a bit), and I'm all for having a search option as well. But I think the trade-off for having descriptions would be more helpful. The combobox would need a click to open it, so I think it would work well enough with the current layout that includes the name/tags/schedule above. I will try switching this so we can see how it works.

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

New ComboBox looks great and works as expected! 👍
I have a few changes suggestions in the code to simplify it a little. One console issue come up when I tested it locally: img
It might be related to the react state update of alertTypeModel and depending visibility of the ComboBox component. I've tested how it works without the condition for hiding it and error disappeared - I can help you to figure out the problem.

Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

image 1

  • Can we add a heading to the section? Alert trigger or Alert type perhaps? It would be replaced by the actual alert type name when it is selected.
  • I'd add a default value to the combobox or a placeholder
  • Why does the Actions section only show up once they've selected the alert type? Isn't that section common to all alert types? I think the Actions section should show up at all times, just like the first section.

@YulNaumenko YulNaumenko self-assigned this Nov 3, 2020
@ymao1
Copy link
Contributor

ymao1 commented Nov 4, 2020

It's looking great! A few questions (with a screenshot for reference)
Screen Shot 2020-11-04 at 2 30 50 PM

  • The alert types are alphabetized by solution name (which I like) but the Filter by solutions dropdown is not. Can we alphabetized the dropdown?

  • The Filter by solutions dropdown contains solutions that don't have associated alerts (in the screenshot above, Security, Stack Monitoring and APM and User Experience will filter the list down to 0). Maybe this is because I don't have the right configs that I don't have alert types for these solutions? But would it make sense to have the solutions dropdown only contain solutions that have alert types?

  • In the Option links to styles and js #1 mockup from the above comment: Update alert type selection layout to rows instead of grid #73665 (comment), the both the name of the solution group and the name of the alert are left-aligned, but in the PR, the alert types are indented. Maybe you've already had this discussion, but I think the left-aligned look is better for scanning.

  • Not sure why but my second Uptime alert type (bottom of the screenshot) shows the alert id (xpack.uptime.alerts.monitorStatus) instead of the alert name

@YulNaumenko
Copy link
Contributor

It's looking great! A few questions (with a screenshot for reference)

  • The alert types are alphabetized by solution name (which I like) but the Filter by solutions dropdown is not. Can we alphabetized the dropdown?
  • The Filter by solutions dropdown contains solutions that don't have associated alerts (in the screenshot above, Security, Stack Monitoring and APM and User Experience will filter the list down to 0). Maybe this is because I don't have the right configs that I don't have alert types for these solutions? But would it make sense to have the solutions dropdown only contain solutions that have alert types?
  • In the Option links to styles and js #1 mockup from the above comment: #73665 (comment), the both the name of the solution group and the name of the alert are left-aligned, but in the PR, the alert types are indented. Maybe you've already had this discussion, but I think the left-aligned look is better for scanning.
  • Not sure why but my second Uptime alert type (bottom of the screenshot) shows the alert id (xpack.uptime.alerts.monitorStatus) instead of the alert name

Thank you for a feedback!

  • The alert types are alphabetized by solution name (which I like) but the Filter by solutions dropdown is not. Can we alphabetized the dropdown?

I will fix the sorting, good catch!

  • The Filter by solutions dropdown contains solutions that don't have associated alerts (in the screenshot above, Security, Stack Monitoring and APM and User Experience will filter the list down to 0). Maybe this is because I don't have the right configs that I don't have alert types for these solutions? But would it make sense to have the solutions dropdown only contain solutions that have alert types?

Basically this solutions has alerts, but those are not registered in the alerting UI. So I agree, that it doesn't make any sense to have a filter by non visible alerting producers

  • In the Option links to styles and js #1 mockup from the above comment: #73665 (comment), the both the name of the solution group and the name of the alert are left-aligned, but in the PR, the alert types are indented. Maybe you've already had this discussion, but I think the left-aligned look is better for scanning.

I will rely on @mdefazio to fix the UI alignments - he already has something not pushed yet.

  • Not sure why but my second Uptime alert type (bottom of the screenshot) shows the alert id (xpack.uptime.alerts.monitorStatus) instead of the alert name

Yeah, it is because they use JSX element instead of text, but agree that I need to handle this as well

@mdefazio mdefazio requested a review from a team as a code owner November 4, 2020 20:56
@mdefazio mdefazio dismissed andreadelrio’s stale review November 5, 2020 01:36

The original plan and implementation has changed quite a bit.

…pdates

# Conflicts:
#	x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
@YulNaumenko
Copy link
Contributor

It's looking great! A few questions (with a screenshot for reference)

  • The alert types are alphabetized by solution name (which I like) but the Filter by solutions dropdown is not. Can we alphabetized the dropdown?
  • The Filter by solutions dropdown contains solutions that don't have associated alerts (in the screenshot above, Security, Stack Monitoring and APM and User Experience will filter the list down to 0). Maybe this is because I don't have the right configs that I don't have alert types for these solutions? But would it make sense to have the solutions dropdown only contain solutions that have alert types?
  • In the Option links to styles and js #1 mockup from the above comment: #73665 (comment), the both the name of the solution group and the name of the alert are left-aligned, but in the PR, the alert types are indented. Maybe you've already had this discussion, but I think the left-aligned look is better for scanning.
  • Not sure why but my second Uptime alert type (bottom of the screenshot) shows the alert id (xpack.uptime.alerts.monitorStatus) instead of the alert name

@ymao1 I've addressed changes that you mentioned here, ready for review 👍

return result;
},
[]
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be simpler here to reduce availableAlertTypesResult instead of alertTypesResult since that is already filtered down to the available?

const solutionsResult2 = availableAlertTypesResult.reduce(
    (result: Array<{ id: string; title: string }>, alertTypeItem) => {
        if (!result.find((solution) => solution.id === alertTypeItem.alertType.producer)) {
            result.push({
                id: alertTypeItem.alertType.producer,
                title:
                    (kibanaFeatures
                        ? getProducerFeatureName(alertTypeItem.alertType.producer, kibanaFeatures)
                        : capitalize(alertTypeItem.alertType.producer)) ?? capitalize(alertTypeItem.alertType.producer),
            });
        }
        return result;
    },
    []
);

@ymao1
Copy link
Contributor

ymao1 commented Nov 6, 2020

One more alphabetization nit:

Screen Shot 2020-11-06 at 8 05 45 AM

It looks like the dropdown is alphabetized by producer name and the list is alphabetized by producer id. In this case, the producer Metrics has the id infrastructure which causes it to show up above Logs in the list and below Logs in the dropdown.

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Hey, @mdefazio. This is looking great and it works as advertised. I did leave a handful of comments that I would consider low priority nitpicks, but have a look and let me know your thoughts.

iconType="arrowDown"
hasActiveFilters={selectedValues.length > 0}
numActiveFilters={selectedValues.length}
numFilters={selectedValues.length}
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than showing the number of actively selected filters, I believe the correct pattern for prop numFilters is to instead show the total number of available filters. For example, with no filters active, the EuiFilterButton should show the total number of filters available to choose from.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have this behavior the same across Alerting Plugin - filters on Alerts list. So maybe should address this as a separate issue and do the same change for all filters. Is it OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. Let me know if you'd like me to make the issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MichaelMarcialis, please open the issue. Thank you!

@YulNaumenko YulNaumenko requested a review from ymao1 November 6, 2020 21:44
Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

Looks great!

…pdates

# Conflicts:
#	x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Thanks for acknowledging my little nitpicks. Approving.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id before after diff
triggersActionsUi 287 297 +10

async chunks size

id before after diff
triggersActionsUi 1.5MB 1.5MB +12.7KB

distributable file count

id before after diff
default 42766 42767 +1

History

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

@YulNaumenko YulNaumenko merged commit 2c05957 into elastic:master Nov 9, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 10, 2020
* master: (39 commits)
  Fix ilm navigation (elastic#81664)
  [Lens] Distinct icons for XY and pie chart value labels toolbar (elastic#82927)
  [data.search.aggs] Throw an error when trying to create an agg type that doesn't exist. (elastic#81509)
  Index patterns api - load field list on server (elastic#82629)
  New events resolver (elastic#82170)
  [App Search] Misc naming tech debt (elastic#82770)
  load empty_kibana in test to have clean starting point (elastic#82772)
  Remove data <--> expressions circular dependencies. (elastic#82685)
  Update 8.0 breaking change template to gather information on how to programmatically detect it. (elastic#82905)
  Add alerting as codeowners to related documentation folder (elastic#82777)
  Add captions to user and space grid pages (elastic#82713)
  add alternate path for x-pack/Cloud test for Lens (elastic#82634)
  Uses asCurrentUser in getClusterUuid (elastic#82908)
  [Alerting][Connectors] Add new executor subaction to get 3rd party case fields (elastic#82519)
  Fix test import objects (elastic#82767)
  [ML] Add option for anomaly charts for metric detector should plot min, mean or max as appropriate (elastic#81662)
  Update alert type selection layout to rows instead of grid (elastic#73665)
  Prevent Kerberos and PKI providers from initiating a new session for unauthenticated XHR/API requests. (elastic#82817)
  Update grunt and related packages (elastic#79327)
  Allow the repository to search across all namespaces (elastic#82863)
  ...
@mikecote mikecote added release_note:enhancement and removed release_note:skip Skip the PR/issue when compiling release notes labels Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting release_note:enhancement Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert flyout icons within "Select a trigger type" are not vertically aligned
9 participants