diff --git a/components/api/apiDescription.tsx b/components/api/apiDescription.tsx index 5d1546292..763296f20 100644 --- a/components/api/apiDescription.tsx +++ b/components/api/apiDescription.tsx @@ -1,7 +1,6 @@ -import React from 'react'; +import React, { useState } from 'react'; import { RichLink } from '../../uiComponents'; import RichReactMarkdown from '../../components/richReactMarkdown'; -import Section from '../../components/api/section'; import { IGuideElementShort } from '../../model'; import { H3WithAnchor } from '../../uiComponents/titleWithAnchor'; import slugify from 'slugify'; @@ -11,42 +10,76 @@ const ApiDescription: React.FC<{ body: string; guides: IGuideElementShort[]; title: string; -}> = ({ content_intro, guides, body, title }) => ( -
- <> -
- ⚠️ Ces informations ne sont plus mises à jour depuis le 20/11/2024.
- Le site API.gouv.fr va progressivement être fusionné dans le catalogue unique data.gouv.fr.

- Retrouvez la fiche d'information à jour de cette API sur la nouvelle page API de Data.gouv.fr ]/g, ""))}`} target="_blank" rel="noopener noreferrer">⇢ Consulter la fiche à jour +}> = ({ title }) => { + const [searchQuery, setSearchQuery] = useState(title); + + const handleSearch = (e: React.FormEvent) => { + e.preventDefault(); + const encodedQuery = encodeURIComponent(searchQuery); + window.location.href = `https://www.data.gouv.fr/fr/dataservices/?q=${encodedQuery}`; + }; + + return ( +
+
+

Rechercher "{title}" sur data.gouv.fr

+
+ setSearchQuery(e.target.value)} + placeholder="Rechercher sur data.gouv.fr..." + className="search-input" + /> + +
- - {content_intro && } - {guides.length > 0 && ( - <> - Exemples d’application -
- {guides.map(guide => ( - - ))} -
- - )} - - - -
-); + + + + ); +}; + export default ApiDescription; diff --git a/components/api/index.js b/components/api/index.js index c42b4cffb..ebd4a4928 100644 --- a/components/api/index.js +++ b/components/api/index.js @@ -4,11 +4,9 @@ import Partners from './partners'; import TechnicalDocumentation from './technical-documentation'; import ApiRelatedServices from './apiRelatedServices.tsx'; import ApiOpenDataSources from './apiOpenDataSources.tsx'; -import PageHeader from './pageHeader'; import ApiDescription from './apiDescription'; export { - PageHeader, Access, SupportAndTeam, Partners, diff --git a/components/api/pageHeader.tsx b/components/api/pageHeader.tsx deleted file mode 100644 index 4c50a8ec2..000000000 --- a/components/api/pageHeader.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import React from 'react'; - -import constants from '../../constants'; - -interface IProps { - title: string; - logo: string; - tagline: string; - owner: string; - owner_acronym?: string; - owner_slug: string; -} - -const PageHeader: React.FC = ({ - title, - tagline, - owner, - owner_acronym, - owner_slug, -}) => ( -
-
-
- - ⇠ Toutes les API - -
-
-

{title}

- - Producteur :{' '} - - {owner_acronym ? owner_acronym : owner} - - -

{tagline}

-
-
- - -
-); - -export default PageHeader; diff --git a/components/api/section.js b/components/api/section.js index 4ac8954bf..fd9695667 100644 --- a/components/api/section.js +++ b/components/api/section.js @@ -7,17 +7,19 @@ const Section = ({ id, title, children }) => { This is a hidden anchor. It is a trick to avoid having the header hiding the top of the page. -

- - {title} -

+ {title && ( +

+ + {title} +

+ )} {children} diff --git a/components/footer/preFooter.js b/components/footer/preFooter.js index bd5d4ae4e..fefe62c09 100644 --- a/components/footer/preFooter.js +++ b/components/footer/preFooter.js @@ -21,7 +21,7 @@ const PreFooter = ({ background }) => (

Vous voulez partager une API ?

- + Partager votre API
diff --git a/pages/les-api/[slug].tsx b/pages/les-api/[slug].tsx index 2494a39c7..eb659761a 100644 --- a/pages/les-api/[slug].tsx +++ b/pages/les-api/[slug].tsx @@ -13,7 +13,6 @@ import { import Page from '../../layouts'; import { - PageHeader, Access, SupportAndTeam, Partners, @@ -26,7 +25,6 @@ import ApiDetails from '../../components/api/apiDetails'; import { HEADER_PAGE } from '../../components'; import constants from '../../constants'; -import Feedback from '../../components/feedback'; import { IDataGouvDataset, fetchDatagouvDatasets } from '../../components/api/apiOpenDataSources'; interface IProps { @@ -74,93 +72,24 @@ const API: React.FC = ({ api, guides, datagouvDatasets }) => { canonical={`https://api.gouv.fr/les-api/${slug}`} usePreFooter={!hide_pre_footer} > - -
-
-
- - - {datagouvDatasets.length > 0 && ( - - )} - - -
-
- - - - - - -
+
+ + + {datagouvDatasets.length > 0 && ( + + )}
); diff --git a/pages/rechercher-api.tsx b/pages/rechercher-api.tsx index 35e265afa..381d62acb 100644 --- a/pages/rechercher-api.tsx +++ b/pages/rechercher-api.tsx @@ -1,20 +1,17 @@ -import React from 'react'; -import { flatten, uniq } from 'lodash'; -import { GetStaticProps } from 'next'; - -import { getAllAPIs, IApi } from '../model'; +import React, { useState } from 'react'; import Page from '../layouts/page'; -import SearchApis from '../components/searchApis'; import { HEADER_PAGE } from '../components'; import constants from '../constants'; -import { filterExceptions } from '../components/searchApis/filtersLogic'; -interface IProps { - allApis: IApi[]; - allThemes: string[]; -} +const RechercherApi: React.FC = () => { + const [searchQuery, setSearchQuery] = useState(''); + + const handleSearch = (e: React.FormEvent) => { + e.preventDefault(); + const encodedQuery = encodeURIComponent(searchQuery); + window.location.href = `https://www.data.gouv.fr/fr/dataservices/?q=${encodedQuery}`; + }; -const RechercherApi: React.FC = ({ allApis, allThemes }) => { return ( = ({ allApis, allThemes }) => { title="Rechercher une API du service public" description="Vous faites partie d'un ministère ou d'une collectivité et vous cherchez une API du service public ? Vous êtes au bon endroit." > -
-

- Vous recherchez une API du service public ? Vous êtes au bon endroit ! -

-
+
+
+

Rechercher une API sur data.gouv.fr

+
+ setSearchQuery(e.target.value)} + placeholder="Rechercher sur data.gouv.fr..." + className="search-input" + /> + +
+
- - - ); -}; + +
+
+ ); }; export default RechercherApi; diff --git a/uiComponents/alertFusion/index.tsx b/uiComponents/alertFusion/index.tsx index 62b582cee..b1493fd6b 100644 --- a/uiComponents/alertFusion/index.tsx +++ b/uiComponents/alertFusion/index.tsx @@ -5,8 +5,10 @@ export const AlertFusion: React.FC<{}> = () => (
-

⚠️ Le site API.gouv.fr fusionne dans le catalogue unique Data.gouv.fr : Pour découvrir les nouvelles API et obtenir les informations les plus à jour, rendez-vous sur - ⇢ data.gouv.fr/dataservices. +

+ ⚠️ Les fiches d'API ont été déplacées sur data.gouv.fr
+ Pour découvrir les nouvelles API et obtenir les informations les plus à jour, rendez-vous sur + data.gouv.fr/dataservices.