diff --git a/public/app/features/alerting/AlertRuleList.test.tsx b/public/app/features/alerting/AlertRuleList.test.tsx index 2d1cf653540..ce3b8d47142 100644 --- a/public/app/features/alerting/AlertRuleList.test.tsx +++ b/public/app/features/alerting/AlertRuleList.test.tsx @@ -18,6 +18,7 @@ const setup = (propOverrides?: object) => { togglePauseAlertRule: jest.fn(), stateFilter: '', search: '', + isLoading: false }; Object.assign(props, propOverrides); @@ -121,7 +122,7 @@ describe('Functions', () => { describe('State filter changed', () => { it('should update location', () => { const { instance } = setup(); - const mockEvent = { target: { value: 'alerting' } }; + const mockEvent = { target: { value: 'alerting' } } as React.ChangeEvent; instance.onStateFilterChanged(mockEvent); @@ -146,7 +147,7 @@ describe('Functions', () => { describe('Search query change', () => { it('should set search query', () => { const { instance } = setup(); - const mockEvent = { target: { value: 'dashboard' } }; + const mockEvent = { target: { value: 'dashboard' } } as React.ChangeEvent; instance.onSearchQueryChange(mockEvent); diff --git a/public/app/features/alerting/AlertRuleList.tsx b/public/app/features/alerting/AlertRuleList.tsx index f94134f3ee1..a6c770aad9b 100644 --- a/public/app/features/alerting/AlertRuleList.tsx +++ b/public/app/features/alerting/AlertRuleList.tsx @@ -1,7 +1,8 @@ import React, { PureComponent } from 'react'; import { hot } from 'react-hot-loader'; import { connect } from 'react-redux'; -import PageHeader from 'app/core/components/PageHeader/PageHeader'; +import Page from 'app/core/components/Page/Page'; +// import PageHeader from 'app/core/components/PageHeader/PageHeader'; import AlertRuleItem from './AlertRuleItem'; import appEvents from 'app/core/app_events'; import { updateLocation } from 'app/core/actions'; @@ -19,6 +20,7 @@ export interface Props { togglePauseAlertRule: typeof togglePauseAlertRule; stateFilter: string; search: string; + isLoading: boolean; } export class AlertRuleList extends PureComponent { @@ -54,9 +56,9 @@ export class AlertRuleList extends PureComponent { return 'all'; } - onStateFilterChanged = event => { + onStateFilterChanged = (evt: React.ChangeEvent) => { this.props.updateLocation({ - query: { state: event.target.value }, + query: { state: evt.target.value }, }); }; @@ -68,8 +70,8 @@ export class AlertRuleList extends PureComponent { }); }; - onSearchQueryChange = event => { - const { value } = event.target; + onSearchQueryChange = (evt: React.ChangeEvent) => { + const { value } = evt.target; this.props.setSearchQuery(value); }; @@ -77,7 +79,7 @@ export class AlertRuleList extends PureComponent { this.props.togglePauseAlertRule(rule.id, { paused: rule.state !== 'paused' }); }; - alertStateFilterOption = ({ text, value }) => { + alertStateFilterOption = ({ text, value }: { text: string; value: string; }) => { return (