Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Rename filesTableTab to FilesTable
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Sep 13, 2023
1 parent c23e7ea commit 52a42b3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/components/Table/BaseTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export const BaseTable = <T extends LGRowData>({
</HeaderRow>
))}
</TableHead>

<TableBody>
{table.getRowModel().rows.map((row) => (
<Row key={row.id} row={row} data-cy={dataCyRow}>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/task/TaskTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { queryString } from "utils";
import { BuildBaron } from "./taskTabs/BuildBaron";
import { useBuildBaronVariables } from "./taskTabs/buildBaronAndAnnotations";
import { ExecutionTasksTable } from "./taskTabs/ExecutionTasksTable";
import FilesTableTab from "./taskTabs/FileTableTab";
import FilesTable from "./taskTabs/FileTable";
import { Logs } from "./taskTabs/Logs";
import { TestsTable } from "./taskTabs/TestsTable";

Expand Down Expand Up @@ -115,7 +115,7 @@ export const TaskTabs: React.FC<TaskTabProps> = ({ isDisplayTask, task }) => {
data-cy="task-files-tab"
key="task-files-tab"
>
<FilesTableTab taskId={id} execution={execution} />
<FilesTable taskId={id} execution={execution} />
</Tab>
),
[TaskTab.Annotations]: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ 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 { TablePlaceholder } from "components/Table/TablePlaceholder";
import { Body } from "@leafygreen-ui/typography";
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";
import { filterGroupedFiles } from "./utils";

interface FilesTableTabProps {
interface FilesTableProps {
taskId: string;
execution: number;
}
const FilesTableTab: React.FC<FilesTableTabProps> = ({ execution, taskId }) => {
const FilesTable: React.FC<FilesTableProps> = ({ execution, taskId }) => {
const [search, setSearch] = useState("");
const dispatchToast = useToastContext();
const { data, loading } = useQuery<TaskFilesQuery, TaskFilesQueryVariables>(
Expand All @@ -39,7 +39,7 @@ const FilesTableTab: React.FC<FilesTableTabProps> = ({ execution, taskId }) => {
const hasMultipleFileGroups = groupedFiles.length > 1;

return loading ? (
<FilesTableTabSkeleton />
<FilesTableSkeleton />
) : (
<>
<StyledSearchInput
Expand All @@ -49,9 +49,7 @@ const FilesTableTab: React.FC<FilesTableTabProps> = ({ execution, taskId }) => {
value={search}
data-cy="file-search-input"
/>
{filteredGroupedFiles.length === 0 && (
<TablePlaceholder message="No files found" />
)}
{filteredGroupedFiles.length === 0 && <Body>No files found</Body>}
{filteredGroupedFiles.map((groupedFile) => (
<GroupedFilesTable
key={groupedFile?.taskName}
Expand All @@ -63,7 +61,7 @@ const FilesTableTab: React.FC<FilesTableTabProps> = ({ execution, taskId }) => {
);
};

const FilesTableTabSkeleton = () => (
const FilesTableSkeleton = () => (
<>
<Skeleton />
<TableSkeleton numCols={1} numRows={5} />
Expand All @@ -73,4 +71,4 @@ const StyledSearchInput = styled(SearchInput)`
margin-bottom: ${size.m};
width: 400px;
`;
export default FilesTableTab;
export default FilesTable;

0 comments on commit 52a42b3

Please sign in to comment.