From d892ec06684d2754fa0956adb763025bbdef9eab Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 09:56:59 -0400 Subject: [PATCH 01/18] Create GroupedFilesTable component --- .../GroupedFilesTable.stories.tsx | 28 ++++++ .../FileTable/GroupedFilesTable/index.tsx | 88 +++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 src/pages/task/taskTabs/FileTable/GroupedFilesTable/GroupedFilesTable.stories.tsx create mode 100644 src/pages/task/taskTabs/FileTable/GroupedFilesTable/index.tsx diff --git a/src/pages/task/taskTabs/FileTable/GroupedFilesTable/GroupedFilesTable.stories.tsx b/src/pages/task/taskTabs/FileTable/GroupedFilesTable/GroupedFilesTable.stories.tsx new file mode 100644 index 0000000000..4b51c6cde1 --- /dev/null +++ b/src/pages/task/taskTabs/FileTable/GroupedFilesTable/GroupedFilesTable.stories.tsx @@ -0,0 +1,28 @@ +import { CustomStoryObj, CustomMeta } from "test_utils/types"; +import GroupedFilesTable from "."; + +const files = [ + { + name: "some_file", + link: "some_link", + visibility: "", + }, + { + name: "another_file", + link: "another_link", + visibility: "", + }, +]; + +export default { + title: "Pages/Task/table/GroupedFilesTable", + component: GroupedFilesTable, +} satisfies CustomMeta; + +export const DefaultTable: CustomStoryObj = { + render: (args) => , + args: { + taskName: "Task 1", + files, + }, +}; diff --git a/src/pages/task/taskTabs/FileTable/GroupedFilesTable/index.tsx b/src/pages/task/taskTabs/FileTable/GroupedFilesTable/index.tsx new file mode 100644 index 0000000000..8ebdd7d34d --- /dev/null +++ b/src/pages/task/taskTabs/FileTable/GroupedFilesTable/index.tsx @@ -0,0 +1,88 @@ +import { useMemo, useRef } from "react"; +import { + Table, + TableHead, + HeaderRow, + HeaderCell, + TableBody, + Row, + Cell, + LGColumnDef, + useLeafyGreenTable, + HeaderGroup, + LeafyGreenTableRow, + flexRender, +} from "@leafygreen-ui/table/new"; +import { Subtitle } from "@leafygreen-ui/typography"; +import { StyledLink } from "components/styles"; +import { File } from "gql/generated/types"; + +interface GroupedFilesTableProps { + files: File[]; + taskName?: string; +} +const GroupedFilesTable: React.FC = ({ + files, + taskName, +}) => { + const tableContainerRef = useRef(null); + + const columns = useMemo>>( + () => [ + { + accessorKey: "name", + header: "Name", + size: 60, + enableSorting: true, + cell: (value) => ( + + {value.getValue()} + + ), + }, + ], + [] + ); + const table = useLeafyGreenTable({ + containerRef: tableContainerRef, + data: files, + columns, + }); + + const { rows } = table.getRowModel(); + + return ( + <> + {taskName && {taskName}} + + + {table.getHeaderGroups().map((headerGroup: HeaderGroup) => ( + + {headerGroup.headers.map((header) => ( + + {flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + + + {rows.map((row: LeafyGreenTableRow) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ))} + + ))} + +
+ + ); +}; + +export default GroupedFilesTable; From 5bff45044bf51a7820a15c671aede3e3a71f8efd Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 10:25:55 -0400 Subject: [PATCH 02/18] Refactor files table component --- .../GroupedFilesTable.stories.tsx | 2 - .../GroupedFilesTable/index.tsx | 35 +++++----- .../task/taskTabs/FileTableTab/index.tsx | 64 +++++++++++++++++++ 3 files changed, 83 insertions(+), 18 deletions(-) rename src/pages/task/taskTabs/{FileTable => FileTableTab}/GroupedFilesTable/GroupedFilesTable.stories.tsx (93%) rename src/pages/task/taskTabs/{FileTable => FileTableTab}/GroupedFilesTable/index.tsx (65%) create mode 100644 src/pages/task/taskTabs/FileTableTab/index.tsx diff --git a/src/pages/task/taskTabs/FileTable/GroupedFilesTable/GroupedFilesTable.stories.tsx b/src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/GroupedFilesTable.stories.tsx similarity index 93% rename from src/pages/task/taskTabs/FileTable/GroupedFilesTable/GroupedFilesTable.stories.tsx rename to src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/GroupedFilesTable.stories.tsx index 4b51c6cde1..03800e8a05 100644 --- a/src/pages/task/taskTabs/FileTable/GroupedFilesTable/GroupedFilesTable.stories.tsx +++ b/src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/GroupedFilesTable.stories.tsx @@ -5,12 +5,10 @@ const files = [ { name: "some_file", link: "some_link", - visibility: "", }, { name: "another_file", link: "another_link", - visibility: "", }, ]; diff --git a/src/pages/task/taskTabs/FileTable/GroupedFilesTable/index.tsx b/src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/index.tsx similarity index 65% rename from src/pages/task/taskTabs/FileTable/GroupedFilesTable/index.tsx rename to src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/index.tsx index 8ebdd7d34d..c84c21a52c 100644 --- a/src/pages/task/taskTabs/FileTable/GroupedFilesTable/index.tsx +++ b/src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/index.tsx @@ -17,8 +17,9 @@ import { Subtitle } from "@leafygreen-ui/typography"; import { StyledLink } from "components/styles"; import { File } from "gql/generated/types"; +type GroupedFilesTableFile = Omit; interface GroupedFilesTableProps { - files: File[]; + files: GroupedFilesTableFile[]; taskName?: string; } const GroupedFilesTable: React.FC = ({ @@ -27,7 +28,7 @@ const GroupedFilesTable: React.FC = ({ }) => { const tableContainerRef = useRef(null); - const columns = useMemo>>( + const columns = useMemo>>( () => [ { accessorKey: "name", @@ -43,7 +44,7 @@ const GroupedFilesTable: React.FC = ({ ], [] ); - const table = useLeafyGreenTable({ + const table = useLeafyGreenTable({ containerRef: tableContainerRef, data: files, columns, @@ -56,21 +57,23 @@ const GroupedFilesTable: React.FC = ({ {taskName && {taskName}} - {table.getHeaderGroups().map((headerGroup: HeaderGroup) => ( - - {headerGroup.headers.map((header) => ( - - {flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ))} - - ))} + {table + .getHeaderGroups() + .map((headerGroup: HeaderGroup) => ( + + {headerGroup.headers.map((header) => ( + + {flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} - {rows.map((row: LeafyGreenTableRow) => ( + {rows.map((row: LeafyGreenTableRow) => ( {row.getVisibleCells().map((cell) => ( diff --git a/src/pages/task/taskTabs/FileTableTab/index.tsx b/src/pages/task/taskTabs/FileTableTab/index.tsx new file mode 100644 index 0000000000..741cdb391d --- /dev/null +++ b/src/pages/task/taskTabs/FileTableTab/index.tsx @@ -0,0 +1,64 @@ +import { useState } from "react"; +import { useQuery } from "@apollo/client"; +import styled from "@emotion/styled"; +import { SearchInput } from "@leafygreen-ui/search-input"; +import { size } from "constants/tokens"; +import { useToastContext } from "context/toast"; +import { TaskFilesQuery, TaskFilesQueryVariables } from "gql/generated/types"; +import { GET_TASK_FILES } from "gql/queries"; +import GroupedFilesTable from "./GroupedFilesTable"; + +interface FilesTableTabProps { + taskId: string; + execution: number; +} +const FilesTableTab: React.FC = ({ execution, taskId }) => { + const [search, setSearch] = useState(""); + const dispatchToast = useToastContext(); + const { data, loading } = useQuery( + GET_TASK_FILES, + { + variables: { + taskId, + execution, + }, + onError: (err) => { + dispatchToast.error(`Unable to load task files: ${err}`); + }, + } + ); + const { taskFiles } = data?.task ?? {}; + + const filteredFiles = taskFiles?.groupedFiles?.filter( + (groupedFile) => + groupedFile?.files?.filter((file) => + file?.name?.toLowerCase().includes(search.toLowerCase()) + ).length + ); + + // We only want to show the file group name if there are multiple file groups. + const hasMultipleFileGroups = taskFiles?.groupedFiles?.length > 1; + return ( + <> + setSearch(e.target.value)} + value={search} + /> + {filteredFiles?.map((groupedFile) => ( + + ))} + + ); +}; + +const StyledSearchInput = styled(SearchInput)` + margin-bottom: ${size.m}; + width: 400px; +`; +export default FilesTableTab; From 91b13ac44e696b0328633d0f876d722a2c60524c Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 10:28:00 -0400 Subject: [PATCH 03/18] Use new table component --- src/pages/task/TaskTabs.tsx | 3 +- src/pages/task/taskTabs/FilesTables.tsx | 146 ------------------------ 2 files changed, 2 insertions(+), 147 deletions(-) delete mode 100644 src/pages/task/taskTabs/FilesTables.tsx diff --git a/src/pages/task/TaskTabs.tsx b/src/pages/task/TaskTabs.tsx index 9d3c63e77f..fd2b543664 100644 --- a/src/pages/task/TaskTabs.tsx +++ b/src/pages/task/TaskTabs.tsx @@ -15,6 +15,7 @@ import { BuildBaron } from "./taskTabs/BuildBaron"; import { useBuildBaronVariables } from "./taskTabs/buildBaronAndAnnotations"; import { ExecutionTasksTable } from "./taskTabs/ExecutionTasksTable"; import { FilesTables } from "./taskTabs/FilesTables"; +import FilesTableTab from "./taskTabs/FileTableTab"; import { Logs } from "./taskTabs/Logs"; import { TestsTable } from "./taskTabs/TestsTable"; @@ -115,7 +116,7 @@ export const TaskTabs: React.FC = ({ isDisplayTask, task }) => { data-cy="task-files-tab" key="task-files-tab" > - + ), [TaskTab.Annotations]: ( diff --git a/src/pages/task/taskTabs/FilesTables.tsx b/src/pages/task/taskTabs/FilesTables.tsx deleted file mode 100644 index 058598751b..0000000000 --- a/src/pages/task/taskTabs/FilesTables.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import { Fragment, useState, useEffect } from "react"; -import { useQuery } from "@apollo/client"; -import styled from "@emotion/styled"; -import { SearchInput } from "@leafygreen-ui/search-input"; -import { Body, Subtitle } from "@leafygreen-ui/typography"; -import { Table, Skeleton } from "antd"; -import { SortOrder } from "antd/es/table/interface"; -import debounce from "lodash.debounce"; -import get from "lodash/get"; -import { useParams, useLocation } from "react-router-dom"; -import { StyledLink, WordBreak } from "components/styles"; -import { size } from "constants/tokens"; -import { - TaskFilesQuery, - TaskFilesQueryVariables, - File, - GroupedFiles, -} from "gql/generated/types"; -import { GET_TASK_FILES } from "gql/queries"; -import { RequiredQueryParams } from "types/task"; -import { queryString } from "utils"; - -const { parseQueryString, queryParamAsNumber } = queryString; - -const columns = [ - { - title: "Name", - dataIndex: "name", - key: "name", - render: (text: string, record: File): JSX.Element => ( - - {text} - - ), - defaultSortOrder: "ascend" as SortOrder, - sorter: (a: File, b: File): number => a.name.localeCompare(b.name), - }, -]; - -export const FilesTables: React.FC = () => { - const { id: taskId } = useParams<{ id: string }>(); - const { search: queryVars } = useLocation(); - const parsed = parseQueryString(queryVars); - const initialExecution = queryParamAsNumber( - parsed[RequiredQueryParams.Execution] - ); - const { data, error, loading } = useQuery< - TaskFilesQuery, - TaskFilesQueryVariables - >(GET_TASK_FILES, { - variables: { - taskId, - execution: initialExecution, - }, - }); - const [filterStr, setFilterStr] = useState(""); - const [filteredData, setFilteredData] = useState<[GroupedFiles]>(); - - const { task } = data ?? {}; - const { taskFiles } = task ?? {}; - - useEffect( - () => - debounce(() => { - if (taskFiles) { - const nextData = taskFiles.groupedFiles.map((currVal) => ({ - taskName: currVal.taskName, - files: filterStr.length - ? currVal.files.filter(({ name }) => - name.toLowerCase().includes(filterStr.toLowerCase()) - ) - : currVal.files, - })) as [GroupedFiles]; - setFilteredData(nextData); - } - }, 300)(), - [taskFiles, filterStr] - ); - - if (error) { - return
{error.message}
; - } - - const onSearch = (e: React.ChangeEvent): void => { - setFilterStr(e.target.value); - }; - - const rowKey = (record: File): string => `${record.name}_${record.link}`; - - const renderTable = () => { - if (loading || (!filteredData && data)) { - return ; - } - const filteredFiles = (filteredData || []).filter(({ files }) => - get(files, "length", 0) - ); - if (!filteredFiles.length) { - return No files found; - } - return filteredFiles.map(({ files, taskName }) => ( - - {filteredData?.length > 1 && {taskName}} - - - )); - }; - - return ( - - - - - {renderTable()} - - ); -}; - -const ContentWrapper = styled.div` - padding: 0 ${size.xxs}; -`; - -const TextInputWrapper = styled.div` - margin-bottom: ${size.s}; - width: 50%; -`; - -const StyledTable = styled(Table)` - padding-top: ${size.s}; - padding-bottom: ${size.s}; -`; From 0f20e16ef6d7a0ab65860094c3183582137a3349 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 10:33:24 -0400 Subject: [PATCH 04/18] Remove unused import --- src/pages/task/TaskTabs.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/task/TaskTabs.tsx b/src/pages/task/TaskTabs.tsx index fd2b543664..090b0920fa 100644 --- a/src/pages/task/TaskTabs.tsx +++ b/src/pages/task/TaskTabs.tsx @@ -14,7 +14,6 @@ import { queryString } from "utils"; import { BuildBaron } from "./taskTabs/BuildBaron"; import { useBuildBaronVariables } from "./taskTabs/buildBaronAndAnnotations"; import { ExecutionTasksTable } from "./taskTabs/ExecutionTasksTable"; -import { FilesTables } from "./taskTabs/FilesTables"; import FilesTableTab from "./taskTabs/FileTableTab"; import { Logs } from "./taskTabs/Logs"; import { TestsTable } from "./taskTabs/TestsTable"; From 661ff13b013643f88a3c4169fe3b2962507ae06e Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 10:34:24 -0400 Subject: [PATCH 05/18] Add loading state --- package.json | 1 + .../task/taskTabs/FileTableTab/index.tsx | 11 ++++++++- yarn.lock | 24 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 28c424017f..68b773495b 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "@leafygreen-ui/segmented-control": "8.2.6", "@leafygreen-ui/select": "10.2.0", "@leafygreen-ui/side-nav": "13.0.2", + "@leafygreen-ui/skeleton-loader": "^1.1.0", "@leafygreen-ui/table": "10.0.1", "@leafygreen-ui/table/new": "npm:@leafygreen-ui/table@12.0.10", "@leafygreen-ui/tabs": "11.0.4", diff --git a/src/pages/task/taskTabs/FileTableTab/index.tsx b/src/pages/task/taskTabs/FileTableTab/index.tsx index 741cdb391d..2ce13aa46f 100644 --- a/src/pages/task/taskTabs/FileTableTab/index.tsx +++ b/src/pages/task/taskTabs/FileTableTab/index.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import { useQuery } from "@apollo/client"; import styled from "@emotion/styled"; import { SearchInput } from "@leafygreen-ui/search-input"; +import { Skeleton, TableSkeleton } from "@leafygreen-ui/skeleton-loader"; import { size } from "constants/tokens"; import { useToastContext } from "context/toast"; import { TaskFilesQuery, TaskFilesQueryVariables } from "gql/generated/types"; @@ -38,7 +39,9 @@ const FilesTableTab: React.FC = ({ execution, taskId }) => { // We only want to show the file group name if there are multiple file groups. const hasMultipleFileGroups = taskFiles?.groupedFiles?.length > 1; - return ( + return loading ? ( + + ) : ( <> = ({ execution, taskId }) => { ); }; +const FilesTableTabSkeleton = () => ( + <> + + + +); const StyledSearchInput = styled(SearchInput)` margin-bottom: ${size.m}; width: 400px; diff --git a/yarn.lock b/yarn.lock index 6a44647760..7fe0bec4e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3072,6 +3072,18 @@ "@leafygreen-ui/tokens" "^1.4.0" polished "^4.2.2" +"@leafygreen-ui/card@^10.0.4": + version "10.0.4" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/card/-/card-10.0.4.tgz#a33b590eba59fa2c0d23b9396f0856d0c60032ef" + integrity sha512-GiwKA+Dr/jNgUvUvn3G8A4s2AsJqYu56NvhoTjOHefowE2Y657pQdD4JWvtv1tW88VdqEt2NbGmaVc9cVs677Q== + dependencies: + "@leafygreen-ui/box" "^3.1.8" + "@leafygreen-ui/emotion" "^4.0.7" + "@leafygreen-ui/lib" "^11.0.0" + "@leafygreen-ui/palette" "^4.0.7" + "@leafygreen-ui/tokens" "^2.1.4" + polished "^4.2.2" + "@leafygreen-ui/card@^9.0.4": version "9.0.9" resolved "https://registry.yarnpkg.com/@leafygreen-ui/card/-/card-9.0.9.tgz#91bbda4ac462ad767ef6afd717bfc705064cf821" @@ -3726,6 +3738,18 @@ polished "^4.2.2" react-transition-group "^4.4.5" +"@leafygreen-ui/skeleton-loader@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/skeleton-loader/-/skeleton-loader-1.1.0.tgz#3ce8582a1a4043dea3f5ff0721f207e06bc0c726" + integrity sha512-q4RCyT0WUmKfHeOON39pOx4pVWFymXbyjd7mG08YdigiPHfq/q5BrmOg8nK7psXwusD0BY3tNYK2A+WZ9PLpJQ== + dependencies: + "@leafygreen-ui/card" "^10.0.4" + "@leafygreen-ui/emotion" "^4.0.7" + "@leafygreen-ui/lib" "^11.0.0" + "@leafygreen-ui/palette" "^4.0.7" + "@leafygreen-ui/tokens" "^2.1.4" + "@leafygreen-ui/typography" "^17.0.0" + "@leafygreen-ui/table/new@npm:@leafygreen-ui/table@12.0.10": version "12.0.10" resolved "https://registry.yarnpkg.com/@leafygreen-ui/table/-/table-12.0.10.tgz#b6d6a1d55795cc428a1199e8a67938e5b32ed162" From 2f28abd0b38698abca79a8e98b8561c58d77f0cf Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 10:40:45 -0400 Subject: [PATCH 06/18] Fix filter logic --- src/pages/task/taskTabs/FileTableTab/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/task/taskTabs/FileTableTab/index.tsx b/src/pages/task/taskTabs/FileTableTab/index.tsx index 2ce13aa46f..cc2ae29625 100644 --- a/src/pages/task/taskTabs/FileTableTab/index.tsx +++ b/src/pages/task/taskTabs/FileTableTab/index.tsx @@ -30,12 +30,12 @@ const FilesTableTab: React.FC = ({ execution, taskId }) => { ); const { taskFiles } = data?.task ?? {}; - const filteredFiles = taskFiles?.groupedFiles?.filter( - (groupedFile) => - groupedFile?.files?.filter((file) => - file?.name?.toLowerCase().includes(search.toLowerCase()) - ).length - ); + const filteredFiles = taskFiles?.groupedFiles?.map((groupedFile) => ({ + ...groupedFile, + files: groupedFile?.files?.filter((file) => + file?.name?.toLowerCase().includes(search.toLowerCase()) + ), + })); // We only want to show the file group name if there are multiple file groups. const hasMultipleFileGroups = taskFiles?.groupedFiles?.length > 1; From eb81f50f9788d939dbc214c26690e44ff5177f15 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 12:01:48 -0400 Subject: [PATCH 07/18] Update filter function --- .../task/taskTabs/FileTableTab/index.tsx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/pages/task/taskTabs/FileTableTab/index.tsx b/src/pages/task/taskTabs/FileTableTab/index.tsx index cc2ae29625..b108868975 100644 --- a/src/pages/task/taskTabs/FileTableTab/index.tsx +++ b/src/pages/task/taskTabs/FileTableTab/index.tsx @@ -30,15 +30,23 @@ const FilesTableTab: React.FC = ({ execution, taskId }) => { ); const { taskFiles } = data?.task ?? {}; - const filteredFiles = taskFiles?.groupedFiles?.map((groupedFile) => ({ - ...groupedFile, - files: groupedFile?.files?.filter((file) => + const { groupedFiles = [] } = taskFiles ?? {}; + const filteredGroupedFiles = groupedFiles.reduce((acc, groupedFile) => { + const filteredFiles = groupedFile?.files?.filter((file) => file?.name?.toLowerCase().includes(search.toLowerCase()) - ), - })); + ); + if (filteredFiles?.length) { + acc.push({ + ...groupedFile, + files: filteredFiles, + }); + } + return acc; + }, [] as (typeof taskFiles)["groupedFiles"]); // We only want to show the file group name if there are multiple file groups. - const hasMultipleFileGroups = taskFiles?.groupedFiles?.length > 1; + const hasMultipleFileGroups = groupedFiles.length > 1; + return loading ? ( ) : ( @@ -49,7 +57,7 @@ const FilesTableTab: React.FC = ({ execution, taskId }) => { onChange={(e) => setSearch(e.target.value)} value={search} /> - {filteredFiles?.map((groupedFile) => ( + {filteredGroupedFiles.map((groupedFile) => ( Date: Fri, 8 Sep 2023 13:19:24 -0400 Subject: [PATCH 08/18] Refactor to make testing easier --- .../FileTableTab/GroupedFilesTable/index.tsx | 15 +- .../task/taskTabs/FileTableTab/index.tsx | 14 +- src/pages/task/taskTabs/FileTableTab/types.ts | 6 + .../task/taskTabs/FileTableTab/utils.test.ts | 151 ++++++++++++++++++ src/pages/task/taskTabs/FileTableTab/utils.ts | 23 +++ 5 files changed, 190 insertions(+), 19 deletions(-) create mode 100644 src/pages/task/taskTabs/FileTableTab/types.ts create mode 100644 src/pages/task/taskTabs/FileTableTab/utils.test.ts create mode 100644 src/pages/task/taskTabs/FileTableTab/utils.ts diff --git a/src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/index.tsx b/src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/index.tsx index c84c21a52c..ae858bcc9b 100644 --- a/src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/index.tsx +++ b/src/pages/task/taskTabs/FileTableTab/GroupedFilesTable/index.tsx @@ -15,11 +15,12 @@ import { } from "@leafygreen-ui/table/new"; import { Subtitle } from "@leafygreen-ui/typography"; import { StyledLink } from "components/styles"; -import { File } from "gql/generated/types"; +import { Unpacked } from "types/utils"; +import { GroupedFiles } from "../types"; -type GroupedFilesTableFile = Omit; +type GroupedFilesFile = Unpacked; interface GroupedFilesTableProps { - files: GroupedFilesTableFile[]; + files: GroupedFilesFile[]; taskName?: string; } const GroupedFilesTable: React.FC = ({ @@ -28,7 +29,7 @@ const GroupedFilesTable: React.FC = ({ }) => { const tableContainerRef = useRef(null); - const columns = useMemo>>( + const columns = useMemo>>( () => [ { accessorKey: "name", @@ -44,7 +45,7 @@ const GroupedFilesTable: React.FC = ({ ], [] ); - const table = useLeafyGreenTable({ + const table = useLeafyGreenTable({ containerRef: tableContainerRef, data: files, columns, @@ -59,7 +60,7 @@ const GroupedFilesTable: React.FC = ({ {table .getHeaderGroups() - .map((headerGroup: HeaderGroup) => ( + .map((headerGroup: HeaderGroup) => ( {headerGroup.headers.map((header) => ( @@ -73,7 +74,7 @@ const GroupedFilesTable: React.FC = ({ ))} - {rows.map((row: LeafyGreenTableRow) => ( + {rows.map((row: LeafyGreenTableRow) => ( {row.getVisibleCells().map((cell) => ( diff --git a/src/pages/task/taskTabs/FileTableTab/index.tsx b/src/pages/task/taskTabs/FileTableTab/index.tsx index b108868975..6f7d2e5e1e 100644 --- a/src/pages/task/taskTabs/FileTableTab/index.tsx +++ b/src/pages/task/taskTabs/FileTableTab/index.tsx @@ -8,6 +8,7 @@ import { useToastContext } from "context/toast"; import { TaskFilesQuery, TaskFilesQueryVariables } from "gql/generated/types"; import { GET_TASK_FILES } from "gql/queries"; import GroupedFilesTable from "./GroupedFilesTable"; +import { filterGroupedFiles } from "./utils"; interface FilesTableTabProps { taskId: string; @@ -31,18 +32,7 @@ const FilesTableTab: React.FC = ({ execution, taskId }) => { const { taskFiles } = data?.task ?? {}; const { groupedFiles = [] } = taskFiles ?? {}; - const filteredGroupedFiles = groupedFiles.reduce((acc, groupedFile) => { - const filteredFiles = groupedFile?.files?.filter((file) => - file?.name?.toLowerCase().includes(search.toLowerCase()) - ); - if (filteredFiles?.length) { - acc.push({ - ...groupedFile, - files: filteredFiles, - }); - } - return acc; - }, [] as (typeof taskFiles)["groupedFiles"]); + const filteredGroupedFiles = filterGroupedFiles(groupedFiles, search); // We only want to show the file group name if there are multiple file groups. const hasMultipleFileGroups = groupedFiles.length > 1; diff --git a/src/pages/task/taskTabs/FileTableTab/types.ts b/src/pages/task/taskTabs/FileTableTab/types.ts new file mode 100644 index 0000000000..becb7bf7bb --- /dev/null +++ b/src/pages/task/taskTabs/FileTableTab/types.ts @@ -0,0 +1,6 @@ +import { TaskFilesQuery } from "gql/generated/types"; +import { Unpacked } from "types/utils"; + +export type GroupedFiles = Unpacked< + TaskFilesQuery["task"]["taskFiles"]["groupedFiles"] +>; diff --git a/src/pages/task/taskTabs/FileTableTab/utils.test.ts b/src/pages/task/taskTabs/FileTableTab/utils.test.ts new file mode 100644 index 0000000000..b2bdacaa04 --- /dev/null +++ b/src/pages/task/taskTabs/FileTableTab/utils.test.ts @@ -0,0 +1,151 @@ +import { filterGroupedFiles } from "./utils"; + +describe("filterGroupedFiles", () => { + it("should return an empty array if groupedFiles is empty", () => { + const groupedFiles = []; + const search = ""; + const result = filterGroupedFiles(groupedFiles, search); + expect(result).toStrictEqual([]); + }); + it("should return the original array if search is empty", () => { + const groupedFiles = [ + { + taskName: "some_task_name", + files: [ + { + name: "some_file_name", + link: "some_url", + }, + ], + }, + ]; + const search = ""; + const result = filterGroupedFiles(groupedFiles, search); + expect(result).toStrictEqual(groupedFiles); + }); + it("should filter the array if search is not empty", () => { + const groupedFiles = [ + { + taskName: "some_task_name", + files: [ + { + name: "some_file_name", + link: "some_url", + }, + { + name: "some_other_file_name", + link: "some_url", + }, + ], + }, + ]; + const search = "some_file_name"; + const result = filterGroupedFiles(groupedFiles, search); + expect(result).toStrictEqual([ + { + taskName: "some_task_name", + files: [ + { + name: "some_file_name", + link: "some_url", + }, + ], + }, + ]); + }); + it("should filter across multiple groups", () => { + const groupedFiles = [ + { + taskName: "some_task_name", + files: [ + { + name: "some_file_name", + link: "some_url", + }, + { + name: "some_other_file_name", + link: "some_url", + }, + ], + }, + { + taskName: "some_other_task_name", + files: [ + { + name: "some_file_name", + link: "some_url", + }, + { + name: "some_other_file_name", + link: "some_url", + }, + ], + }, + ]; + const search = "some_file_name"; + const result = filterGroupedFiles(groupedFiles, search); + expect(result).toStrictEqual([ + { + taskName: "some_task_name", + files: [ + { + name: "some_file_name", + link: "some_url", + }, + ], + }, + { + taskName: "some_other_task_name", + files: [ + { + name: "some_file_name", + link: "some_url", + }, + ], + }, + ]); + }); + it("should not return groups that have no matching files", () => { + const groupedFiles = [ + { + taskName: "some_task_name", + files: [ + { + name: "some_matching_file_name", + link: "some_url", + }, + { + name: "some_other_file_name", + link: "some_url", + }, + ], + }, + { + taskName: "some_other_task_name", + files: [ + { + name: "some_file_name", + link: "some_url", + }, + { + name: "some_other_file_name", + link: "some_url", + }, + ], + }, + ]; + const search = "some_matching_file_name"; + const result = filterGroupedFiles(groupedFiles, search); + expect(result).toStrictEqual([ + { + taskName: "some_task_name", + files: [ + { + name: "some_matching_file_name", + link: "some_url", + }, + ], + }, + ]); + }); +}); diff --git a/src/pages/task/taskTabs/FileTableTab/utils.ts b/src/pages/task/taskTabs/FileTableTab/utils.ts new file mode 100644 index 0000000000..a51d618f97 --- /dev/null +++ b/src/pages/task/taskTabs/FileTableTab/utils.ts @@ -0,0 +1,23 @@ +import type { GroupedFiles } from "./types"; + +/** + * `filterGroupedFiles` filters the groupedFiles array from the TaskFilesQuery + * @param groupedFiles - the groupedFiles array from the TaskFilesQuery + * @param search - the search string + * @returns - a new array of groupedFiles that contain the search string + */ +const filterGroupedFiles = (groupedFiles: GroupedFiles[], search: string) => + groupedFiles.reduce((acc, groupedFile) => { + const filteredFiles = groupedFile?.files?.filter((file) => + file?.name?.toLowerCase().includes(search.toLowerCase()) + ); + if (filteredFiles?.length) { + acc.push({ + ...groupedFile, + files: filteredFiles, + }); + } + return acc; + }, [] as GroupedFiles[]); + +export { filterGroupedFiles }; From 47f0a25065344e2ac7ccd04725fdf27721c37c5c Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 13:36:01 -0400 Subject: [PATCH 09/18] 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; From ff69c416cca93595b381309281b370d214e77a9a Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 13:39:32 -0400 Subject: [PATCH 10/18] Lock versions --- package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 68b773495b..ef59737491 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@leafygreen-ui/segmented-control": "8.2.6", "@leafygreen-ui/select": "10.2.0", "@leafygreen-ui/side-nav": "13.0.2", - "@leafygreen-ui/skeleton-loader": "^1.1.0", + "@leafygreen-ui/skeleton-loader": "1.1.0", "@leafygreen-ui/table": "10.0.1", "@leafygreen-ui/table/new": "npm:@leafygreen-ui/table@12.0.10", "@leafygreen-ui/tabs": "11.0.4", diff --git a/yarn.lock b/yarn.lock index 7fe0bec4e6..fecea1a73c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3738,7 +3738,7 @@ polished "^4.2.2" react-transition-group "^4.4.5" -"@leafygreen-ui/skeleton-loader@^1.1.0": +"@leafygreen-ui/skeleton-loader@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@leafygreen-ui/skeleton-loader/-/skeleton-loader-1.1.0.tgz#3ce8582a1a4043dea3f5ff0721f207e06bc0c726" integrity sha512-q4RCyT0WUmKfHeOON39pOx4pVWFymXbyjd7mG08YdigiPHfq/q5BrmOg8nK7psXwusD0BY3tNYK2A+WZ9PLpJQ== From d62b846102fdea5894d016f038bfcf260e8e7dec Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 13:58:17 -0400 Subject: [PATCH 11/18] Case sensitive renaming of folders --- .../AddIssueModal/AddIssueModal.test.tsx | 0 .../AddIssueModal/index.tsx | 0 .../AnnotationNote.tsx | 0 .../AnnotationTicketsTable/AnnotationTicketRow.stories.tsx | 0 .../AnnotationTicketsTable/AnnotationTicketRow.tsx | 0 .../AnnotationTicketsTable/AnnotationTicketsTable.test.tsx | 0 .../AnnotationTicketsTable/AnnotationTicketsTable.tsx | 0 .../__snapshots__/AnnotationTicketRow.stories.storyshot | 0 .../AnnotationTicketsTable/index.ts | 0 .../AnnotationTicketsTable/types.ts | 0 .../BBComponents.tsx | 0 .../BuildBaron.test.tsx | 0 .../BuildBaron.tsx | 0 .../BuildBaronContent.tsx | 0 .../CreatedTicketsTable/BBCreatedTickets.tsx | 0 .../CreatedTicketsTable/BuildBaronTable.tsx | 0 .../CreatedTicketsTable/CustomCreatedTickets.tsx | 0 .../CreatedTicketsTable/CustomCreatedTicketsTable.tsx | 0 .../CreatedTicketsTable/index.ts | 0 .../FileTicketButton.tsx | 0 .../Issues/AnnotationTickets.tsx | 0 .../Issues/Issues.tsx | 0 .../Issues/SuspectedIssues.tsx | 0 .../Issues/index.ts | 0 .../JiraIssueTable/index.tsx | 0 .../index.ts | 0 .../useBuildBaronVariables.ts | 0 27 files changed, 0 insertions(+), 0 deletions(-) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AddIssueModal/AddIssueModal.test.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AddIssueModal/index.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AnnotationNote.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AnnotationTicketsTable/AnnotationTicketRow.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AnnotationTicketsTable/AnnotationTicketsTable.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AnnotationTicketsTable/index.ts (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/AnnotationTicketsTable/types.ts (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/BBComponents.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/BuildBaron.test.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/BuildBaron.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/BuildBaronContent.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/CreatedTicketsTable/BBCreatedTickets.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/CreatedTicketsTable/BuildBaronTable.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/CreatedTicketsTable/CustomCreatedTickets.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/CreatedTicketsTable/CustomCreatedTicketsTable.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/CreatedTicketsTable/index.ts (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/FileTicketButton.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/Issues/AnnotationTickets.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/Issues/Issues.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/Issues/SuspectedIssues.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/Issues/index.ts (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/JiraIssueTable/index.tsx (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/index.ts (100%) rename src/pages/task/taskTabs/{buildBaronAndAnnotations => BuildBaronAndAnnotations}/useBuildBaronVariables.ts (100%) diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AddIssueModal/AddIssueModal.test.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AddIssueModal/AddIssueModal.test.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AddIssueModal/AddIssueModal.test.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AddIssueModal/AddIssueModal.test.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AddIssueModal/index.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AddIssueModal/index.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AddIssueModal/index.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AddIssueModal/index.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationNote.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationNote.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationNote.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationNote.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/index.ts b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/index.ts similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/index.ts rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/index.ts diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/types.ts b/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/types.ts similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/types.ts rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/types.ts diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/BBComponents.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/BBComponents.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/BBComponents.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/BBComponents.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaron.test.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaron.test.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaron.test.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaron.test.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaron.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaron.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaron.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaron.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaronContent.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaronContent.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaronContent.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaronContent.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/BBCreatedTickets.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/BBCreatedTickets.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/BBCreatedTickets.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/BBCreatedTickets.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/BuildBaronTable.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/BuildBaronTable.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/BuildBaronTable.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/BuildBaronTable.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTickets.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTickets.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTickets.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTickets.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTicketsTable.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTicketsTable.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTicketsTable.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTicketsTable.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/index.ts b/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/index.ts similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/index.ts rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/index.ts diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/FileTicketButton.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/FileTicketButton.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/FileTicketButton.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/FileTicketButton.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/AnnotationTickets.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/AnnotationTickets.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/AnnotationTickets.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/AnnotationTickets.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/Issues.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/Issues.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/Issues.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/Issues.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/SuspectedIssues.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/SuspectedIssues.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/SuspectedIssues.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/SuspectedIssues.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/index.ts b/src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/index.ts similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/index.ts rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/index.ts diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/JiraIssueTable/index.tsx b/src/pages/task/taskTabs/BuildBaronAndAnnotations/JiraIssueTable/index.tsx similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/JiraIssueTable/index.tsx rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/JiraIssueTable/index.tsx diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts b/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/useBuildBaronVariables.ts b/src/pages/task/taskTabs/BuildBaronAndAnnotations/useBuildBaronVariables.ts similarity index 100% rename from src/pages/task/taskTabs/buildBaronAndAnnotations/useBuildBaronVariables.ts rename to src/pages/task/taskTabs/BuildBaronAndAnnotations/useBuildBaronVariables.ts From dfc0f86546c47571ef50ce8fbda9550d21df9f98 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Fri, 8 Sep 2023 13:58:57 -0400 Subject: [PATCH 12/18] Types --- src/gql/generated/types.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gql/generated/types.ts b/src/gql/generated/types.ts index 35d7d58150..3724f371d2 100644 --- a/src/gql/generated/types.ts +++ b/src/gql/generated/types.ts @@ -2212,6 +2212,12 @@ export enum RoundingRule { Up = "UP", } +export type SshKey = { + __typename?: "SSHKey"; + location: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; +}; + /** SaveDistroInput is the input to the saveDistro mutation. */ export type SaveDistroInput = { distro: DistroInput; @@ -2326,6 +2332,7 @@ export type SpruceConfig = { bannerTheme?: Maybe; githubOrgs: Array; jira?: Maybe; + keys: Array; providers?: Maybe; slack?: Maybe; spawnHost: SpawnHostConfig; From 91dd66c6eff3e50c49b0ac8ab41134f6cfd85d76 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Mon, 11 Sep 2023 09:27:31 -0400 Subject: [PATCH 13/18] Fix buildbaronannotations hook export --- src/pages/task/TaskTabs.tsx | 6 ++++-- src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/task/TaskTabs.tsx b/src/pages/task/TaskTabs.tsx index e63c9bc4ff..76424e9cc6 100644 --- a/src/pages/task/TaskTabs.tsx +++ b/src/pages/task/TaskTabs.tsx @@ -11,8 +11,10 @@ import { usePrevious } from "hooks"; import { useTabShortcut } from "hooks/useTabShortcut"; import { TaskTab } from "types/task"; import { queryString } from "utils"; -import { BuildBaron } from "./taskTabs/BuildBaronAndAnnotations"; -import useBuildBaronVariables from "./taskTabs/BuildBaronAndAnnotations/useBuildBaronVariables"; +import { + BuildBaron, + useBuildBaronVariables, +} from "./taskTabs/BuildBaronAndAnnotations"; import { ExecutionTasksTable } from "./taskTabs/ExecutionTasksTable"; import FilesTableTab from "./taskTabs/FileTableTab"; import { Logs } from "./taskTabs/Logs"; diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts b/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts index 14d0913439..289487e247 100644 --- a/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts +++ b/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts @@ -1,3 +1,6 @@ import { loadable } from "components/SpruceLoader"; +import useBuildBaronVariables from "./useBuildBaronVariables"; export const BuildBaron = loadable(() => import("./BuildBaron")); + +export { useBuildBaronVariables }; From 3553914c9fa7d2a9e89fd8c7a5dce6d22a39eabf Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Mon, 11 Sep 2023 16:19:56 -0400 Subject: [PATCH 14/18] Revert "Fix buildbaronannotations hook export" This reverts commit 91dd66c6eff3e50c49b0ac8ab41134f6cfd85d76. --- src/pages/task/TaskTabs.tsx | 6 ++---- src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pages/task/TaskTabs.tsx b/src/pages/task/TaskTabs.tsx index 76424e9cc6..e63c9bc4ff 100644 --- a/src/pages/task/TaskTabs.tsx +++ b/src/pages/task/TaskTabs.tsx @@ -11,10 +11,8 @@ import { usePrevious } from "hooks"; import { useTabShortcut } from "hooks/useTabShortcut"; import { TaskTab } from "types/task"; import { queryString } from "utils"; -import { - BuildBaron, - 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/BuildBaronAndAnnotations/index.ts b/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts index 289487e247..14d0913439 100644 --- a/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts +++ b/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts @@ -1,6 +1,3 @@ import { loadable } from "components/SpruceLoader"; -import useBuildBaronVariables from "./useBuildBaronVariables"; export const BuildBaron = loadable(() => import("./BuildBaron")); - -export { useBuildBaronVariables }; From 23ea22cb62c6c02f5119e34717ac700eb5692a95 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Mon, 11 Sep 2023 16:19:59 -0400 Subject: [PATCH 15/18] Revert "Types" This reverts commit dfc0f86546c47571ef50ce8fbda9550d21df9f98. --- src/gql/generated/types.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gql/generated/types.ts b/src/gql/generated/types.ts index 3724f371d2..35d7d58150 100644 --- a/src/gql/generated/types.ts +++ b/src/gql/generated/types.ts @@ -2212,12 +2212,6 @@ export enum RoundingRule { Up = "UP", } -export type SshKey = { - __typename?: "SSHKey"; - location: Scalars["String"]["output"]; - name: Scalars["String"]["output"]; -}; - /** SaveDistroInput is the input to the saveDistro mutation. */ export type SaveDistroInput = { distro: DistroInput; @@ -2332,7 +2326,6 @@ export type SpruceConfig = { bannerTheme?: Maybe; githubOrgs: Array; jira?: Maybe; - keys: Array; providers?: Maybe; slack?: Maybe; spawnHost: SpawnHostConfig; From e4266c3c44c52d2112205e126fe342f96340a539 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Mon, 11 Sep 2023 16:21:46 -0400 Subject: [PATCH 16/18] Revert "Case sensitive renaming of folders" This reverts commit d62b846102fdea5894d016f038bfcf260e8e7dec. --- .../AddIssueModal/AddIssueModal.test.tsx | 0 .../AddIssueModal/index.tsx | 0 .../AnnotationNote.tsx | 0 .../AnnotationTicketsTable/AnnotationTicketRow.stories.tsx | 0 .../AnnotationTicketsTable/AnnotationTicketRow.tsx | 0 .../AnnotationTicketsTable/AnnotationTicketsTable.test.tsx | 0 .../AnnotationTicketsTable/AnnotationTicketsTable.tsx | 0 .../__snapshots__/AnnotationTicketRow.stories.storyshot | 0 .../AnnotationTicketsTable/index.ts | 0 .../AnnotationTicketsTable/types.ts | 0 .../BBComponents.tsx | 0 .../BuildBaron.test.tsx | 0 .../BuildBaron.tsx | 0 .../BuildBaronContent.tsx | 0 .../CreatedTicketsTable/BBCreatedTickets.tsx | 0 .../CreatedTicketsTable/BuildBaronTable.tsx | 0 .../CreatedTicketsTable/CustomCreatedTickets.tsx | 0 .../CreatedTicketsTable/CustomCreatedTicketsTable.tsx | 0 .../CreatedTicketsTable/index.ts | 0 .../FileTicketButton.tsx | 0 .../Issues/AnnotationTickets.tsx | 0 .../Issues/Issues.tsx | 0 .../Issues/SuspectedIssues.tsx | 0 .../Issues/index.ts | 0 .../JiraIssueTable/index.tsx | 0 .../index.ts | 0 .../useBuildBaronVariables.ts | 0 27 files changed, 0 insertions(+), 0 deletions(-) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AddIssueModal/AddIssueModal.test.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AddIssueModal/index.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AnnotationNote.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AnnotationTicketsTable/AnnotationTicketRow.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AnnotationTicketsTable/AnnotationTicketsTable.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AnnotationTicketsTable/index.ts (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/AnnotationTicketsTable/types.ts (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/BBComponents.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/BuildBaron.test.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/BuildBaron.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/BuildBaronContent.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/CreatedTicketsTable/BBCreatedTickets.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/CreatedTicketsTable/BuildBaronTable.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/CreatedTicketsTable/CustomCreatedTickets.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/CreatedTicketsTable/CustomCreatedTicketsTable.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/CreatedTicketsTable/index.ts (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/FileTicketButton.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/Issues/AnnotationTickets.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/Issues/Issues.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/Issues/SuspectedIssues.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/Issues/index.ts (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/JiraIssueTable/index.tsx (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/index.ts (100%) rename src/pages/task/taskTabs/{BuildBaronAndAnnotations => buildBaronAndAnnotations}/useBuildBaronVariables.ts (100%) diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AddIssueModal/AddIssueModal.test.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/AddIssueModal/AddIssueModal.test.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AddIssueModal/AddIssueModal.test.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AddIssueModal/AddIssueModal.test.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AddIssueModal/index.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/AddIssueModal/index.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AddIssueModal/index.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AddIssueModal/index.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationNote.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationNote.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationNote.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationNote.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.stories.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketRow.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.test.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/AnnotationTicketsTable.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot b/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/__snapshots__/AnnotationTicketRow.stories.storyshot diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/index.ts b/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/index.ts similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/index.ts rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/index.ts diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/types.ts b/src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/types.ts similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/AnnotationTicketsTable/types.ts rename to src/pages/task/taskTabs/buildBaronAndAnnotations/AnnotationTicketsTable/types.ts diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/BBComponents.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/BBComponents.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/BBComponents.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/BBComponents.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaron.test.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaron.test.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaron.test.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaron.test.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaron.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaron.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaron.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaron.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaronContent.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaronContent.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/BuildBaronContent.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/BuildBaronContent.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/BBCreatedTickets.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/BBCreatedTickets.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/BBCreatedTickets.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/BBCreatedTickets.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/BuildBaronTable.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/BuildBaronTable.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/BuildBaronTable.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/BuildBaronTable.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTickets.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTickets.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTickets.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTickets.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTicketsTable.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTicketsTable.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTicketsTable.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/CustomCreatedTicketsTable.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/index.ts b/src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/index.ts similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/CreatedTicketsTable/index.ts rename to src/pages/task/taskTabs/buildBaronAndAnnotations/CreatedTicketsTable/index.ts diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/FileTicketButton.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/FileTicketButton.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/FileTicketButton.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/FileTicketButton.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/AnnotationTickets.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/AnnotationTickets.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/AnnotationTickets.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/AnnotationTickets.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/Issues.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/Issues.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/Issues.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/Issues.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/SuspectedIssues.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/SuspectedIssues.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/SuspectedIssues.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/SuspectedIssues.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/index.ts b/src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/index.ts similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/Issues/index.ts rename to src/pages/task/taskTabs/buildBaronAndAnnotations/Issues/index.ts diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/JiraIssueTable/index.tsx b/src/pages/task/taskTabs/buildBaronAndAnnotations/JiraIssueTable/index.tsx similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/JiraIssueTable/index.tsx rename to src/pages/task/taskTabs/buildBaronAndAnnotations/JiraIssueTable/index.tsx diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts b/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/index.ts rename to src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts diff --git a/src/pages/task/taskTabs/BuildBaronAndAnnotations/useBuildBaronVariables.ts b/src/pages/task/taskTabs/buildBaronAndAnnotations/useBuildBaronVariables.ts similarity index 100% rename from src/pages/task/taskTabs/BuildBaronAndAnnotations/useBuildBaronVariables.ts rename to src/pages/task/taskTabs/buildBaronAndAnnotations/useBuildBaronVariables.ts From a2ba29a2e1a32a3d3d94cdd07f172134303f07cc Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Mon, 11 Sep 2023 16:21:53 -0400 Subject: [PATCH 17/18] Revert "Lock versions" This reverts commit ff69c416cca93595b381309281b370d214e77a9a. --- package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ef59737491..68b773495b 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@leafygreen-ui/segmented-control": "8.2.6", "@leafygreen-ui/select": "10.2.0", "@leafygreen-ui/side-nav": "13.0.2", - "@leafygreen-ui/skeleton-loader": "1.1.0", + "@leafygreen-ui/skeleton-loader": "^1.1.0", "@leafygreen-ui/table": "10.0.1", "@leafygreen-ui/table/new": "npm:@leafygreen-ui/table@12.0.10", "@leafygreen-ui/tabs": "11.0.4", diff --git a/yarn.lock b/yarn.lock index fecea1a73c..7fe0bec4e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3738,7 +3738,7 @@ polished "^4.2.2" react-transition-group "^4.4.5" -"@leafygreen-ui/skeleton-loader@1.1.0": +"@leafygreen-ui/skeleton-loader@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@leafygreen-ui/skeleton-loader/-/skeleton-loader-1.1.0.tgz#3ce8582a1a4043dea3f5ff0721f207e06bc0c726" integrity sha512-q4RCyT0WUmKfHeOON39pOx4pVWFymXbyjd7mG08YdigiPHfq/q5BrmOg8nK7psXwusD0BY3tNYK2A+WZ9PLpJQ== From fd7eae27a33718dbf155735a41b054e33395eda1 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Mon, 11 Sep 2023 16:35:57 -0400 Subject: [PATCH 18/18] Revert "Move tabs files to be more idiomatic with the rest of the app" This reverts commit 47f0a25065344e2ac7ccd04725fdf27721c37c5c. --- src/pages/task/TaskTabs.tsx | 4 ++-- src/pages/task/taskTabs/BuildBaron.ts | 5 +++++ .../ExecutionTasksTable.stories.tsx | 2 +- .../index.tsx => ExecutionTasksTable.tsx} | 0 src/pages/task/taskTabs/{logs/index.tsx => Logs.tsx} | 8 +++++++- .../taskTabs/{testsTable/index.tsx => TestsTable.tsx} | 2 +- .../__snapshots__/ExecutionTasksTable.stories.storyshot | 0 src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts | 4 ++-- 8 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 src/pages/task/taskTabs/BuildBaron.ts rename src/pages/task/taskTabs/{ExecutionTasksTable => }/ExecutionTasksTable.stories.tsx (96%) rename src/pages/task/taskTabs/{ExecutionTasksTable/index.tsx => ExecutionTasksTable.tsx} (100%) rename src/pages/task/taskTabs/{logs/index.tsx => Logs.tsx} (98%) rename src/pages/task/taskTabs/{testsTable/index.tsx => TestsTable.tsx} (99%) rename src/pages/task/taskTabs/{ExecutionTasksTable => }/__snapshots__/ExecutionTasksTable.stories.storyshot (100%) diff --git a/src/pages/task/TaskTabs.tsx b/src/pages/task/TaskTabs.tsx index e63c9bc4ff..090b0920fa 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/BuildBaronAndAnnotations"; -import useBuildBaronVariables from "./taskTabs/BuildBaronAndAnnotations/useBuildBaronVariables"; +import { BuildBaron } from "./taskTabs/BuildBaron"; +import { useBuildBaronVariables } from "./taskTabs/buildBaronAndAnnotations"; 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 new file mode 100644 index 0000000000..3d62b6099d --- /dev/null +++ b/src/pages/task/taskTabs/BuildBaron.ts @@ -0,0 +1,5 @@ +import { loadable } from "components/SpruceLoader"; + +export const BuildBaron = loadable( + () => import("./buildBaronAndAnnotations/BuildBaron") +); diff --git a/src/pages/task/taskTabs/ExecutionTasksTable/ExecutionTasksTable.stories.tsx b/src/pages/task/taskTabs/ExecutionTasksTable.stories.tsx similarity index 96% rename from src/pages/task/taskTabs/ExecutionTasksTable/ExecutionTasksTable.stories.tsx rename to src/pages/task/taskTabs/ExecutionTasksTable.stories.tsx index 2662c5df1e..8af0489035 100644 --- a/src/pages/task/taskTabs/ExecutionTasksTable/ExecutionTasksTable.stories.tsx +++ b/src/pages/task/taskTabs/ExecutionTasksTable.stories.tsx @@ -1,6 +1,6 @@ import { CustomStoryObj, CustomMeta } from "test_utils/types"; -import { ExecutionTasksTable } from "."; +import { ExecutionTasksTable } from "./ExecutionTasksTable"; export default { title: "Pages/Task/Table/Execution Tasks Table", diff --git a/src/pages/task/taskTabs/ExecutionTasksTable/index.tsx b/src/pages/task/taskTabs/ExecutionTasksTable.tsx similarity index 100% rename from src/pages/task/taskTabs/ExecutionTasksTable/index.tsx rename to src/pages/task/taskTabs/ExecutionTasksTable.tsx diff --git a/src/pages/task/taskTabs/logs/index.tsx b/src/pages/task/taskTabs/Logs.tsx similarity index 98% rename from src/pages/task/taskTabs/logs/index.tsx rename to src/pages/task/taskTabs/Logs.tsx index 30c04ad957..7c85c9f8e4 100644 --- a/src/pages/task/taskTabs/logs/index.tsx +++ b/src/pages/task/taskTabs/Logs.tsx @@ -16,7 +16,13 @@ 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 "./LogTypes"; +import { + EventLog, + AgentLog, + SystemLog, + TaskLog, + AllLog, +} from "./logs/LogTypes"; const DEFAULT_LOG_TYPE = LogTypes.Task; diff --git a/src/pages/task/taskTabs/testsTable/index.tsx b/src/pages/task/taskTabs/TestsTable.tsx similarity index 99% rename from src/pages/task/taskTabs/testsTable/index.tsx rename to src/pages/task/taskTabs/TestsTable.tsx index cc7f178adc..462fc0a013 100644 --- a/src/pages/task/taskTabs/testsTable/index.tsx +++ b/src/pages/task/taskTabs/TestsTable.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 "./getColumnsTemplate"; +import { getColumnsTemplate } from "./testsTable/getColumnsTemplate"; const { getLimitFromSearch, getPageFromSearch } = url; const { parseQueryString, queryParamAsNumber } = queryString; diff --git a/src/pages/task/taskTabs/ExecutionTasksTable/__snapshots__/ExecutionTasksTable.stories.storyshot b/src/pages/task/taskTabs/__snapshots__/ExecutionTasksTable.stories.storyshot similarity index 100% rename from src/pages/task/taskTabs/ExecutionTasksTable/__snapshots__/ExecutionTasksTable.stories.storyshot rename to src/pages/task/taskTabs/__snapshots__/ExecutionTasksTable.stories.storyshot diff --git a/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts b/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts index 14d0913439..0be0337937 100644 --- a/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts +++ b/src/pages/task/taskTabs/buildBaronAndAnnotations/index.ts @@ -1,3 +1,3 @@ -import { loadable } from "components/SpruceLoader"; +import useBuildBaronVariables from "./useBuildBaronVariables"; -export const BuildBaron = loadable(() => import("./BuildBaron")); +export { useBuildBaronVariables };