Skip to content

Commit

Permalink
Sort action type filters in alerts list and hide case action type (#8…
Browse files Browse the repository at this point in the history
…6360)

* Hide case action type from alert list action type filter

* Apply a sort as well
  • Loading branch information
mikecote authored Dec 18, 2020
1 parent ddea10e commit ca24e11
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { hasAllPrivilege } from '../../../lib/capabilities';
import { alertsStatusesTranslationsMapping } from '../translations';
import { useKibana } from '../../../../common/lib/kibana';
import { checkAlertTypeEnabled } from '../../../lib/check_alert_type_enabled';
import { DEFAULT_HIDDEN_ACTION_TYPES } from '../../../../common/constants';
import './alerts_list.scss';

const ENTER_KEY = 13;
Expand Down Expand Up @@ -155,7 +156,15 @@ export const AlertsList: React.FunctionComponent = () => {
(async () => {
try {
const result = await loadActionTypes({ http });
setActionTypes(result.filter((actionType) => actionTypeRegistry.has(actionType.id)));
setActionTypes(
result
.filter(
// TODO: Remove "DEFAULT_HIDDEN_ACTION_TYPES" when cases connector is available across Kibana.
// Issue: https://github.com/elastic/kibana/issues/82502.
({ id }) => actionTypeRegistry.has(id) && !DEFAULT_HIDDEN_ACTION_TYPES.includes(id)
)
.sort((a, b) => a.name.localeCompare(b.name))
);
} catch (e) {
toasts.addDanger({
title: i18n.translate(
Expand Down

0 comments on commit ca24e11

Please sign in to comment.