Alerting: miscllaneous UI fixes & improvements (#33734)

This commit is contained in:
Domas
2021-05-06 11:21:58 +03:00
committed by GitHub
parent d994d0e762
commit d2d13ea39a
27 changed files with 217 additions and 157 deletions

View File

@@ -1,16 +1,16 @@
import { SelectableValue } from '@grafana/data';
import { Select } from '@grafana/ui';
import { SelectBaseProps } from '@grafana/ui/src/components/Select/types';
import { GrafanaAlertState } from 'app/types/unified-alerting-dto';
import { GrafanaAlertStateDecision } from 'app/types/unified-alerting-dto';
import React, { FC } from 'react';
type Props = Omit<SelectBaseProps<GrafanaAlertState>, 'options'>;
type Props = Omit<SelectBaseProps<GrafanaAlertStateDecision>, 'options'>;
const options: SelectableValue[] = [
{ value: GrafanaAlertState.Alerting, label: 'Alerting' },
{ value: GrafanaAlertState.NoData, label: 'No Data' },
{ value: GrafanaAlertState.KeepLastState, label: 'Keep Last State' },
{ value: GrafanaAlertState.OK, label: 'OK' },
{ value: GrafanaAlertStateDecision.Alerting, label: 'Alerting' },
{ value: GrafanaAlertStateDecision.NoData, label: 'No Data' },
{ value: GrafanaAlertStateDecision.KeepLastState, label: 'Keep Last State' },
{ value: GrafanaAlertStateDecision.OK, label: 'OK' },
];
export const GrafanaAlertStatePicker: FC<Props> = (props) => <Select options={options} {...props} />;