diff --git a/client/src/pages/european-projects/charts-config.json b/client/src/pages/european-projects/charts-config.json index f0d267b4..cd597fe3 100644 --- a/client/src/pages/european-projects/charts-config.json +++ b/client/src/pages/european-projects/charts-config.json @@ -42,6 +42,15 @@ "sourceURL": "https://cordis.europa.eu/", "integrationURL": "/european-projects/components/pages/analysis/overview/charts/projects-types-2" }, + { + "id": "successRateForAmountsByPillar", + "title": "", + "subtitle": "Taux de succès sur le montants par pilier", + "description": "Attention EIT", + "source": "Commission européenne, Cordis", + "sourceURL": "https://cordis.europa.eu/", + "integrationURL": "/european-projects/components/pages/analysis/overview/charts/projects-types-2" + }, { "id": "projectsTypesPiliers1", "title": "", diff --git a/client/src/pages/european-projects/components/pages/general/overview/charts/projects-types-2/query.tsx b/client/src/pages/european-projects/components/pages/general/overview/charts/projects-types-2/query.tsx index 69df4e83..cbfd00ab 100644 --- a/client/src/pages/european-projects/components/pages/general/overview/charts/projects-types-2/query.tsx +++ b/client/src/pages/european-projects/components/pages/general/overview/charts/projects-types-2/query.tsx @@ -1,11 +1,10 @@ const { VITE_APP_SERVER_URL } = import.meta.env; export async function GetData(params: string) { - let url = `${VITE_APP_SERVER_URL}/european-projects/analysis-synthese-projects-types-2`; - if (params !== '') { - url = `${VITE_APP_SERVER_URL}/european-projects/analysis-synthese-projects-types-2?${params}`; + let url = `${VITE_APP_SERVER_URL}/european-projects/general-ProjectsTypes-SuccessRateForAmountsByProjectsTypes`; + if (params !== "") { + url = `${VITE_APP_SERVER_URL}/european-projects/general-ProjectsTypes-SuccessRateForAmountsByProjectsTypes?${params}`; } - return fetch(url).then((response) => (response.json())) + return fetch(url).then((response) => response.json()); } - diff --git a/client/src/pages/european-projects/components/pages/general/projects-types/charts/success-rate-for-amounts-by-pillar/index.tsx b/client/src/pages/european-projects/components/pages/general/projects-types/charts/success-rate-for-amounts-by-pillar/index.tsx new file mode 100644 index 00000000..f645ebf7 --- /dev/null +++ b/client/src/pages/european-projects/components/pages/general/projects-types/charts/success-rate-for-amounts-by-pillar/index.tsx @@ -0,0 +1,72 @@ +import { useQuery } from "@tanstack/react-query"; +import { useSearchParams } from "react-router-dom"; + +import Template from "./template"; +import { GetData } from "./query"; +import options from "./options"; + +import ChartWrapper from "../../../../../chart-wrapper"; +import { getDefaultParams } from "./utils"; +import { Col, Container, Row } from "@dataesr/dsfr-plus"; + +export default function SuccessRateForAmountsByPillar() { + const [searchParams] = useSearchParams(); + const params = getDefaultParams(searchParams); + + const { data, isLoading } = useQuery({ + queryKey: ["successRateForAmountsByPillar", params], + queryFn: () => GetData(params), + }); + + if (isLoading || !data) return