From 874886d0ef379d265963a4424ad66d35f22e921c Mon Sep 17 00:00:00 2001 From: Eric P Green Date: Tue, 27 Feb 2024 16:31:03 -0800 Subject: [PATCH 1/7] Update chip colors & copy --- .../history/AlertHistoryStatusChip.svelte | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/web-admin/src/features/alerts/history/AlertHistoryStatusChip.svelte b/web-admin/src/features/alerts/history/AlertHistoryStatusChip.svelte index 60cac32e9f9..a95aa7a7a7f 100644 --- a/web-admin/src/features/alerts/history/AlertHistoryStatusChip.svelte +++ b/web-admin/src/features/alerts/history/AlertHistoryStatusChip.svelte @@ -1,7 +1,7 @@
{currentStatusDisplay.text} From e3315ee83c89d729e3a77ba616dbdd8db3d453cf Mon Sep 17 00:00:00 2001 From: Eric P Green Date: Tue, 27 Feb 2024 16:59:01 -0800 Subject: [PATCH 3/7] Account for "Running" state; refactor to use `Tag` component --- .../history/AlertHistoryStatusChip.svelte | 50 ++++++++++--------- .../alerts/history/AlertHistoryTable.svelte | 2 + .../AlertHistoryTableCompositeCell.svelte | 15 +++--- web-common/src/components/tag/Tag.svelte | 6 ++- 4 files changed, 40 insertions(+), 33 deletions(-) diff --git a/web-admin/src/features/alerts/history/AlertHistoryStatusChip.svelte b/web-admin/src/features/alerts/history/AlertHistoryStatusChip.svelte index 66164b00089..63b946cfb09 100644 --- a/web-admin/src/features/alerts/history/AlertHistoryStatusChip.svelte +++ b/web-admin/src/features/alerts/history/AlertHistoryStatusChip.svelte @@ -1,45 +1,49 @@ -
- {currentStatusDisplay.text} -
+{#if currentExecution} + Running +{:else} + + {assertionResultDisplay.text} + +{/if} diff --git a/web-admin/src/features/alerts/history/AlertHistoryTable.svelte b/web-admin/src/features/alerts/history/AlertHistoryTable.svelte index 37561d9c748..7f32c41d1bc 100644 --- a/web-admin/src/features/alerts/history/AlertHistoryTable.svelte +++ b/web-admin/src/features/alerts/history/AlertHistoryTable.svelte @@ -26,6 +26,8 @@ alertTime: info.row.original.executionTime, timeZone: $alertQuery.data.resource.alert.spec.refreshSchedule.timeZone, + currentExecution: + $alertQuery.data.resource.alert.state.currentExecution, result: info.row.original.result, }), }, diff --git a/web-admin/src/features/alerts/history/AlertHistoryTableCompositeCell.svelte b/web-admin/src/features/alerts/history/AlertHistoryTableCompositeCell.svelte index b2093e3efdb..ccfc4ee7b69 100644 --- a/web-admin/src/features/alerts/history/AlertHistoryTableCompositeCell.svelte +++ b/web-admin/src/features/alerts/history/AlertHistoryTableCompositeCell.svelte @@ -1,22 +1,21 @@
-
- {result.status === V1AssertionStatus.ASSERTION_STATUS_UNSPECIFIED - ? "Checking" - : "Checked"} +
+ {currentExecution ? "Checking" : "Checked"} {formatRunDate(alertTime, timeZone)}
- +
diff --git a/web-common/src/components/tag/Tag.svelte b/web-common/src/components/tag/Tag.svelte index 717203490fd..9ec4a6f9b62 100644 --- a/web-common/src/components/tag/Tag.svelte +++ b/web-common/src/components/tag/Tag.svelte @@ -1,5 +1,5 @@ - +
@@ -20,6 +21,6 @@
{#if result.status === V1AssertionStatus.ASSERTION_STATUS_ERROR} - ({result.errorMessage}) + {result.errorMessage} {/if}
From e13ca1f7881a05e22e861c6827143d48f6430417 Mon Sep 17 00:00:00 2001 From: Eric P Green Date: Tue, 27 Feb 2024 17:11:53 -0800 Subject: [PATCH 7/7] Nit: error copy --- runtime/queries/metricsview.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/metricsview.go b/runtime/queries/metricsview.go index 3ed6f75bcd6..4769aa6670b 100644 --- a/runtime/queries/metricsview.go +++ b/runtime/queries/metricsview.go @@ -473,7 +473,7 @@ func buildInExpression(mv *runtimev1.MetricsViewSpec, cond *runtimev1.Condition, func buildAndOrExpressions(mv *runtimev1.MetricsViewSpec, cond *runtimev1.Condition, aliases []*runtimev1.MetricsViewComparisonMeasureAlias, dialect drivers.Dialect, joiner string) (string, []any, error) { if len(cond.Exprs) == 0 { - return "", nil, fmt.Errorf("or/and expression should have at least 1 sub expressions") + return "", nil, fmt.Errorf("or/and expression should have at least 1 sub expression") } clauses := make([]string, 0)