Add missing option "OK" for Error state (#45262)

* Add missing OK option to models
* add ok to legacy legacy UI does not support it but it is possible to do so via provisioning.
* use enums in migration so linter would catch missing cases
This commit is contained in:
Yuriy Tseretyan
2022-03-02 19:07:55 -05:00
committed by GitHub
parent b58f3c8a05
commit 016d9e14ed
5 changed files with 28 additions and 21 deletions
+2 -1
View File
@@ -28,6 +28,7 @@ const (
)
const (
ExecutionErrorSetOk ExecutionErrorOption = "ok"
ExecutionErrorSetAlerting ExecutionErrorOption = "alerting"
ExecutionErrorKeepState ExecutionErrorOption = "keep_state"
)
@@ -55,7 +56,7 @@ func (s NoDataOption) ToAlertState() AlertStateType {
}
func (s ExecutionErrorOption) IsValid() bool {
return s == ExecutionErrorSetAlerting || s == ExecutionErrorKeepState
return s == ExecutionErrorSetAlerting || s == ExecutionErrorKeepState || s == ExecutionErrorSetOk
}
func (s ExecutionErrorOption) ToAlertState() AlertStateType {