From 4fe0c382dbc0d5080d6e3e8eb9a0db356e5d9014 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Wed, 24 Jan 2024 17:22:48 -0500 Subject: [PATCH 1/2] Use project config instead of project settings to fetch project health view --- src/gql/generated/types.ts | 11 ++++------- src/gql/queries/project-health-view.graphql | 8 +++----- src/pages/commits/ViewToggle.tsx | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/gql/generated/types.ts b/src/gql/generated/types.ts index 8cdae65f8e..1235243be3 100644 --- a/src/gql/generated/types.ts +++ b/src/gql/generated/types.ts @@ -7111,13 +7111,10 @@ export type ProjectHealthViewQueryVariables = Exact<{ export type ProjectHealthViewQuery = { __typename?: "Query"; - projectSettings: { - __typename?: "ProjectSettings"; - projectRef?: { - __typename?: "Project"; - id: string; - projectHealthView: ProjectHealthView; - } | null; + project: { + __typename?: "Project"; + id: string; + projectHealthView: ProjectHealthView; }; }; diff --git a/src/gql/queries/project-health-view.graphql b/src/gql/queries/project-health-view.graphql index 544a0dc1b0..0a83b77a4f 100644 --- a/src/gql/queries/project-health-view.graphql +++ b/src/gql/queries/project-health-view.graphql @@ -1,8 +1,6 @@ query ProjectHealthView($identifier: String!) { - projectSettings(identifier: $identifier) { - projectRef { - id - projectHealthView - } + project(projectIdentifier: $identifier) { + id + projectHealthView } } diff --git a/src/pages/commits/ViewToggle.tsx b/src/pages/commits/ViewToggle.tsx index 3d27af4b5d..16fa2bc141 100644 --- a/src/pages/commits/ViewToggle.tsx +++ b/src/pages/commits/ViewToggle.tsx @@ -42,7 +42,7 @@ export const ViewToggle: React.FC = ({ identifier }) => { useEffect(() => { if (!view) { - setView(data?.projectSettings?.projectRef?.projectHealthView); + setView(data?.project.projectHealthView); } }, [data, setView, view]); From f86ba46053b3ed72a96e86e92229a6560f36335c Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Thu, 25 Jan 2024 11:07:14 -0500 Subject: [PATCH 2/2] Update src/pages/commits/ViewToggle.tsx Co-authored-by: Sophie Stadler --- src/pages/commits/ViewToggle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/commits/ViewToggle.tsx b/src/pages/commits/ViewToggle.tsx index 16fa2bc141..9471ccb9f9 100644 --- a/src/pages/commits/ViewToggle.tsx +++ b/src/pages/commits/ViewToggle.tsx @@ -42,7 +42,7 @@ export const ViewToggle: React.FC = ({ identifier }) => { useEffect(() => { if (!view) { - setView(data?.project.projectHealthView); + setView(data?.project?.projectHealthView); } }, [data, setView, view]);