-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
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. |
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 |
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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?
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. |
There was a problem hiding this 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:
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.
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
It's looking great! A few questions (with a screenshot for reference)
|
Thank you for a feedback!
I will fix the sorting, good catch!
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
I will rely on @mdefazio to fix the UI alignments - he already has something not pushed yet.
Yeah, it is because they use JSX element instead of text, but agree that I need to handle this as well |
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
@ymao1 I've addressed changes that you mentioned here, ready for review 👍 |
return result; | ||
}, | ||
[] | ||
); |
There was a problem hiding this comment.
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;
},
[]
);
There was a problem hiding this 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.
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/solution_filter.tsx
Outdated
Show resolved
Hide resolved
iconType="arrowDown" | ||
hasActiveFilters={selectedValues.length > 0} | ||
numActiveFilters={selectedValues.length} | ||
numFilters={selectedValues.length} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx
Outdated
Show resolved
Hide resolved
…into alerting-design-updates
There was a problem hiding this 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
There was a problem hiding this 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.
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
distributable file count
History
To update your PR or re-run it, just comment with: |
* 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) ...
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.Resolves #67139