From f0ff78131a48e7bfc711b7f67e1d0e7857237a53 Mon Sep 17 00:00:00 2001 From: Mihoub Date: Tue, 8 Oct 2024 16:42:08 +0200 Subject: [PATCH] fix(structures): comment patents graphs --- .../[id]/components/patents/index.tsx | 44 +++++++++---------- .../pages/organizations/[id]/locales/fr.json | 2 - 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/client/src/pages/organizations/[id]/components/patents/index.tsx b/client/src/pages/organizations/[id]/components/patents/index.tsx index 31b433da..0c0a9a54 100644 --- a/client/src/pages/organizations/[id]/components/patents/index.tsx +++ b/client/src/pages/organizations/[id]/components/patents/index.tsx @@ -3,11 +3,11 @@ import { Button, Row, Col, Text } from "@dataesr/dsfr-plus"; import useScreenSize from "../../../../../hooks/useScreenSize"; import YearBars from "../../../../../components/year-bars"; import { useState } from "react"; -import { useQuery } from "@tanstack/react-query"; -import PatentChart from "../../../../../components/patent-chart"; -import { getCpcAggregation } from "../../../../../api/patents/[id]"; +// import { useQuery } from "@tanstack/react-query"; +// import PatentChart from "../../../../../components/patent-chart"; +// import { getCpcAggregation } from "../../../../../api/patents/[id]"; import { OrganizationPatentsData } from "../../../../../types/organization"; -import CpcWordCloud from "../../../../../components/patent-chart/indexA"; +// import CpcWordCloud from "../../../../../components/patent-chart/indexA"; type OrganizationPatentsProps = { data: OrganizationPatentsData; @@ -28,22 +28,22 @@ export default function OrganizationPatents({ "applicants.ids.id": { values: [{ value, label }], type: "terms" }, }; - const patentId = searchFilters["applicants.ids.id"].values[0].value; - const { data: patentsData = [] } = useQuery({ - queryKey: ["patent", patentId], - queryFn: () => getCpcAggregation(patentId), - throwOnError: true, - }); + // const patentId = searchFilters["applicants.ids.id"].values[0].value; + // const { data: patentsData = [] } = useQuery({ + // queryKey: ["patent", patentId], + // queryFn: () => getCpcAggregation(patentId), + // throwOnError: true, + // }); - const prepareCpcGraphData = (patentsData) => { - return patentsData.map((item) => ({ - code: item.code, - doc_count: item.doc_count, - label: item.label, - })); - }; + // const prepareCpcGraphData = (patentsData) => { + // return patentsData.map((item) => ({ + // code: item.code, + // doc_count: item.doc_count, + // label: item.label, + // })); + // }; - const graphData = prepareCpcGraphData(patentsData); + // const graphData = prepareCpcGraphData(patentsData); const patentsFilterUrl = `/search/patents?filters=${encodeURIComponent( JSON.stringify(searchFilters) @@ -135,7 +135,7 @@ export default function OrganizationPatents({ -
+ {/*
-
+
*/} @@ -175,12 +175,12 @@ export default function OrganizationPatents({ years={patents.byYear.map((year) => year.label)} /> )} - {projectGraph === "cpc" && patentsData && ( + {/* {projectGraph === "cpc" && patentsData && ( )} {projectGraph === "cpc2" && patentsData && ( - )} + )} */}
diff --git a/client/src/pages/organizations/[id]/locales/fr.json b/client/src/pages/organizations/[id]/locales/fr.json index f14e85ed..a2741868 100644 --- a/client/src/pages/organizations/[id]/locales/fr.json +++ b/client/src/pages/organizations/[id]/locales/fr.json @@ -39,8 +39,6 @@ "organizations.patents.count": "Familles de brevets répertoriés par scanR", "organizations.patents.search": "Voir la liste des brevets", "organizations.patents.nav.year": "Répartition par année", - "organizations.patents.nav.cpc-1": "Répartition par classification TEST 1 ", - "organizations.patents.nav.cpc-2": "Répartition par classification TEST 2 ", "organizations.patents.year-bars.name": "Familles de brevets", "organizations.projects.count": "financements répertoriés par scanR", "organizations.projects.search": "Voir la liste des financements",