-
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
Make alerts list sortable by name and status #93426
Conversation
const sortFieldMap: Record<string, string> = { | ||
name: 'name.keyword', | ||
}; | ||
|
||
export function mapSortField(field?: string): string | undefined { | ||
return field ? sortFieldMap[field] || field : undefined; | ||
} |
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.
To de-couple our mappings from HTTP API parameters, I decided to create this function, so people don't have to know they need to pass name.keyword
when they want to sort by name
. We still need text
mapping for free-text searching.
@@ -191,6 +196,7 @@ export type AlertUpdates = Omit<Alert, 'id' | 'executionStatus'>; | |||
export interface AlertTableItem extends Alert { | |||
alertType: AlertType['name']; | |||
tagsText: string; | |||
actionsCount: number; |
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.
To work with the EuiTableSortingType
interface, I had to add actionsCount
here. I also renamed it from actionsText
to avoid confusion because it contains a number
value.
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
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.
LGTM!
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @mikecote |
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.
LGTM, works as expected
* Initial commit * Update docs Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Fixes #60584.
This PR allows sorting the alerts list by
name
andstatus
.*PR done as a fix-it task I've assigned to myself.