-
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
[8.0][RAC] 117686 replace alert workflow status in alerts view #118723
Merged
fkanout
merged 32 commits into
elastic:main
from
fkanout:117686-replace-alert-workflow-status-in-alerts-view
Nov 29, 2021
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
69091b4
Add AlertStatus types
fkanout 38f1829
Add alert status filter component
fkanout f4cb043
Remove Filter in action from the t grid table
fkanout 7880781
Update group buttons to applied Alert status filter instead of Workfl…
fkanout b17d8db
Keep the Alert status button in sync when typing and first page load
fkanout ec3be8c
Fix data test object name and translation keys label
fkanout 391945b
Add possibility to hide the bulk actions
fkanout 3918b8d
Update how hide the bulk actions
fkanout 2fb0b01
Fix showCheckboxes hardcoded "true". Instead use the leadingControlCo…
fkanout b4f8df4
Hide the leading checkboxes in the T Grid with the bulk actions
fkanout 80132a3
Update showCheckboxes to false
fkanout 9b8ef26
Merge branch 'main' into 117686-replace-alert-workflow-status-in-aler…
kibanamachine 67bf04d
Fix test as the leading checkboxes are hidden
fkanout 1b82d80
Update tests
fkanout edca181
Merge branch 'main' into 117686-replace-alert-workflow-status-in-aler…
fkanout 338da2d
Get back disabledCellActions as it's required by T Grid
fkanout b1562d6
Update tests to skip test related to Workflow action buttons
fkanout 3e6c8c6
Skip workflow tests
fkanout caab870
Merge branch 'main' into 117686-replace-alert-workflow-status-in-aler…
kibanamachine 3ae465d
Revert fix showCheckboxes
fkanout f79bcff
Merge branch 'main' into 117686-replace-alert-workflow-status-in-aler…
fkanout 762ba4d
Remove unused imports
fkanout 963b34e
Revert the o11y tests as the checkBoxes fix is reverted
fkanout 3ade606
Reactive the tests effected by checkBoxes
fkanout 1682878
Skip alert workflow status
fkanout 5b55600
Merge branch 'main' into 117686-replace-alert-workflow-status-in-aler…
kibanamachine 8c8f114
[Code review] use predefined types
fkanout 2a0774f
Remove unused prop
fkanout 6ebbb68
Use the alert-data index name in the RegEx
fkanout 029bbea
Detect * in KQL as "show al"l alert filter
fkanout 8ada6ae
Merge branch 'main' into 117686-replace-alert-workflow-status-in-aler…
kibanamachine 01caf34
Merge branch 'main' into 117686-replace-alert-workflow-status-in-aler…
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
x-pack/plugins/observability/public/pages/alerts/alerts_status_filter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiButtonGroup, EuiButtonGroupOptionProps } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React from 'react'; | ||
import { | ||
ALERT_STATUS_ACTIVE, | ||
ALERT_STATUS_RECOVERED, | ||
} from '@kbn/rule-data-utils/alerts_as_data_status'; | ||
import { ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names'; | ||
import { AlertStatusFilterButton } from '../../../common/typings'; | ||
import { AlertStatusFilter } from '../../../common/typings'; | ||
|
||
export interface AlertStatusFilterProps { | ||
status: AlertStatusFilterButton; | ||
onChange: (id: string, value: string) => void; | ||
} | ||
|
||
export const allAlerts: AlertStatusFilter = { | ||
status: '', | ||
query: '', | ||
label: i18n.translate('xpack.observability.alerts.alertStatusFilter.showAll', { | ||
defaultMessage: 'Show all', | ||
}), | ||
}; | ||
|
||
export const activeAlerts: AlertStatusFilter = { | ||
status: ALERT_STATUS_ACTIVE, | ||
query: `${ALERT_STATUS}: "${ALERT_STATUS_ACTIVE}"`, | ||
label: i18n.translate('xpack.observability.alerts.alertStatusFilter.active', { | ||
defaultMessage: 'Active', | ||
}), | ||
}; | ||
|
||
export const recoveredAlerts: AlertStatusFilter = { | ||
status: ALERT_STATUS_RECOVERED, | ||
query: `${ALERT_STATUS}: "${ALERT_STATUS_RECOVERED}"`, | ||
label: i18n.translate('xpack.observability.alerts.alertStatusFilter.recovered', { | ||
defaultMessage: 'Recovered', | ||
}), | ||
}; | ||
|
||
const options: EuiButtonGroupOptionProps[] = [ | ||
{ | ||
id: allAlerts.status, | ||
label: allAlerts.label, | ||
value: allAlerts.query, | ||
'data-test-subj': 'alert-status-filter-show-all-button', | ||
}, | ||
{ | ||
id: activeAlerts.status, | ||
label: activeAlerts.label, | ||
value: activeAlerts.query, | ||
'data-test-subj': 'alert-status-filter-active-button', | ||
}, | ||
{ | ||
id: recoveredAlerts.status, | ||
label: recoveredAlerts.label, | ||
value: recoveredAlerts.query, | ||
'data-test-subj': 'alert-status-filter-recovered-button', | ||
}, | ||
]; | ||
|
||
export function AlertsStatusFilter({ status, onChange }: AlertStatusFilterProps) { | ||
return ( | ||
<EuiButtonGroup | ||
legend="Filter by" | ||
color="primary" | ||
options={options} | ||
idSelected={status} | ||
onChange={onChange} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@fkanout We should delete
workflowStatus
from here. There are probably a few more places that workflowStatus might need to be deleted as well. This is not needed, since we are not filtering by workflowStatus anymore in the UI. That's why we still seeworkflowStatus:open
in the urlbar when we first load the page. This is not needed anymoreThere 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.
Same as here:
#118723 (comment)
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.
Removing
workflowStatus
It will blocked byTGridStandaloneCompProps
requiresfilterStatus
. Because the value offilterStatus
isworkflowStatus
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.
@fkanout filterStatus at the moment has value
workflowStatus
, but nothing prevents us by changing it back to alert status. This change was introduced as part of this PR #109817, so we could pair together to manually revert some workflows status leftover that is not neededLet's get this PR merged for now. I summarized later on in a comment what we discussed during our sync up.