diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 754bdb2b1461..da374786f650 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,7 +5,7 @@ /ui @znicholasbrown # integrations -/src/integrations/prefect-dbt @aaazzam @kevingrismore +/src/integrations/prefect-dbt @cicdw @desertaxle @zzstoatzz @kevingrismore # imports /src/prefect/__init__.py @aaazzam @chrisguidry @cicdw @desertaxle @zzstoatzz diff --git a/src/integrations/prefect-dbt/prefect_dbt/utilities.py b/src/integrations/prefect-dbt/prefect_dbt/utilities.py index 33c7ee907b7b..647ac90999fe 100644 --- a/src/integrations/prefect-dbt/prefect_dbt/utilities.py +++ b/src/integrations/prefect-dbt/prefect_dbt/utilities.py @@ -8,6 +8,11 @@ import slugify +from prefect.types.names import ( + MAX_ASSET_KEY_LENGTH, + RESTRICTED_ASSET_CHARACTERS, +) + def find_profiles_dir() -> Path: """ @@ -54,7 +59,15 @@ def format_resource_id(adapter_type: str, relation_name: str) -> str: relation_name: The name of the relation to format Returns: - The formatted relation name + The formatted asset key """ relation_name = relation_name.replace('"', "").replace(".", "/") - return f"{adapter_type}://{relation_name}" + for char in RESTRICTED_ASSET_CHARACTERS: + relation_name = relation_name.replace(char, "") + + asset_key = f"{adapter_type}://{relation_name}" + + if len(asset_key) > MAX_ASSET_KEY_LENGTH: + asset_key = asset_key[:MAX_ASSET_KEY_LENGTH] + + return asset_key diff --git a/src/integrations/prefect-dbt/tests/test_utilities.py b/src/integrations/prefect-dbt/tests/test_utilities.py index 2d01efb86871..543a8390b994 100644 --- a/src/integrations/prefect-dbt/tests/test_utilities.py +++ b/src/integrations/prefect-dbt/tests/test_utilities.py @@ -12,6 +12,8 @@ replace_with_env_var_call, ) +from prefect.types.names import MAX_ASSET_KEY_LENGTH + class TestFindProfilesDir: """Test cases for find_profiles_dir function.""" @@ -58,25 +60,6 @@ def test_find_profiles_dir_with_symlink(self, tmp_path: Path) -> None: result = find_profiles_dir() assert result == symlink_dir - def test_find_profiles_dir_with_different_case(self, tmp_path: Path) -> None: - """Test when profiles.yml exists with different case.""" - # Create a profiles.yml file with different case - profiles_file: Path = tmp_path / "PROFILES.YML" - profiles_file.write_text("test content") - - with patch("pathlib.Path.cwd", return_value=tmp_path): - result = find_profiles_dir() - # Should still find the file regardless of case on case-insensitive systems - if os.name == "nt": # Windows - assert result == tmp_path - else: # Unix-like systems - # On case-sensitive systems, it should fall back to home directory - with patch("pathlib.Path.home") as mock_home: - mock_home_dir = Path("/home/user") - mock_home.return_value = mock_home_dir - result = find_profiles_dir() - assert result == mock_home_dir / ".dbt" - class TestReplaceWithEnvVarCall: """Test cases for replace_with_env_var_call function.""" @@ -203,3 +186,23 @@ def test_format_resource_id_with_mixed_quotes_and_dots(self) -> None: expected = "duckdb://my_catalog/my_schema/my/table" assert result == expected + + def test_format_resource_id_with_restricted_characters(self) -> None: + """Test with restricted characters.""" + adapter_type = "duckdb" + relation_name = "`my_table`" + + result = format_resource_id(adapter_type, relation_name) + expected = "duckdb://my_table" + + assert result == expected + + def test_format_resource_id_over_max_length(self) -> None: + """Test with over max length.""" + adapter_type = "duckdb" + relation_name = "a" * MAX_ASSET_KEY_LENGTH + + result = len(format_resource_id(adapter_type, relation_name)) + expected = MAX_ASSET_KEY_LENGTH + + assert result == expected diff --git a/src/prefect/blocks/core.py b/src/prefect/blocks/core.py index 1fc5f0624f37..4a618556c198 100644 --- a/src/prefect/blocks/core.py +++ b/src/prefect/blocks/core.py @@ -4,6 +4,7 @@ import html import inspect import sys +import types import uuid import warnings from abc import ABC @@ -163,7 +164,11 @@ def _collect_secret_fields( secrets list, supporting nested Union / Dict / Tuple / List / BaseModel fields. Also, note, this function mutates the input secrets list, thus does not return anything. """ - if get_origin(type_) in (Union, dict, list, tuple): + nested_types = (Union, dict, list, tuple) + # Include UnionType if it's available for the current Python version + if union_type := getattr(types, "UnionType", None): + nested_types = nested_types + (union_type,) + if get_origin(type_) in nested_types: for nested_type in get_args(type_): _collect_secret_fields(name, nested_type, secrets) return diff --git a/tests/blocks/test_core.py b/tests/blocks/test_core.py index 6d97cf05d5dd..e7edb17e5231 100644 --- a/tests/blocks/test_core.py +++ b/tests/blocks/test_core.py @@ -1,5 +1,6 @@ import abc import json +import sys import warnings from textwrap import dedent from typing import Any, Dict, List, Tuple, Type, Union @@ -1159,6 +1160,30 @@ async def test_save_protected_block_with_new_block_schema_version( block_document = await prefect_client.read_block_document(block_document_id) assert block_document.block_schema.version == mock_version + @pytest.mark.skipif( + sys.version_info < (3, 10), reason="requires python3.10 or higher for `| None`" + ) + def test_maintain_secrets_after_load_for_union_type(self): + """ + Regression test for https://github.com/PrefectHQ/prefect/issues/18486 + """ + block_name = f"test-conf-{uuid4()}" + + class NestedModel(BaseModel): + password: SecretStr | None = None + + class Conf(Block): + nested: NestedModel + + nested = NestedModel(password="1234") + Conf(nested=nested).save( + block_name, + overwrite=True, + ) + + conf: Conf = Conf.load(block_name) + assert conf.nested.password.get_secret_value() == "1234" + class TestRegisterBlockTypeAndSchema: class NewBlock(Block): diff --git a/ui-v2/.storybook/preview.ts b/ui-v2/.storybook/preview.ts index 89b4ffee186a..4d5d5cc75817 100644 --- a/ui-v2/.storybook/preview.ts +++ b/ui-v2/.storybook/preview.ts @@ -1,7 +1,7 @@ -import { ModeDecorator } from "@/storybook/utils"; import type { Preview } from "@storybook/react"; import { handlers } from "@tests/utils/handlers"; import { initialize, mswLoader } from "msw-storybook-addon"; +import { ModeDecorator } from "@/storybook/utils"; import "../src/index.css"; diff --git a/ui-v2/biome.json b/ui-v2/biome.json index 5859885ae4de..73edd6748533 100644 --- a/ui-v2/biome.json +++ b/ui-v2/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.0.6/schema.json", "vcs": { "enabled": true, "clientKind": "git", @@ -8,30 +8,21 @@ }, "files": { "ignoreUnknown": false, - "ignore": [ - "node_modules", - "dist", - "src/api/prefect.ts", - "src/routeTree.gen.ts", - "package.json", - "package-lock.json" + "includes": [ + "**", + "!**/node_modules", + "!**/dist", + "!**/src/api/prefect.ts", + "!**/src/routeTree.gen.ts", + "!**/package.json", + "!**/package-lock.json" ] }, "formatter": { "enabled": true, "indentStyle": "tab" }, - "organizeImports": { - "enabled": true, - "ignore": [ - "node_modules", - "dist", - "src/api/prefect.ts", - "src/routeTree.gen.ts", - "package.json", - "package-lock.json" - ] - }, + "assist": { "actions": { "source": { "organizeImports": "on" } } }, "linter": { "enabled": true, "rules": { @@ -40,6 +31,18 @@ "noUnusedVariables": "error", "noUnusedImports": "error", "noUnusedFunctionParameters": "error" + }, + "style": { + "noParameterAssign": "error", + "useAsConstAssertion": "error", + "useDefaultParameterLast": "error", + "useEnumInitializers": "error", + "useSelfClosingElements": "error", + "useSingleVarDeclarator": "error", + "noUnusedTemplateLiteral": "error", + "useNumberNamespace": "error", + "noInferrableTypes": "error", + "noUselessElse": "error" } } }, diff --git a/ui-v2/package-lock.json b/ui-v2/package-lock.json index 96994d5665c9..d171f1bdaad3 100644 --- a/ui-v2/package-lock.json +++ b/ui-v2/package-lock.json @@ -69,7 +69,7 @@ "zod": "^3.24.3" }, "devDependencies": { - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "2.0.6", "@eslint/js": "^9.30.1", "@storybook/addon-docs": "^9.0.12", "@storybook/react-vite": "^9.0.12", @@ -462,11 +462,10 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", - "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.0.6.tgz", + "integrity": "sha512-RRP+9cdh5qwe2t0gORwXaa27oTOiQRQvrFf49x2PA1tnpsyU7FIHX4ZOFMtBC4QNtyWsN7Dqkf5EDbg4X+9iqA==", "dev": true, - "hasInstallScript": true, "bin": { "biome": "bin/biome" }, @@ -478,20 +477,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "@biomejs/cli-darwin-arm64": "2.0.6", + "@biomejs/cli-darwin-x64": "2.0.6", + "@biomejs/cli-linux-arm64": "2.0.6", + "@biomejs/cli-linux-arm64-musl": "2.0.6", + "@biomejs/cli-linux-x64": "2.0.6", + "@biomejs/cli-linux-x64-musl": "2.0.6", + "@biomejs/cli-win32-arm64": "2.0.6", + "@biomejs/cli-win32-x64": "2.0.6" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", - "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.0.6.tgz", + "integrity": "sha512-AzdiNNjNzsE6LfqWyBvcL29uWoIuZUkndu+wwlXW13EKcBHbbKjNQEZIJKYDc6IL+p7bmWGx3v9ZtcRyIoIz5A==", "cpu": [ "arm64" ], @@ -505,9 +504,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", - "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.0.6.tgz", + "integrity": "sha512-wJjjP4E7bO4WJmiQaLnsdXMa516dbtC6542qeRkyJg0MqMXP0fvs4gdsHhZ7p9XWTAmGIjZHFKXdsjBvKGIJJQ==", "cpu": [ "x64" ], @@ -521,9 +520,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", - "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.0.6.tgz", + "integrity": "sha512-ZSVf6TYo5rNMUHIW1tww+rs/krol7U5A1Is/yzWyHVZguuB0lBnIodqyFuwCNqG9aJGyk7xIMS8HG0qGUPz0SA==", "cpu": [ "arm64" ], @@ -537,9 +536,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", - "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.0.6.tgz", + "integrity": "sha512-CVPEMlin3bW49sBqLBg2x016Pws7eUXA27XYDFlEtponD0luYjg2zQaMJ2nOqlkKG9fqzzkamdYxHdMDc2gZFw==", "cpu": [ "arm64" ], @@ -553,9 +552,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", - "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.0.6.tgz", + "integrity": "sha512-geM1MkHTV1Kh2Cs/Xzot9BOF3WBacihw6bkEmxkz4nSga8B9/hWy5BDiOG3gHDGIBa8WxT0nzsJs2f/hPqQIQw==", "cpu": [ "x64" ], @@ -569,9 +568,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", - "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.0.6.tgz", + "integrity": "sha512-mKHE/e954hR/hSnAcJSjkf4xGqZc/53Kh39HVW1EgO5iFi0JutTN07TSjEMg616julRtfSNJi0KNyxvc30Y4rQ==", "cpu": [ "x64" ], @@ -585,9 +584,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", - "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.0.6.tgz", + "integrity": "sha512-290V4oSFoKaprKE1zkYVsDfAdn0An5DowZ+GIABgjoq1ndhvNxkJcpxPsiYtT7slbVe3xmlT0ncdfOsN7KruzA==", "cpu": [ "arm64" ], @@ -601,9 +600,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", - "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.0.6.tgz", + "integrity": "sha512-bfM1Bce0d69Ao7pjTjUS+AWSZ02+5UHdiAP85Th8e9yV5xzw6JrHXbL5YWlcEKQ84FIZMdDc7ncuti1wd2sdbw==", "cpu": [ "x64" ], diff --git a/ui-v2/package.json b/ui-v2/package.json index d22bb642710f..0401a323e1fe 100644 --- a/ui-v2/package.json +++ b/ui-v2/package.json @@ -80,7 +80,7 @@ "zod": "^3.24.3" }, "devDependencies": { - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "2.0.6", "@eslint/js": "^9.30.1", "@storybook/addon-docs": "^9.0.12", "@storybook/react-vite": "^9.0.12", @@ -124,6 +124,8 @@ "vitest": "^3.0.5" }, "lint-staged": { - "*.{js,jsx,ts,tsx}": ["eslint --fix"] + "*.{js,jsx,ts,tsx}": [ + "eslint --fix" + ] } } diff --git a/ui-v2/src/api/admin/admin.test.ts b/ui-v2/src/api/admin/admin.test.ts index f453064a367c..68cfa056e8b8 100644 --- a/ui-v2/src/api/admin/admin.test.ts +++ b/ui-v2/src/api/admin/admin.test.ts @@ -1,9 +1,9 @@ -import { createFakeServerSettings, createFakeVersion } from "@/mocks"; import { useSuspenseQuery } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { expect, test } from "vitest"; +import { createFakeServerSettings, createFakeVersion } from "@/mocks"; import { buildGetSettingsQuery, buildGetVersionQuery } from "./admin"; diff --git a/ui-v2/src/api/admin/admin.ts b/ui-v2/src/api/admin/admin.ts index 548589ddf42a..2025303626c7 100644 --- a/ui-v2/src/api/admin/admin.ts +++ b/ui-v2/src/api/admin/admin.ts @@ -1,5 +1,5 @@ -import { getQueryService } from "@/api/service"; import { queryOptions } from "@tanstack/react-query"; +import { getQueryService } from "@/api/service"; /** * ``` diff --git a/ui-v2/src/api/artifacts/artifacts.test.ts b/ui-v2/src/api/artifacts/artifacts.test.ts index cc82774914d6..0d5105750d87 100644 --- a/ui-v2/src/api/artifacts/artifacts.test.ts +++ b/ui-v2/src/api/artifacts/artifacts.test.ts @@ -1,7 +1,7 @@ import { useSuspenseQuery } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; import { createFakeArtifact } from "@/mocks"; diff --git a/ui-v2/src/api/artifacts/use-get-artifacts-flow-task-runs/use-get-artifacts-flow-task-runs.ts b/ui-v2/src/api/artifacts/use-get-artifacts-flow-task-runs/use-get-artifacts-flow-task-runs.ts index 9a8bc53ce1bc..96d0bd13e620 100644 --- a/ui-v2/src/api/artifacts/use-get-artifacts-flow-task-runs/use-get-artifacts-flow-task-runs.ts +++ b/ui-v2/src/api/artifacts/use-get-artifacts-flow-task-runs/use-get-artifacts-flow-task-runs.ts @@ -1,9 +1,9 @@ +import { useQueries, useQuery } from "@tanstack/react-query"; import { buildFilterFlowRunsQuery } from "@/api/flow-runs"; import { buildListTaskRunsQuery } from "@/api/task-runs"; -import { useQueries, useQuery } from "@tanstack/react-query"; import { - type ArtifactWithFlowRunAndTaskRun, type ArtifactsFilter, + type ArtifactWithFlowRunAndTaskRun, buildGetArtifactQuery, buildListArtifactsQuery, } from ".."; diff --git a/ui-v2/src/api/automations/automations.test.ts b/ui-v2/src/api/automations/automations.test.ts index 3b728f4ab661..43cf71978451 100644 --- a/ui-v2/src/api/automations/automations.test.ts +++ b/ui-v2/src/api/automations/automations.test.ts @@ -1,7 +1,7 @@ import { QueryClient, useSuspenseQuery } from "@tanstack/react-query"; import { act, renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; import { createFakeAutomation } from "@/mocks"; @@ -149,9 +149,14 @@ describe("automations queries and mutations", () => { updated: "2021-01-01T00:00:00Z", }); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { id, created, updated, ...CREATE_AUTOMATION_PAYLOAD } = - NEW_AUTOMATION_DATA; + const { + /* eslint-disable @typescript-eslint/no-unused-vars */ + id: _id, + created: _created, + updated: _updated, + /* eslint-enable @typescript-eslint/no-unused-vars */ + ...CREATE_AUTOMATION_PAYLOAD + } = NEW_AUTOMATION_DATA; // ------------ Mock API requests after queries are invalidated const mockData = [...seedAutomationsData(), NEW_AUTOMATION_DATA]; diff --git a/ui-v2/src/api/automations/automations.ts b/ui-v2/src/api/automations/automations.ts index fa8235eba934..160195db8722 100644 --- a/ui-v2/src/api/automations/automations.ts +++ b/ui-v2/src/api/automations/automations.ts @@ -1,10 +1,10 @@ -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import { queryOptions, useMutation, useQueryClient, } from "@tanstack/react-query"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export type Automation = components["schemas"]["Automation"]; export type AutomationsFilter = diff --git a/ui-v2/src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.test.ts b/ui-v2/src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.test.ts index 8f60f4dc5522..844819d7d777 100644 --- a/ui-v2/src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.test.ts +++ b/ui-v2/src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.test.ts @@ -1,3 +1,12 @@ +import { QueryClient } from "@tanstack/react-query"; +import { renderHook, waitFor } from "@testing-library/react"; +import { buildApiUrl, createWrapper, server } from "@tests/utils"; +import { HttpResponse, http } from "msw"; +import { describe, expect, it } from "vitest"; +import type { BlockDocument } from "@/api/block-documents"; +import type { Deployment } from "@/api/deployments"; +import type { WorkPool } from "@/api/work-pools"; +import type { WorkQueue } from "@/api/work-queues"; import { createFakeAutomation, createFakeBlockDocument, @@ -5,16 +14,6 @@ import { createFakeWorkPool, createFakeWorkQueue, } from "@/mocks"; - -import type { BlockDocument } from "@/api/block-documents"; -import type { Deployment } from "@/api/deployments"; -import type { WorkPool } from "@/api/work-pools"; -import type { WorkQueue } from "@/api/work-queues"; -import { QueryClient } from "@tanstack/react-query"; -import { renderHook, waitFor } from "@testing-library/react"; -import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; -import { describe, expect, it } from "vitest"; import type { Automation } from "../automations"; import { getResourceSets, diff --git a/ui-v2/src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.ts b/ui-v2/src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.ts index 1a316e4b84db..623f1d8e1205 100644 --- a/ui-v2/src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.ts +++ b/ui-v2/src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.ts @@ -1,9 +1,9 @@ +import { useQueries } from "@tanstack/react-query"; import { type Automation, buildGetAutomationQuery } from "@/api/automations"; import { buildListFilterBlockDocumentsQuery } from "@/api/block-documents"; import { buildFilterDeploymentsQuery } from "@/api/deployments"; import { buildFilterWorkPoolsQuery } from "@/api/work-pools"; import { buildFilterWorkQueuesQuery } from "@/api/work-queues"; -import { useQueries } from "@tanstack/react-query"; /** * diff --git a/ui-v2/src/api/block-documents/block-documents.test.ts b/ui-v2/src/api/block-documents/block-documents.test.ts index e9622d785589..1e4543b7d70d 100644 --- a/ui-v2/src/api/block-documents/block-documents.test.ts +++ b/ui-v2/src/api/block-documents/block-documents.test.ts @@ -1,7 +1,7 @@ import { QueryClient, useSuspenseQuery } from "@tanstack/react-query"; import { act, renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; import { createFakeBlockDocument } from "@/mocks"; diff --git a/ui-v2/src/api/block-documents/block-documents.ts b/ui-v2/src/api/block-documents/block-documents.ts index 16b50762e53b..78abd012bc2d 100644 --- a/ui-v2/src/api/block-documents/block-documents.ts +++ b/ui-v2/src/api/block-documents/block-documents.ts @@ -1,11 +1,11 @@ -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import { keepPreviousData, queryOptions, useMutation, useQueryClient, } from "@tanstack/react-query"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export type BlockDocument = components["schemas"]["BlockDocument"]; export type BlockDocumentsFilter = diff --git a/ui-v2/src/api/block-documents/index.ts b/ui-v2/src/api/block-documents/index.ts index b8bb3e7a2a10..f8466b42e21c 100644 --- a/ui-v2/src/api/block-documents/index.ts +++ b/ui-v2/src/api/block-documents/index.ts @@ -1,10 +1,10 @@ export { type BlockDocument, type BlockDocumentsFilter, - buildListFilterBlockDocumentsQuery, buildCountAllBlockDocumentsQuery, buildCountFilterBlockDocumentsQuery, buildGetBlockDocumentQuery, + buildListFilterBlockDocumentsQuery, useCreateBlockDocument, useDeleteBlockDocument, useUpdateBlockDocument, diff --git a/ui-v2/src/api/block-schemas/block-schemas.test.ts b/ui-v2/src/api/block-schemas/block-schemas.test.ts index 20eeb79fb337..a0fe8bb413a6 100644 --- a/ui-v2/src/api/block-schemas/block-schemas.test.ts +++ b/ui-v2/src/api/block-schemas/block-schemas.test.ts @@ -1,7 +1,7 @@ import { useSuspenseQuery } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; import { BLOCK_SCHEMAS, createFakeBlockSchema } from "@/mocks"; diff --git a/ui-v2/src/api/block-schemas/block-schemas.ts b/ui-v2/src/api/block-schemas/block-schemas.ts index 9e5b3fc8c0ed..6e10319a4c00 100644 --- a/ui-v2/src/api/block-schemas/block-schemas.ts +++ b/ui-v2/src/api/block-schemas/block-schemas.ts @@ -1,6 +1,6 @@ +import { queryOptions } from "@tanstack/react-query"; import type { components } from "@/api/prefect"; import { getQueryService } from "@/api/service"; -import { queryOptions } from "@tanstack/react-query"; export type BlockSchema = components["schemas"]["BlockSchema"]; export type BlockSchemaFilter = diff --git a/ui-v2/src/api/block-types/block-types.test.ts b/ui-v2/src/api/block-types/block-types.test.ts index bdeb09f8b48a..2f232946f68e 100644 --- a/ui-v2/src/api/block-types/block-types.test.ts +++ b/ui-v2/src/api/block-types/block-types.test.ts @@ -1,7 +1,7 @@ import { useSuspenseQuery } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; import { createFakeBlockType } from "@/mocks"; diff --git a/ui-v2/src/api/block-types/block-types.ts b/ui-v2/src/api/block-types/block-types.ts index 6050599eb436..c6ca0e23ade3 100644 --- a/ui-v2/src/api/block-types/block-types.ts +++ b/ui-v2/src/api/block-types/block-types.ts @@ -1,6 +1,6 @@ +import { queryOptions } from "@tanstack/react-query"; import type { components } from "@/api/prefect"; import { getQueryService } from "@/api/service"; -import { queryOptions } from "@tanstack/react-query"; export type BlockType = components["schemas"]["BlockType"]; export type BlockTypesFilter = diff --git a/ui-v2/src/api/block-types/index.ts b/ui-v2/src/api/block-types/index.ts index d2f36e4129d5..54015a4afaec 100644 --- a/ui-v2/src/api/block-types/index.ts +++ b/ui-v2/src/api/block-types/index.ts @@ -1,5 +1,5 @@ export { type BlockType, - buildListFilterBlockTypesQuery, buildGetBlockTypeQuery, + buildListFilterBlockTypesQuery, } from "./block-types"; diff --git a/ui-v2/src/api/deployments/deployments.test.ts b/ui-v2/src/api/deployments/deployments.test.ts index 0ce3261ad8ee..c11a169bb1b6 100644 --- a/ui-v2/src/api/deployments/deployments.test.ts +++ b/ui-v2/src/api/deployments/deployments.test.ts @@ -1,9 +1,9 @@ -import { createFakeDeployment } from "@/mocks/create-fake-deployment"; import { QueryClient, useQuery, useSuspenseQuery } from "@tanstack/react-query"; import { act, renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import { createFakeDeployment } from "@/mocks/create-fake-deployment"; import type { Deployment } from "./index"; import { buildCountDeploymentsQuery, diff --git a/ui-v2/src/api/deployments/index.ts b/ui-v2/src/api/deployments/index.ts index 10da61f25d30..f7cb91e53201 100644 --- a/ui-v2/src/api/deployments/index.ts +++ b/ui-v2/src/api/deployments/index.ts @@ -1,11 +1,11 @@ -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import { keepPreviousData, queryOptions, useMutation, useQueryClient, } from "@tanstack/react-query"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export type Deployment = components["schemas"]["DeploymentResponse"]; export type DeploymentWithFlow = Deployment & { diff --git a/ui-v2/src/api/deployments/use-list-deployments-with-flows/index.ts b/ui-v2/src/api/deployments/use-list-deployments-with-flows/index.ts index 9e20d1696a0a..25bd67cae87c 100644 --- a/ui-v2/src/api/deployments/use-list-deployments-with-flows/index.ts +++ b/ui-v2/src/api/deployments/use-list-deployments-with-flows/index.ts @@ -1,4 +1,4 @@ export { - useListDeploymentsWithFlows, type DeploymentWithFlow, + useListDeploymentsWithFlows, } from "./use-list-deployments-with-flows"; diff --git a/ui-v2/src/api/deployments/use-list-deployments-with-flows/use-list-deployments-with-flows.test.ts b/ui-v2/src/api/deployments/use-list-deployments-with-flows/use-list-deployments-with-flows.test.ts index 03c1c01bce49..04aed964ac57 100644 --- a/ui-v2/src/api/deployments/use-list-deployments-with-flows/use-list-deployments-with-flows.test.ts +++ b/ui-v2/src/api/deployments/use-list-deployments-with-flows/use-list-deployments-with-flows.test.ts @@ -1,9 +1,9 @@ -import { createFakeDeployment, createFakeFlow } from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import { createFakeDeployment, createFakeFlow } from "@/mocks"; import { useListDeploymentsWithFlows } from "./use-list-deployments-with-flows"; describe("buildPaginateDeploymentsWithFlowQuery", () => { diff --git a/ui-v2/src/api/deployments/use-list-deployments-with-flows/use-list-deployments-with-flows.ts b/ui-v2/src/api/deployments/use-list-deployments-with-flows/use-list-deployments-with-flows.ts index 67b76c4cb974..519a41090b51 100644 --- a/ui-v2/src/api/deployments/use-list-deployments-with-flows/use-list-deployments-with-flows.ts +++ b/ui-v2/src/api/deployments/use-list-deployments-with-flows/use-list-deployments-with-flows.ts @@ -1,11 +1,11 @@ +import { useQuery } from "@tanstack/react-query"; +import { useMemo } from "react"; import { + buildPaginateDeploymentsQuery, type Deployment, type DeploymentsPaginationFilter, - buildPaginateDeploymentsQuery, } from "@/api/deployments"; -import { type Flow, buildListFlowsQuery } from "@/api/flows"; -import { useQuery } from "@tanstack/react-query"; -import { useMemo } from "react"; +import { buildListFlowsQuery, type Flow } from "@/api/flows"; export type DeploymentWithFlow = Deployment & { flow: Flow | undefined; diff --git a/ui-v2/src/api/flow-runs/flow-runs.test.ts b/ui-v2/src/api/flow-runs/flow-runs.test.ts index d6bd6770a599..dd74c6727af7 100644 --- a/ui-v2/src/api/flow-runs/flow-runs.test.ts +++ b/ui-v2/src/api/flow-runs/flow-runs.test.ts @@ -1,13 +1,13 @@ -import { createFakeFlowRun } from "@/mocks"; import { QueryClient, useSuspenseQuery } from "@tanstack/react-query"; import { act, renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it, vi } from "vitest"; +import { createFakeFlowRun } from "@/mocks"; import { - type FlowRun, buildFilterFlowRunsQuery, buildPaginateFlowRunsQuery, + type FlowRun, queryKeyFactory, useDeleteFlowRun, useDeploymentCreateFlowRun, diff --git a/ui-v2/src/api/flow-runs/index.ts b/ui-v2/src/api/flow-runs/index.ts index 797ddf65b6bd..44e085b209a9 100644 --- a/ui-v2/src/api/flow-runs/index.ts +++ b/ui-v2/src/api/flow-runs/index.ts @@ -1,13 +1,13 @@ -import type { Deployment } from "@/api/deployments"; -import type { Flow } from "@/api/flows"; -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import { keepPreviousData, queryOptions, useMutation, useQueryClient, } from "@tanstack/react-query"; +import type { Deployment } from "@/api/deployments"; +import type { Flow } from "@/api/flows"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export type FlowRun = components["schemas"]["FlowRun"]; export type FlowRunWithFlow = FlowRun & { diff --git a/ui-v2/src/api/flow-runs/use-filter-flow-runs-with-flows/use-filter-flow-runs-with-flows.test.ts b/ui-v2/src/api/flow-runs/use-filter-flow-runs-with-flows/use-filter-flow-runs-with-flows.test.ts index a4539027a533..6f2614bdab8d 100644 --- a/ui-v2/src/api/flow-runs/use-filter-flow-runs-with-flows/use-filter-flow-runs-with-flows.test.ts +++ b/ui-v2/src/api/flow-runs/use-filter-flow-runs-with-flows/use-filter-flow-runs-with-flows.test.ts @@ -1,13 +1,11 @@ -import { createFakeFlow, createFakeFlowRun } from "@/mocks"; - -import type { FlowRun } from "@/api/flow-runs"; -import type { Flow } from "@/api/flows"; - import { QueryClient } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import type { FlowRun } from "@/api/flow-runs"; +import type { Flow } from "@/api/flows"; +import { createFakeFlow, createFakeFlowRun } from "@/mocks"; import { useFilterFlowRunswithFlows } from "./use-filter-flow-runs-with-flows"; describe("useFilterFlowRunswithFlows", () => { diff --git a/ui-v2/src/api/flow-runs/use-filter-flow-runs-with-flows/use-filter-flow-runs-with-flows.ts b/ui-v2/src/api/flow-runs/use-filter-flow-runs-with-flows/use-filter-flow-runs-with-flows.ts index b1ee93820ad0..61d4b0b1f43e 100644 --- a/ui-v2/src/api/flow-runs/use-filter-flow-runs-with-flows/use-filter-flow-runs-with-flows.ts +++ b/ui-v2/src/api/flow-runs/use-filter-flow-runs-with-flows/use-filter-flow-runs-with-flows.ts @@ -1,7 +1,7 @@ -import { type FlowRunsFilter, buildFilterFlowRunsQuery } from "@/api/flow-runs"; -import { type Flow, buildListFlowsQuery } from "@/api/flows"; import { useQuery } from "@tanstack/react-query"; import { useMemo } from "react"; +import { buildFilterFlowRunsQuery, type FlowRunsFilter } from "@/api/flow-runs"; +import { buildListFlowsQuery, type Flow } from "@/api/flows"; /** * diff --git a/ui-v2/src/api/flow-runs/use-paginate-flow-runs-with-flows/use-paginate-flow-runs-with-flows.test.ts b/ui-v2/src/api/flow-runs/use-paginate-flow-runs-with-flows/use-paginate-flow-runs-with-flows.test.ts index 2c64bee899cb..29579473e464 100644 --- a/ui-v2/src/api/flow-runs/use-paginate-flow-runs-with-flows/use-paginate-flow-runs-with-flows.test.ts +++ b/ui-v2/src/api/flow-runs/use-paginate-flow-runs-with-flows/use-paginate-flow-runs-with-flows.test.ts @@ -1,13 +1,11 @@ -import { createFakeFlow, createFakeFlowRun } from "@/mocks"; - -import type { FlowRun } from "@/api/flow-runs"; -import type { Flow } from "@/api/flows"; - import { QueryClient } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import type { FlowRun } from "@/api/flow-runs"; +import type { Flow } from "@/api/flows"; +import { createFakeFlow, createFakeFlowRun } from "@/mocks"; import { usePaginateFlowRunswithFlows } from "./use-paginate-flow-runs-with-flows"; describe("usePaginateFlowRunswithFlows", () => { diff --git a/ui-v2/src/api/flow-runs/use-paginate-flow-runs-with-flows/use-paginate-flow-runs-with-flows.ts b/ui-v2/src/api/flow-runs/use-paginate-flow-runs-with-flows/use-paginate-flow-runs-with-flows.ts index 2605f840b7bb..cdf078c75dce 100644 --- a/ui-v2/src/api/flow-runs/use-paginate-flow-runs-with-flows/use-paginate-flow-runs-with-flows.ts +++ b/ui-v2/src/api/flow-runs/use-paginate-flow-runs-with-flows/use-paginate-flow-runs-with-flows.ts @@ -1,11 +1,11 @@ +import { useQuery } from "@tanstack/react-query"; +import { useMemo } from "react"; import { - type FlowRunWithFlow, - type FlowRunsPaginateFilter, buildPaginateFlowRunsQuery, + type FlowRunsPaginateFilter, + type FlowRunWithFlow, } from "@/api/flow-runs"; -import { type Flow, buildListFlowsQuery } from "@/api/flows"; -import { useQuery } from "@tanstack/react-query"; -import { useMemo } from "react"; +import { buildListFlowsQuery, type Flow } from "@/api/flows"; /** * diff --git a/ui-v2/src/api/flows/flows.test.ts b/ui-v2/src/api/flows/flows.test.ts index a38c2f3aa70e..c467f7ebbef0 100644 --- a/ui-v2/src/api/flows/flows.test.ts +++ b/ui-v2/src/api/flows/flows.test.ts @@ -1,10 +1,10 @@ -import type { components } from "@/api/prefect"; -import { createFakeFlow } from "@/mocks"; import { QueryClient, useQuery, useSuspenseQuery } from "@tanstack/react-query"; import { act, renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import type { components } from "@/api/prefect"; +import { createFakeFlow } from "@/mocks"; import { buildCountFlowsFilteredQuery, buildFLowDetailsQuery, diff --git a/ui-v2/src/api/flows/index.ts b/ui-v2/src/api/flows/index.ts index a5d2a48144ad..5305bf607ef9 100644 --- a/ui-v2/src/api/flows/index.ts +++ b/ui-v2/src/api/flows/index.ts @@ -1,11 +1,11 @@ -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import { keepPreviousData, queryOptions, useMutation, useQueryClient, } from "@tanstack/react-query"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export type Flow = components["schemas"]["Flow"]; export type FlowsFilter = diff --git a/ui-v2/src/api/global-concurrency-limits/global-concurrency-limits.test.ts b/ui-v2/src/api/global-concurrency-limits/global-concurrency-limits.test.ts index ad7e366a0ae2..eed49aa59ff5 100644 --- a/ui-v2/src/api/global-concurrency-limits/global-concurrency-limits.test.ts +++ b/ui-v2/src/api/global-concurrency-limits/global-concurrency-limits.test.ts @@ -1,7 +1,7 @@ import { QueryClient } from "@tanstack/react-query"; import { act, renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; import { createFakeGlobalConcurrencyLimit } from "@/mocks"; diff --git a/ui-v2/src/api/global-concurrency-limits/global-concurrency-limits.ts b/ui-v2/src/api/global-concurrency-limits/global-concurrency-limits.ts index 8fbd00e32475..eab8c4c137a2 100644 --- a/ui-v2/src/api/global-concurrency-limits/global-concurrency-limits.ts +++ b/ui-v2/src/api/global-concurrency-limits/global-concurrency-limits.ts @@ -1,11 +1,11 @@ -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import { queryOptions, useMutation, useQueryClient, useSuspenseQuery, } from "@tanstack/react-query"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export type GlobalConcurrencyLimit = components["schemas"]["GlobalConcurrencyLimitResponse"]; diff --git a/ui-v2/src/api/global-concurrency-limits/index.ts b/ui-v2/src/api/global-concurrency-limits/index.ts index 6e80804d24ad..9eee3a9e4ee9 100644 --- a/ui-v2/src/api/global-concurrency-limits/index.ts +++ b/ui-v2/src/api/global-concurrency-limits/index.ts @@ -1,6 +1,6 @@ export { - type GlobalConcurrencyLimit, buildListGlobalConcurrencyLimitsQuery, + type GlobalConcurrencyLimit, useCreateGlobalConcurrencyLimit, useDeleteGlobalConcurrencyLimit, useListGlobalConcurrencyLimits, diff --git a/ui-v2/src/api/logs/index.ts b/ui-v2/src/api/logs/index.ts index 96887b83287d..5e89ccb198f2 100644 --- a/ui-v2/src/api/logs/index.ts +++ b/ui-v2/src/api/logs/index.ts @@ -1,9 +1,9 @@ -import type { components } from "@/api/prefect"; import { infiniteQueryOptions, keepPreviousData, queryOptions, } from "@tanstack/react-query"; +import type { components } from "@/api/prefect"; import { getQueryService } from "../service"; type LogsFilter = components["schemas"]["Body_read_logs_logs_filter_post"]; diff --git a/ui-v2/src/api/logs/logs.test.ts b/ui-v2/src/api/logs/logs.test.ts index 32d11189e0ec..759dfce67a86 100644 --- a/ui-v2/src/api/logs/logs.test.ts +++ b/ui-v2/src/api/logs/logs.test.ts @@ -1,9 +1,9 @@ -import type { components } from "@/api/prefect"; import { QueryClient, useSuspenseQuery } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import type { components } from "@/api/prefect"; import { buildFilterLogsQuery, queryKeyFactory } from "."; type Log = components["schemas"]["Log"]; diff --git a/ui-v2/src/api/task-run-concurrency-limits/index.ts b/ui-v2/src/api/task-run-concurrency-limits/index.ts index 3dee0e118b04..fe8ede75d58c 100644 --- a/ui-v2/src/api/task-run-concurrency-limits/index.ts +++ b/ui-v2/src/api/task-run-concurrency-limits/index.ts @@ -1,8 +1,8 @@ export { - type TaskRunConcurrencyLimit, - buildDetailTaskRunConcurrencyLimitsQuery, buildConcurrenyLimitDetailsActiveRunsQuery, + buildDetailTaskRunConcurrencyLimitsQuery, buildListTaskRunConcurrencyLimitsQuery, + type TaskRunConcurrencyLimit, useCreateTaskRunConcurrencyLimit, useDeleteTaskRunConcurrencyLimit, useGetTaskRunConcurrencyLimit, diff --git a/ui-v2/src/api/task-run-concurrency-limits/task-run-concurrency-limits.test.tsx b/ui-v2/src/api/task-run-concurrency-limits/task-run-concurrency-limits.test.tsx index 85830c49874d..53e4baf6bf55 100644 --- a/ui-v2/src/api/task-run-concurrency-limits/task-run-concurrency-limits.test.tsx +++ b/ui-v2/src/api/task-run-concurrency-limits/task-run-concurrency-limits.test.tsx @@ -1,3 +1,8 @@ +import { QueryClient, useSuspenseQuery } from "@tanstack/react-query"; +import { act, renderHook, waitFor } from "@testing-library/react"; +import { buildApiUrl, createWrapper, server } from "@tests/utils"; +import { HttpResponse, http } from "msw"; +import { describe, expect, it } from "vitest"; import type { components } from "@/api/prefect"; import { createFakeFlow, @@ -5,15 +10,10 @@ import { createFakeTaskRun, createFakeTaskRunConcurrencyLimit, } from "@/mocks"; -import { QueryClient, useSuspenseQuery } from "@tanstack/react-query"; -import { act, renderHook, waitFor } from "@testing-library/react"; -import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; -import { describe, expect, it } from "vitest"; import { - type TaskRunConcurrencyLimit, buildConcurrenyLimitDetailsActiveRunsQuery, queryKeyFactory, + type TaskRunConcurrencyLimit, useCreateTaskRunConcurrencyLimit, useDeleteTaskRunConcurrencyLimit, useGetTaskRunConcurrencyLimit, diff --git a/ui-v2/src/api/task-run-concurrency-limits/task-run-concurrency-limits.ts b/ui-v2/src/api/task-run-concurrency-limits/task-run-concurrency-limits.ts index 369b401ea218..35ca4e13d127 100644 --- a/ui-v2/src/api/task-run-concurrency-limits/task-run-concurrency-limits.ts +++ b/ui-v2/src/api/task-run-concurrency-limits/task-run-concurrency-limits.ts @@ -1,11 +1,11 @@ -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import { queryOptions, useMutation, useQueryClient, useSuspenseQuery, } from "@tanstack/react-query"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export type TaskRunConcurrencyLimit = components["schemas"]["ConcurrencyLimit"]; export type TaskRunConcurrencyLimitsFilter = diff --git a/ui-v2/src/api/task-runs/task-runs.test.ts b/ui-v2/src/api/task-runs/task-runs.test.ts index 70612ad3438b..7624d29c39bf 100644 --- a/ui-v2/src/api/task-runs/task-runs.test.ts +++ b/ui-v2/src/api/task-runs/task-runs.test.ts @@ -1,9 +1,9 @@ -import { createFakeTaskRun } from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { act, renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it, vi } from "vitest"; +import { createFakeTaskRun } from "@/mocks"; import type { TaskRun } from "."; import { queryKeyFactory, useDeleteTaskRun, useSetTaskRunState } from "."; diff --git a/ui-v2/src/api/work-pools/index.ts b/ui-v2/src/api/work-pools/index.ts index b9dbae6da09c..e3a0a973ef6c 100644 --- a/ui-v2/src/api/work-pools/index.ts +++ b/ui-v2/src/api/work-pools/index.ts @@ -1,11 +1,11 @@ export { - type WorkPool, - type WorkPoolsFilter, - type WorkPoolsCountFilter, - buildFilterWorkPoolsQuery, buildCountWorkPoolsQuery, + buildFilterWorkPoolsQuery, buildWorkPoolDetailsQuery, useDeleteWorkPool, usePauseWorkPool, useResumeWorkPool, + type WorkPool, + type WorkPoolsCountFilter, + type WorkPoolsFilter, } from "./work-pools"; diff --git a/ui-v2/src/api/work-pools/work-pools.test.ts b/ui-v2/src/api/work-pools/work-pools.test.ts index bcf1c991e272..af001cd498c1 100644 --- a/ui-v2/src/api/work-pools/work-pools.test.ts +++ b/ui-v2/src/api/work-pools/work-pools.test.ts @@ -1,17 +1,17 @@ -import { createFakeWorkPool } from "@/mocks"; import { QueryClient, useSuspenseQuery } from "@tanstack/react-query"; import { act, renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import { createFakeWorkPool } from "@/mocks"; import { - type WorkPool, buildCountWorkPoolsQuery, buildFilterWorkPoolsQuery, buildWorkPoolDetailsQuery, useDeleteWorkPool, usePauseWorkPool, useResumeWorkPool, + type WorkPool, } from "./work-pools"; describe("work pools api", () => { diff --git a/ui-v2/src/api/work-pools/work-pools.ts b/ui-v2/src/api/work-pools/work-pools.ts index 767b9225446d..716bd00614d9 100644 --- a/ui-v2/src/api/work-pools/work-pools.ts +++ b/ui-v2/src/api/work-pools/work-pools.ts @@ -1,10 +1,10 @@ -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import { queryOptions, useMutation, useQueryClient, } from "@tanstack/react-query"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export type WorkPool = components["schemas"]["WorkPool"]; export type WorkPoolsFilter = diff --git a/ui-v2/src/api/work-queues/index.ts b/ui-v2/src/api/work-queues/index.ts index 51ef5895d4b5..c518558f93b4 100644 --- a/ui-v2/src/api/work-queues/index.ts +++ b/ui-v2/src/api/work-queues/index.ts @@ -1,7 +1,7 @@ export { - type WorkQueue, - type WorkQueuesFilter, + buildFilterWorkPoolWorkQueuesQuery, buildFilterWorkQueuesQuery, buildWorkQueueDetailsQuery, - buildFilterWorkPoolWorkQueuesQuery, + type WorkQueue, + type WorkQueuesFilter, } from "./work-queues"; diff --git a/ui-v2/src/api/work-queues/work-queues.test.ts b/ui-v2/src/api/work-queues/work-queues.test.ts index d48bbc62a71d..d230f13f9ee4 100644 --- a/ui-v2/src/api/work-queues/work-queues.test.ts +++ b/ui-v2/src/api/work-queues/work-queues.test.ts @@ -1,14 +1,14 @@ -import { createFakeWorkQueue } from "@/mocks"; import { QueryClient, useSuspenseQuery } from "@tanstack/react-query"; import { renderHook, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import { createFakeWorkQueue } from "@/mocks"; import { - type WorkQueue, buildFilterWorkPoolWorkQueuesQuery, buildFilterWorkQueuesQuery, buildWorkQueueDetailsQuery, + type WorkQueue, } from "./work-queues"; describe("work queues api", () => { diff --git a/ui-v2/src/api/work-queues/work-queues.ts b/ui-v2/src/api/work-queues/work-queues.ts index b2853f93a269..430ef38d9b02 100644 --- a/ui-v2/src/api/work-queues/work-queues.ts +++ b/ui-v2/src/api/work-queues/work-queues.ts @@ -1,6 +1,6 @@ +import { queryOptions } from "@tanstack/react-query"; import type { components } from "@/api/prefect"; import { getQueryService } from "@/api/service"; -import { queryOptions } from "@tanstack/react-query"; export type WorkQueue = components["schemas"]["WorkQueueResponse"]; export type WorkQueuesFilter = diff --git a/ui-v2/src/components/artifacts/artifact-card.test.tsx b/ui-v2/src/components/artifacts/artifact-card.test.tsx index be9241650db1..384de3c6c70b 100644 --- a/ui-v2/src/components/artifacts/artifact-card.test.tsx +++ b/ui-v2/src/components/artifacts/artifact-card.test.tsx @@ -1,15 +1,15 @@ -import type { Artifact } from "@/api/artifacts"; -import { createFakeArtifact } from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render } from "@testing-library/react"; import { createWrapper } from "@tests/utils"; import { describe, expect, it } from "vitest"; +import type { Artifact } from "@/api/artifacts"; +import { createFakeArtifact } from "@/mocks"; import { ArtifactCard, type ArtifactsCardProps } from "./artifact-card"; // Wraps component in test with a Tanstack router provider diff --git a/ui-v2/src/components/artifacts/artifact-card.tsx b/ui-v2/src/components/artifacts/artifact-card.tsx index ee2b226a7879..f2828d013e51 100644 --- a/ui-v2/src/components/artifacts/artifact-card.tsx +++ b/ui-v2/src/components/artifacts/artifact-card.tsx @@ -1,9 +1,9 @@ -import type { Artifact } from "@/api/artifacts"; -import { cn } from "@/lib/utils"; -import { formatDate } from "@/utils/date"; import { Link } from "@tanstack/react-router"; import { useMemo } from "react"; import Markdown from "react-markdown"; +import type { Artifact } from "@/api/artifacts"; +import { cn } from "@/lib/utils"; +import { formatDate } from "@/utils/date"; import { Card, CardContent, CardHeader } from "../ui/card"; import { Typography } from "../ui/typography"; diff --git a/ui-v2/src/components/artifacts/artifact/artifact-detail-header.test.tsx b/ui-v2/src/components/artifacts/artifact/artifact-detail-header.test.tsx index 24fe0e682981..9296b2a37762 100644 --- a/ui-v2/src/components/artifacts/artifact/artifact-detail-header.test.tsx +++ b/ui-v2/src/components/artifacts/artifact/artifact-detail-header.test.tsx @@ -1,19 +1,19 @@ -import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; -import { - createFakeArtifact, - createFakeFlowRun, - createFakeTaskRun, -} from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render } from "@testing-library/react"; import { createWrapper } from "@tests/utils"; import { describe, expect, it } from "vitest"; +import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; +import { + createFakeArtifact, + createFakeFlowRun, + createFakeTaskRun, +} from "@/mocks"; import { ArtifactDetailHeader, type ArtifactDetailHeaderProps, diff --git a/ui-v2/src/components/artifacts/artifact/artifact-detail-header.tsx b/ui-v2/src/components/artifacts/artifact/artifact-detail-header.tsx index f1d2125ae701..a47630fc8371 100644 --- a/ui-v2/src/components/artifacts/artifact/artifact-detail-header.tsx +++ b/ui-v2/src/components/artifacts/artifact/artifact-detail-header.tsx @@ -1,3 +1,6 @@ +import { Link } from "@tanstack/react-router"; +import Markdown from "react-markdown"; +import remarkGfm from "remark-gfm"; import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; import { Breadcrumb, @@ -7,9 +10,6 @@ import { } from "@/components/ui/breadcrumb"; import { DocsLink } from "@/components/ui/docs-link"; import { Typography } from "@/components/ui/typography"; -import { Link } from "@tanstack/react-router"; -import Markdown from "react-markdown"; -import remarkGfm from "remark-gfm"; export type ArtifactDetailHeaderProps = { artifact: ArtifactWithFlowRunAndTaskRun; diff --git a/ui-v2/src/components/artifacts/artifact/artifact-detail-page.test.tsx b/ui-v2/src/components/artifacts/artifact/artifact-detail-page.test.tsx index 38772af13780..44f3a6bb19d9 100644 --- a/ui-v2/src/components/artifacts/artifact/artifact-detail-page.test.tsx +++ b/ui-v2/src/components/artifacts/artifact/artifact-detail-page.test.tsx @@ -1,14 +1,14 @@ -import { createFakeArtifact } from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render, screen } from "@testing-library/react"; import { createWrapper } from "@tests/utils"; import { describe, expect, it } from "vitest"; +import { createFakeArtifact } from "@/mocks"; import { ArtifactDetailPage, type ArtifactDetailPageProps, diff --git a/ui-v2/src/components/artifacts/artifact/artifact-detail-page.tsx b/ui-v2/src/components/artifacts/artifact/artifact-detail-page.tsx index 304c29519a5f..3165f768edf0 100644 --- a/ui-v2/src/components/artifacts/artifact/artifact-detail-page.tsx +++ b/ui-v2/src/components/artifacts/artifact/artifact-detail-page.tsx @@ -1,5 +1,5 @@ -import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; import { useMemo } from "react"; +import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; import { ArtifactDetailHeader } from "./artifact-detail-header"; import { ArtifactDataDisplay } from "./artifact-raw-data-display"; import { DetailImage } from "./detail-image"; diff --git a/ui-v2/src/components/artifacts/artifact/artifact-raw-data-display.test.tsx b/ui-v2/src/components/artifacts/artifact/artifact-raw-data-display.test.tsx index fab0f05e7488..24bb49e53d5a 100644 --- a/ui-v2/src/components/artifacts/artifact/artifact-raw-data-display.test.tsx +++ b/ui-v2/src/components/artifacts/artifact/artifact-raw-data-display.test.tsx @@ -1,6 +1,6 @@ -import { createFakeArtifact } from "@/mocks"; import { fireEvent, render } from "@testing-library/react"; import { describe, expect, it } from "vitest"; +import { createFakeArtifact } from "@/mocks"; import { ArtifactDataDisplay } from "./artifact-raw-data-display"; describe("ArtifactDataDisplay", () => { diff --git a/ui-v2/src/components/artifacts/artifact/artifact-raw-data-display.tsx b/ui-v2/src/components/artifacts/artifact/artifact-raw-data-display.tsx index de9cc470e69e..4f5b392e942f 100644 --- a/ui-v2/src/components/artifacts/artifact/artifact-raw-data-display.tsx +++ b/ui-v2/src/components/artifacts/artifact/artifact-raw-data-display.tsx @@ -1,9 +1,9 @@ -import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; -import { Button } from "@/components/ui/button"; -import { Icon } from "@/components/ui/icons"; import { EditorView, useCodeMirror } from "@uiw/react-codemirror"; import { useEffect, useRef, useState } from "react"; import { toast } from "sonner"; +import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; +import { Button } from "@/components/ui/button"; +import { Icon } from "@/components/ui/icons"; type ArtifactDataDisplayProps = { artifact: ArtifactWithFlowRunAndTaskRun; diff --git a/ui-v2/src/components/artifacts/artifact/detail-image.test.tsx b/ui-v2/src/components/artifacts/artifact/detail-image.test.tsx index 6f5c3744dd1a..cdffddd16035 100644 --- a/ui-v2/src/components/artifacts/artifact/detail-image.test.tsx +++ b/ui-v2/src/components/artifacts/artifact/detail-image.test.tsx @@ -1,6 +1,6 @@ -import { createFakeArtifact } from "@/mocks"; import { render } from "@testing-library/react"; import { describe, expect, it } from "vitest"; +import { createFakeArtifact } from "@/mocks"; import { DetailImage } from "./detail-image"; describe("ArtifactDetailImage", () => { diff --git a/ui-v2/src/components/artifacts/artifact/detail-table.test.tsx b/ui-v2/src/components/artifacts/artifact/detail-table.test.tsx index b6f0a2dab2f8..5dad0a53747f 100644 --- a/ui-v2/src/components/artifacts/artifact/detail-table.test.tsx +++ b/ui-v2/src/components/artifacts/artifact/detail-table.test.tsx @@ -1,6 +1,6 @@ -import { createFakeArtifact } from "@/mocks"; import { fireEvent, render, waitFor } from "@testing-library/react"; import { describe, expect, it } from "vitest"; +import { createFakeArtifact } from "@/mocks"; import { DetailTable } from "./detail-table"; const sampleData = diff --git a/ui-v2/src/components/artifacts/artifact/detail-table.tsx b/ui-v2/src/components/artifacts/artifact/detail-table.tsx index a737ce665612..f248447019cf 100644 --- a/ui-v2/src/components/artifacts/artifact/detail-table.tsx +++ b/ui-v2/src/components/artifacts/artifact/detail-table.tsx @@ -1,3 +1,4 @@ +import { useMemo, useState } from "react"; import { SearchInput } from "@/components/ui/input"; import { Table, @@ -7,7 +8,6 @@ import { TableHeader, TableRow, } from "@/components/ui/table"; -import { useMemo, useState } from "react"; export type DetailTableProps = { tableData: string; diff --git a/ui-v2/src/components/artifacts/artifacts-filter.test.tsx b/ui-v2/src/components/artifacts/artifacts-filter.test.tsx index 076e2a85dbf5..96ac2f101664 100644 --- a/ui-v2/src/components/artifacts/artifacts-filter.test.tsx +++ b/ui-v2/src/components/artifacts/artifacts-filter.test.tsx @@ -1,9 +1,8 @@ -import { createFakeArtifact } from "@/mocks"; import { fireEvent, render, waitFor } from "@testing-library/react"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; -import { beforeEach, expect, it, vi } from "vitest"; -import { describe } from "vitest"; +import { HttpResponse, http } from "msw"; +import { beforeEach, describe, expect, it, vi } from "vitest"; +import { createFakeArtifact } from "@/mocks"; import { ArtifactsFilterComponent } from "./artifacts-filter"; describe("Artifacts Filter", () => { diff --git a/ui-v2/src/components/artifacts/artifacts-filter.tsx b/ui-v2/src/components/artifacts/artifacts-filter.tsx index c65e4a82c14c..eb025547b1f4 100644 --- a/ui-v2/src/components/artifacts/artifacts-filter.tsx +++ b/ui-v2/src/components/artifacts/artifacts-filter.tsx @@ -1,3 +1,4 @@ +import { useCallback, useMemo } from "react"; import { SearchInput } from "@/components/ui/input"; import { Select, @@ -7,7 +8,6 @@ import { SelectValue, } from "@/components/ui/select"; import { pluralize } from "@/utils"; -import { useCallback, useMemo } from "react"; import { Icon } from "../ui/icons"; import { ToggleGroup, ToggleGroupItem } from "../ui/toggle-group"; import { Typography } from "../ui/typography"; diff --git a/ui-v2/src/components/artifacts/artifacts-page.test.tsx b/ui-v2/src/components/artifacts/artifacts-page.test.tsx index e9404a8f5cab..8f2c4c7093b3 100644 --- a/ui-v2/src/components/artifacts/artifacts-page.test.tsx +++ b/ui-v2/src/components/artifacts/artifacts-page.test.tsx @@ -1,14 +1,14 @@ -import { createFakeArtifact } from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render } from "@testing-library/react"; import { createWrapper } from "@tests/utils"; import { describe, expect, it, vi } from "vitest"; +import { createFakeArtifact } from "@/mocks"; import { ArtifactsPage, type ArtifactsPageProps } from "./artifacts-page"; // Wraps component in test with a Tanstack router provider diff --git a/ui-v2/src/components/artifacts/artifacts-page.tsx b/ui-v2/src/components/artifacts/artifacts-page.tsx index b82b079ab710..c923e6a16517 100644 --- a/ui-v2/src/components/artifacts/artifacts-page.tsx +++ b/ui-v2/src/components/artifacts/artifacts-page.tsx @@ -1,6 +1,6 @@ +import { useMemo } from "react"; import type { Artifact } from "@/api/artifacts"; import { useLocalStorage } from "@/hooks/use-local-storage"; -import { useMemo } from "react"; import { ArtifactCard } from "./artifact-card"; import { ArtifactsFilterComponent } from "./artifacts-filter"; import { ArtifactsHeader } from "./artifacts-header"; diff --git a/ui-v2/src/components/artifacts/key/artifacts-key-header.tsx b/ui-v2/src/components/artifacts/key/artifacts-key-header.tsx index d416a2fb7275..ebffcc2f03e1 100644 --- a/ui-v2/src/components/artifacts/key/artifacts-key-header.tsx +++ b/ui-v2/src/components/artifacts/key/artifacts-key-header.tsx @@ -1,3 +1,7 @@ +import { Link } from "@tanstack/react-router"; +import { useCallback } from "react"; +import Markdown from "react-markdown"; +import remarkGfm from "remark-gfm"; import { Breadcrumb, BreadcrumbItem, @@ -14,10 +18,6 @@ import { MenubarTrigger, } from "@/components/ui/menubar"; import { Typography } from "@/components/ui/typography"; -import { Link } from "@tanstack/react-router"; -import { useCallback } from "react"; -import Markdown from "react-markdown"; -import remarkGfm from "remark-gfm"; type ArtifactsKeyHeaderProps = { artifactKey: string; diff --git a/ui-v2/src/components/artifacts/key/timeline/timelineCard.test.tsx b/ui-v2/src/components/artifacts/key/timeline/timelineCard.test.tsx index 29c1f0bba586..9afd64384c50 100644 --- a/ui-v2/src/components/artifacts/key/timeline/timelineCard.test.tsx +++ b/ui-v2/src/components/artifacts/key/timeline/timelineCard.test.tsx @@ -1,19 +1,19 @@ -import type { Artifact, ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; -import { - createFakeArtifact, - createFakeFlowRun, - createFakeTaskRun, -} from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render } from "@testing-library/react"; import { createWrapper } from "@tests/utils"; import { describe, expect, it } from "vitest"; +import type { Artifact, ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; +import { + createFakeArtifact, + createFakeFlowRun, + createFakeTaskRun, +} from "@/mocks"; import { ArtifactTimelineCard, type ArtifactTimelineCardProps, diff --git a/ui-v2/src/components/artifacts/key/timeline/timelineCard.tsx b/ui-v2/src/components/artifacts/key/timeline/timelineCard.tsx index a6c42f5e8aee..2df810597d27 100644 --- a/ui-v2/src/components/artifacts/key/timeline/timelineCard.tsx +++ b/ui-v2/src/components/artifacts/key/timeline/timelineCard.tsx @@ -1,8 +1,8 @@ +import { Link } from "@tanstack/react-router"; +import { useMemo } from "react"; import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; import { Card } from "@/components/ui/card"; import { Typography } from "@/components/ui/typography"; -import { Link } from "@tanstack/react-router"; -import { useMemo } from "react"; export type ArtifactTimelineCardProps = { artifact: ArtifactWithFlowRunAndTaskRun; diff --git a/ui-v2/src/components/artifacts/key/timeline/timelineContainer.test.tsx b/ui-v2/src/components/artifacts/key/timeline/timelineContainer.test.tsx index d5f8651fbb19..7609fdb62eab 100644 --- a/ui-v2/src/components/artifacts/key/timeline/timelineContainer.test.tsx +++ b/ui-v2/src/components/artifacts/key/timeline/timelineContainer.test.tsx @@ -1,19 +1,19 @@ -import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; -import { - createFakeArtifact, - createFakeFlowRun, - createFakeTaskRun, -} from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render } from "@testing-library/react"; import { createWrapper } from "@tests/utils"; import { describe, expect, it } from "vitest"; +import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; +import { + createFakeArtifact, + createFakeFlowRun, + createFakeTaskRun, +} from "@/mocks"; import { TimelineContainer, type TimelineContainerProps, diff --git a/ui-v2/src/components/artifacts/key/timeline/timelineRow.test.tsx b/ui-v2/src/components/artifacts/key/timeline/timelineRow.test.tsx index dcd8a3316ba4..cd6a75cf283e 100644 --- a/ui-v2/src/components/artifacts/key/timeline/timelineRow.test.tsx +++ b/ui-v2/src/components/artifacts/key/timeline/timelineRow.test.tsx @@ -1,19 +1,19 @@ -import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; -import { - createFakeArtifact, - createFakeFlowRun, - createFakeTaskRun, -} from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render } from "@testing-library/react"; import { createWrapper } from "@tests/utils"; import { describe, expect, it } from "vitest"; +import type { ArtifactWithFlowRunAndTaskRun } from "@/api/artifacts"; +import { + createFakeArtifact, + createFakeFlowRun, + createFakeTaskRun, +} from "@/mocks"; import { TimelineRow, type TimelineRowProps } from "./timelineRow"; // Wraps component in test with a Tanstack router provider diff --git a/ui-v2/src/components/automations/action-details/action-details.stories.tsx b/ui-v2/src/components/automations/action-details/action-details.stories.tsx index 8e0fc1a36f24..bb36c36e6426 100644 --- a/ui-v2/src/components/automations/action-details/action-details.stories.tsx +++ b/ui-v2/src/components/automations/action-details/action-details.stories.tsx @@ -1,3 +1,4 @@ +import type { Meta, StoryObj } from "@storybook/react"; import type { Automation } from "@/api/automations"; import type { BlockDocument } from "@/api/block-documents"; import type { Deployment } from "@/api/deployments"; @@ -11,7 +12,6 @@ import { createFakeWorkQueue, } from "@/mocks"; import { routerDecorator } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; import { ActionDetails } from "./action-details"; const ACTIONS: Array = [ diff --git a/ui-v2/src/components/automations/action-details/action-details.tsx b/ui-v2/src/components/automations/action-details/action-details.tsx index 1608c1a964ce..cc9086c27852 100644 --- a/ui-v2/src/components/automations/action-details/action-details.tsx +++ b/ui-v2/src/components/automations/action-details/action-details.tsx @@ -1,3 +1,4 @@ +import { Link } from "@tanstack/react-router"; import type { Automation } from "@/api/automations"; import type { BlockDocument } from "@/api/block-documents"; import type { Deployment } from "@/api/deployments"; @@ -18,7 +19,6 @@ import { JsonInput } from "@/components/ui/json-input"; import { StateBadge } from "@/components/ui/state-badge"; import { Typography } from "@/components/ui/typography"; import { capitalize } from "@/utils"; -import { Link } from "@tanstack/react-router"; const ACTION_TYPE_TO_STRING = { "cancel-flow-run": "Cancel flow run", @@ -183,7 +183,10 @@ const ActionResource = ({ children }: { children: React.ReactNode }) => ( const ActionResourceName = ({ iconId, name, -}: { name: string; iconId: IconId }) => ( +}: { + name: string; + iconId: IconId; +}) => (
{name} @@ -232,27 +235,25 @@ export const DeploymentActionDetails = ({ job_variables, }: DeploymentActionDetailsProps) => { return ( - <> - - - - - - {parameters !== undefined && ( - - )} - {job_variables !== undefined && ( - - )} - - + + + + + + {parameters !== undefined && ( + + )} + {job_variables !== undefined && ( + + )} + ); }; diff --git a/ui-v2/src/components/automations/automation-details-page.tsx b/ui-v2/src/components/automations/automation-details-page.tsx index 997c0ad214c3..ddaf68a2afee 100644 --- a/ui-v2/src/components/automations/automation-details-page.tsx +++ b/ui-v2/src/components/automations/automation-details-page.tsx @@ -1,3 +1,4 @@ +import { useSuspenseQuery } from "@tanstack/react-query"; import { type Automation, buildGetAutomationQuery } from "@/api/automations"; import { Breadcrumb, @@ -8,7 +9,6 @@ import { BreadcrumbSeparator, } from "@/components/ui/breadcrumb"; import { DeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; -import { useSuspenseQuery } from "@tanstack/react-query"; import { AutomationActions, AutomationDescription, diff --git a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.stories.tsx b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.stories.tsx index b38016dfb640..dea66bacd835 100644 --- a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.stories.tsx +++ b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.stories.tsx @@ -1,6 +1,6 @@ +import type { Meta, StoryObj } from "@storybook/react"; import { createFakeAutomation } from "@/mocks"; import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; import { AutomationEnableToggle } from "./automation-enable-toggle"; const MOCK_DATA = createFakeAutomation(); diff --git a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.test.tsx b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.test.tsx index 3d891098e64f..097fa077663c 100644 --- a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.test.tsx +++ b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.test.tsx @@ -1,9 +1,9 @@ -import { Toaster } from "@/components/ui/sonner"; -import { createFakeAutomation } from "@/mocks"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { expect, test } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; +import { createFakeAutomation } from "@/mocks"; import { AutomationEnableToggle } from "./automation-enable-toggle"; const MOCK_DATA = createFakeAutomation({ enabled: true }); diff --git a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx index 956ca0308c83..f0fdad5f6c38 100644 --- a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx +++ b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx @@ -1,6 +1,6 @@ +import { toast } from "sonner"; import { type Automation, useUpdateAutomation } from "@/api/automations"; import { Switch } from "@/components/ui/switch"; -import { toast } from "sonner"; type AutomationEnableToggleProps = { automation: Automation; diff --git a/ui-v2/src/components/automations/automations-actions-menu/automations-actions-menu.stories.tsx b/ui-v2/src/components/automations/automations-actions-menu/automations-actions-menu.stories.tsx index 005862821ed1..985ee9a90d32 100644 --- a/ui-v2/src/components/automations/automations-actions-menu/automations-actions-menu.stories.tsx +++ b/ui-v2/src/components/automations/automations-actions-menu/automations-actions-menu.stories.tsx @@ -1,8 +1,8 @@ -import { routerDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; +import { fn } from "storybook/test"; import { createFakeAutomation } from "@/mocks"; -import { fn } from "storybook/test"; +import { routerDecorator, toastDecorator } from "@/storybook/utils"; import { AutomationsActionsMenu } from "./automations-actions-menu"; const MOCK_DATA = createFakeAutomation(); diff --git a/ui-v2/src/components/automations/automations-actions-menu/automations-actions-menu.tsx b/ui-v2/src/components/automations/automations-actions-menu/automations-actions-menu.tsx index a3d9e286093e..7a12ebc8defb 100644 --- a/ui-v2/src/components/automations/automations-actions-menu/automations-actions-menu.tsx +++ b/ui-v2/src/components/automations/automations-actions-menu/automations-actions-menu.tsx @@ -1,3 +1,5 @@ +import { Link } from "@tanstack/react-router"; +import { toast } from "sonner"; import { Button } from "@/components/ui/button"; import { DOCS_LINKS } from "@/components/ui/docs-link"; import { @@ -8,8 +10,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; -import { Link } from "@tanstack/react-router"; -import { toast } from "sonner"; type Props = { id: string; diff --git a/ui-v2/src/components/automations/automations-create-header/automations-create-header.stories.tsx b/ui-v2/src/components/automations/automations-create-header/automations-create-header.stories.tsx index 91d6a9258af4..17ec52139411 100644 --- a/ui-v2/src/components/automations/automations-create-header/automations-create-header.stories.tsx +++ b/ui-v2/src/components/automations/automations-create-header/automations-create-header.stories.tsx @@ -1,5 +1,5 @@ -import { routerDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; +import { routerDecorator } from "@/storybook/utils"; import { AutomationsCreateHeader } from "./automations-create-header"; diff --git a/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.stories.tsx b/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.stories.tsx index afdd0b268c23..bd23931b2c6b 100644 --- a/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.stories.tsx +++ b/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.stories.tsx @@ -1,7 +1,7 @@ -import { createFakeAutomation } from "@/mocks"; -import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeAutomation } from "@/mocks"; +import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; import { AutomationsDeleteDialog } from "./automations-delete-dialog"; const meta = { diff --git a/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.test.tsx b/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.test.tsx index 68e4990951b2..e0ebe58c22b6 100644 --- a/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.test.tsx +++ b/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.test.tsx @@ -1,9 +1,9 @@ -import { Toaster } from "@/components/ui/sonner"; -import { createFakeAutomation } from "@/mocks"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { expect, test, vi } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; +import { createFakeAutomation } from "@/mocks"; import { AutomationsDeleteDialog } from "./automations-delete-dialog"; diff --git a/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.tsx b/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.tsx index 51e4957e3128..ff14c5965039 100644 --- a/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.tsx +++ b/ui-v2/src/components/automations/automations-delete-dialog/automations-delete-dialog.tsx @@ -1,3 +1,4 @@ +import { toast } from "sonner"; import { type Automation, useDeleteAutomation } from "@/api/automations"; import { Button } from "@/components/ui/button"; import { @@ -9,7 +10,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { toast } from "sonner"; type AutomationsDeleteDialogProps = { automation: Automation; diff --git a/ui-v2/src/components/automations/automations-empty-state/automations-empty-state.stories.tsx b/ui-v2/src/components/automations/automations-empty-state/automations-empty-state.stories.tsx index 9c357c27513b..c8a139a4e97b 100644 --- a/ui-v2/src/components/automations/automations-empty-state/automations-empty-state.stories.tsx +++ b/ui-v2/src/components/automations/automations-empty-state/automations-empty-state.stories.tsx @@ -1,5 +1,5 @@ -import { routerDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; +import { routerDecorator } from "@/storybook/utils"; import { AutomationsEmptyState } from "./automations-empty-state"; diff --git a/ui-v2/src/components/automations/automations-empty-state/automations-empty-state.tsx b/ui-v2/src/components/automations/automations-empty-state/automations-empty-state.tsx index 42f51cb1bdf3..f44f3d90f899 100644 --- a/ui-v2/src/components/automations/automations-empty-state/automations-empty-state.tsx +++ b/ui-v2/src/components/automations/automations-empty-state/automations-empty-state.tsx @@ -1,3 +1,4 @@ +import { Link } from "@tanstack/react-router"; import { Button } from "@/components/ui/button"; import { DocsLink } from "@/components/ui/docs-link"; import { @@ -8,7 +9,6 @@ import { EmptyStateTitle, } from "@/components/ui/empty-state"; import { Icon } from "@/components/ui/icons"; -import { Link } from "@tanstack/react-router"; export const AutomationsEmptyState = () => { return ( diff --git a/ui-v2/src/components/automations/automations-header/automations-header.stories.tsx b/ui-v2/src/components/automations/automations-header/automations-header.stories.tsx index 599013d0b0c0..c98838960de9 100644 --- a/ui-v2/src/components/automations/automations-header/automations-header.stories.tsx +++ b/ui-v2/src/components/automations/automations-header/automations-header.stories.tsx @@ -1,5 +1,5 @@ -import { routerDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; +import { routerDecorator } from "@/storybook/utils"; import { AutomationsHeader } from "./automations-header"; diff --git a/ui-v2/src/components/automations/automations-header/automations-header.tsx b/ui-v2/src/components/automations/automations-header/automations-header.tsx index 8f0cd0caf1a2..bff215e7a6e2 100644 --- a/ui-v2/src/components/automations/automations-header/automations-header.tsx +++ b/ui-v2/src/components/automations/automations-header/automations-header.tsx @@ -1,3 +1,4 @@ +import { Link } from "@tanstack/react-router"; import { Breadcrumb, BreadcrumbItem, @@ -6,7 +7,6 @@ import { import { Button } from "@/components/ui/button"; import { DocsLink } from "@/components/ui/docs-link"; import { Icon } from "@/components/ui/icons"; -import { Link } from "@tanstack/react-router"; export const AutomationsHeader = () => { return ( diff --git a/ui-v2/src/components/automations/automations-page.tsx b/ui-v2/src/components/automations/automations-page.tsx index fd043f8f290a..1f777796a9b3 100644 --- a/ui-v2/src/components/automations/automations-page.tsx +++ b/ui-v2/src/components/automations/automations-page.tsx @@ -1,3 +1,4 @@ +import { useSuspenseQuery } from "@tanstack/react-query"; import { type Automation, buildListAutomationsQuery } from "@/api/automations"; import { Breadcrumb, @@ -7,7 +8,6 @@ import { } from "@/components/ui/breadcrumb"; import { Card } from "@/components/ui/card"; import { DeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; -import { useSuspenseQuery } from "@tanstack/react-query"; import { Typography } from "../ui/typography"; import { AutomationActions, diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/action-step.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/action-step.tsx index 79bafeb4b40e..6984f49db9fb 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/action-step.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/action-step.tsx @@ -1,8 +1,8 @@ +import { useWatch } from "react-hook-form"; import type { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icons"; import { Typography } from "@/components/ui/typography"; -import { useWatch } from "react-hook-form"; import { ActionTypeSelect } from "./action-type-select"; import { ChangeFlowRunStateFields } from "./change-flow-run-fields"; import { SelectAutomationsFields } from "./select-automations-fields"; diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/action-type-select.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/action-type-select.tsx index ac5cc625e51a..ad56792d64b9 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/action-type-select.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/action-type-select.tsx @@ -1,12 +1,4 @@ -import { - Select, - SelectContent, - SelectGroup, - SelectItem, - SelectLabel, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; +import { useFormContext } from "react-hook-form"; import { type ActionType, @@ -19,7 +11,15 @@ import { FormItem, FormLabel, } from "@/components/ui/form"; -import { useFormContext } from "react-hook-form"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; const AUTOMATION_ACTION_TYPES: Partial> = { "cancel-flow-run": "Cancel a flow run", diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.stories.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.stories.tsx index f8c97835f38e..36eb29b4a077 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.stories.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.stories.tsx @@ -1,5 +1,9 @@ +import { zodResolver } from "@hookform/resolvers/zod"; import type { Meta, StoryObj } from "@storybook/react"; - +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; +import { useForm } from "react-hook-form"; +import { fn } from "storybook/test"; import { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; import { Form } from "@/components/ui/form"; import { @@ -10,11 +14,6 @@ import { createFakeWorkQueue, } from "@/mocks"; import { reactQueryDecorator } from "@/storybook/utils"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; -import { useForm } from "react-hook-form"; -import { fn } from "storybook/test"; import { ActionsStep } from "./actions-step"; const MOCK_AUTOMATIONS_DATA = Array.from({ length: 5 }, createFakeAutomation); diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.test.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.test.tsx index 7291e631d609..483ea6b28ddc 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.test.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.test.tsx @@ -1,3 +1,11 @@ +import { zodResolver } from "@hookform/resolvers/zod"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { buildApiUrl, createWrapper, server } from "@tests/utils"; +import { mockPointerEvents } from "@tests/utils/browser"; +import { HttpResponse, http } from "msw"; +import { useForm } from "react-hook-form"; +import { beforeAll, describe, expect, it } from "vitest"; import type { Automation } from "@/api/automations"; import type { Deployment } from "@/api/deployments"; import type { Flow } from "@/api/flows"; @@ -12,14 +20,6 @@ import { createFakeWorkPool, createFakeWorkQueue, } from "@/mocks"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { render, screen } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; -import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { mockPointerEvents } from "@tests/utils/browser"; -import { http, HttpResponse } from "msw"; -import { useForm } from "react-hook-form"; -import { beforeAll, describe, expect, it } from "vitest"; import { ActionsStep } from "./actions-step"; const ActionStepFormContainer = () => { @@ -46,9 +46,7 @@ describe("ActionsStep", () => { // ------------ Setup render(); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Cancel a flow run" }), ); @@ -196,17 +194,13 @@ describe("ActionsStep", () => { }); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Pause an automation" }), ); expect(screen.getAllByText("Infer Automation")).toBeTruthy(); - await user.click( - screen.getByRole("combobox", { name: /select automation to pause/i }), - ); + await user.click(screen.getByLabelText(/select automation to pause/i)); await user.click(screen.getByRole("option", { name: "my automation 0" })); // ------------ Assert @@ -227,17 +221,13 @@ describe("ActionsStep", () => { }); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Resume an automation" }), ); expect(screen.getAllByText("Infer Automation")).toBeTruthy(); - await user.click( - screen.getByRole("combobox", { name: /select automation to resume/i }), - ); + await user.click(screen.getByLabelText(/select automation to resume/i)); await user.click(screen.getByRole("option", { name: "my automation 1" })); @@ -287,17 +277,13 @@ describe("ActionsStep", () => { }); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Pause a deployment" }), ); expect(screen.getAllByText("Infer Deployment")).toBeTruthy(); - await user.click( - screen.getByRole("combobox", { name: /select deployment to pause/i }), - ); + await user.click(screen.getByLabelText(/select deployment to pause/i)); await user.click(screen.getByRole("option", { name: "my deployment 0" })); // ------------ Assert @@ -322,19 +308,13 @@ describe("ActionsStep", () => { }); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Resume a deployment" }), ); expect(screen.getAllByText("Infer Deployment")).toBeTruthy(); - await user.click( - screen.getByRole("combobox", { - name: /select deployment to resume/i, - }), - ); + await user.click(screen.getByLabelText(/select deployment to resume/i)); await user.click(screen.getByRole("option", { name: "my deployment 1" })); @@ -369,17 +349,13 @@ describe("ActionsStep", () => { }); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Pause a work pool" }), ); expect(screen.getAllByText("Infer Work Pool")).toBeTruthy(); - await user.click( - screen.getByRole("combobox", { name: /select work pool to pause/i }), - ); + await user.click(screen.getByLabelText(/select work pool to pause/i)); await user.click(screen.getByRole("option", { name: "my work pool 0" })); // ------------ Assert @@ -400,19 +376,13 @@ describe("ActionsStep", () => { }); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Resume a work pool" }), ); expect(screen.getAllByText("Infer Work Pool")).toBeTruthy(); - await user.click( - screen.getByRole("combobox", { - name: /select work pool to resume/i, - }), - ); + await user.click(screen.getByLabelText(/select work pool to resume/i)); await user.click(screen.getByRole("option", { name: "my work pool 1" })); @@ -451,17 +421,13 @@ describe("ActionsStep", () => { }); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Pause a work queue" }), ); expect(screen.getAllByText("Infer Work Queue")).toBeTruthy(); - await user.click( - screen.getByRole("combobox", { name: /select work queue to pause/i }), - ); + await user.click(screen.getByLabelText(/select work queue to pause/i)); expect(screen.getByText("Work Pool A")).toBeVisible(); await user.click(screen.getByRole("option", { name: "my work queue 0" })); @@ -489,19 +455,13 @@ describe("ActionsStep", () => { }); // ------------ Act - await user.click( - screen.getByRole("combobox", { name: /select action/i }), - ); + await user.click(screen.getByLabelText(/select action/i)); await user.click( screen.getByRole("option", { name: "Resume a work queue" }), ); expect(screen.getAllByText("Infer Work Queue")).toBeTruthy(); - await user.click( - screen.getByRole("combobox", { - name: /select work queue to resume/i, - }), - ); + await user.click(screen.getByLabelText(/select work queue to resume/i)); expect(screen.getByText("Work Pool A")).toBeVisible(); await user.click(screen.getByRole("option", { name: "my work queue 1" })); diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.tsx index ecd868a15a40..87be266b1c12 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/actions-step.tsx @@ -1,8 +1,7 @@ +import { useFieldArray, useFormContext } from "react-hook-form"; +import type { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icons"; - -import type { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; -import { useFieldArray, useFormContext } from "react-hook-form"; import { ActionStep } from "./action-step"; export const ActionsStep = () => { diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/change-flow-run-fields.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/change-flow-run-fields.tsx index 583ef411d486..da344d8a8148 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/change-flow-run-fields.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/change-flow-run-fields.tsx @@ -1,3 +1,4 @@ +import { useFormContext } from "react-hook-form"; import type { components } from "@/api/prefect"; import type { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; import { @@ -18,7 +19,7 @@ import { SelectValue, } from "@/components/ui/select"; import { Textarea } from "@/components/ui/textarea"; -import { useFormContext } from "react-hook-form"; + const FLOW_STATES = { COMPLETED: "Completed", RUNNING: "Running", diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/select-automations-fields.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/select-automations-fields.tsx index 6e92cf49c461..fdb2502ca4e4 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/select-automations-fields.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/select-automations-fields.tsx @@ -1,3 +1,6 @@ +import { useQuery } from "@tanstack/react-query"; +import { useDeferredValue, useMemo, useState } from "react"; +import { useFormContext } from "react-hook-form"; import { type Automation, buildListAutomationsQuery } from "@/api/automations"; import { type AutomationWizardSchema, @@ -13,16 +16,12 @@ import { ComboboxContent, ComboboxTrigger, } from "@/components/ui/combobox"; - import { FormField, FormItem, FormLabel, FormMessage, } from "@/components/ui/form"; -import { useQuery } from "@tanstack/react-query"; -import { useDeferredValue, useMemo, useState } from "react"; -import { useFormContext } from "react-hook-form"; import { LoadingSelectState } from "./loading-select-state"; const INFER_OPTION = { diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/select-deployments-fields.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/select-deployments-fields.tsx index 98a7831fdb4b..1d5505d61da7 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/select-deployments-fields.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/select-deployments-fields.tsx @@ -1,3 +1,6 @@ +import { useState } from "react"; +import { useFormContext, useWatch } from "react-hook-form"; +import type { DeploymentWithFlow } from "@/api/deployments"; import { useListDeploymentsWithFlows } from "@/api/deployments/use-list-deployments-with-flows"; import { type AutomationWizardSchema, @@ -13,8 +16,6 @@ import { ComboboxContent, ComboboxTrigger, } from "@/components/ui/combobox"; - -import type { DeploymentWithFlow } from "@/api/deployments"; import { FormField, FormItem, @@ -23,8 +24,6 @@ import { } from "@/components/ui/form"; import { Icon } from "@/components/ui/icons"; import useDebounce from "@/hooks/use-debounce"; -import { useState } from "react"; -import { useFormContext, useWatch } from "react-hook-form"; import { LoadingSelectState } from "./loading-select-state"; const INFER_OPTION = { diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/select-work-pools-fields.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/select-work-pools-fields.tsx index af91a49786b4..68caeaf51add 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/select-work-pools-fields.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/select-work-pools-fields.tsx @@ -1,4 +1,7 @@ -import { type WorkPool, buildFilterWorkPoolsQuery } from "@/api/work-pools"; +import { useQuery } from "@tanstack/react-query"; +import { useDeferredValue, useMemo, useState } from "react"; +import { useFormContext } from "react-hook-form"; +import { buildFilterWorkPoolsQuery, type WorkPool } from "@/api/work-pools"; import { type AutomationWizardSchema, UNASSIGNED, @@ -13,16 +16,12 @@ import { ComboboxContent, ComboboxTrigger, } from "@/components/ui/combobox"; - import { FormField, FormItem, FormLabel, FormMessage, } from "@/components/ui/form"; -import { useQuery } from "@tanstack/react-query"; -import { useDeferredValue, useMemo, useState } from "react"; -import { useFormContext } from "react-hook-form"; import { LoadingSelectState } from "./loading-select-state"; const INFER_OPTION = { diff --git a/ui-v2/src/components/automations/automations-wizard/actions-step/select-work-queues-fields.tsx b/ui-v2/src/components/automations/automations-wizard/actions-step/select-work-queues-fields.tsx index 517ab098138d..023130a0cd2d 100644 --- a/ui-v2/src/components/automations/automations-wizard/actions-step/select-work-queues-fields.tsx +++ b/ui-v2/src/components/automations/automations-wizard/actions-step/select-work-queues-fields.tsx @@ -1,3 +1,7 @@ +import { useQuery } from "@tanstack/react-query"; +import { useDeferredValue, useMemo, useState } from "react"; +import { useFormContext } from "react-hook-form"; +import { buildFilterWorkQueuesQuery, type WorkQueue } from "@/api/work-queues"; import { type AutomationWizardSchema, UNASSIGNED, @@ -12,17 +16,12 @@ import { ComboboxContent, ComboboxTrigger, } from "@/components/ui/combobox"; - -import { type WorkQueue, buildFilterWorkQueuesQuery } from "@/api/work-queues"; import { FormField, FormItem, FormLabel, FormMessage, } from "@/components/ui/form"; -import { useQuery } from "@tanstack/react-query"; -import { useDeferredValue, useMemo, useState } from "react"; -import { useFormContext } from "react-hook-form"; import { LoadingSelectState } from "./loading-select-state"; const INFER_OPTION = { diff --git a/ui-v2/src/components/automations/automations-wizard/automation-wizard.stories.tsx b/ui-v2/src/components/automations/automations-wizard/automation-wizard.stories.tsx index 7dfe3bcf5e06..2244ed7c7a2b 100644 --- a/ui-v2/src/components/automations/automations-wizard/automation-wizard.stories.tsx +++ b/ui-v2/src/components/automations/automations-wizard/automation-wizard.stories.tsx @@ -1,3 +1,6 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; import { createFakeAutomation, createFakeDeployment, @@ -6,9 +9,6 @@ import { createFakeWorkQueue, } from "@/mocks"; import { reactQueryDecorator, routerDecorator } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; import { AutomationWizard } from "./automation-wizard"; const MOCK_AUTOMATIONS_DATA = Array.from({ length: 5 }, createFakeAutomation); diff --git a/ui-v2/src/components/automations/automations-wizard/automation-wizard.tsx b/ui-v2/src/components/automations/automations-wizard/automation-wizard.tsx index 0fb4635be473..161d7f54c7a3 100644 --- a/ui-v2/src/components/automations/automations-wizard/automation-wizard.tsx +++ b/ui-v2/src/components/automations/automations-wizard/automation-wizard.tsx @@ -1,12 +1,11 @@ -import { Stepper } from "@/components/ui/stepper"; -import { useStepper } from "@/hooks/use-stepper"; - -import { Button } from "@/components/ui/button"; -import { Card } from "@/components/ui/card"; -import { Form, FormMessage } from "@/components/ui/form"; import { zodResolver } from "@hookform/resolvers/zod"; import { Link } from "@tanstack/react-router"; import { useForm } from "react-hook-form"; +import { Button } from "@/components/ui/button"; +import { Card } from "@/components/ui/card"; +import { Form, FormMessage } from "@/components/ui/form"; +import { Stepper } from "@/components/ui/stepper"; +import { useStepper } from "@/hooks/use-stepper"; import { ActionsStep } from "./actions-step"; import { AutomationWizardSchema, diff --git a/ui-v2/src/components/automations/automations-wizard/details-step/details-step.stories.tsx b/ui-v2/src/components/automations/automations-wizard/details-step/details-step.stories.tsx index 50b69aa7bdf3..ef627f966c28 100644 --- a/ui-v2/src/components/automations/automations-wizard/details-step/details-step.stories.tsx +++ b/ui-v2/src/components/automations/automations-wizard/details-step/details-step.stories.tsx @@ -1,10 +1,9 @@ +import { zodResolver } from "@hookform/resolvers/zod"; import type { Meta, StoryObj } from "@storybook/react"; +import { useForm } from "react-hook-form"; import { fn } from "storybook/test"; - import { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; import { Form } from "@/components/ui/form"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; import { DetailsStep } from "./details-step"; const meta = { diff --git a/ui-v2/src/components/automations/automations-wizard/details-step/details-step.test.tsx b/ui-v2/src/components/automations/automations-wizard/details-step/details-step.test.tsx index 8b4622b25c48..454732f04ec4 100644 --- a/ui-v2/src/components/automations/automations-wizard/details-step/details-step.test.tsx +++ b/ui-v2/src/components/automations/automations-wizard/details-step/details-step.test.tsx @@ -1,12 +1,11 @@ import { zodResolver } from "@hookform/resolvers/zod"; -import { DetailsStep } from "./details-step"; - -import { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; -import { Form } from "@/components/ui/form"; import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { useForm } from "react-hook-form"; import { describe, expect, it } from "vitest"; +import { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; +import { Form } from "@/components/ui/form"; +import { DetailsStep } from "./details-step"; const DetailsStepFormContainer = () => { const form = useForm({ diff --git a/ui-v2/src/components/automations/automations-wizard/details-step/details-step.tsx b/ui-v2/src/components/automations/automations-wizard/details-step/details-step.tsx index 9f30d5ff1ddc..16f86813abce 100644 --- a/ui-v2/src/components/automations/automations-wizard/details-step/details-step.tsx +++ b/ui-v2/src/components/automations/automations-wizard/details-step/details-step.tsx @@ -1,3 +1,4 @@ +import { useFormContext } from "react-hook-form"; import type { AutomationWizardSchema } from "@/components/automations/automations-wizard/automation-schema"; import { FormControl, @@ -7,7 +8,6 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { useFormContext } from "react-hook-form"; export const DetailsStep = () => { const form = useFormContext(); diff --git a/ui-v2/src/components/automations/use-delete-automation-confirmation-dialog.ts b/ui-v2/src/components/automations/use-delete-automation-confirmation-dialog.ts index a2c11a0fcf0b..ef0e71873087 100644 --- a/ui-v2/src/components/automations/use-delete-automation-confirmation-dialog.ts +++ b/ui-v2/src/components/automations/use-delete-automation-confirmation-dialog.ts @@ -1,7 +1,7 @@ -import { type Automation, useDeleteAutomation } from "@/api/automations"; -import { useDeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; import { useNavigate } from "@tanstack/react-router"; import { toast } from "sonner"; +import { type Automation, useDeleteAutomation } from "@/api/automations"; +import { useDeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; export const useDeleteAutomationConfirmationDialog = () => { const navigate = useNavigate(); diff --git a/ui-v2/src/components/block-type-logo/block-type-logo.stories.tsx b/ui-v2/src/components/block-type-logo/block-type-logo.stories.tsx index e630aa5f48db..996261bb7437 100644 --- a/ui-v2/src/components/block-type-logo/block-type-logo.stories.tsx +++ b/ui-v2/src/components/block-type-logo/block-type-logo.stories.tsx @@ -1,6 +1,6 @@ +import type { Meta, StoryObj } from "@storybook/react"; import { BLOCK_TYPES } from "@/mocks"; import { routerDecorator, toastDecorator } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; import { BlockTypeLogo } from "./block-type-logo"; const meta = { diff --git a/ui-v2/src/components/block-type-logo/block-type-logo.tsx b/ui-v2/src/components/block-type-logo/block-type-logo.tsx index 32c5777a70b8..3938e16d6be3 100644 --- a/ui-v2/src/components/block-type-logo/block-type-logo.tsx +++ b/ui-v2/src/components/block-type-logo/block-type-logo.tsx @@ -1,5 +1,5 @@ -import type { BlockType } from "@/api/block-types"; import { cva } from "class-variance-authority"; +import type { BlockType } from "@/api/block-types"; type BlockTypeLogoProps = { alt?: string; diff --git a/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.stories.tsx b/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.stories.tsx index 8dbb45a41889..0c3c8339f912 100644 --- a/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.stories.tsx +++ b/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.stories.tsx @@ -1,7 +1,7 @@ -import { createFakeBlockDocument } from "@/mocks"; -import { routerDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeBlockDocument } from "@/mocks"; +import { routerDecorator, toastDecorator } from "@/storybook/utils"; import { BlockDocumentActionMenu } from "./block-document-action-menu"; const meta = { diff --git a/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.test.tsx b/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.test.tsx index 521cc934e471..b67bc58db3b3 100644 --- a/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.test.tsx +++ b/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.test.tsx @@ -1,17 +1,15 @@ -import { Toaster } from "@/components/ui/sonner"; - -import { render, screen, waitFor } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; -import { describe, expect, it, vi } from "vitest"; - -import { createFakeBlockDocument } from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; +import { render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { describe, expect, it, vi } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; +import { createFakeBlockDocument } from "@/mocks"; import { BlockDocumentActionMenu, type BlockDocumentActionMenuProps, diff --git a/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.tsx b/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.tsx index d66dc7c53100..5cde8a85c314 100644 --- a/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.tsx +++ b/ui-v2/src/components/blocks/block-document-action-menu/block-document-action-menu.tsx @@ -1,3 +1,5 @@ +import { Link } from "@tanstack/react-router"; +import { toast } from "sonner"; import type { BlockDocument } from "@/api/block-documents"; import { Button } from "@/components/ui/button"; import { @@ -8,8 +10,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; -import { Link } from "@tanstack/react-router"; -import { toast } from "sonner"; export type BlockDocumentActionMenuProps = { blockDocument: BlockDocument; diff --git a/ui-v2/src/components/blocks/block-document-create-page/block-document-create-page.tsx b/ui-v2/src/components/blocks/block-document-create-page/block-document-create-page.tsx index 059e4442c4fb..80589f218ef3 100644 --- a/ui-v2/src/components/blocks/block-document-create-page/block-document-create-page.tsx +++ b/ui-v2/src/components/blocks/block-document-create-page/block-document-create-page.tsx @@ -1,3 +1,8 @@ +import { zodResolver } from "@hookform/resolvers/zod"; +import { Link, useNavigate } from "@tanstack/react-router"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import { useCreateBlockDocument } from "@/api/block-documents"; import type { BlockSchema } from "@/api/block-schemas"; import type { BlockType } from "@/api/block-types"; @@ -18,11 +23,6 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { Link, useNavigate } from "@tanstack/react-router"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; import { BlockDocumentCreatePageHeader } from "./block-document-create-page-header"; type BlockDocumentCreatePageProps = { diff --git a/ui-v2/src/components/blocks/block-document-data-table/block-document-cell.tsx b/ui-v2/src/components/blocks/block-document-data-table/block-document-cell.tsx index 8f0a226a1289..6ac4dd54ef88 100644 --- a/ui-v2/src/components/blocks/block-document-data-table/block-document-cell.tsx +++ b/ui-v2/src/components/blocks/block-document-data-table/block-document-cell.tsx @@ -1,7 +1,7 @@ +import { Link } from "@tanstack/react-router"; import type { BlockDocument } from "@/api/block-documents"; import { BlockTypeLogo } from "@/components/block-type-logo/block-type-logo"; import { Typography } from "@/components/ui/typography"; -import { Link } from "@tanstack/react-router"; type BlockDocumentCellProps = { blockDocument: BlockDocument; diff --git a/ui-v2/src/components/blocks/block-document-data-table/block-document-data-table.stories.tsx b/ui-v2/src/components/blocks/block-document-data-table/block-document-data-table.stories.tsx index 83c43e692482..d720cc4f2357 100644 --- a/ui-v2/src/components/blocks/block-document-data-table/block-document-data-table.stories.tsx +++ b/ui-v2/src/components/blocks/block-document-data-table/block-document-data-table.stories.tsx @@ -1,7 +1,7 @@ -import type { BlockDocument } from "@/api/block-documents"; -import { routerDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import type { BlockDocument } from "@/api/block-documents"; +import { routerDecorator, toastDecorator } from "@/storybook/utils"; import { BlockDocumentsDataTable } from "./block-document-data-table"; const MOCK_BLOCK_DOCUMENT: BlockDocument = { diff --git a/ui-v2/src/components/blocks/block-document-data-table/block-document-data-table.tsx b/ui-v2/src/components/blocks/block-document-data-table/block-document-data-table.tsx index 8d381fdad750..c69e2be8747e 100644 --- a/ui-v2/src/components/blocks/block-document-data-table/block-document-data-table.tsx +++ b/ui-v2/src/components/blocks/block-document-data-table/block-document-data-table.tsx @@ -1,19 +1,18 @@ -import { Checkbox } from "@/components/ui/checkbox"; -import { DataTable } from "@/components/ui/data-table"; import type { CheckedState } from "@radix-ui/react-checkbox"; import { + createColumnHelper, + getCoreRowModel, type OnChangeFn, type PaginationState, type RowSelectionState, - createColumnHelper, - getCoreRowModel, useReactTable, } from "@tanstack/react-table"; import { useCallback } from "react"; - import type { BlockDocument } from "@/api/block-documents"; import { BlockDocumentActionMenu } from "@/components/blocks/block-document-action-menu"; import { useDeleteBlockDocumentConfirmationDialog } from "@/components/blocks/use-delete-block-document-confirmation-dialog"; +import { Checkbox } from "@/components/ui/checkbox"; +import { DataTable } from "@/components/ui/data-table"; import { DeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; import { BlockDocumentCell } from "./block-document-cell"; @@ -21,7 +20,9 @@ const columnHelper = createColumnHelper(); const createColumns = ({ onDelete, -}: { onDelete: (blockDocument: BlockDocument) => void }) => [ +}: { + onDelete: (blockDocument: BlockDocument) => void; +}) => [ columnHelper.display({ size: 20, id: "select", diff --git a/ui-v2/src/components/blocks/block-document-edit-page/block-document-edit-page.tsx b/ui-v2/src/components/blocks/block-document-edit-page/block-document-edit-page.tsx index 74535140e8ba..a402b1bd2a97 100644 --- a/ui-v2/src/components/blocks/block-document-edit-page/block-document-edit-page.tsx +++ b/ui-v2/src/components/blocks/block-document-edit-page/block-document-edit-page.tsx @@ -1,3 +1,6 @@ +import { Link, useNavigate } from "@tanstack/react-router"; +import { type FormEvent, useEffect } from "react"; +import { toast } from "sonner"; import { type BlockDocument, useUpdateBlockDocument, @@ -10,9 +13,6 @@ import { } from "@/components/schemas"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; -import { Link, useNavigate } from "@tanstack/react-router"; -import { type FormEvent, useEffect } from "react"; -import { toast } from "sonner"; import { BlockDocumentEditPageHeader } from "./block-document-edit-page-header"; type BlockDocumentEditPageProps = { diff --git a/ui-v2/src/components/blocks/block-type-details.tsx b/ui-v2/src/components/blocks/block-type-details.tsx index 50388b37f930..5e8474e2a4c5 100644 --- a/ui-v2/src/components/blocks/block-type-details.tsx +++ b/ui-v2/src/components/blocks/block-type-details.tsx @@ -1,11 +1,10 @@ +import Markdown from "react-markdown"; +import remarkGfm from "remark-gfm"; import type { BlockType } from "@/api/block-types"; import { BlockTypeLogo } from "@/components/block-type-logo/block-type-logo"; import { Card } from "@/components/ui/card"; import { Typography } from "@/components/ui/typography"; -import Markdown from "react-markdown"; -import remarkGfm from "remark-gfm"; - type BlockTypeDetailsProps = { blockType: BlockType; }; diff --git a/ui-v2/src/components/blocks/block-type-page/block-type-page.stories.tsx b/ui-v2/src/components/blocks/block-type-page/block-type-page.stories.tsx index 9156e09ba087..4831c975e21d 100644 --- a/ui-v2/src/components/blocks/block-type-page/block-type-page.stories.tsx +++ b/ui-v2/src/components/blocks/block-type-page/block-type-page.stories.tsx @@ -1,6 +1,6 @@ +import type { Meta, StoryObj } from "@storybook/react"; import { createFakeBlockType } from "@/mocks"; import { routerDecorator, toastDecorator } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; import { BlockTypePage } from "./block-type-page"; const meta = { diff --git a/ui-v2/src/components/blocks/block-type-page/block-type-page.tsx b/ui-v2/src/components/blocks/block-type-page/block-type-page.tsx index 3ed1db28b523..5d25a13af21c 100644 --- a/ui-v2/src/components/blocks/block-type-page/block-type-page.tsx +++ b/ui-v2/src/components/blocks/block-type-page/block-type-page.tsx @@ -1,3 +1,6 @@ +import { Link } from "@tanstack/react-router"; +import Markdown from "react-markdown"; +import remarkGfm from "remark-gfm"; import type { BlockType } from "@/api/block-types"; import { BlockTypeLogo } from "@/components/block-type-logo/block-type-logo"; import { PythonBlockSnippet } from "@/components/blocks/python-example-snippet"; @@ -11,9 +14,6 @@ import { import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { Typography } from "@/components/ui/typography"; -import { Link } from "@tanstack/react-router"; -import Markdown from "react-markdown"; -import remarkGfm from "remark-gfm"; type BlockTypePageProps = { blockType: BlockType; diff --git a/ui-v2/src/components/blocks/block-types-multi-select/block-types-multi-select.stories.tsx b/ui-v2/src/components/blocks/block-types-multi-select/block-types-multi-select.stories.tsx index 6697b7714853..f012b50477f3 100644 --- a/ui-v2/src/components/blocks/block-types-multi-select/block-types-multi-select.stories.tsx +++ b/ui-v2/src/components/blocks/block-types-multi-select/block-types-multi-select.stories.tsx @@ -1,9 +1,9 @@ -import { createFakeBlockType } from "@/mocks"; -import { reactQueryDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { useState } from "react"; +import { createFakeBlockType } from "@/mocks"; +import { reactQueryDecorator } from "@/storybook/utils"; import { BlockTypesMultiSelect } from "./block-types-multi-select"; const MOCK_BLOCK_TYPES = Array.from({ length: 5 }, createFakeBlockType); diff --git a/ui-v2/src/components/blocks/block-types-multi-select/block-types-multi-select.tsx b/ui-v2/src/components/blocks/block-types-multi-select/block-types-multi-select.tsx index 3e31fa29b840..e9741f0f86e1 100644 --- a/ui-v2/src/components/blocks/block-types-multi-select/block-types-multi-select.tsx +++ b/ui-v2/src/components/blocks/block-types-multi-select/block-types-multi-select.tsx @@ -1,10 +1,11 @@ "use client"; +import { useSuspenseQuery } from "@tanstack/react-query"; +import { Suspense, useDeferredValue, useMemo, useState } from "react"; import { type BlockType, buildListFilterBlockTypesQuery, } from "@/api/block-types"; - import { Combobox, ComboboxCommandEmtpy, @@ -16,8 +17,6 @@ import { ComboboxTrigger, } from "@/components/ui/combobox"; import { TagBadge } from "@/components/ui/tag-badge"; -import { useSuspenseQuery } from "@tanstack/react-query"; -import { Suspense, useDeferredValue, useMemo, useState } from "react"; type BlockTypesMultiSelectProps = { selectedBlockTypesSlugs: Array; diff --git a/ui-v2/src/components/blocks/blocks-catalog-page/block-type-card.tsx b/ui-v2/src/components/blocks/blocks-catalog-page/block-type-card.tsx index 4c4997c8e178..b9b2857d32ac 100644 --- a/ui-v2/src/components/blocks/blocks-catalog-page/block-type-card.tsx +++ b/ui-v2/src/components/blocks/blocks-catalog-page/block-type-card.tsx @@ -1,12 +1,11 @@ +import { Link } from "@tanstack/react-router"; +import Markdown from "react-markdown"; +import remarkGfm from "remark-gfm"; import type { BlockType } from "@/api/block-types"; import { BlockTypeLogo } from "@/components/block-type-logo/block-type-logo"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { Typography } from "@/components/ui/typography"; -import { Link } from "@tanstack/react-router"; - -import Markdown from "react-markdown"; -import remarkGfm from "remark-gfm"; type BlockTypeCardProps = { blockType: BlockType; diff --git a/ui-v2/src/components/blocks/blocks-catalog-page/blocks-catalog-page.stories.tsx b/ui-v2/src/components/blocks/blocks-catalog-page/blocks-catalog-page.stories.tsx index 7fbf092f51d4..72f56bdaaac4 100644 --- a/ui-v2/src/components/blocks/blocks-catalog-page/blocks-catalog-page.stories.tsx +++ b/ui-v2/src/components/blocks/blocks-catalog-page/blocks-catalog-page.stories.tsx @@ -1,7 +1,7 @@ -import { BLOCK_TYPES } from "@/mocks"; -import { routerDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { BLOCK_TYPES } from "@/mocks"; +import { routerDecorator, toastDecorator } from "@/storybook/utils"; import { BlocksCatalogPage } from "./blocks-catalog-page"; const meta = { diff --git a/ui-v2/src/components/blocks/blocks-page.tsx b/ui-v2/src/components/blocks/blocks-page.tsx index a697929292e2..e0a7f7284aa7 100644 --- a/ui-v2/src/components/blocks/blocks-page.tsx +++ b/ui-v2/src/components/blocks/blocks-page.tsx @@ -1,11 +1,11 @@ +import { Link } from "@tanstack/react-router"; +import type { PaginationState, RowSelectionState } from "@tanstack/react-table"; +import { useState } from "react"; import type { BlockDocument } from "@/api/block-documents"; import { Breadcrumb, BreadcrumbItem } from "@/components/ui/breadcrumb"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icons"; import { SearchInput } from "@/components/ui/input"; -import { Link } from "@tanstack/react-router"; -import type { PaginationState, RowSelectionState } from "@tanstack/react-table"; -import { useState } from "react"; import { BlockDocumentsDataTable } from "./block-document-data-table"; import { BlockTypesMultiSelect } from "./block-types-multi-select"; import { BlocksRowCount } from "./blocks-row-count"; diff --git a/ui-v2/src/components/blocks/blocks-row-count/blocks-row-count.test.tsx b/ui-v2/src/components/blocks/blocks-row-count/blocks-row-count.test.tsx index 014820acea43..d8bc410947ad 100644 --- a/ui-v2/src/components/blocks/blocks-row-count/blocks-row-count.test.tsx +++ b/ui-v2/src/components/blocks/blocks-row-count/blocks-row-count.test.tsx @@ -1,15 +1,15 @@ -import { Toaster } from "@/components/ui/sonner"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { describe, expect, it, vi } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; import { BlocksRowCount, type BlocksRowCountProps } from "./blocks-row-count"; // Wraps component in test with a Tanstack router provider diff --git a/ui-v2/src/components/blocks/blocks-row-count/blocks-row-count.tsx b/ui-v2/src/components/blocks/blocks-row-count/blocks-row-count.tsx index 5b3c47a586cf..791b13486877 100644 --- a/ui-v2/src/components/blocks/blocks-row-count/blocks-row-count.tsx +++ b/ui-v2/src/components/blocks/blocks-row-count/blocks-row-count.tsx @@ -1,11 +1,11 @@ +import type { OnChangeFn, RowSelectionState } from "@tanstack/react-table"; +import { useMemo } from "react"; import { useDeleteBlockDocumentConfirmationDialog } from "@/components/blocks/use-delete-block-document-confirmation-dialog"; import { Button } from "@/components/ui/button"; import { DeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; import { Icon } from "@/components/ui/icons"; import { Typography } from "@/components/ui/typography"; import { pluralize } from "@/utils"; -import type { OnChangeFn, RowSelectionState } from "@tanstack/react-table"; -import { useMemo } from "react"; export type BlocksRowCountProps = { count: number; diff --git a/ui-v2/src/components/blocks/empty-state/empty-state.stories.tsx b/ui-v2/src/components/blocks/empty-state/empty-state.stories.tsx index b5035e6db4aa..ef9e9c3b8eb5 100644 --- a/ui-v2/src/components/blocks/empty-state/empty-state.stories.tsx +++ b/ui-v2/src/components/blocks/empty-state/empty-state.stories.tsx @@ -1,5 +1,5 @@ -import { routerDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; +import { routerDecorator } from "@/storybook/utils"; import { BlocksEmptyState } from "./empty-state"; diff --git a/ui-v2/src/components/blocks/empty-state/empty-state.tsx b/ui-v2/src/components/blocks/empty-state/empty-state.tsx index a76134d0997c..db6ebbb67eed 100644 --- a/ui-v2/src/components/blocks/empty-state/empty-state.tsx +++ b/ui-v2/src/components/blocks/empty-state/empty-state.tsx @@ -1,3 +1,4 @@ +import { Link } from "@tanstack/react-router"; import { Button } from "@/components/ui/button"; import { DocsLink } from "@/components/ui/docs-link"; import { @@ -8,7 +9,6 @@ import { EmptyStateTitle, } from "@/components/ui/empty-state"; import { Icon } from "@/components/ui/icons"; -import { Link } from "@tanstack/react-router"; export const BlocksEmptyState = () => ( diff --git a/ui-v2/src/components/blocks/python-example-snippet.tsx b/ui-v2/src/components/blocks/python-example-snippet.tsx index db1509d0a223..c115baa1acee 100644 --- a/ui-v2/src/components/blocks/python-example-snippet.tsx +++ b/ui-v2/src/components/blocks/python-example-snippet.tsx @@ -1,5 +1,5 @@ -import { PythonInput } from "@/components/ui/python-input"; import { useMemo } from "react"; +import { PythonInput } from "@/components/ui/python-input"; type PythonBlockSnippetProps = { codeExample: string; diff --git a/ui-v2/src/components/blocks/use-delete-block-document-confirmation-dialog.ts b/ui-v2/src/components/blocks/use-delete-block-document-confirmation-dialog.ts index 22467553e553..2d3c68c770df 100644 --- a/ui-v2/src/components/blocks/use-delete-block-document-confirmation-dialog.ts +++ b/ui-v2/src/components/blocks/use-delete-block-document-confirmation-dialog.ts @@ -1,10 +1,10 @@ +import { useNavigate } from "@tanstack/react-router"; +import { toast } from "sonner"; import { type BlockDocument, useDeleteBlockDocument, } from "@/api/block-documents"; import { useDeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; -import { useNavigate } from "@tanstack/react-router"; -import { toast } from "sonner"; export const useDeleteBlockDocumentConfirmationDialog = () => { const navigate = useNavigate(); diff --git a/ui-v2/src/components/concurrency/concurrency-limits-tabs.tsx b/ui-v2/src/components/concurrency/concurrency-limits-tabs.tsx index 5cf97be1c40b..b4e1ddc797b3 100644 --- a/ui-v2/src/components/concurrency/concurrency-limits-tabs.tsx +++ b/ui-v2/src/components/concurrency/concurrency-limits-tabs.tsx @@ -1,7 +1,7 @@ -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import type { TabOptions } from "@/routes/concurrency-limits"; import { getRouteApi } from "@tanstack/react-router"; import type { JSX } from "react"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import type { TabOptions } from "@/routes/concurrency-limits"; const routeApi = getRouteApi("/concurrency-limits/"); diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.stories.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.stories.tsx index 5a3ad0256640..88536ddf7189 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.stories.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.stories.tsx @@ -1,7 +1,7 @@ -import { createFakeGlobalConcurrencyLimit } from "@/mocks"; -import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeGlobalConcurrencyLimit } from "@/mocks"; +import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; import { GlobalConcurrencyLimitsCreateOrEditDialog } from "./global-concurrency-limits-create-or-edit-dialog"; const meta = { diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.test.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.test.tsx index 4242be417f41..03c48d7803b4 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.test.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.test.tsx @@ -1,9 +1,8 @@ -import { GlobalConcurrencyLimitsCreateOrEditDialog } from "./global-concurrency-limits-create-or-edit-dialog"; - import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { beforeAll, describe, expect, it, vi } from "vitest"; +import { GlobalConcurrencyLimitsCreateOrEditDialog } from "./global-concurrency-limits-create-or-edit-dialog"; const MOCK_DATA = { id: "0", diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/use-create-or-edit-global-concurrency-limit-form.ts b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/use-create-or-edit-global-concurrency-limit-form.ts index d7259d261156..12e72bb8e20d 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/use-create-or-edit-global-concurrency-limit-form.ts +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/use-create-or-edit-global-concurrency-limit-form.ts @@ -1,13 +1,13 @@ -import { - type GlobalConcurrencyLimit, - useCreateGlobalConcurrencyLimit, - useUpdateGlobalConcurrencyLimit, -} from "@/api/global-concurrency-limits"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; +import { + type GlobalConcurrencyLimit, + useCreateGlobalConcurrencyLimit, + useUpdateGlobalConcurrencyLimit, +} from "@/api/global-concurrency-limits"; const formSchema = z.object({ active: z.boolean().default(true), diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/actions-cell.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/actions-cell.tsx index 179e89f28b96..e4872a4dd15a 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/actions-cell.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/actions-cell.tsx @@ -1,3 +1,5 @@ +import type { CellContext } from "@tanstack/react-table"; +import { toast } from "sonner"; import type { GlobalConcurrencyLimit } from "@/api/global-concurrency-limits"; import { Button } from "@/components/ui/button"; import { @@ -8,8 +10,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; -import type { CellContext } from "@tanstack/react-table"; -import { toast } from "sonner"; type ActionsCellProps = CellContext & { onEditRow: (row: GlobalConcurrencyLimit) => void; diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/active-cell.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/active-cell.tsx index 32982ceed309..90062aefbf33 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/active-cell.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/active-cell.tsx @@ -1,10 +1,10 @@ +import type { CellContext } from "@tanstack/react-table"; +import { toast } from "sonner"; import { type GlobalConcurrencyLimit, useUpdateGlobalConcurrencyLimit, } from "@/api/global-concurrency-limits"; import { Switch } from "@/components/ui/switch"; -import type { CellContext } from "@tanstack/react-table"; -import { toast } from "sonner"; export const ActiveCell = ( props: CellContext, diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.stories.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.stories.tsx index 87ef2fde74e2..dc0ff4dccdae 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.stories.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.stories.tsx @@ -1,7 +1,7 @@ -import { createFakeGlobalConcurrencyLimit } from "@/mocks"; -import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeGlobalConcurrencyLimit } from "@/mocks"; +import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; import { Table as GlobalConcurrencyLimitsDataTable } from "./global-concurrency-limits-data-table"; const MOCK_DATA = [ diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.test.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.test.tsx index 94fc8ec3eda2..8c4104c3beb6 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.test.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.test.tsx @@ -1,8 +1,8 @@ -import { Toaster } from "@/components/ui/sonner"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { describe, expect, it, vi } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; import { Table } from "./global-concurrency-limits-data-table"; const MOCK_ROW = { diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.tsx index 567bfefd3be9..8120e549e54f 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.tsx @@ -1,5 +1,3 @@ -import type { GlobalConcurrencyLimit } from "@/api/global-concurrency-limits"; -import { DataTable } from "@/components/ui/data-table"; import { getRouteApi } from "@tanstack/react-router"; import { createColumnHelper, @@ -7,9 +5,10 @@ import { getPaginationRowModel, useReactTable, } from "@tanstack/react-table"; - -import { SearchInput } from "@/components/ui/input"; import { useDeferredValue, useMemo } from "react"; +import type { GlobalConcurrencyLimit } from "@/api/global-concurrency-limits"; +import { DataTable } from "@/components/ui/data-table"; +import { SearchInput } from "@/components/ui/input"; import { ActionsCell } from "./actions-cell"; import { ActiveCell } from "./active-cell"; diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.stories.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.stories.tsx index 71972b409da2..8bfdfc35c1ed 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.stories.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.stories.tsx @@ -1,8 +1,7 @@ -import { createFakeGlobalConcurrencyLimit } from "@/mocks"; - -import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeGlobalConcurrencyLimit } from "@/mocks"; +import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; import { GlobalConcurrencyLimitsDeleteDialog } from "./global-concurrency-limits-delete-dialog"; const meta = { diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.test.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.test.tsx index 3cf322bbe82b..2d7f1fb14bcc 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.test.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.test.tsx @@ -1,9 +1,8 @@ -import { GlobalConcurrencyLimitsDeleteDialog } from "./global-concurrency-limits-delete-dialog"; - import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { expect, test, vi } from "vitest"; +import { GlobalConcurrencyLimitsDeleteDialog } from "./global-concurrency-limits-delete-dialog"; const MOCK_DATA = { id: "0", diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.tsx index 22bf21679b65..6d943315080d 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.tsx @@ -1,3 +1,4 @@ +import { toast } from "sonner"; import { type GlobalConcurrencyLimit, useDeleteGlobalConcurrencyLimit, @@ -12,7 +13,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { toast } from "sonner"; type GlobalConcurrencyLimitsDeleteDialogProps = { limit: GlobalConcurrencyLimit; diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-header/global-concurrency-limits-header.test.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-header/global-concurrency-limits-header.test.tsx index 470c85b34b6e..ae99933c6af2 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-header/global-concurrency-limits-header.test.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-header/global-concurrency-limits-header.test.tsx @@ -1,8 +1,7 @@ -import { GlobalConcurrencyLimitsHeader } from "./global-concurrency-limits-header"; - import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { expect, test, vi } from "vitest"; +import { GlobalConcurrencyLimitsHeader } from "./global-concurrency-limits-header"; test("GlobalConcurrencyLimitsHeader can successfully call onAdd", async () => { const user = userEvent.setup(); diff --git a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/index.tsx b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/index.tsx index d07dea8597af..b9c1dc367bb3 100644 --- a/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/index.tsx +++ b/ui-v2/src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/index.tsx @@ -1,8 +1,8 @@ +import { useState } from "react"; import { type GlobalConcurrencyLimit, useListGlobalConcurrencyLimits, } from "@/api/global-concurrency-limits"; -import { useState } from "react"; import { GlobalConcurrencyLimitsDataTable } from "@/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table"; import { GlobalConcurrencyLimitsEmptyState } from "@/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state"; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-active-task-runs/task-run-concurrency-limit-active-task-runs.stories.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-active-task-runs/task-run-concurrency-limit-active-task-runs.stories.tsx index 9382eb623cb0..4f512037be69 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-active-task-runs/task-run-concurrency-limit-active-task-runs.stories.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-active-task-runs/task-run-concurrency-limit-active-task-runs.stories.tsx @@ -1,6 +1,6 @@ +import type { Meta, StoryObj } from "@storybook/react"; import { createFakeFlow, createFakeFlowRun, createFakeTaskRun } from "@/mocks"; import { routerDecorator } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; import { TaskRunConcurrencyLimitActiveTaskRuns } from "./task-run-concurrency-limit-active-task-runs"; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details/task-run-concurrency-limit-details.stories.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details/task-run-concurrency-limit-details.stories.tsx index 92543ee5567c..c9ed94578782 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details/task-run-concurrency-limit-details.stories.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details/task-run-concurrency-limit-details.stories.tsx @@ -1,5 +1,5 @@ -import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; import type { Meta, StoryObj } from "@storybook/react"; +import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; import { TaskRunConcurrencyLimitDetails } from "./task-run-concurrency-limit-details"; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details/task-run-concurrency-limit-details.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details/task-run-concurrency-limit-details.tsx index 1b62a2dc4f16..a1764fac027c 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details/task-run-concurrency-limit-details.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details/task-run-concurrency-limit-details.tsx @@ -1,8 +1,7 @@ -import { cn } from "@/lib/utils"; - -import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; import { format, parseISO } from "date-fns"; import React from "react"; +import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; +import { cn } from "@/lib/utils"; type TaskRunConcurrencyLimitDetailsProps = { data: TaskRunConcurrencyLimit; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-header/task-run-concurrency-limit-header.stories.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-header/task-run-concurrency-limit-header.stories.tsx index 75b0a0a071b2..7c63ebb102cb 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-header/task-run-concurrency-limit-header.stories.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-header/task-run-concurrency-limit-header.stories.tsx @@ -1,7 +1,7 @@ -import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; -import { routerDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; +import { routerDecorator, toastDecorator } from "@/storybook/utils"; import { TaskRunConcurrencyLimitHeader } from "./task-run-concurrency-limit-header"; const meta = { diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/index.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/index.tsx index ec9e4bff2a47..f7f5f2109082 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/index.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/index.tsx @@ -1,13 +1,12 @@ -import { buildConcurrenyLimitDetailsActiveRunsQuery } from "@/api/task-run-concurrency-limits"; -import { TaskRunConcurrencyLimitHeader } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-header"; +import { useSuspenseQuery } from "@tanstack/react-query"; +import { Await } from "@tanstack/react-router"; import { useState } from "react"; - +import { buildConcurrenyLimitDetailsActiveRunsQuery } from "@/api/task-run-concurrency-limits"; import { TaskRunConcurrencyLimitActiveTaskRuns } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-active-task-runs"; import { TaskRunConcurrencyLimitDetails } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-details"; +import { TaskRunConcurrencyLimitHeader } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-header"; import { Card } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; -import { useSuspenseQuery } from "@tanstack/react-query"; -import { Await } from "@tanstack/react-router"; import { type Dialogs, TaskRunConcurrencyLimitDialog, diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/task-run-concurrency-limit-dialog.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/task-run-concurrency-limit-dialog.tsx index 38d1b50762c6..ece5099d8aa8 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/task-run-concurrency-limit-dialog.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/task-run-concurrency-limit-dialog.tsx @@ -1,7 +1,7 @@ +import { useNavigate } from "@tanstack/react-router"; import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; import { TaskRunConcurrencyLimitsDeleteDialog } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog"; import { TaskRunConcurrencyLimitsResetDialog } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog"; -import { useNavigate } from "@tanstack/react-router"; export type Dialogs = null | "delete" | "reset"; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/task-run-concurrency-limit-tab-navigation.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/task-run-concurrency-limit-tab-navigation.tsx index d9970fcbb353..28a84edea4a6 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/task-run-concurrency-limit-tab-navigation.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limit-page/task-run-concurrency-limit-tab-navigation.tsx @@ -1,6 +1,6 @@ +import { getRouteApi } from "@tanstack/react-router"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import type { TabOptions } from "@/routes/concurrency-limits/concurrency-limit.$id"; -import { getRouteApi } from "@tanstack/react-router"; const routeApi = getRouteApi("/concurrency-limits/concurrency-limit/$id"); diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.stories.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.stories.tsx index f6b746c79294..926b3ed37bc2 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.stories.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.stories.tsx @@ -1,7 +1,6 @@ -import { toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; - import { fn } from "storybook/test"; +import { toastDecorator } from "@/storybook/utils"; import { TaskRunConcurrencyLimitsActionsMenu } from "./task-run-concurrency-limits-actions-menu"; const meta = { diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.test.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.test.tsx index 7458ce85fad8..6b9dd93a2baf 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.test.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.test.tsx @@ -1,8 +1,7 @@ -import { Toaster } from "@/components/ui/sonner"; - import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { describe, expect, it, vi } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; import { TaskRunConcurrencyLimitsActionsMenu } from "./task-run-concurrency-limits-actions-menu"; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.tsx index d54b40238263..15ad6cb6ce4c 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu/task-run-concurrency-limits-actions-menu.tsx @@ -1,3 +1,4 @@ +import { toast } from "sonner"; import { Button } from "@/components/ui/button"; import { DropdownMenu, @@ -7,7 +8,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; -import { toast } from "sonner"; type TaskRunConcurrencyLimitsActionsMenuProps = { id: string; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.stories.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.stories.tsx index 5ee05d7a5509..bd92f0fe44cd 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.stories.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.stories.tsx @@ -1,6 +1,6 @@ -import { reactQueryDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { reactQueryDecorator } from "@/storybook/utils"; import { TaskRunConcurrencyLimitsCreateDialog } from "./task-run-concurrency-limits-create-dialog"; const meta = { diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.tsx index bea8ba2949c0..bc356f854339 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.tsx @@ -1,3 +1,7 @@ +import { zodResolver } from "@hookform/resolvers/zod"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import { useCreateTaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; import { Button } from "@/components/ui/button"; import { @@ -17,10 +21,6 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; const formSchema = z.object({ tag: z.string().min(1), diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/active-task-runs-cell.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/active-task-runs-cell.tsx index eea276838333..996a0e7e61c1 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/active-task-runs-cell.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/active-task-runs-cell.tsx @@ -1,5 +1,5 @@ -import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; import type { CellContext } from "@tanstack/react-table"; +import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; type ActiveTaskRunCellsProps = CellContext< TaskRunConcurrencyLimit, diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/tag-cell.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/tag-cell.tsx index c6a957a156ae..b4e15180a9d6 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/tag-cell.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/tag-cell.tsx @@ -1,6 +1,6 @@ -import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; import { Link } from "@tanstack/react-router"; import type { CellContext } from "@tanstack/react-table"; +import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; type TagCellProps = CellContext; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.stories.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.stories.tsx index e83a6efca2ac..a5bf5ae1ee6d 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.stories.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.stories.tsx @@ -1,7 +1,7 @@ -import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; -import { routerDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; +import { routerDecorator, toastDecorator } from "@/storybook/utils"; import { Table as TaskRunConcurrencyLimitsDataTable } from "./task-run-concurrency-limits-data-table"; const MOCK_DATA = [ diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.tsx index 61598dd4e739..a9e0e69b0348 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.tsx @@ -1,7 +1,3 @@ -import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; -import { TaskRunConcurrencyLimitsActionsMenu } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu"; -import { DataTable } from "@/components/ui/data-table"; -import { SearchInput } from "@/components/ui/input"; import { getRouteApi } from "@tanstack/react-router"; import { createColumnHelper, @@ -10,6 +6,10 @@ import { useReactTable, } from "@tanstack/react-table"; import { useDeferredValue, useMemo } from "react"; +import type { TaskRunConcurrencyLimit } from "@/api/task-run-concurrency-limits"; +import { TaskRunConcurrencyLimitsActionsMenu } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu"; +import { DataTable } from "@/components/ui/data-table"; +import { SearchInput } from "@/components/ui/input"; import { ActiveTaskRunCells } from "./active-task-runs-cell"; import { TagCell } from "./tag-cell"; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.stories.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.stories.tsx index 1896f7e2b093..0ee6b41163bc 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.stories.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.stories.tsx @@ -1,7 +1,7 @@ -import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; -import { reactQueryDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; +import { reactQueryDecorator } from "@/storybook/utils"; import { TaskRunConcurrencyLimitsDeleteDialog } from "./task-run-concurrency-limits-delete-dialog"; const meta = { diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.test.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.test.tsx index db0fad431cef..7f7a8c618b8c 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.test.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.test.tsx @@ -1,9 +1,8 @@ -import { TaskRunConcurrencyLimitsDeleteDialog } from "./task-run-concurrency-limits-delete-dialog"; - import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { expect, test, vi } from "vitest"; +import { TaskRunConcurrencyLimitsDeleteDialog } from "./task-run-concurrency-limits-delete-dialog"; const MOCK_DATA = { id: "0", diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.tsx index 8eaef1724a65..22969869d271 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog/task-run-concurrency-limits-delete-dialog.tsx @@ -1,3 +1,4 @@ +import { toast } from "sonner"; import { type TaskRunConcurrencyLimit, useDeleteTaskRunConcurrencyLimit, @@ -12,7 +13,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { toast } from "sonner"; type TaskRunConcurrencyLimitsDeleteDialogProps = { data: TaskRunConcurrencyLimit; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header/task-run-conrrency-limits-header.test.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header/task-run-conrrency-limits-header.test.tsx index bdb30e0c9244..eed3012c63c4 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header/task-run-conrrency-limits-header.test.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header/task-run-conrrency-limits-header.test.tsx @@ -1,8 +1,7 @@ -import { TaskRunConcurrencyLimitsHeader } from "./task-run-concurrency-limits-header"; - import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { expect, test, vi } from "vitest"; +import { TaskRunConcurrencyLimitsHeader } from "./task-run-concurrency-limits-header"; test("TaskRunConcurrencyLimitsHeader can successfully call onAdd", async () => { const user = userEvent.setup(); diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limit-reset-dialog.stories.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limit-reset-dialog.stories.tsx index 775dc91a9d92..ef225609445d 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limit-reset-dialog.stories.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limit-reset-dialog.stories.tsx @@ -1,7 +1,7 @@ -import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; -import { reactQueryDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { createFakeTaskRunConcurrencyLimit } from "@/mocks"; +import { reactQueryDecorator } from "@/storybook/utils"; import { TaskRunConcurrencyLimitsResetDialog } from "./task-run-concurrency-limits-reset-dialog"; const meta = { diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limits-reset-dialog.test.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limits-reset-dialog.test.tsx index a49bfa4ede85..21483282ba08 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limits-reset-dialog.test.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limits-reset-dialog.test.tsx @@ -1,9 +1,8 @@ -import { TaskRunConcurrencyLimitsResetDialog } from "./task-run-concurrency-limits-reset-dialog"; - import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { expect, test, vi } from "vitest"; +import { TaskRunConcurrencyLimitsResetDialog } from "./task-run-concurrency-limits-reset-dialog"; const MOCK_DATA = { id: "0", diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limits-reset-dialog.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limits-reset-dialog.tsx index 4492a27b4a1e..da2dd319b57f 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limits-reset-dialog.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog/task-run-concurrency-limits-reset-dialog.tsx @@ -1,3 +1,4 @@ +import { toast } from "sonner"; import { type TaskRunConcurrencyLimit, useResetTaskRunConcurrencyLimitTag, @@ -12,7 +13,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { toast } from "sonner"; type TaskRunConcurrencyLimitsResetDialogProps = { data: TaskRunConcurrencyLimit; diff --git a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/index.tsx b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/index.tsx index 40378211aae2..a07b50adadc7 100644 --- a/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/index.tsx +++ b/ui-v2/src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/index.tsx @@ -1,8 +1,8 @@ +import { useState } from "react"; import { type TaskRunConcurrencyLimit, useListTaskRunConcurrencyLimits, } from "@/api/task-run-concurrency-limits"; -import { useState } from "react"; import { TaskRunConcurrencyLimitsDataTable } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table"; import { TaskRunConcurrencyLimitsEmptyState } from "@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state"; @@ -40,24 +40,22 @@ export const TaskRunConcurrencyLimitsView = () => { }; return ( - <> -
- - {data.length === 0 ? ( - - ) : ( - - )} - + + {data.length === 0 ? ( + + ) : ( + -
- + )} + +
); }; diff --git a/ui-v2/src/components/deployments/create-flow-run-form/create-flow-run-form.stories.tsx b/ui-v2/src/components/deployments/create-flow-run-form/create-flow-run-form.stories.tsx index 77daf17f9b98..f396ffbbcf39 100644 --- a/ui-v2/src/components/deployments/create-flow-run-form/create-flow-run-form.stories.tsx +++ b/ui-v2/src/components/deployments/create-flow-run-form/create-flow-run-form.stories.tsx @@ -1,3 +1,6 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; import { createFakeDeployment, createFakeFlowRun, @@ -9,9 +12,6 @@ import { routerDecorator, toastDecorator, } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; import { CreateFlowRunForm } from "./create-flow-run-form"; const MOCK_WORK_POOLS_DATA = Array.from({ length: 5 }, createFakeWorkPool); diff --git a/ui-v2/src/components/deployments/create-flow-run-form/create-flow-run-form.tsx b/ui-v2/src/components/deployments/create-flow-run-form/create-flow-run-form.tsx index 7dac5482e467..66a427bbe5fc 100644 --- a/ui-v2/src/components/deployments/create-flow-run-form/create-flow-run-form.tsx +++ b/ui-v2/src/components/deployments/create-flow-run-form/create-flow-run-form.tsx @@ -1,6 +1,7 @@ +import { Link } from "@tanstack/react-router"; import type { Deployment } from "@/api/deployments"; -import { SchemaForm } from "@/components/schemas"; import type { PrefectSchemaObject } from "@/components/schemas"; +import { SchemaForm } from "@/components/schemas"; import { Accordion, AccordionContent, @@ -23,7 +24,6 @@ import { TagsInput } from "@/components/ui/tags-input"; import { Textarea } from "@/components/ui/textarea"; import { Typography } from "@/components/ui/typography"; import { WorkQueueSelect } from "@/components/work-pools/work-queue-select"; -import { Link } from "@tanstack/react-router"; import { FlowRunNameInput } from "./flow-run-name-input"; import { FlowRunStartInput } from "./flow-run-start-input"; import { useCreateFlowRunForm } from "./use-create-flow-run-form"; diff --git a/ui-v2/src/components/deployments/create-flow-run-form/flow-run-name-input.tsx b/ui-v2/src/components/deployments/create-flow-run-form/flow-run-name-input.tsx index e38ee2d0efc3..380a5e583159 100644 --- a/ui-v2/src/components/deployments/create-flow-run-form/flow-run-name-input.tsx +++ b/ui-v2/src/components/deployments/create-flow-run-form/flow-run-name-input.tsx @@ -1,7 +1,7 @@ +import clsx from "clsx"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icons"; import { Input, type InputProps } from "@/components/ui/input"; -import clsx from "clsx"; import { createFakeFlowRunName } from "./create-fake-flow-run-name"; type FlowRunNameInputProps = InputProps & { diff --git a/ui-v2/src/components/deployments/create-flow-run-form/flow-run-start-input.tsx b/ui-v2/src/components/deployments/create-flow-run-form/flow-run-start-input.tsx index 29c25d3d810c..79461c7cf2fe 100644 --- a/ui-v2/src/components/deployments/create-flow-run-form/flow-run-start-input.tsx +++ b/ui-v2/src/components/deployments/create-flow-run-form/flow-run-start-input.tsx @@ -1,7 +1,7 @@ +import { useState } from "react"; import { DateTimePicker } from "@/components/ui/date-time-picker"; import { Label } from "@/components/ui/label"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { useState } from "react"; const TAB_OPTIONS = { now: { diff --git a/ui-v2/src/components/deployments/create-flow-run-form/use-create-flow-run-form.tsx b/ui-v2/src/components/deployments/create-flow-run-form/use-create-flow-run-form.tsx index 3d3b7a9dd955..02fb55fc526a 100644 --- a/ui-v2/src/components/deployments/create-flow-run-form/use-create-flow-run-form.tsx +++ b/ui-v2/src/components/deployments/create-flow-run-form/use-create-flow-run-form.tsx @@ -1,3 +1,9 @@ +import { zodResolver } from "@hookform/resolvers/zod"; +import { Link, useNavigate } from "@tanstack/react-router"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; import type { Deployment } from "@/api/deployments"; import { type CreateNewFlowRun, @@ -7,12 +13,6 @@ import { useSchemaForm } from "@/components/schemas"; import type { SchemaFormValues } from "@/components/schemas/types/values"; import { Button } from "@/components/ui/button"; import { formatDate } from "@/utils/date"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { Link, useNavigate } from "@tanstack/react-router"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; import { createFakeFlowRunName } from "./create-fake-flow-run-name"; const formSchema = z.object({ diff --git a/ui-v2/src/components/deployments/custom-run-page.tsx b/ui-v2/src/components/deployments/custom-run-page.tsx index 8824e958850a..bb7e57e75fb2 100644 --- a/ui-v2/src/components/deployments/custom-run-page.tsx +++ b/ui-v2/src/components/deployments/custom-run-page.tsx @@ -1,6 +1,6 @@ +import { useSuspenseQuery } from "@tanstack/react-query"; import { buildDeploymentDetailsQuery } from "@/api/deployments"; import { CreateFlowRunForm } from "@/components/deployments/create-flow-run-form"; -import { useSuspenseQuery } from "@tanstack/react-query"; import { DeploymentActionHeader } from "./deployment-action-header"; import { DeploymentLinks } from "./deployment-links"; diff --git a/ui-v2/src/components/deployments/data-table/cells.tsx b/ui-v2/src/components/deployments/data-table/cells.tsx index 07dba2524646..3adaf33742b9 100644 --- a/ui-v2/src/components/deployments/data-table/cells.tsx +++ b/ui-v2/src/components/deployments/data-table/cells.tsx @@ -1,5 +1,10 @@ -import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; - +import { useQuery } from "@tanstack/react-query"; +import { Link } from "@tanstack/react-router"; +import type { CellContext } from "@tanstack/react-table"; +import { subSeconds } from "date-fns"; +import { secondsInWeek } from "date-fns/constants"; +import { useCallback, useState } from "react"; +import { toast } from "sonner"; import type { DeploymentWithFlow } from "@/api/deployments"; import { buildFilterFlowRunsQuery } from "@/api/flow-runs"; import { useQuickRun } from "@/components/deployments/use-quick-run"; @@ -7,19 +12,13 @@ import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, + DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { FlowRunActivityBarChart } from "@/components/ui/flow-run-activity-bar-graph"; import { Icon } from "@/components/ui/icons"; import useDebounce from "@/hooks/use-debounce"; -import { useQuery } from "@tanstack/react-query"; -import { Link } from "@tanstack/react-router"; -import type { CellContext } from "@tanstack/react-table"; -import { subSeconds } from "date-fns"; -import { secondsInWeek } from "date-fns/constants"; -import { useCallback, useState } from "react"; -import { toast } from "sonner"; type ActionsCellProps = CellContext & { onDelete: (deployment: DeploymentWithFlow) => void; diff --git a/ui-v2/src/components/deployments/data-table/data-table.stories.tsx b/ui-v2/src/components/deployments/data-table/data-table.stories.tsx index 4d418161d611..bfd37fb40b76 100644 --- a/ui-v2/src/components/deployments/data-table/data-table.stories.tsx +++ b/ui-v2/src/components/deployments/data-table/data-table.stories.tsx @@ -1,3 +1,8 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; +import { type ComponentProps, useMemo, useState } from "react"; +import { fn } from "storybook/test"; import type { FlowRunWithDeploymentAndFlow } from "@/api/flow-runs"; import { createFakeDeploymentWithFlow } from "@/mocks"; import { createFakeFlowRunWithDeploymentAndFlow } from "@/mocks/create-fake-flow-run"; @@ -6,11 +11,6 @@ import { routerDecorator, toastDecorator, } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; -import { type ComponentProps, useMemo, useState } from "react"; -import { fn } from "storybook/test"; import { DeploymentsDataTable } from "."; export default { diff --git a/ui-v2/src/components/deployments/data-table/data-table.test.tsx b/ui-v2/src/components/deployments/data-table/data-table.test.tsx index d09f0e48e268..dc76bc40cbc4 100644 --- a/ui-v2/src/components/deployments/data-table/data-table.test.tsx +++ b/ui-v2/src/components/deployments/data-table/data-table.test.tsx @@ -1,23 +1,22 @@ -import type { DeploymentWithFlow } from "@/api/deployments"; -import { Toaster } from "@/components/ui/sonner"; -import { - createFakeFlowRun, - createFakeFlowRunWithDeploymentAndFlow, -} from "@/mocks/create-fake-flow-run"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; import { mockPointerEvents } from "@tests/utils/browser"; -import { HttpResponse } from "msw"; -import { http } from "msw"; +import { HttpResponse, http } from "msw"; import { beforeEach, describe, expect, it, vi } from "vitest"; +import type { DeploymentWithFlow } from "@/api/deployments"; +import { Toaster } from "@/components/ui/sonner"; +import { + createFakeFlowRun, + createFakeFlowRunWithDeploymentAndFlow, +} from "@/mocks/create-fake-flow-run"; import { DeploymentsDataTable, type DeploymentsDataTableProps } from "."; describe("DeploymentsDataTable", () => { diff --git a/ui-v2/src/components/deployments/data-table/index.tsx b/ui-v2/src/components/deployments/data-table/index.tsx index aa7186e4aa7e..b6bd37f87063 100644 --- a/ui-v2/src/components/deployments/data-table/index.tsx +++ b/ui-v2/src/components/deployments/data-table/index.tsx @@ -1,3 +1,15 @@ +import { Link } from "@tanstack/react-router"; +import type { + ColumnFiltersState, + OnChangeFn, + PaginationState, +} from "@tanstack/react-table"; +import { + createColumnHelper, + getCoreRowModel, + useReactTable, +} from "@tanstack/react-table"; +import { useCallback } from "react"; import type { DeploymentWithFlow } from "@/api/deployments"; import type { components } from "@/api/prefect"; import { useDeleteDeploymentConfirmationDialog } from "@/components/deployments/use-delete-deployment-confirmation-dialog"; @@ -18,18 +30,6 @@ import { StatusBadge } from "@/components/ui/status-badge"; import { TagBadgeGroup } from "@/components/ui/tag-badge-group"; import { TagsInput } from "@/components/ui/tags-input"; import { pluralize } from "@/utils"; -import { Link } from "@tanstack/react-router"; -import type { - ColumnFiltersState, - OnChangeFn, - PaginationState, -} from "@tanstack/react-table"; -import { - createColumnHelper, - getCoreRowModel, - useReactTable, -} from "@tanstack/react-table"; -import { useCallback } from "react"; import { ActionsCell, ActivityCell } from "./cells"; export type DeploymentsDataTableProps = { diff --git a/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.stories.tsx b/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.stories.tsx index 95c59f44df9b..cdd0bc8950ff 100644 --- a/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.stories.tsx +++ b/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.stories.tsx @@ -1,6 +1,6 @@ -import { routerDecorator, toastDecorator } from "@/storybook/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { fn } from "storybook/test"; +import { routerDecorator, toastDecorator } from "@/storybook/utils"; import { DeploymentActionMenu } from "./deployment-action-menu"; diff --git a/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.test.tsx b/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.test.tsx index a2b90b8b9ea4..69b727798d1a 100644 --- a/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.test.tsx +++ b/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.test.tsx @@ -1,16 +1,14 @@ -import { Toaster } from "@/components/ui/sonner"; - -import { render, screen, waitFor } from "@testing-library/react"; -import userEvent from "@testing-library/user-event"; -import { describe, expect, it, vi } from "vitest"; - import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; +import { render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { describe, expect, it, vi } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; import { DeploymentActionMenu, type DeploymentActionMenuProps, diff --git a/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.tsx b/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.tsx index e30530bcd74d..b859209f7ae6 100644 --- a/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.tsx +++ b/ui-v2/src/components/deployments/deployment-action-menu/deployment-action-menu.tsx @@ -1,3 +1,5 @@ +import { Link } from "@tanstack/react-router"; +import { toast } from "sonner"; import { Button } from "@/components/ui/button"; import { DropdownMenu, @@ -7,8 +9,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; -import { Link } from "@tanstack/react-router"; -import { toast } from "sonner"; export type DeploymentActionMenuProps = { id: string; diff --git a/ui-v2/src/components/deployments/deployment-description.tsx b/ui-v2/src/components/deployments/deployment-description.tsx index 5256dfe8f130..87c548135ce5 100644 --- a/ui-v2/src/components/deployments/deployment-description.tsx +++ b/ui-v2/src/components/deployments/deployment-description.tsx @@ -1,6 +1,6 @@ -import type { Deployment } from "@/api/deployments"; import Markdown from "react-markdown"; import remarkGfm from "remark-gfm"; +import type { Deployment } from "@/api/deployments"; type DeploymentDescriptionProps = { deployment: Deployment; diff --git a/ui-v2/src/components/deployments/deployment-details-page.tsx b/ui-v2/src/components/deployments/deployment-details-page.tsx index 6eca74276c67..cf5874e6556d 100644 --- a/ui-v2/src/components/deployments/deployment-details-page.tsx +++ b/ui-v2/src/components/deployments/deployment-details-page.tsx @@ -1,7 +1,7 @@ -import { buildDeploymentDetailsQuery } from "@/api/deployments"; -import { DeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; import { useSuspenseQuery } from "@tanstack/react-query"; import { useMemo, useState } from "react"; +import { buildDeploymentDetailsQuery } from "@/api/deployments"; +import { DeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; import { DeploymentActionMenu } from "./deployment-action-menu"; import { DeploymentDetailsHeader } from "./deployment-details-header"; diff --git a/ui-v2/src/components/deployments/deployment-details-runs-tab.tsx b/ui-v2/src/components/deployments/deployment-details-runs-tab.tsx index 7f52d5c74e2c..bc51014bf790 100644 --- a/ui-v2/src/components/deployments/deployment-details-runs-tab.tsx +++ b/ui-v2/src/components/deployments/deployment-details-runs-tab.tsx @@ -1,8 +1,11 @@ +import { getRouteApi } from "@tanstack/react-router"; +import { useCallback, useMemo } from "react"; import type { Deployment } from "@/api/deployments"; import { useFilterFlowRunswithFlows } from "@/api/flow-runs/use-filter-flow-runs-with-flows"; import { usePaginateFlowRunswithFlows } from "@/api/flow-runs/use-paginate-flow-runs-with-flows"; import { FlowRunCard } from "@/components/flow-runs/flow-run-card"; import { + FLOW_RUN_STATES_NO_SCHEDULED, type FlowRunState, FlowRunsFilters, FlowRunsList, @@ -12,10 +15,7 @@ import { type SortFilters, useFlowRunsSelectedRows, } from "@/components/flow-runs/flow-runs-list"; -import { FLOW_RUN_STATES_NO_SCHEDULED } from "@/components/flow-runs/flow-runs-list"; import { Typography } from "@/components/ui/typography"; -import { getRouteApi } from "@tanstack/react-router"; -import { useCallback, useMemo } from "react"; const routeApi = getRouteApi("/deployments/deployment/$id"); diff --git a/ui-v2/src/components/deployments/deployment-details-tabs.tsx b/ui-v2/src/components/deployments/deployment-details-tabs.tsx index 715d972d532f..286aa83adef2 100644 --- a/ui-v2/src/components/deployments/deployment-details-tabs.tsx +++ b/ui-v2/src/components/deployments/deployment-details-tabs.tsx @@ -1,8 +1,8 @@ +import { getRouteApi, Link } from "@tanstack/react-router"; +import { type JSX, useMemo } from "react"; import type { Deployment } from "@/api/deployments"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import type { DeploymentDetailsTabOptions } from "@/routes/deployments/deployment.$id"; -import { Link, getRouteApi } from "@tanstack/react-router"; -import { type JSX, useMemo } from "react"; import { DeploymentConfiguration } from "./deployment-configuration"; import { DeploymentDescription } from "./deployment-description"; diff --git a/ui-v2/src/components/deployments/deployment-details-upcoming-tab.tsx b/ui-v2/src/components/deployments/deployment-details-upcoming-tab.tsx index 3eb6800ef9c2..e64230a3e53f 100644 --- a/ui-v2/src/components/deployments/deployment-details-upcoming-tab.tsx +++ b/ui-v2/src/components/deployments/deployment-details-upcoming-tab.tsx @@ -1,5 +1,5 @@ import { getRouteApi } from "@tanstack/react-router"; - +import { useCallback, useMemo } from "react"; import type { Deployment } from "@/api/deployments"; import { usePaginateFlowRunswithFlows } from "@/api/flow-runs/use-paginate-flow-runs-with-flows"; import { @@ -12,7 +12,6 @@ import { type SortFilters, useFlowRunsSelectedRows, } from "@/components/flow-runs/flow-runs-list"; -import { useCallback, useMemo } from "react"; const routeApi = getRouteApi("/deployments/deployment/$id"); diff --git a/ui-v2/src/components/deployments/deployment-duplicate-page.tsx b/ui-v2/src/components/deployments/deployment-duplicate-page.tsx index 18a4d33cde43..e63b82bf698b 100644 --- a/ui-v2/src/components/deployments/deployment-duplicate-page.tsx +++ b/ui-v2/src/components/deployments/deployment-duplicate-page.tsx @@ -1,5 +1,5 @@ -import { buildDeploymentDetailsQuery } from "@/api/deployments"; import { useSuspenseQuery } from "@tanstack/react-query"; +import { buildDeploymentDetailsQuery } from "@/api/deployments"; import { DeploymentActionHeader } from "./deployment-action-header"; import { DeploymentForm } from "./deployment-form"; diff --git a/ui-v2/src/components/deployments/deployment-edit-page.tsx b/ui-v2/src/components/deployments/deployment-edit-page.tsx index b6dea186555c..3ae462108894 100644 --- a/ui-v2/src/components/deployments/deployment-edit-page.tsx +++ b/ui-v2/src/components/deployments/deployment-edit-page.tsx @@ -1,5 +1,5 @@ -import { buildDeploymentDetailsQuery } from "@/api/deployments"; import { useSuspenseQuery } from "@tanstack/react-query"; +import { buildDeploymentDetailsQuery } from "@/api/deployments"; import { DeploymentActionHeader } from "./deployment-action-header"; import { DeploymentForm } from "./deployment-form"; diff --git a/ui-v2/src/components/deployments/deployment-form/deployment-form.stories.tsx b/ui-v2/src/components/deployments/deployment-form/deployment-form.stories.tsx index 7903c54d8226..ea30f50587b6 100644 --- a/ui-v2/src/components/deployments/deployment-form/deployment-form.stories.tsx +++ b/ui-v2/src/components/deployments/deployment-form/deployment-form.stories.tsx @@ -1,3 +1,6 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; import { createFakeDeployment, createFakeWorkPool, @@ -8,9 +11,6 @@ import { routerDecorator, toastDecorator, } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; import { DeploymentForm } from "./deployment-form"; const MOCK_WORK_POOLS_DATA = Array.from({ length: 5 }, createFakeWorkPool); diff --git a/ui-v2/src/components/deployments/deployment-form/deployment-form.tsx b/ui-v2/src/components/deployments/deployment-form/deployment-form.tsx index 2a34a8369ea4..ee4ae213acde 100644 --- a/ui-v2/src/components/deployments/deployment-form/deployment-form.tsx +++ b/ui-v2/src/components/deployments/deployment-form/deployment-form.tsx @@ -1,7 +1,8 @@ +import { Link } from "@tanstack/react-router"; import type { Deployment } from "@/api/deployments"; import { GlobalConcurrencyLimitSelect } from "@/components/global-concurrency-limit/global-concurrency-limit-select"; -import { SchemaForm } from "@/components/schemas"; import type { PrefectSchemaObject } from "@/components/schemas"; +import { SchemaForm } from "@/components/schemas"; import { Button } from "@/components/ui/button"; import { Form, @@ -19,7 +20,6 @@ import { TagsInput } from "@/components/ui/tags-input"; import { Typography } from "@/components/ui/typography"; import { WorkPoolSelect } from "@/components/work-pools/work-pool-select"; import { WorkQueueSelect } from "@/components/work-pools/work-queue-select"; -import { Link } from "@tanstack/react-router"; import { LimitCollissionStrategySelect } from "./limit-collision-strategy-select"; import { useDeploymentForm } from "./use-deployment-form"; diff --git a/ui-v2/src/components/deployments/deployment-form/use-deployment-form.ts b/ui-v2/src/components/deployments/deployment-form/use-deployment-form.ts index 7922228a3bf3..b9578379c42c 100644 --- a/ui-v2/src/components/deployments/deployment-form/use-deployment-form.ts +++ b/ui-v2/src/components/deployments/deployment-form/use-deployment-form.ts @@ -1,15 +1,15 @@ -import { - type Deployment, - useCreateDeployment, - useUpdateDeployment, -} from "@/api/deployments"; -import { useSchemaForm } from "@/components/schemas"; import { zodResolver } from "@hookform/resolvers/zod"; import { useNavigate } from "@tanstack/react-router"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; +import { + type Deployment, + useCreateDeployment, + useUpdateDeployment, +} from "@/api/deployments"; +import { useSchemaForm } from "@/components/schemas"; type FormMode = "edit" | "duplicate"; diff --git a/ui-v2/src/components/deployments/deployment-metadata.tsx b/ui-v2/src/components/deployments/deployment-metadata.tsx index 910153d4eed6..0cb7610a2c2b 100644 --- a/ui-v2/src/components/deployments/deployment-metadata.tsx +++ b/ui-v2/src/components/deployments/deployment-metadata.tsx @@ -1,8 +1,7 @@ import type { Deployment } from "@/api/deployments"; -import { cn } from "@/lib/utils"; - import { StatusBadge } from "@/components/ui/status-badge"; import { TagBadgeGroup } from "@/components/ui/tag-badge-group"; +import { cn } from "@/lib/utils"; type DeploymentMetadataProps = { deployment: Deployment; @@ -16,9 +15,10 @@ const FieldLabel = ({ children }: { children: React.ReactNode }) => ( const FieldValue = ({ className, children, -}: { className?: string; children: React.ReactNode }) => ( -
{children}
-); +}: { + className?: string; + children: React.ReactNode; +}) =>
{children}
; export const DeploymentMetadata = ({ deployment }: DeploymentMetadataProps) => { const TOP_FIELDS = [ { @@ -115,7 +115,7 @@ export const DeploymentMetadata = ({ deployment }: DeploymentMetadataProps) => { field: "Tags", ComponentValue: () => deployment.tags && deployment.tags.length > 0 ? ( -
+
) : ( diff --git a/ui-v2/src/components/deployments/deployment-parameters-table/deployment-parameters-table.tsx b/ui-v2/src/components/deployments/deployment-parameters-table/deployment-parameters-table.tsx index 3ae06c48ba5e..f85e65474ac2 100644 --- a/ui-v2/src/components/deployments/deployment-parameters-table/deployment-parameters-table.tsx +++ b/ui-v2/src/components/deployments/deployment-parameters-table/deployment-parameters-table.tsx @@ -1,8 +1,3 @@ -import type { Deployment } from "@/api/deployments"; -import { DataTable } from "@/components/ui/data-table"; -import { SearchInput } from "@/components/ui/input"; -import { Typography } from "@/components/ui/typography"; -import { pluralize } from "@/utils"; import { createColumnHelper, getCoreRowModel, @@ -10,6 +5,11 @@ import { useReactTable, } from "@tanstack/react-table"; import { useDeferredValue, useMemo, useState } from "react"; +import type { Deployment } from "@/api/deployments"; +import { DataTable } from "@/components/ui/data-table"; +import { SearchInput } from "@/components/ui/input"; +import { Typography } from "@/components/ui/typography"; +import { pluralize } from "@/utils"; type DeploymentParametersTableProps = { deployment: Deployment; diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.test.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.test.tsx index b0832deee25d..2e3e9734e7d3 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.test.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.test.tsx @@ -1,11 +1,10 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; +import { createWrapper } from "@tests/utils"; +import { mockPointerEvents } from "@tests/utils/browser"; import { beforeAll, describe, expect, it, vi } from "vitest"; - import { Dialog } from "@/components/ui/dialog"; import { Toaster } from "@/components/ui/sonner"; -import { createWrapper } from "@tests/utils"; -import { mockPointerEvents } from "@tests/utils/browser"; import { CronScheduleForm, type CronScheduleFormProps, @@ -36,9 +35,7 @@ describe("CronScheduleForm", () => { await user.type(screen.getByLabelText(/value/i), "* * * * 1/2"); await user.click(screen.getByRole("switch", { name: /day or/i })); - await user.click( - screen.getByRole("combobox", { name: /select timezone/i }), - ); + await user.click(screen.getByLabelText(/select timezone/i)); await user.click(screen.getByRole("option", { name: /africa \/ asmera/i })); await user.click(screen.getByRole("button", { name: /save/i })); diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.tsx index 72fc4a4480ee..a6c25a00cc4a 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.tsx @@ -1,8 +1,14 @@ +import { zodResolver } from "@hookform/resolvers/zod"; +import { CronExpressionParser } from "cron-parser"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; +import type { DeploymentSchedule } from "@/api/deployments"; import { useCreateDeploymentSchedule, useUpdateDeploymentSchedule, } from "@/api/deployments"; -import type { DeploymentSchedule } from "@/api/deployments"; import { Button } from "@/components/ui/button"; import { CronInput } from "@/components/ui/cron-input"; import { @@ -25,12 +31,6 @@ import { Icon } from "@/components/ui/icons"; import { Switch } from "@/components/ui/switch"; import { TimezoneSelect } from "@/components/ui/timezone-select"; import { Typography } from "@/components/ui/typography"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { CronExpressionParser } from "cron-parser"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; const verifyCronValue = (cronValue: string) => { try { diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/deployment-schedule-dialog.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/deployment-schedule-dialog.tsx index 4f266f625047..028621d78ba4 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/deployment-schedule-dialog.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/deployment-schedule-dialog.tsx @@ -1,3 +1,4 @@ +import { useEffect, useState } from "react"; import type { DeploymentSchedule } from "@/api/deployments"; import { Dialog, @@ -6,8 +7,6 @@ import { DialogTitle, } from "@/components/ui/dialog"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; - -import { useEffect, useState } from "react"; import { CronScheduleForm } from "./cron-schedule-form"; import { IntervalScheduleForm } from "./interval-schedule-form"; import { RRuleScheduleForm } from "./rrule-schedule-form"; diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/interval-schedule-form.test.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/interval-schedule-form.test.tsx index 7fab4bc34acd..26c6a46381b9 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/interval-schedule-form.test.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/interval-schedule-form.test.tsx @@ -1,10 +1,9 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { beforeAll, describe, expect, it, vi } from "vitest"; - -import { Dialog } from "@/components/ui/dialog"; import { createWrapper } from "@tests/utils"; import { mockPointerEvents } from "@tests/utils/browser"; +import { beforeAll, describe, expect, it, vi } from "vitest"; +import { Dialog } from "@/components/ui/dialog"; import { IntervalScheduleForm, type IntervalScheduleFormProps, @@ -33,12 +32,10 @@ describe("CronScheduleForm", () => { await user.clear(screen.getByLabelText(/value/i)); await user.type(screen.getByLabelText(/value/i), "100"); - await user.click(screen.getByRole("combobox", { name: /interval/i })); + await user.click(screen.getByLabelText(/interval/i)); await user.click(screen.getByRole("option", { name: /hours/i })); - await user.click( - screen.getByRole("combobox", { name: /select timezone/i }), - ); + await user.click(screen.getByLabelText(/select timezone/i)); await user.click(screen.getByRole("option", { name: /africa \/ asmera/i })); await user.click(screen.getByRole("button", { name: /save/i })); diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/interval-schedule-form.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/interval-schedule-form.tsx index ee68bd090a58..f70edc3a611d 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/interval-schedule-form.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/interval-schedule-form.tsx @@ -1,8 +1,13 @@ +import { zodResolver } from "@hookform/resolvers/zod"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; +import type { DeploymentSchedule } from "@/api/deployments"; import { useCreateDeploymentSchedule, useUpdateDeploymentSchedule, } from "@/api/deployments"; -import type { DeploymentSchedule } from "@/api/deployments"; import { Button } from "@/components/ui/button"; import { Calendar } from "@/components/ui/calendar"; import { DialogFooter, DialogTrigger } from "@/components/ui/dialog"; @@ -32,11 +37,6 @@ import { Switch } from "@/components/ui/switch"; import { TimezoneSelect } from "@/components/ui/timezone-select"; import { cn } from "@/lib/utils"; import { formatDate } from "@/utils/date"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; const INTERVALS = [ { label: "Seconds", value: "seconds" }, diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/rrule-schedule-form.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/rrule-schedule-form.tsx index 29105894172b..4906f67dd8c4 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/rrule-schedule-form.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/rrule-schedule-form.tsx @@ -1,7 +1,7 @@ +import { DialogTrigger } from "@radix-ui/react-dialog"; import { Button } from "@/components/ui/button"; import { DialogFooter } from "@/components/ui/dialog"; import { Typography } from "@/components/ui/typography"; -import { DialogTrigger } from "@radix-ui/react-dialog"; export const RRuleScheduleForm = () => { return ( diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-toggle.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-toggle.tsx index 37bc60dc5e3c..c3b9a790bec5 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-toggle.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-toggle.tsx @@ -1,3 +1,4 @@ +import { toast } from "sonner"; import { type Deployment, useUpdateDeployment } from "@/api/deployments"; import { Switch } from "@/components/ui/switch"; import { @@ -6,7 +7,6 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; -import { toast } from "sonner"; type DeploymentScheduleToggleProps = { deployment: Deployment; diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedules.stories.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedules.stories.tsx index cbc22b97d61f..f92a48bacdad 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedules.stories.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedules.stories.tsx @@ -1,12 +1,12 @@ +import { randRecentDate, randUuid } from "@ngneat/falso"; +import type { Meta, StoryObj } from "@storybook/react"; + +import { createFakeDeployment } from "@/mocks"; import { reactQueryDecorator, routerDecorator, toastDecorator, } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; - -import { createFakeDeployment } from "@/mocks"; -import { randRecentDate, randUuid } from "@ngneat/falso"; import { DeploymentSchedules } from "./deployment-schedules"; const baseDeploymentSchedule = { diff --git a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedules.tsx b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedules.tsx index 0c01b8537501..5cefe0e1c0b9 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/deployment-schedules.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/deployment-schedules.tsx @@ -1,8 +1,8 @@ +import { useMemo } from "react"; import type { Deployment } from "@/api/deployments"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icons"; import { Typography } from "@/components/ui/typography"; -import { useMemo } from "react"; import { DeploymentScheduleItem } from "./deployment-schedule-item"; import { DeploymentScheduleToggle } from "./deployment-schedule-toggle"; diff --git a/ui-v2/src/components/deployments/deployment-schedules/get-schedule-title.test.ts b/ui-v2/src/components/deployments/deployment-schedules/get-schedule-title.test.ts index 28c8eb18706d..63bc1585a8f4 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/get-schedule-title.test.ts +++ b/ui-v2/src/components/deployments/deployment-schedules/get-schedule-title.test.ts @@ -1,6 +1,6 @@ -import type { DeploymentSchedule } from "@/api/deployments"; import { randRecentDate, randUuid } from "@ngneat/falso"; import { describe, expect, it } from "vitest"; +import type { DeploymentSchedule } from "@/api/deployments"; import { getScheduleTitle } from "./get-schedule-title"; describe("getScheduleTitle()", () => { diff --git a/ui-v2/src/components/deployments/deployment-schedules/get-schedule-title.ts b/ui-v2/src/components/deployments/deployment-schedules/get-schedule-title.ts index 16f5e6153a0e..f3a0d0497126 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/get-schedule-title.ts +++ b/ui-v2/src/components/deployments/deployment-schedules/get-schedule-title.ts @@ -1,7 +1,7 @@ -import type { DeploymentSchedule } from "@/api/deployments"; import cronstrue from "cronstrue"; import humanizeDuration from "humanize-duration"; import { rrulestr } from "rrule"; +import type { DeploymentSchedule } from "@/api/deployments"; export const getScheduleTitle = (deploymentSchedule: DeploymentSchedule) => { const { schedule } = deploymentSchedule; diff --git a/ui-v2/src/components/deployments/deployment-schedules/schedule-action-menu.test.tsx b/ui-v2/src/components/deployments/deployment-schedules/schedule-action-menu.test.tsx index 0f320008dd3d..be2ce1deecf6 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/schedule-action-menu.test.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/schedule-action-menu.test.tsx @@ -1,9 +1,9 @@ -import { Toaster } from "@/components/ui/sonner"; import { randRecentDate, randUuid } from "@ngneat/falso"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { describe, expect, it, vi } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; import { ScheduleActionMenu } from "./schedule-action-menu"; const MOCK_DEPLOYMENT_SCHEDULE = { diff --git a/ui-v2/src/components/deployments/deployment-schedules/schedule-action-menu.tsx b/ui-v2/src/components/deployments/deployment-schedules/schedule-action-menu.tsx index 4e4c7a40f771..e299c3d821ed 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/schedule-action-menu.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/schedule-action-menu.tsx @@ -1,3 +1,4 @@ +import { toast } from "sonner"; import type { DeploymentSchedule } from "@/api/deployments"; import { Button } from "@/components/ui/button"; import { DeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; @@ -9,7 +10,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; -import { toast } from "sonner"; import { useDeleteSchedule } from "./use-delete-schedule"; type ScheduleActionMenuProps = { diff --git a/ui-v2/src/components/deployments/deployment-schedules/schedule-toggle-switch.test.tsx b/ui-v2/src/components/deployments/deployment-schedules/schedule-toggle-switch.test.tsx index e6b3732ac6fe..01937428b5b9 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/schedule-toggle-switch.test.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/schedule-toggle-switch.test.tsx @@ -1,9 +1,9 @@ -import { Toaster } from "@/components/ui/sonner"; import { randRecentDate, randUuid } from "@ngneat/falso"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { createWrapper } from "@tests/utils"; import { expect, test } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; import { ScheduleToggleSwitch } from "./schedule-toggle-switch"; const MOCK_DEPLOYMENT_SCHEDULE = { diff --git a/ui-v2/src/components/deployments/deployment-schedules/schedule-toggle-switch.tsx b/ui-v2/src/components/deployments/deployment-schedules/schedule-toggle-switch.tsx index a563f5b9cb48..48f9ab6895f9 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/schedule-toggle-switch.tsx +++ b/ui-v2/src/components/deployments/deployment-schedules/schedule-toggle-switch.tsx @@ -1,5 +1,6 @@ -import { useUpdateDeploymentSchedule } from "@/api/deployments"; +import { toast } from "sonner"; import type { DeploymentSchedule } from "@/api/deployments"; +import { useUpdateDeploymentSchedule } from "@/api/deployments"; import { Switch } from "@/components/ui/switch"; import { Tooltip, @@ -7,7 +8,6 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; -import { toast } from "sonner"; import { getScheduleTitle } from "./get-schedule-title"; type ScheduleToggleSwitchProps = { diff --git a/ui-v2/src/components/deployments/deployment-schedules/use-delete-schedule.ts b/ui-v2/src/components/deployments/deployment-schedules/use-delete-schedule.ts index 442188cf8f6a..159f9ac4696e 100644 --- a/ui-v2/src/components/deployments/deployment-schedules/use-delete-schedule.ts +++ b/ui-v2/src/components/deployments/deployment-schedules/use-delete-schedule.ts @@ -1,7 +1,7 @@ -import { useDeleteDeploymentSchedule } from "@/api/deployments"; +import { toast } from "sonner"; import type { DeploymentSchedule } from "@/api/deployments"; +import { useDeleteDeploymentSchedule } from "@/api/deployments"; import { useDeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; -import { toast } from "sonner"; import { getScheduleTitle } from "./get-schedule-title"; export const useDeleteSchedule = () => { diff --git a/ui-v2/src/components/deployments/deployment-triggers.tsx b/ui-v2/src/components/deployments/deployment-triggers.tsx index 970220c8df15..c315d98cd4ff 100644 --- a/ui-v2/src/components/deployments/deployment-triggers.tsx +++ b/ui-v2/src/components/deployments/deployment-triggers.tsx @@ -1,12 +1,12 @@ +import { useSuspenseQuery } from "@tanstack/react-query"; +import { Link } from "@tanstack/react-router"; +import { Suspense } from "react"; import type { Automation } from "@/api/automations"; import { buildListAutomationsRelatedQuery } from "@/api/automations/automations"; import type { Deployment } from "@/api/deployments"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icons"; import { Skeleton } from "@/components/ui/skeleton"; -import { useSuspenseQuery } from "@tanstack/react-query"; -import { Link } from "@tanstack/react-router"; -import { Suspense } from "react"; type DeploymentTriggersProps = { deployment: Deployment; diff --git a/ui-v2/src/components/deployments/run-flow-button/run-flow-button.stories.tsx b/ui-v2/src/components/deployments/run-flow-button/run-flow-button.stories.tsx index 5c7ac8164974..6f892a3616cd 100644 --- a/ui-v2/src/components/deployments/run-flow-button/run-flow-button.stories.tsx +++ b/ui-v2/src/components/deployments/run-flow-button/run-flow-button.stories.tsx @@ -1,13 +1,12 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; +import { createFakeAutomation, createFakeDeployment } from "@/mocks"; import { reactQueryDecorator, routerDecorator, toastDecorator, } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; - -import { createFakeAutomation, createFakeDeployment } from "@/mocks"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; import { RunFlowButton } from "./run-flow-button"; const meta = { diff --git a/ui-v2/src/components/deployments/run-flow-button/run-flow-button.test.tsx b/ui-v2/src/components/deployments/run-flow-button/run-flow-button.test.tsx index 6f0b7c6de726..f97a7e4f71fe 100644 --- a/ui-v2/src/components/deployments/run-flow-button/run-flow-button.test.tsx +++ b/ui-v2/src/components/deployments/run-flow-button/run-flow-button.test.tsx @@ -1,17 +1,17 @@ -import { Toaster } from "@/components/ui/sonner"; -import { createFakeDeployment, createFakeFlowRun } from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { render, screen, waitFor } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { buildApiUrl, createWrapper, server } from "@tests/utils"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import { describe, expect, it } from "vitest"; +import { Toaster } from "@/components/ui/sonner"; +import { createFakeDeployment, createFakeFlowRun } from "@/mocks"; import { RunFlowButton, type RunFlowButtonProps } from "./run-flow-button"; describe("RunFlowButton", () => { diff --git a/ui-v2/src/components/deployments/run-flow-button/run-flow-button.tsx b/ui-v2/src/components/deployments/run-flow-button/run-flow-button.tsx index 96469aede7b1..f5a5f5c8df4e 100644 --- a/ui-v2/src/components/deployments/run-flow-button/run-flow-button.tsx +++ b/ui-v2/src/components/deployments/run-flow-button/run-flow-button.tsx @@ -1,3 +1,4 @@ +import { Link } from "@tanstack/react-router"; import type { Deployment } from "@/api/deployments"; import { useQuickRun } from "@/components/deployments/use-quick-run"; import { Button } from "@/components/ui/button"; @@ -9,7 +10,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; -import { Link } from "@tanstack/react-router"; export type RunFlowButtonProps = { deployment: Deployment; diff --git a/ui-v2/src/components/deployments/use-delete-deployment-confirmation-dialog.ts b/ui-v2/src/components/deployments/use-delete-deployment-confirmation-dialog.ts index c071bafd70b4..a2540e5934d1 100644 --- a/ui-v2/src/components/deployments/use-delete-deployment-confirmation-dialog.ts +++ b/ui-v2/src/components/deployments/use-delete-deployment-confirmation-dialog.ts @@ -1,7 +1,7 @@ -import { type Deployment, useDeleteDeployment } from "@/api/deployments"; -import { useDeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; import { useNavigate } from "@tanstack/react-router"; import { toast } from "sonner"; +import { type Deployment, useDeleteDeployment } from "@/api/deployments"; +import { useDeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; export const useDeleteDeploymentConfirmationDialog = () => { const navigate = useNavigate(); diff --git a/ui-v2/src/components/deployments/use-quick-run.tsx b/ui-v2/src/components/deployments/use-quick-run.tsx index a7113972880a..e9e136fa25b2 100644 --- a/ui-v2/src/components/deployments/use-quick-run.tsx +++ b/ui-v2/src/components/deployments/use-quick-run.tsx @@ -1,7 +1,7 @@ -import { useDeploymentCreateFlowRun } from "@/api/flow-runs"; -import { Button } from "@/components/ui/button"; import { Link } from "@tanstack/react-router"; import { toast } from "sonner"; +import { useDeploymentCreateFlowRun } from "@/api/flow-runs"; +import { Button } from "@/components/ui/button"; const DEPLOYMENT_QUICK_RUN_PAYLOAD = { state: { diff --git a/ui-v2/src/components/flow-runs/activity-chart/activity-chart.test.tsx b/ui-v2/src/components/flow-runs/activity-chart/activity-chart.test.tsx index 29942ff36b74..5073e79ee5d8 100644 --- a/ui-v2/src/components/flow-runs/activity-chart/activity-chart.test.tsx +++ b/ui-v2/src/components/flow-runs/activity-chart/activity-chart.test.tsx @@ -1,6 +1,6 @@ -import { createFakeFlowRuns } from "@/mocks/create-fake-flow-run"; import { render } from "@testing-library/react"; import { describe, expect, it } from "vitest"; +import { createFakeFlowRuns } from "@/mocks/create-fake-flow-run"; import FlowRunsBarChart from "./activity-chart"; describe("Flow Run Activity Chart", () => { diff --git a/ui-v2/src/components/flow-runs/activity-chart/activity-chart.tsx b/ui-v2/src/components/flow-runs/activity-chart/activity-chart.tsx index cb7d30e49fe9..f1117a611e4b 100644 --- a/ui-v2/src/components/flow-runs/activity-chart/activity-chart.tsx +++ b/ui-v2/src/components/flow-runs/activity-chart/activity-chart.tsx @@ -1,9 +1,9 @@ +import { cva } from "class-variance-authority"; +import React, { useCallback, useEffect, useMemo } from "react"; import type { FlowRun } from "@/api/flow-runs"; import type { components } from "@/api/prefect"; import { TooltipProvider } from "@/components/ui/tooltip"; import { Typography } from "@/components/ui/typography"; -import { cva } from "class-variance-authority"; -import React, { useCallback, useEffect, useMemo } from "react"; import { FlowRunCell } from "./flowRunCell"; export type FlowRunsBarChartProps = { @@ -64,7 +64,7 @@ const FlowRunsBarChart = ({ ); const maxBucketIndex = buckets.length - 1; - const isFutureTimeSpan = endWindow.getTime() > new Date().getTime(); + const isFutureTimeSpan = endWindow.getTime() > Date.now(); const bucketIncrementDirection = isFutureTimeSpan ? 1 : -1; const sortedRuns = isFutureTimeSpan diff --git a/ui-v2/src/components/flow-runs/activity-chart/flowRunCell.test.tsx b/ui-v2/src/components/flow-runs/activity-chart/flowRunCell.test.tsx index 174aaead2ca1..fd80f7600324 100644 --- a/ui-v2/src/components/flow-runs/activity-chart/flowRunCell.test.tsx +++ b/ui-v2/src/components/flow-runs/activity-chart/flowRunCell.test.tsx @@ -1,7 +1,7 @@ -import { TooltipProvider } from "@/components/ui/tooltip"; -import { createFakeFlowRun } from "@/mocks"; import { render, waitFor } from "@testing-library/react"; import { describe, expect, it } from "vitest"; +import { TooltipProvider } from "@/components/ui/tooltip"; +import { createFakeFlowRun } from "@/mocks"; import { FlowRunCell } from "./flowRunCell"; describe("Flow Run Activity Chart Cells", () => { diff --git a/ui-v2/src/components/flow-runs/activity-chart/flowRunCell.tsx b/ui-v2/src/components/flow-runs/activity-chart/flowRunCell.tsx index 27a94e6b54c9..5764be9ec9c8 100644 --- a/ui-v2/src/components/flow-runs/activity-chart/flowRunCell.tsx +++ b/ui-v2/src/components/flow-runs/activity-chart/flowRunCell.tsx @@ -1,6 +1,6 @@ +import { TooltipContent, TooltipTrigger } from "@radix-ui/react-tooltip"; import type { FlowRun } from "@/api/flow-runs"; import { Tooltip } from "@/components/ui/tooltip"; -import { TooltipContent, TooltipTrigger } from "@radix-ui/react-tooltip"; import { Popover } from "./popover"; export type FlowRunCellProps = { diff --git a/ui-v2/src/components/flow-runs/activity-chart/popover.test.tsx b/ui-v2/src/components/flow-runs/activity-chart/popover.test.tsx index 41ccb4f44c0d..5360888c63e0 100644 --- a/ui-v2/src/components/flow-runs/activity-chart/popover.test.tsx +++ b/ui-v2/src/components/flow-runs/activity-chart/popover.test.tsx @@ -1,14 +1,14 @@ -import { createFakeFlowRun } from "@/mocks"; import { QueryClient } from "@tanstack/react-query"; import { - RouterProvider, createMemoryHistory, createRootRoute, createRouter, + RouterProvider, } from "@tanstack/react-router"; import { waitFor } from "@testing-library/dom"; import { render } from "@testing-library/react"; import { describe, expect, it } from "vitest"; +import { createFakeFlowRun } from "@/mocks"; import { Popover, type PopoverProps } from "./popover"; // Wraps component in test with a Tanstack router provider diff --git a/ui-v2/src/components/flow-runs/activity-chart/popover.tsx b/ui-v2/src/components/flow-runs/activity-chart/popover.tsx index e8050b364c7c..2d1dc50bf31e 100644 --- a/ui-v2/src/components/flow-runs/activity-chart/popover.tsx +++ b/ui-v2/src/components/flow-runs/activity-chart/popover.tsx @@ -1,9 +1,9 @@ +import { Link } from "@tanstack/react-router"; +import humanizeDuration from "humanize-duration"; import type { FlowRun } from "@/api/flow-runs"; import { Icon } from "@/components/ui/icons"; import { StateBadge } from "@/components/ui/state-badge"; import { Typography } from "@/components/ui/typography"; -import { Link } from "@tanstack/react-router"; -import humanizeDuration from "humanize-duration"; export type PopoverProps = { name: string; diff --git a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-deployment.tsx b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-deployment.tsx index 84100fd68112..6aecffbe8fa4 100644 --- a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-deployment.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-deployment.tsx @@ -1,10 +1,8 @@ +import { Link } from "@tanstack/react-router"; import type { Deployment } from "@/api/deployments"; - import { Icon } from "@/components/ui/icons"; import { Typography } from "@/components/ui/typography"; -import { Link } from "@tanstack/react-router"; - type FlowRunDeploymentProps = { deployment: Deployment }; export const FlowRunDeployment = ({ deployment }: FlowRunDeploymentProps) => { return ( diff --git a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-duration.tsx b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-duration.tsx index 08cbd410f421..afdc1294c551 100644 --- a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-duration.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-duration.tsx @@ -1,3 +1,4 @@ +import humanizeDuration from "humanize-duration"; import type { FlowRunCardData } from "@/components/flow-runs/flow-run-card"; import { Icon } from "@/components/ui/icons"; import { @@ -6,7 +7,6 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; -import humanizeDuration from "humanize-duration"; type FlowRunDurationProps = { flowRun: FlowRunCardData; diff --git a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-parameters.tsx b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-parameters.tsx index a7c9320589b7..d9a5cd158172 100644 --- a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-parameters.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-parameters.tsx @@ -1,9 +1,9 @@ import type { FlowRunCardData } from "@/components/flow-runs/flow-run-card"; import { Button } from "@/components/ui/button"; -import { DialogHeader } from "@/components/ui/dialog"; import { Dialog, DialogContent, + DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; diff --git a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-start-time.tsx b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-start-time.tsx index cc6eb11a60a2..f9c4ac191fd2 100644 --- a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-start-time.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-start-time.tsx @@ -1,3 +1,6 @@ +import humanizeDuration from "humanize-duration"; +import { useMemo } from "react"; +import type { FlowRunCardData } from "@/components/flow-runs/flow-run-card"; import { Icon } from "@/components/ui/icons"; import { Tooltip, @@ -6,10 +9,6 @@ import { TooltipTrigger, } from "@/components/ui/tooltip"; import { formatDate } from "@/utils/date"; -import humanizeDuration from "humanize-duration"; -import { useMemo } from "react"; - -import type { FlowRunCardData } from "@/components/flow-runs/flow-run-card"; type FlowRunStartTimeProps = { flowRun: FlowRunCardData }; export const FlowRunStartTime = ({ flowRun }: FlowRunStartTimeProps) => { diff --git a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-task-runs.tsx b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-task-runs.tsx index 00dd791ce23c..628cb466d21a 100644 --- a/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-task-runs.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-card/card-properties/flow-run-task-runs.tsx @@ -1,11 +1,10 @@ +import { useSuspenseQuery } from "@tanstack/react-query"; +import clsx from "clsx"; import { buildGetFlowRunsTaskRunsCountQuery } from "@/api/task-runs"; import type { FlowRunCardData } from "@/components/flow-runs/flow-run-card"; import { Icon } from "@/components/ui/icons"; - import { Typography } from "@/components/ui/typography"; import { pluralize } from "@/utils"; -import { useSuspenseQuery } from "@tanstack/react-query"; -import clsx from "clsx"; type FlowRunTaskRunsProps = { flowRun: FlowRunCardData; diff --git a/ui-v2/src/components/flow-runs/flow-run-card/flow-run-card.stories.tsx b/ui-v2/src/components/flow-runs/flow-run-card/flow-run-card.stories.tsx index e5fadbc6e8f5..71a98ee8041b 100644 --- a/ui-v2/src/components/flow-runs/flow-run-card/flow-run-card.stories.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-card/flow-run-card.stories.tsx @@ -1,3 +1,8 @@ +import { randNumber } from "@ngneat/falso"; +import type { Meta, StoryObj } from "@storybook/react"; +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; +import { fn } from "storybook/test"; import { createFakeFlowRunWithDeploymentAndFlow, createFakeFlowRunWithFlow, @@ -7,11 +12,6 @@ import { routerDecorator, toastDecorator, } from "@/storybook/utils"; -import { randNumber } from "@ngneat/falso"; -import type { Meta, StoryObj } from "@storybook/react"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; -import { fn } from "storybook/test"; import { FlowRunCard } from "./flow-run-card"; const MOCK_DATA = createFakeFlowRunWithFlow({ diff --git a/ui-v2/src/components/flow-runs/flow-run-card/flow-run-card.tsx b/ui-v2/src/components/flow-runs/flow-run-card/flow-run-card.tsx index 5a8b0aade366..30a6a6978324 100644 --- a/ui-v2/src/components/flow-runs/flow-run-card/flow-run-card.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-card/flow-run-card.tsx @@ -1,13 +1,12 @@ +import { cva } from "class-variance-authority"; import type { Deployment } from "@/api/deployments"; import type { FlowRun } from "@/api/flow-runs"; import type { Flow } from "@/api/flows"; import type { components } from "@/api/prefect"; import { Card } from "@/components/ui/card"; import { Checkbox } from "@/components/ui/checkbox"; -import { TagBadgeGroup } from "@/components/ui/tag-badge-group"; -import { cva } from "class-variance-authority"; - import { StateBadge } from "@/components/ui/state-badge"; +import { TagBadgeGroup } from "@/components/ui/tag-badge-group"; import { FlowRunDeployment } from "./card-properties/flow-run-deployment"; import { FlowRunDuration } from "./card-properties/flow-run-duration"; import { FlowRunName } from "./card-properties/flow-run-name"; diff --git a/ui-v2/src/components/flow-runs/flow-run-graph/api.ts b/ui-v2/src/components/flow-runs/flow-run-graph/api.ts index 46d040fcb988..66b5472ddcb1 100644 --- a/ui-v2/src/components/flow-runs/flow-run-graph/api.ts +++ b/ui-v2/src/components/flow-runs/flow-run-graph/api.ts @@ -1,5 +1,3 @@ -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import type { EventRelatedResource, RunGraphArtifact, @@ -10,6 +8,8 @@ import type { RunGraphNode, } from "@prefecthq/graphs"; import { parseISO } from "date-fns"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; /** * Fetches the graph data for a flow run. diff --git a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-center-button.tsx b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-center-button.tsx index 2484f7a06efe..158c283a9584 100644 --- a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-center-button.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-center-button.tsx @@ -1,3 +1,5 @@ +import { centerViewport } from "@prefecthq/graphs"; +import { useEffect } from "react"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icons/icon"; import { @@ -5,8 +7,6 @@ import { TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; -import { centerViewport } from "@prefecthq/graphs"; -import { useEffect } from "react"; import { isEventTargetInput } from "./utilities"; const center = () => { diff --git a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-fullscreen-button.tsx b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-fullscreen-button.tsx index cc98c603903e..3bc10589bc69 100644 --- a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-fullscreen-button.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-fullscreen-button.tsx @@ -1,8 +1,11 @@ +import { useCallback, useEffect } from "react"; import { Button } from "@/components/ui/button"; import { Icon } from "@/components/ui/icons/icon"; -import { TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; -import { Tooltip } from "@/components/ui/tooltip"; -import { useCallback, useEffect } from "react"; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip"; import { isEventTargetInput } from "./utilities"; type FlowRunGraphFullscreenButtonProps = { diff --git a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-settings.tsx b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-settings.tsx index dfd2ee2df4ed..38321daeb086 100644 --- a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-settings.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph-settings.tsx @@ -1,11 +1,6 @@ -import { Button } from "@/components/ui/button"; -import { Label } from "@/components/ui/label"; -import { Switch } from "@/components/ui/switch"; -import { Typography } from "@/components/ui/typography"; import { DEFAULT_HORIZONTAL_SCALE_MULTIPLIER, type HorizontalMode, - type VerticalMode, isHorizontalMode, isVerticalMode, layout, @@ -16,8 +11,13 @@ import { setHorizontalMode, setHorizontalScaleMultiplier, setVerticalMode, + type VerticalMode, } from "@prefecthq/graphs"; import { useCallback, useState } from "react"; +import { Button } from "@/components/ui/button"; +import { Label } from "@/components/ui/label"; +import { Switch } from "@/components/ui/switch"; +import { Typography } from "@/components/ui/typography"; type LayoutOption = `${HorizontalMode}_${VerticalMode}`; diff --git a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.stories.tsx b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.stories.tsx index 022a43d4b22d..a0f9814b840d 100644 --- a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.stories.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.stories.tsx @@ -1,7 +1,7 @@ import { TooltipProvider } from "@radix-ui/react-tooltip"; import type { Meta, StoryObj } from "@storybook/react"; import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; +import { HttpResponse, http } from "msw"; import type { ComponentProps } from "react"; import DemoData from "./demo-data.json"; import DemoEvents from "./demo-events.json"; diff --git a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.tsx b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.tsx index 75cfc2810d75..da9f0b192061 100644 --- a/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-graph/flow-run-graph.tsx @@ -1,15 +1,15 @@ import { + emitter, type GraphItemSelection, type RunGraphConfig, type RunGraphNode, type RunGraphStateEvent, - type ViewportDateRange, - emitter, selectItem, setConfig, start, stop, updateViewportFromDateRange, + type ViewportDateRange, } from "@prefecthq/graphs"; import { type CSSProperties, @@ -19,8 +19,7 @@ import { useRef, useState, } from "react"; -import { fetchFlowRunEvents } from "./api"; -import { fetchFlowRunGraph } from "./api"; +import { fetchFlowRunEvents, fetchFlowRunGraph } from "./api"; import { stateTypeColors } from "./consts"; import { FlowRunGraphActions } from "./flow-run-graph-actions"; diff --git a/ui-v2/src/components/flow-runs/flow-run-state-dialog/flow-run-state-dialog.stories.tsx b/ui-v2/src/components/flow-runs/flow-run-state-dialog/flow-run-state-dialog.stories.tsx index 3c431ea53734..907ff8afc029 100644 --- a/ui-v2/src/components/flow-runs/flow-run-state-dialog/flow-run-state-dialog.stories.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-state-dialog/flow-run-state-dialog.stories.tsx @@ -1,14 +1,14 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; +import { useState } from "react"; +import { toast } from "sonner"; import type { components } from "@/api/prefect"; import { Button } from "@/components/ui/button"; -import { RunStateChangeDialog } from "@/components/ui/run-state-change-dialog"; import type { RunStateFormValues } from "@/components/ui/run-state-change-dialog"; +import { RunStateChangeDialog } from "@/components/ui/run-state-change-dialog"; import { StateBadge } from "@/components/ui/state-badge"; import { reactQueryDecorator, toastDecorator } from "@/storybook/utils"; -import type { Meta, StoryObj } from "@storybook/react"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; -import { useState } from "react"; -import { toast } from "sonner"; const meta = { title: "Components/FlowRuns/RunStateChangeDialog", diff --git a/ui-v2/src/components/flow-runs/flow-run-state-dialog/use-flow-run-state-dialog.tsx b/ui-v2/src/components/flow-runs/flow-run-state-dialog/use-flow-run-state-dialog.tsx index 256eb8f636c3..b471089207c7 100644 --- a/ui-v2/src/components/flow-runs/flow-run-state-dialog/use-flow-run-state-dialog.tsx +++ b/ui-v2/src/components/flow-runs/flow-run-state-dialog/use-flow-run-state-dialog.tsx @@ -1,10 +1,10 @@ +import { useState } from "react"; +import { toast } from "sonner"; import type { FlowRun } from "@/api/flow-runs"; import { useSetFlowRunState } from "@/api/flow-runs"; import type { components } from "@/api/prefect"; import type { RunStateFormValues } from "@/components/ui/run-state-change-dialog"; import { StateBadge } from "@/components/ui/state-badge"; -import { useState } from "react"; -import { toast } from "sonner"; export const useFlowRunStateDialog = (flowRun: FlowRun) => { const [open, setOpen] = useState(false); diff --git a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/sort-filter.test.tsx b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/sort-filter.test.tsx index e11b802d9955..85e6166c434f 100644 --- a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/sort-filter.test.tsx +++ b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/sort-filter.test.tsx @@ -1,8 +1,7 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { beforeAll, describe, expect, it, vi } from "vitest"; - import { mockPointerEvents } from "@tests/utils/browser"; +import { beforeAll, describe, expect, it, vi } from "vitest"; import { SortFilter } from "./sort-filter"; describe("FlowRunsDataTable -- SortFilter", () => { diff --git a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/state-filter.test.tsx b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/state-filter.test.tsx index f05c9085ccba..e3c89e98ac7a 100644 --- a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/state-filter.test.tsx +++ b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/state-filter.test.tsx @@ -1,9 +1,8 @@ import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { beforeAll, describe, expect, it } from "vitest"; - import { mockPointerEvents } from "@tests/utils/browser"; import { useState } from "react"; +import { beforeAll, describe, expect, it } from "vitest"; import { StateFilter } from "./state-filter"; import type { FlowRunState } from "./state-filters.constants"; diff --git a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/state-filter.tsx b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/state-filter.tsx index 6bb7b3e9d82b..34155f8d6dfe 100644 --- a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/state-filter.tsx +++ b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-filters/state-filter.tsx @@ -1,3 +1,4 @@ +import { useMemo, useState } from "react"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { @@ -9,7 +10,6 @@ import { import { Icon } from "@/components/ui/icons"; import { StateBadge } from "@/components/ui/state-badge"; import { Typography } from "@/components/ui/typography"; -import { useMemo, useState } from "react"; import { FLOW_RUN_STATES_MAP, FLOW_RUN_STATES_NO_SCHEDULED, diff --git a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-list.stories.tsx b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-list.stories.tsx index d50e04a082a5..0d00c0b3378d 100644 --- a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-list.stories.tsx +++ b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-list.stories.tsx @@ -1,16 +1,15 @@ +import { randNumber } from "@ngneat/falso"; import type { Meta, StoryObj } from "@storybook/react"; - +import { buildApiUrl } from "@tests/utils/handlers"; +import { HttpResponse, http } from "msw"; +import { useMemo, useState } from "react"; +import { fn } from "storybook/test"; import { createFakeFlowRunWithDeploymentAndFlow } from "@/mocks/create-fake-flow-run"; import { reactQueryDecorator, routerDecorator, toastDecorator, } from "@/storybook/utils"; -import { randNumber } from "@ngneat/falso"; -import { buildApiUrl } from "@tests/utils/handlers"; -import { http, HttpResponse } from "msw"; -import { useMemo, useState } from "react"; -import { fn } from "storybook/test"; import { FlowRunsFilters } from "./flow-runs-filters"; import type { FlowRunState } from "./flow-runs-filters/state-filters.constants"; import { FlowRunsList } from "./flow-runs-list"; diff --git a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-row-count.tsx b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-row-count.tsx index c2c39f7e7625..19c6700364de 100644 --- a/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-row-count.tsx +++ b/ui-v2/src/components/flow-runs/flow-runs-list/flow-runs-row-count.tsx @@ -1,12 +1,11 @@ +import type { CheckedState } from "@radix-ui/react-checkbox"; +import { useMemo } from "react"; import { Button } from "@/components/ui/button"; +import { Checkbox } from "@/components/ui/checkbox"; import { DeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; import { Icon } from "@/components/ui/icons"; import { Typography } from "@/components/ui/typography"; import { pluralize } from "@/utils"; - -import { Checkbox } from "@/components/ui/checkbox"; -import type { CheckedState } from "@radix-ui/react-checkbox"; -import { useMemo } from "react"; import type { FlowRunCardData } from "../flow-run-card"; import { useDeleteFlowRunsDialog } from "./use-delete-flow-runs-dialog"; diff --git a/ui-v2/src/components/flow-runs/flow-runs-list/index.ts b/ui-v2/src/components/flow-runs/flow-runs-list/index.ts index 525b5c422153..65723f4a6318 100644 --- a/ui-v2/src/components/flow-runs/flow-runs-list/index.ts +++ b/ui-v2/src/components/flow-runs/flow-runs-list/index.ts @@ -1,17 +1,17 @@ export { FlowRunsFilters } from "./flow-runs-filters"; -export { FlowRunsRowCount } from "./flow-runs-row-count"; export { - FlowRunsPagination, - type PaginationState, -} from "./flow-runs-pagination"; -export { FlowRunsList } from "./flow-runs-list"; + SORT_FILTERS, + type SortFilters, +} from "./flow-runs-filters/sort-filter.constants"; export { - FLOW_RUN_STATES_NO_SCHEDULED, FLOW_RUN_STATES, + FLOW_RUN_STATES_NO_SCHEDULED, type FlowRunState, } from "./flow-runs-filters/state-filters.constants"; +export { FlowRunsList } from "./flow-runs-list"; export { - SORT_FILTERS, - type SortFilters, -} from "./flow-runs-filters/sort-filter.constants"; + FlowRunsPagination, + type PaginationState, +} from "./flow-runs-pagination"; +export { FlowRunsRowCount } from "./flow-runs-row-count"; export { useFlowRunsSelectedRows } from "./use-flow-runs-selected-rows"; diff --git a/ui-v2/src/components/flow-runs/flow-runs-list/use-delete-flow-runs-dialog.ts b/ui-v2/src/components/flow-runs/flow-runs-list/use-delete-flow-runs-dialog.ts index 9483c74a0388..e4e4cf71938d 100644 --- a/ui-v2/src/components/flow-runs/flow-runs-list/use-delete-flow-runs-dialog.ts +++ b/ui-v2/src/components/flow-runs/flow-runs-list/use-delete-flow-runs-dialog.ts @@ -1,6 +1,6 @@ +import { toast } from "sonner"; import { useDeleteFlowRun } from "@/api/flow-runs"; import { useDeleteConfirmationDialog } from "@/components/ui/delete-confirmation-dialog"; -import { toast } from "sonner"; export const useDeleteFlowRunsDialog = () => { const [dialogState, confirmDelete] = useDeleteConfirmationDialog(); diff --git a/ui-v2/src/components/flow-runs/flow-runs-list/use-flow-runs-selected-rows.test.ts b/ui-v2/src/components/flow-runs/flow-runs-list/use-flow-runs-selected-rows.test.ts index 89695ca3bcae..9e23a0348daa 100644 --- a/ui-v2/src/components/flow-runs/flow-runs-list/use-flow-runs-selected-rows.test.ts +++ b/ui-v2/src/components/flow-runs/flow-runs-list/use-flow-runs-selected-rows.test.ts @@ -1,7 +1,6 @@ import { act, renderHook } from "@testing-library/react"; -import { useFlowRunsSelectedRows } from "./use-flow-runs-selected-rows"; - import { describe, expect, it } from "vitest"; +import { useFlowRunsSelectedRows } from "./use-flow-runs-selected-rows"; describe("useFlowRunsSelectedRows", () => { it("addRow() to set", () => { diff --git a/ui-v2/src/components/flows/cells.tsx b/ui-v2/src/components/flows/cells.tsx index a3707a8ed3ed..d31ea3708df4 100644 --- a/ui-v2/src/components/flows/cells.tsx +++ b/ui-v2/src/components/flows/cells.tsx @@ -1,3 +1,6 @@ +import { useQuery } from "@tanstack/react-query"; +import { Link } from "@tanstack/react-router"; +import { useDeleteFlowById } from "@/api/flows"; import type { components } from "@/api/prefect"; import { Button } from "@/components/ui/button"; import { @@ -10,10 +13,6 @@ import { } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; import { cn } from "@/lib/utils"; -import { useQuery } from "@tanstack/react-query"; -import { Link } from "@tanstack/react-router"; - -import { useDeleteFlowById } from "@/api/flows"; import { formatDate } from "@/utils/date"; import { Typography } from "../ui/typography"; import { diff --git a/ui-v2/src/components/flows/columns.tsx b/ui-v2/src/components/flows/columns.tsx index f73e120126a6..48e210079ad0 100644 --- a/ui-v2/src/components/flows/columns.tsx +++ b/ui-v2/src/components/flows/columns.tsx @@ -1,6 +1,6 @@ +import type { ColumnDef } from "@tanstack/react-table"; import type { components } from "@/api/prefect"; import { Checkbox } from "@/components/ui/checkbox"; -import type { ColumnDef } from "@tanstack/react-table"; import { FlowActionMenu, FlowActivity, diff --git a/ui-v2/src/components/flows/data-table.tsx b/ui-v2/src/components/flows/data-table.tsx index f23cf6e11891..c550e389a830 100644 --- a/ui-v2/src/components/flows/data-table.tsx +++ b/ui-v2/src/components/flows/data-table.tsx @@ -1,3 +1,12 @@ +import { useNavigate } from "@tanstack/react-router"; +import { + getCoreRowModel, + getPaginationRowModel, + type RowSelectionState, + useReactTable, +} from "@tanstack/react-table"; +import { useState } from "react"; +import { type Flow, useDeleteFlowById } from "@/api/flows"; import { Button } from "@/components/ui/button"; import { DataTable } from "@/components/ui/data-table"; import { @@ -8,17 +17,7 @@ import { } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; import { Input } from "@/components/ui/input"; -import { useNavigate } from "@tanstack/react-router"; -import { - type RowSelectionState, - getCoreRowModel, - getPaginationRowModel, - useReactTable, -} from "@tanstack/react-table"; - -import { type Flow, useDeleteFlowById } from "@/api/flows"; import { useSet } from "@/hooks/use-set"; -import { useState } from "react"; import { columns } from "./columns"; import { TableCountHeader } from "./table-count-header"; @@ -186,22 +185,20 @@ export default function FlowsTable({ }; return ( - <> -
-
- -
- - - -
-
- -
- +
+
+ +
+ + + +
+
+ +
); } diff --git a/ui-v2/src/components/flows/detail/cells.tsx b/ui-v2/src/components/flows/detail/cells.tsx index 6b7e5218e771..ad222c2e8a0f 100644 --- a/ui-v2/src/components/flows/detail/cells.tsx +++ b/ui-v2/src/components/flows/detail/cells.tsx @@ -1,6 +1,6 @@ +import { useQuery } from "@tanstack/react-query"; import type { components } from "@/api/prefect"; import { getQueryService } from "@/api/service"; -import { useQuery } from "@tanstack/react-query"; type FlowRun = components["schemas"]["FlowRun"]; diff --git a/ui-v2/src/components/flows/detail/deployment-columns.tsx b/ui-v2/src/components/flows/detail/deployment-columns.tsx index 39a7f962573a..c1146dd5366b 100644 --- a/ui-v2/src/components/flows/detail/deployment-columns.tsx +++ b/ui-v2/src/components/flows/detail/deployment-columns.tsx @@ -1,3 +1,4 @@ +import type { ColumnDef } from "@tanstack/react-table"; import type { components } from "@/api/prefect"; import { Button } from "@/components/ui/button"; import { @@ -7,7 +8,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; -import type { ColumnDef } from "@tanstack/react-table"; type Deployment = components["schemas"]["DeploymentResponse"]; diff --git a/ui-v2/src/components/flows/detail/index.tsx b/ui-v2/src/components/flows/detail/index.tsx index 45c1e1762ffb..6e3625d43be3 100644 --- a/ui-v2/src/components/flows/detail/index.tsx +++ b/ui-v2/src/components/flows/detail/index.tsx @@ -1,19 +1,16 @@ -import { DataTable } from "@/components/ui/data-table"; -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { useNavigate } from "@tanstack/react-router"; -import type { JSX } from "react"; -import { columns as deploymentColumns } from "./deployment-columns"; import { - getFlowMetadata, - columns as metadataColumns, -} from "./metadata-columns"; -import { columns as flowRunColumns } from "./runs-columns"; - + getCoreRowModel, + getPaginationRowModel, + useReactTable, +} from "@tanstack/react-table"; +import type { JSX } from "react"; import type { FlowRun } from "@/api/flow-runs"; import type { Flow } from "@/api/flows"; import type { components } from "@/api/prefect"; import FlowRunsBarChart from "@/components/flow-runs/activity-chart/activity-chart"; import { Button } from "@/components/ui/button"; +import { DataTable } from "@/components/ui/data-table"; import { DropdownMenu, DropdownMenuContent, @@ -22,11 +19,13 @@ import { } from "@/components/ui/dropdown-menu"; import { Icon } from "@/components/ui/icons"; import { Input } from "@/components/ui/input"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { columns as deploymentColumns } from "./deployment-columns"; import { - getCoreRowModel, - getPaginationRowModel, - useReactTable, -} from "@tanstack/react-table"; + getFlowMetadata, + columns as metadataColumns, +} from "./metadata-columns"; +import { columns as flowRunColumns } from "./runs-columns"; const SearchComponent = () => { const navigate = useNavigate(); diff --git a/ui-v2/src/components/flows/detail/metadata-columns.tsx b/ui-v2/src/components/flows/detail/metadata-columns.tsx index ed2048fbd260..612211944aab 100644 --- a/ui-v2/src/components/flows/detail/metadata-columns.tsx +++ b/ui-v2/src/components/flows/detail/metadata-columns.tsx @@ -1,5 +1,5 @@ -import type { components } from "@/api/prefect"; import type { ColumnDef } from "@tanstack/react-table"; +import type { components } from "@/api/prefect"; type Flow = components["schemas"]["Flow"]; type FlowMetadata = { attribute: string; value: string | string[] | null }; diff --git a/ui-v2/src/components/flows/detail/runs-columns.tsx b/ui-v2/src/components/flows/detail/runs-columns.tsx index d472c341a98f..d968e4a7ba70 100644 --- a/ui-v2/src/components/flows/detail/runs-columns.tsx +++ b/ui-v2/src/components/flows/detail/runs-columns.tsx @@ -1,6 +1,6 @@ -import type { components } from "@/api/prefect"; import type { ColumnDef } from "@tanstack/react-table"; import { format, parseISO } from "date-fns"; +import type { components } from "@/api/prefect"; import { DeploymentCell, WorkPoolCell } from "./cells"; type FlowRun = components["schemas"]["FlowRun"]; diff --git a/ui-v2/src/components/flows/flow-link.tsx b/ui-v2/src/components/flows/flow-link.tsx index 39013465a125..a15eea905527 100644 --- a/ui-v2/src/components/flows/flow-link.tsx +++ b/ui-v2/src/components/flows/flow-link.tsx @@ -1,9 +1,9 @@ -import { buildFLowDetailsQuery } from "@/api/flows"; -import { Icon } from "@/components/ui/icons"; -import { Skeleton } from "@/components/ui/skeleton"; import { useSuspenseQuery } from "@tanstack/react-query"; import { Link } from "@tanstack/react-router"; import { Suspense } from "react"; +import { buildFLowDetailsQuery } from "@/api/flows"; +import { Icon } from "@/components/ui/icons"; +import { Skeleton } from "@/components/ui/skeleton"; type FlowLinkProps = { flowId: string; diff --git a/ui-v2/src/components/flows/queries.tsx b/ui-v2/src/components/flows/queries.tsx index 87231b699269..9c75fd789917 100644 --- a/ui-v2/src/components/flows/queries.tsx +++ b/ui-v2/src/components/flows/queries.tsx @@ -1,6 +1,3 @@ -import type { FlowRunsFilter } from "@/api/flow-runs"; -import type { components } from "@/api/prefect"; -import { getQueryService } from "@/api/service"; import type { MutationFunction, QueryFunction, @@ -8,6 +5,9 @@ import type { QueryObserverOptions, } from "@tanstack/react-query"; import { format } from "date-fns"; +import type { FlowRunsFilter } from "@/api/flow-runs"; +import type { components } from "@/api/prefect"; +import { getQueryService } from "@/api/service"; export const flowQueryParams = ( flowId: string, diff --git a/ui-v2/src/components/global-concurrency-limit/global-concurrency-limit-select/global-concurrency-limit-select.tsx b/ui-v2/src/components/global-concurrency-limit/global-concurrency-limit-select/global-concurrency-limit-select.tsx index 7f3ab6df22a1..b9b205f5d6d4 100644 --- a/ui-v2/src/components/global-concurrency-limit/global-concurrency-limit-select/global-concurrency-limit-select.tsx +++ b/ui-v2/src/components/global-concurrency-limit/global-concurrency-limit-select/global-concurrency-limit-select.tsx @@ -1,5 +1,6 @@ +import { useSuspenseQuery } from "@tanstack/react-query"; +import { Suspense, useDeferredValue, useMemo, useState } from "react"; import { buildListGlobalConcurrencyLimitsQuery } from "@/api/global-concurrency-limits"; - import { Combobox, ComboboxCommandEmtpy, @@ -11,9 +12,6 @@ import { ComboboxTrigger, } from "@/components/ui/combobox"; -import { useSuspenseQuery } from "@tanstack/react-query"; -import { Suspense, useDeferredValue, useMemo, useState } from "react"; - type PresetOption = { label: string; value: string | null | undefined; diff --git a/ui-v2/src/components/schemas/__snapshots__/schema-form.snapshot.test.tsx.snap b/ui-v2/src/components/schemas/__snapshots__/schema-form.snapshot.test.tsx.snap index 957023a53cfe..e54041fc4ef3 100644 --- a/ui-v2/src/components/schemas/__snapshots__/schema-form.snapshot.test.tsx.snap +++ b/ui-v2/src/components/schemas/__snapshots__/schema-form.snapshot.test.tsx.snap @@ -178,13 +178,12 @@ exports[`property.type > boolean > enum 1`] = `