Skip to content

Commit

Permalink
update hardcoded alert status field
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota committed Aug 23, 2021
1 parent 9142be5 commit a8ccfae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion x-pack/plugins/observability/public/pages/alerts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import React, { useCallback, useRef } from 'react';
import { useHistory } from 'react-router-dom';
import useAsync from 'react-use/lib/useAsync';
import { IndexPatternBase } from '@kbn/es-query';
import { ALERT_STATUS as ALERT_STATUS_TYPED } from '@kbn/rule-data-utils';
import {
ALERT_STATUS as ALERT_STATUS_NON_TYPED,
// @ts-expect-error importing from a place other than root because we want to limit what we import from this package
} from '@kbn/rule-data-utils/target_node/technical_field_names';
import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils';
import { ParsedTechnicalFields } from '../../../../rule_registry/common/parse_technical_fields';
import type { AlertWorkflowStatus } from '../../../common/typings';
Expand All @@ -25,6 +30,8 @@ import { AlertsTableTGrid } from './alerts_table_t_grid';
import { WorkflowStatusFilter } from './workflow_status_filter';
import './styles.scss';

const ALERT_STATUS: typeof ALERT_STATUS_TYPED = ALERT_STATUS_NON_TYPED;

export interface TopAlert {
fields: ParsedTechnicalFields;
start: number;
Expand All @@ -46,7 +53,7 @@ export function AlertsPage({ routeParams }: AlertsPageProps) {
query: {
rangeFrom = 'now-15m',
rangeTo = 'now',
kuery = `kibana.alert.status: "${ALERT_STATUS_ACTIVE}"`,
kuery = `${ALERT_STATUS}: "${ALERT_STATUS_ACTIVE}"`,
workflowStatus = 'open',
},
} = routeParams;
Expand Down

0 comments on commit a8ccfae

Please sign in to comment.