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

Commit

Permalink
Migrate TaskFiles usage to task.files
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Sep 19, 2023
1 parent f10d2b9 commit 2b77bb4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8102,7 +8102,7 @@ export type TaskFilesQuery = {
__typename?: "Task";
execution: number;
id: string;
taskFiles: {
files: {
__typename?: "TaskFiles";
fileCount: number;
groupedFiles: Array<{
Expand Down Expand Up @@ -8391,6 +8391,7 @@ export type TaskQuery = {
id: string;
status: string;
}> | null;
files: { __typename?: "TaskFiles"; fileCount: number };
logs: {
__typename?: "TaskLogLinks";
agentLogLink?: string | null;
Expand All @@ -8401,7 +8402,6 @@ export type TaskQuery = {
};
pod?: { __typename?: "Pod"; id: string } | null;
project?: { __typename?: "Project"; id: string; identifier: string } | null;
taskFiles: { __typename?: "TaskFiles"; fileCount: number };
versionMetadata: {
__typename?: "Version";
author: string;
Expand Down
2 changes: 1 addition & 1 deletion src/gql/mocks/taskData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const taskQuery: TaskQuery = {
spawnHostLink:
"https://evergreen.mongodb.com/spawn?distro_id=ubuntu1604-small&task_id=spruce_ubuntu1604_e2e_test_patch_e0ece5ad52ad01630bdf29f55b9382a26d6256b3_5f4889313627e0544660c800_20_08_28_04_33_55",
status: "pending",
taskFiles: { __typename: "TaskFiles", fileCount: 38 },
files: { __typename: "TaskFiles", fileCount: 38 },
totalTestCount: 0,
versionMetadata: {
__typename: "Version",
Expand Down
4 changes: 2 additions & 2 deletions src/gql/queries/task-files.graphql
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
query TaskFiles($taskId: String!, $execution: Int) {
task(taskId: $taskId, execution: $execution) {
execution
id
taskFiles {
files {
fileCount
groupedFiles {
files {
Expand All @@ -12,5 +11,6 @@ query TaskFiles($taskId: String!, $execution: Int) {
taskName
}
}
id
}
}
6 changes: 3 additions & 3 deletions src/gql/queries/task.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ query Task($taskId: String!, $execution: Int) {
}
expectedDuration
failedTestCount
files {
fileCount
}
finishTime
generatedBy
generatedByName
Expand Down Expand Up @@ -103,9 +106,6 @@ query Task($taskId: String!, $execution: Int) {
resetWhenFinished
spawnHostLink
startTime
taskFiles {
fileCount
}
timeTaken
totalTestCount
versionMetadata {
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 @@ -35,15 +35,15 @@ export const TaskTabs: React.FC<TaskTabProps> = ({ isDisplayTask, task }) => {
execution,
executionTasksFull,
failedTestCount,
files,
id,
isPerfPluginEnabled,
logs: logLinks,
status,
taskFiles,
totalTestCount,
versionMetadata,
} = task ?? {};
const { fileCount } = taskFiles ?? {};
const { fileCount } = files ?? {};

const { showBuildBaron } = useBuildBaronVariables({
task: {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/task/taskTabs/FileTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const FileTable: React.FC<FileTableProps> = ({ execution, taskId }) => {
},
}
);
const { taskFiles } = data?.task ?? {};
const { files } = data?.task ?? {};

const { groupedFiles = [] } = taskFiles ?? {};
const { groupedFiles = [] } = files ?? {};
const filteredGroupedFiles = filterGroupedFiles(groupedFiles, search);

// We only want to show the file group name if there are multiple file groups.
Expand Down
2 changes: 1 addition & 1 deletion src/pages/task/taskTabs/FileTable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { TaskFilesQuery } from "gql/generated/types";
import { Unpacked } from "types/utils";

export type GroupedFiles = Unpacked<
TaskFilesQuery["task"]["taskFiles"]["groupedFiles"]
TaskFilesQuery["task"]["files"]["groupedFiles"]
>;

0 comments on commit 2b77bb4

Please sign in to comment.