- {#if $workflowCount?.totalCount >= 0 && $supportsAdvancedVisibility && !$page.data?.systemInfo?.capabilities?.countGroupByExecutionStatus}
+ {#if $workflowCount?.totalCount >= 0 && $supportsAdvancedVisibility && !groupByCountEnabled}
{#if $loading || $updating}
diff --git a/src/lib/stores/bulk-actions.test.ts b/src/lib/stores/bulk-actions.test.ts
index 9d3dfc3f7..aa4a8f2f1 100644
--- a/src/lib/stores/bulk-actions.test.ts
+++ b/src/lib/stores/bulk-actions.test.ts
@@ -1,6 +1,6 @@
import { get, type writable as writableFunc } from 'svelte/store';
-import { beforeEach, describe, expect, test, vi } from 'vitest';
+import { describe, expect, test, vi } from 'vitest';
import { supportsBulkActions } from './bulk-actions';
@@ -22,12 +22,6 @@ vi.mock('$app/stores', () => ({
describe('supportsBulkActions store', () => {
describe('for Cloud', () => {
- beforeEach(() => {
- mockedPageStore.mockSetSubscribeValue({
- data: { settings: { runtimeEnvironment: { isCloud: true } } },
- });
- });
-
test('returns true when batch actions are enabled, and visibility store is elasticsearch regardless of server version', () => {
mockedPageStore.mockSetSubscribeValue({
data: {
@@ -44,14 +38,13 @@ describe('supportsBulkActions store', () => {
});
describe('for Local', () => {
- beforeEach(() => {
- mockedPageStore.mockSetSubscribeValue({
- data: { settings: { runtimeEnvironment: { isCloud: false } } },
- });
- });
test('returns true when version is newer than 1.18.0, advanced visibility is supported, and batch actions are enabled', () => {
mockedPageStore.mockSetSubscribeValue({
data: {
+ settings: {
+ runtimeEnvironment: { isCloud: false },
+ batchActionsDisabled: false,
+ },
cluster: {
serverVersion: '1.19.0',
visibilityStore: 'elasticsearch',
diff --git a/src/lib/stores/group-by-enabled.ts b/src/lib/stores/group-by-enabled.ts
new file mode 100644
index 000000000..3fc60aab0
--- /dev/null
+++ b/src/lib/stores/group-by-enabled.ts
@@ -0,0 +1,10 @@
+import { derived } from 'svelte/store';
+
+import { page } from '$app/stores';
+
+export const groupByCountEnabled = derived([page], ([$page]) => {
+ return (
+ $page.data?.settings?.runtimeEnvironment?.isCloud ||
+ $page.data?.systemInfo?.capabilities?.countGroupByExecutionStatus
+ );
+});
diff --git a/src/lib/stores/workflows.ts b/src/lib/stores/workflows.ts
index 9a5c2a323..8d545844a 100644
--- a/src/lib/stores/workflows.ts
+++ b/src/lib/stores/workflows.ts
@@ -12,6 +12,7 @@ import type { FilterParameters, WorkflowExecution } from '$lib/types/workflows';
import { withLoading } from '$lib/utilities/stores/with-loading';
import { supportsAdvancedVisibility } from './advanced-visibility';
+import { groupByCountEnabled } from './group-by-enabled';
export const refresh = writable(0);
export const hideWorkflowQueryErrors = derived(
@@ -64,7 +65,7 @@ const updateWorkflows: StartStopNotifier = (set) => {
});
set(workflows);
- if (supportsAdvancedVisibility) {
+ if (supportsAdvancedVisibility && !groupByCountEnabled) {
const workflowCount = await fetchWorkflowCount(namespace, query);
setCounts(workflowCount);
}
From 94f0350fe79e0f38fe32973a9c262daa8dd8f32d Mon Sep 17 00:00:00 2001
From: Alex Tideman
Date: Fri, 13 Oct 2023 13:40:09 -0500
Subject: [PATCH 15/20] Fix check for groupByCountEnabled
---
.vscode/settings.json | 22 ++++++-
go.work.sum | 11 ----
.../api/workflowservice/v1/service.proto | 2 +-
.../workflow/filter-search/filter-list.svelte | 5 +-
.../workflow/workflow-counts.svelte | 59 +++++++++----------
.../table-body-cell.test.ts.snap | 2 +-
.../table-header-cell.test.ts.snap | 2 +-
.../pages/workflows-with-new-search.svelte | 4 +-
src/lib/stores/group-by-enabled.ts | 5 +-
src/lib/stores/workflows.ts | 4 +-
src/lib/utilities/route-for-api.ts | 2 +-
11 files changed, 59 insertions(+), 59 deletions(-)
delete mode 100644 go.work.sum
diff --git a/.vscode/settings.json b/.vscode/settings.json
index a0f7c59d7..9c02c94e7 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -11,5 +11,25 @@
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
- ]
+ ],
+ "workbench.colorCustomizations": {
+ "activityBar.activeBackground": "#ff6433",
+ "activityBar.background": "#ff6433",
+ "activityBar.foreground": "#15202b",
+ "activityBar.inactiveForeground": "#15202b99",
+ "activityBarBadge.background": "#00ff3d",
+ "activityBarBadge.foreground": "#15202b",
+ "commandCenter.border": "#e7e7e799",
+ "sash.hoverBorder": "#ff6433",
+ "statusBar.background": "#ff3d00",
+ "statusBar.foreground": "#e7e7e7",
+ "statusBarItem.hoverBackground": "#ff6433",
+ "statusBarItem.remoteBackground": "#ff3d00",
+ "statusBarItem.remoteForeground": "#e7e7e7",
+ "titleBar.activeBackground": "#ff3d00",
+ "titleBar.activeForeground": "#e7e7e7",
+ "titleBar.inactiveBackground": "#ff3d0099",
+ "titleBar.inactiveForeground": "#e7e7e799"
+ },
+ "peacock.color": "#ff3d00"
}
diff --git a/go.work.sum b/go.work.sum
deleted file mode 100644
index 33e1c2a33..000000000
--- a/go.work.sum
+++ /dev/null
@@ -1,11 +0,0 @@
-github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
-golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
-golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
-golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
-google.golang.org/genproto v0.0.0-20230815205213-6bfd019c3878 h1:Iveh6tGCJkHAjJgEqUQYGDGgbwmhjoAOz8kO/ajxefY=
-google.golang.org/genproto/googleapis/api v0.0.0-20230815205213-6bfd019c3878 h1:WGq4lvB/mlicysM/dUT3SBvijH4D3sm/Ny1A4wmt2CI=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0=
-google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
-google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
diff --git a/server/proto/api/temporal/api/workflowservice/v1/service.proto b/server/proto/api/temporal/api/workflowservice/v1/service.proto
index 5952e51ae..f6f7480b1 100644
--- a/server/proto/api/temporal/api/workflowservice/v1/service.proto
+++ b/server/proto/api/temporal/api/workflowservice/v1/service.proto
@@ -398,7 +398,7 @@ service WorkflowService {
// GetSystemInfo returns information about the system.
rpc GetSystemInfo(GetSystemInfoRequest) returns (GetSystemInfoResponse) {
option (google.api.http) = {
- get: "/api/v1/systemInfo"
+ get: "/api/v1/system-info"
};
}
diff --git a/src/lib/components/workflow/filter-search/filter-list.svelte b/src/lib/components/workflow/filter-search/filter-list.svelte
index 0fbe0c2ec..ce88e9957 100644
--- a/src/lib/components/workflow/filter-search/filter-list.svelte
+++ b/src/lib/components/workflow/filter-search/filter-list.svelte
@@ -20,7 +20,6 @@
import { formatDate } from '$lib/utilities/format-date';
import {
isDateTimeFilter,
- isStatusFilter,
isTextFilter,
} from '$lib/utilities/query/filter-search';
import { emptyFilter } from '$lib/utilities/query/to-list-workflow-filters';
@@ -53,9 +52,7 @@
let totalFiltersInView = 5;
- $: visibleFilters = $workflowFilters
- .filter((f) => !isStatusFilter(f.attribute))
- .slice(0, totalFiltersInView);
+ $: visibleFilters = $workflowFilters.slice(0, totalFiltersInView);
$: hasMoreFilters = totalFiltersInView < $workflowFilters.length;
const viewMoreFilters = () => {
diff --git a/src/lib/components/workflow/workflow-counts.svelte b/src/lib/components/workflow/workflow-counts.svelte
index e9034bf52..ed2978ec5 100644
--- a/src/lib/components/workflow/workflow-counts.svelte
+++ b/src/lib/components/workflow/workflow-counts.svelte
@@ -2,7 +2,6 @@
import { page } from '$app/stores';
import { workflowFilters } from '$lib/stores/filters';
- import { groupByCountEnabled } from '$lib/stores/group-by-enabled';
import { workflowCount, workflowsQuery } from '$lib/stores/workflows';
import type { Payloads } from '$lib/types';
import type { WorkflowStatus } from '$lib/types/workflows';
@@ -20,37 +19,35 @@
let statusGroups: { status: WorkflowStatus; count: number }[] = [];
const fetchCounts = async () => {
- if (groupByCountEnabled) {
- const groupByClause = 'GROUP BY ExecutionStatus';
- const countRoute = routeForApi('workflows.count', {
- namespace,
- });
+ const groupByClause = 'GROUP BY ExecutionStatus';
+ const countRoute = routeForApi('workflows.count', {
+ namespace,
+ });
- const query = toListWorkflowQueryFromFilters(
- combineFilters($workflowFilters),
- );
- const { count, groups } = await requestFromAPI<{
- count: string;
- groups: { groupValues: Payloads; count: string }[];
- }>(countRoute, {
- params: { query: `${query} ${groupByClause}` },
- notifyOnError: false,
- });
- totalCount = parseInt(count);
- $workflowCount.totalCount = totalCount;
- statusGroups = groups
- .map((group) => {
- const status = decodePayload(
- group?.groupValues[0],
- ) as unknown as WorkflowStatus;
- const count = parseInt(group.count);
- return {
- status,
- count,
- };
- })
- .filter((s) => s.count > 0);
- }
+ const query = toListWorkflowQueryFromFilters(
+ combineFilters($workflowFilters),
+ );
+ const { count, groups } = await requestFromAPI<{
+ count: string;
+ groups: { groupValues: Payloads; count: string }[];
+ }>(countRoute, {
+ params: { query: `${query} ${groupByClause}` },
+ notifyOnError: false,
+ });
+ totalCount = parseInt(count);
+ $workflowCount.totalCount = totalCount;
+ statusGroups = groups
+ .map((group) => {
+ const status = decodePayload(
+ group?.groupValues[0],
+ ) as unknown as WorkflowStatus;
+ const count = parseInt(group.count);
+ return {
+ status,
+ count,
+ };
+ })
+ .filter((s) => s.count > 0);
};
$: $workflowsQuery, namespace, fetchCounts();
diff --git a/src/lib/components/workflow/workflows-summary-configurable-table/tests/__snapshots__/table-body-cell.test.ts.snap b/src/lib/components/workflow/workflows-summary-configurable-table/tests/__snapshots__/table-body-cell.test.ts.snap
index 230042b79..050c84102 100644
--- a/src/lib/components/workflow/workflows-summary-configurable-table/tests/__snapshots__/table-body-cell.test.ts.snap
+++ b/src/lib/components/workflow/workflows-summary-configurable-table/tests/__snapshots__/table-body-cell.test.ts.snap
@@ -18,7 +18,7 @@ exports[`Table_body_cell$ > Start renders 1`] = `" State Transitions renders 1`] = `" | 12 | "`;
-exports[`Table_body_cell$ > Status renders 1`] = `" | "`;
+exports[`Table_body_cell$ > Status renders 1`] = `" | "`;
exports[`Table_body_cell$ > Task Queue renders 1`] = `"task-queue | "`;
diff --git a/src/lib/components/workflow/workflows-summary-configurable-table/tests/__snapshots__/table-header-cell.test.ts.snap b/src/lib/components/workflow/workflows-summary-configurable-table/tests/__snapshots__/table-header-cell.test.ts.snap
index 0bed8ad25..005cb1d06 100644
--- a/src/lib/components/workflow/workflows-summary-configurable-table/tests/__snapshots__/table-header-cell.test.ts.snap
+++ b/src/lib/components/workflow/workflows-summary-configurable-table/tests/__snapshots__/table-header-cell.test.ts.snap
@@ -18,7 +18,7 @@ exports[`Table_header_cell$ > Start renders 1`] = `" State Transitions renders 1`] = `" | "`;
-exports[`Table_header_cell$ > Status renders 1`] = `""`;
+exports[`Table_header_cell$ > Status renders 1`] = `""`;
exports[`Table_header_cell$ > Task Queue renders 1`] = `""`;
diff --git a/src/lib/pages/workflows-with-new-search.svelte b/src/lib/pages/workflows-with-new-search.svelte
index 13140683a..5af630f16 100644
--- a/src/lib/pages/workflows-with-new-search.svelte
+++ b/src/lib/pages/workflows-with-new-search.svelte
@@ -218,7 +218,7 @@
- {#if $workflowCount?.totalCount >= 0 && $supportsAdvancedVisibility && !groupByCountEnabled}
+ {#if $workflowCount?.totalCount >= 0 && $supportsAdvancedVisibility && !$groupByCountEnabled}
{#if $loading || $updating}
@@ -253,7 +253,7 @@
/>
{/if}
diff --git a/src/lib/stores/group-by-enabled.ts b/src/lib/stores/group-by-enabled.ts
index 3fc60aab0..7f0195c3f 100644
--- a/src/lib/stores/group-by-enabled.ts
+++ b/src/lib/stores/group-by-enabled.ts
@@ -3,8 +3,5 @@ import { derived } from 'svelte/store';
import { page } from '$app/stores';
export const groupByCountEnabled = derived([page], ([$page]) => {
- return (
- $page.data?.settings?.runtimeEnvironment?.isCloud ||
- $page.data?.systemInfo?.capabilities?.countGroupByExecutionStatus
- );
+ return $page.data?.systemInfo?.capabilities?.countGroupByExecutionStatus;
});
diff --git a/src/lib/stores/workflows.ts b/src/lib/stores/workflows.ts
index 8d545844a..23bd421fd 100644
--- a/src/lib/stores/workflows.ts
+++ b/src/lib/stores/workflows.ts
@@ -1,5 +1,5 @@
import type { StartStopNotifier } from 'svelte/store';
-import { derived, readable, writable } from 'svelte/store';
+import { derived, get, readable, writable } from 'svelte/store';
import { page } from '$app/stores';
@@ -65,7 +65,7 @@ const updateWorkflows: StartStopNotifier