-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RAC] Enable workflow status filtering (#108215)
Co-authored-by: Jason Rhodes <jason.matthew.rhodes@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
61a993b
commit 50f72f5
Showing
16 changed files
with
162 additions
and
156 deletions.
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
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
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
56 changes: 0 additions & 56 deletions
56
x-pack/plugins/observability/public/pages/alerts/status_filter.tsx
This file was deleted.
Oops, something went wrong.
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
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
55 changes: 55 additions & 0 deletions
55
x-pack/plugins/observability/public/pages/alerts/workflow_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,55 @@ | ||
/* | ||
* 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 type { AlertWorkflowStatus } from '../../../common/typings'; | ||
|
||
export interface WorkflowStatusFilterProps { | ||
status: AlertWorkflowStatus; | ||
onChange: (value: AlertWorkflowStatus) => void; | ||
} | ||
|
||
const options: Array<EuiButtonGroupOptionProps & { id: AlertWorkflowStatus }> = [ | ||
{ | ||
id: 'open', | ||
label: i18n.translate('xpack.observability.alerts.workflowStatusFilter.openButtonLabel', { | ||
defaultMessage: 'Open', | ||
}), | ||
'data-test-subj': 'WorkflowStatusFilter open button', | ||
}, | ||
{ | ||
id: 'acknowledged', | ||
label: i18n.translate( | ||
'xpack.observability.alerts.workflowStatusFilter.acknowledgedButtonLabel', | ||
{ | ||
defaultMessage: 'Acknowledged', | ||
} | ||
), | ||
'data-test-subj': 'WorkflowStatusFilter acknowledged button', | ||
}, | ||
{ | ||
id: 'closed', | ||
label: i18n.translate('xpack.observability.alerts.workflowStatusFilter.closedButtonLabel', { | ||
defaultMessage: 'Closed', | ||
}), | ||
'data-test-subj': 'WorkflowStatusFilter closed button', | ||
}, | ||
]; | ||
|
||
export function WorkflowStatusFilter({ status = 'open', onChange }: WorkflowStatusFilterProps) { | ||
return ( | ||
<EuiButtonGroup | ||
legend="Filter by" | ||
color="primary" | ||
options={options} | ||
idSelected={status} | ||
onChange={(id) => onChange(id as AlertWorkflowStatus)} | ||
/> | ||
); | ||
} |
Oops, something went wrong.