From 47f0a25065344e2ac7ccd04725fdf27721c37c5c Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 13:36:01 -0400 Subject: [PATCH] Move tabs files to be more idiomatic with the rest of the app --- src/pages/task/TaskTabs.tsx | 4 ++-- src/pages/task/taskTabs/BuildBaron.ts | 5 ----- .../ExecutionTasksTable.stories.tsx | 2 +- .../__snapshots__/ExecutionTasksTable.stories.storyshot | 0 .../index.tsx} | 0 src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts | 4 ++-- src/pages/task/taskTabs/{Logs.tsx => logs/index.tsx} | 8 +------- .../taskTabs/{TestsTable.tsx => testsTable/index.tsx} | 2 +- 8 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 src/pages/task/taskTabs/BuildBaron.ts rename src/pages/task/taskTabs/{ => ExecutionTasksTable}/ExecutionTasksTable.stories.tsx (96%) rename src/pages/task/taskTabs/{ => ExecutionTasksTable}/__snapshots__/ExecutionTasksTable.stories.storyshot (100%) rename src/pages/task/taskTabs/{ExecutionTasksTable.tsx => ExecutionTasksTable/index.tsx} (100%) rename src/pages/task/taskTabs/{Logs.tsx => logs/index.tsx} (98%) rename src/pages/task/taskTabs/{TestsTable.tsx => testsTable/index.tsx} (99%) diff --git a/src/pages/task/TaskTabs.tsx b/src/pages/task/TaskTabs.tsx index 090b0920fa..e63c9bc4ff 100644 --- a/src/pages/task/TaskTabs.tsx +++ b/src/pages/task/TaskTabs.tsx @@ -11,8 +11,8 @@ import { usePrevious } from "hooks"; import { useTabShortcut } from "hooks/useTabShortcut"; import { TaskTab } from "types/task"; import { queryString } from "utils"; -import { BuildBaron } from "./taskTabs/BuildBaron"; -import { useBuildBaronVariables } from "./taskTabs/buildBaronAndAnnotations"; +import { BuildBaron } from "./taskTabs/BuildBaronAndAnnotations"; +import useBuildBaronVariables from "./taskTabs/BuildBaronAndAnnotations/useBuildBaronVariables"; import { ExecutionTasksTable } from "./taskTabs/ExecutionTasksTable"; import FilesTableTab from "./taskTabs/FileTableTab"; import { Logs } from "./taskTabs/Logs"; diff --git a/src/pages/task/taskTabs/BuildBaron.ts b/src/pages/task/taskTabs/BuildBaron.ts deleted file mode 100644 index 3d62b6099d..0000000000 --- a/src/pages/task/taskTabs/BuildBaron.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { loadable } from "components/SpruceLoader"; - -export const BuildBaron = loadable( - () => import("./buildBaronAndAnnotations/BuildBaron") -); diff --git a/src/pages/task/taskTabs/ExecutionTasksTable.stories.tsx b/src/pages/task/taskTabs/ExecutionTasksTable/ExecutionTasksTable.stories.tsx similarity index 96% rename from src/pages/task/taskTabs/ExecutionTasksTable.stories.tsx rename to src/pages/task/taskTabs/ExecutionTasksTable/ExecutionTasksTable.stories.tsx index 8af0489035..2662c5df1e 100644 --- a/src/pages/task/taskTabs/ExecutionTasksTable.stories.tsx +++ b/src/pages/task/taskTabs/ExecutionTasksTable/ExecutionTasksTable.stories.tsx @@ -1,6 +1,6 @@ import { CustomStoryObj, CustomMeta } from "test_utils/types"; -import { ExecutionTasksTable } from "./ExecutionTasksTable"; +import { ExecutionTasksTable } from "."; export default { title: "Pages/Task/Table/Execution Tasks Table", diff --git a/src/pages/task/taskTabs/__snapshots__/ExecutionTasksTable.stories.storyshot b/src/pages/task/taskTabs/ExecutionTasksTable/__snapshots__/ExecutionTasksTable.stories.storyshot similarity index 100% rename from src/pages/task/taskTabs/__snapshots__/ExecutionTasksTable.stories.storyshot rename to src/pages/task/taskTabs/ExecutionTasksTable/__snapshots__/ExecutionTasksTable.stories.storyshot diff --git a/src/pages/task/taskTabs/ExecutionTasksTable.tsx b/src/pages/task/taskTabs/ExecutionTasksTable/index.tsx similarity index 100% rename from src/pages/task/taskTabs/ExecutionTasksTable.tsx rename to src/pages/task/taskTabs/ExecutionTasksTable/index.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts b/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts index 0be0337937..14d0913439 100644 --- a/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts +++ b/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts @@ -1,3 +1,3 @@ -import useBuildBaronVariables from "./useBuildBaronVariables"; +import { loadable } from "components/SpruceLoader"; -export { useBuildBaronVariables }; +export const BuildBaron = loadable(() => import("./BuildBaron")); diff --git a/src/pages/task/taskTabs/Logs.tsx b/src/pages/task/taskTabs/logs/index.tsx similarity index 98% rename from src/pages/task/taskTabs/Logs.tsx rename to src/pages/task/taskTabs/logs/index.tsx index 7c85c9f8e4..30c04ad957 100644 --- a/src/pages/task/taskTabs/Logs.tsx +++ b/src/pages/task/taskTabs/logs/index.tsx @@ -16,13 +16,7 @@ import { size } from "constants/tokens"; import { TaskLogLinks } from "gql/generated/types"; import { useUpdateURLQueryParams } from "hooks"; import { LogTypes, QueryParams } from "types/task"; -import { - EventLog, - AgentLog, - SystemLog, - TaskLog, - AllLog, -} from "./logs/LogTypes"; +import { EventLog, AgentLog, SystemLog, TaskLog, AllLog } from "./LogTypes"; const DEFAULT_LOG_TYPE = LogTypes.Task; diff --git a/src/pages/task/taskTabs/TestsTable.tsx b/src/pages/task/taskTabs/testsTable/index.tsx similarity index 99% rename from src/pages/task/taskTabs/TestsTable.tsx rename to src/pages/task/taskTabs/testsTable/index.tsx index 462fc0a013..cc7f178adc 100644 --- a/src/pages/task/taskTabs/TestsTable.tsx +++ b/src/pages/task/taskTabs/testsTable/index.tsx @@ -26,7 +26,7 @@ import { import { RequiredQueryParams, TableOnChange } from "types/task"; import { TestStatus } from "types/test"; import { queryString, url } from "utils"; -import { getColumnsTemplate } from "./testsTable/getColumnsTemplate"; +import { getColumnsTemplate } from "./getColumnsTemplate"; const { getLimitFromSearch, getPageFromSearch } = url; const { parseQueryString, queryParamAsNumber } = queryString;