-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Watcher stuck firing state (#138563)
* Update WATCH_STATES by replacing DISABLED with INACTIVE and OK/FIRING with ACTIVE. Update ACTION_STATES by replacing FIRING with OK. - Refactor isAckable logic to directly translate value provided by ES. - Replace WatchStatus component with ActionStateBadge and WatchStateBadge components. * Change WatchListPage 'Last fired' column to 'Condition last met' and 'Last triggered' column to 'Last checked'. - Add tooltips to both. - Add tooltips to State and Comment headers. * Rename Watch Status Model's lastFired -> lastExecution for consistency. Remove unused properties from client WatchStatus model. * Add Condition Met column and tooltips to State and Comment headers on Execution History Panel. * Add tooltip to State header in Execution History flyout. Add Last executed header to Action Statuses Panel and tooltips. Update tests. * Use EUI types instead of hand-rolling them. * Remove unused ACTION_STATES.FIRING and references to WATCH_STATES.FIRING. * Use dots to denote states, similar to Index Management. * Refactor deriveComment to use early exits.
- Loading branch information
CJ Cenizal
authored
Aug 16, 2022
1 parent
1adabbc
commit f77afae
Showing
31 changed files
with
492 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import moment, { Moment } from 'moment'; | ||
import { ACTION_STATES, WATCH_STATES } from '../common/constants'; | ||
import { ClientWatchStatusModel, ClientActionStatusModel } from '../common/types'; | ||
|
||
interface WatchHistory { | ||
id: string; | ||
watchId: string; | ||
startTime: Moment; | ||
watchStatus: { | ||
state: ClientWatchStatusModel['state']; | ||
comment?: string; | ||
lastExecution: Moment; | ||
actionStatuses?: Array<{ | ||
id: string; | ||
state: ClientActionStatusModel['state']; | ||
}>; | ||
}; | ||
details?: object; | ||
} | ||
|
||
export const getWatchHistory = ({ | ||
id, | ||
startTime, | ||
}: { | ||
id: string; | ||
startTime: string; | ||
}): WatchHistory => ({ | ||
id, | ||
startTime: moment(startTime), | ||
watchId: id, | ||
watchStatus: { | ||
state: WATCH_STATES.OK, | ||
lastExecution: moment('2019-06-03T19:44:11.088Z'), | ||
actionStatuses: [ | ||
{ | ||
id: 'a', | ||
state: ACTION_STATES.OK, | ||
}, | ||
], | ||
}, | ||
details: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.