From cb81e1f6fb4f5603c583e4bb3b21e3fd39ffeca2 Mon Sep 17 00:00:00 2001 From: Thibaud Dauce Date: Mon, 4 May 2026 11:34:58 +0200 Subject: [PATCH 1/9] feat: improve /explore design page --- .../src/components/DatasetCard.vue | 10 +- .../src/composables/useHasTabularData.ts | 7 + nuxt.config.ts | 6 + pages/explore.vue | 266 ++++++++++-------- 4 files changed, 175 insertions(+), 114 deletions(-) diff --git a/datagouv-components/src/components/DatasetCard.vue b/datagouv-components/src/components/DatasetCard.vue index 2913102ba..7e539dd3e 100644 --- a/datagouv-components/src/components/DatasetCard.vue +++ b/datagouv-components/src/components/DatasetCard.vue @@ -106,10 +106,12 @@

- + + + diff --git a/datagouv-components/src/composables/useHasTabularData.ts b/datagouv-components/src/composables/useHasTabularData.ts index 7b02a78ba..d9b5d9d19 100644 --- a/datagouv-components/src/composables/useHasTabularData.ts +++ b/datagouv-components/src/composables/useHasTabularData.ts @@ -5,10 +5,17 @@ export const useHasTabularData = () => { const config = useComponentsConfig() return (resource: Resource) => { + // Reject resources whose source URL last check failed (>= 400): + // the tabular-api purges its parquet when the source dies, but + // `parsing_table` may still be set — leading to a 404 on fetch. + const checkStatus = resource.extras['check:status'] + const sourceUnreachable = typeof checkStatus === 'number' && checkStatus >= 400 + return ( config.tabularApiUrl && resource.extras['analysis:parsing:parsing_table'] && !resource.extras['analysis:parsing:error'] + && !sourceUnreachable && (config.tabularAllowRemote || resource.filetype === 'file') ) } diff --git a/nuxt.config.ts b/nuxt.config.ts index 65681a07d..af2c10ef7 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -109,6 +109,12 @@ export default defineNuxtConfig({ homepagePublishReuseOnboarding: '/reutilisateurs', homepageAboutUs: '/a-propos', homepageExplore: 'https://explore.data.gouv.fr', + // Featured resources shown on the /explore page. Override via env var: + // NUXT_PUBLIC_FEATURED_RESOURCE_IDS='["resource-id-1","resource-id-2"]' + featuredResourceIds: [ + '1c5075ec-7ce1-49cb-ab89-94f507812daf', // Visas d'exploitations cinématographiques (CNC) + 'df2cbcb3-da0a-4265-a24e-c36f2c787db2', // Indices de position sociale dans les lycées + ] as string[], homepageRightNow: { title: 'Données relatives aux Énergies', url: '/pages/donnees-energie', diff --git a/pages/explore.vue b/pages/explore.vue index 7bb0a9adc..c120d2586 100644 --- a/pages/explore.vue +++ b/pages/explore.vue @@ -1,127 +1,144 @@ From 5767faba13a64cf6dab8bb7edc03211488f8bbf1 Mon Sep 17 00:00:00 2001 From: Thibaud Dauce Date: Tue, 5 May 2026 09:12:32 +0200 Subject: [PATCH 2/9] working on fullscreen explore --- .../ResourceAccordion/DataStructure.vue | 44 +-- .../ResourceAccordion/Downloads.vue | 160 ++++++++++ .../ResourceExplorer/ResourceExplorer.vue | 57 +--- .../ResourceExplorerViewer.vue | 161 ++-------- .../ResourceExplorer/ResourceSelector.vue | 67 +++++ .../TabularExplorer/TabularExplorer.vue | 17 +- .../src/composables/useTabularProfile.ts | 72 +++++ datagouv-components/src/main.ts | 12 + pages/explore.vue | 281 +++++++++++++++++- 9 files changed, 625 insertions(+), 246 deletions(-) create mode 100644 datagouv-components/src/components/ResourceAccordion/Downloads.vue create mode 100644 datagouv-components/src/components/ResourceExplorer/ResourceSelector.vue create mode 100644 datagouv-components/src/composables/useTabularProfile.ts diff --git a/datagouv-components/src/components/ResourceAccordion/DataStructure.vue b/datagouv-components/src/components/ResourceAccordion/DataStructure.vue index 827c7de32..51d617224 100644 --- a/datagouv-components/src/components/ResourceAccordion/DataStructure.vue +++ b/datagouv-components/src/components/ResourceAccordion/DataStructure.vue @@ -49,45 +49,23 @@ diff --git a/datagouv-components/src/components/ResourceAccordion/Downloads.vue b/datagouv-components/src/components/ResourceAccordion/Downloads.vue new file mode 100644 index 000000000..0289155ef --- /dev/null +++ b/datagouv-components/src/components/ResourceAccordion/Downloads.vue @@ -0,0 +1,160 @@ + + + diff --git a/datagouv-components/src/components/ResourceExplorer/ResourceExplorer.vue b/datagouv-components/src/components/ResourceExplorer/ResourceExplorer.vue index b4cefabae..5e4417fd8 100644 --- a/datagouv-components/src/components/ResourceExplorer/ResourceExplorer.vue +++ b/datagouv-components/src/components/ResourceExplorer/ResourceExplorer.vue @@ -2,24 +2,13 @@
-
- - {{ t('Ressources ({count})', { count: dataset.resources.total }) }} - -
- - - - -
// Fetch resource by ID if specified in URL (for SSR) const initialResourceId = resourceIdQuery.value -const mobileSidebarOpen = ref(false) -const mobileSidebarDialog = ref(null) - -watch(mobileSidebarOpen, (open) => { - if (open) { - mobileSidebarDialog.value?.showModal() - } - else { - mobileSidebarDialog.value?.close() - } -}) - -function closeMobileSidebar() { - mobileSidebarOpen.value = false -} const { data: fetchedResource } = initialResourceId ? await useFetch(`/api/1/datasets/${props.dataset.id}/resources/${initialResourceId}/`) : { data: ref(null) } @@ -288,7 +242,6 @@ function updateSearch(newSearch: string) { const selectResource = (resource: Resource) => { selectedResource.value = resource - mobileSidebarOpen.value = false router.replace({ query: { ...router.currentRoute.value.query, resource_id: resource.id }, }) @@ -303,9 +256,3 @@ watch(flatResources, () => { } }) - - diff --git a/datagouv-components/src/components/ResourceExplorer/ResourceExplorerViewer.vue b/datagouv-components/src/components/ResourceExplorer/ResourceExplorerViewer.vue index 6f6f5f341..165c07b27 100644 --- a/datagouv-components/src/components/ResourceExplorer/ResourceExplorerViewer.vue +++ b/datagouv-components/src/components/ResourceExplorer/ResourceExplorerViewer.vue @@ -2,7 +2,7 @@
-
+

{{ resource.title || t('Fichier sans nom') }}

+ - @@ -174,128 +180,10 @@
-
-
- {{ t("URL d'origine") }} -
-
- {{ t('Format original') }} -
-
- - - {{ resource.url }} - - - - - - - {{ t('Format {format}', { format: resource.format }) }} - {{ filesize(resourceFilesize) }} - - - -
- - -
+
@@ -318,7 +206,7 @@ diff --git a/datagouv-components/src/components/TabularExplorer/TabularExplorer.vue b/datagouv-components/src/components/TabularExplorer/TabularExplorer.vue index 93261c585..4ee138b88 100644 --- a/datagouv-components/src/components/TabularExplorer/TabularExplorer.vue +++ b/datagouv-components/src/components/TabularExplorer/TabularExplorer.vue @@ -156,9 +156,12 @@
+