[Alerting] Renaming AlertType to RuleType and updating Alerting Task Runner (#120661)

* Renaming AlertType to RuleType and updating Alerting Task Runner

* Fixing types

* Fixing types

* holy cannoli

* Fixing types

* Fixing types and tests

* Fixing types and tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
ymao1 2021-12-09 09:21:38 -05:00 committed by GitHub
parent f14540ff63
commit 7c27163d6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 1163 additions and 1202 deletions

View file

@ -24,7 +24,7 @@ import { isEmpty } from 'lodash';
import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants';
import {
Alert,
AlertTaskState,
RuleTaskState,
LEGACY_BASE_ALERT_API_PATH,
} from '../../../../plugins/alerting/common';
@ -34,7 +34,7 @@ type Props = RouteComponentProps & {
};
export const ViewAlertPage = withRouter(({ http, id }: Props) => {
const [alert, setAlert] = useState<Alert | null>(null);
const [alertState, setAlertState] = useState<AlertTaskState | null>(null);
const [alertState, setAlertState] = useState<RuleTaskState | null>(null);
useEffect(() => {
if (!alert) {
@ -42,7 +42,7 @@ export const ViewAlertPage = withRouter(({ http, id }: Props) => {
}
if (!alertState) {
http
.get<AlertTaskState | null>(`${LEGACY_BASE_ALERT_API_PATH}/alert/${id}/state`)
.get<RuleTaskState | null>(`${LEGACY_BASE_ALERT_API_PATH}/alert/${id}/state`)
.then(setAlertState);
}
}, [alert, alertState, http, id]);