From df956674f104262f2ccf03f4a36bd6366a500ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bult=C3=A9?= Date: Thu, 3 Sep 2026 09:30:57 +0200 Subject: [PATCH 1/3] feat(resource): add external url override to ResourceViewer --- .../src/components/ResourceExplorer/ResourceExplorer.vue | 4 ++++ .../components/ResourceExplorer/ResourceExplorerViewer.vue | 3 +++ .../components/ResourceExplorer/ResourceViewerHeader.vue | 6 ++++-- .../components/ResourceExplorer/ResourceViewerSkeleton.vue | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/datagouv-components/src/components/ResourceExplorer/ResourceExplorer.vue b/datagouv-components/src/components/ResourceExplorer/ResourceExplorer.vue index e6340f04b..adee94903 100644 --- a/datagouv-components/src/components/ResourceExplorer/ResourceExplorer.vue +++ b/datagouv-components/src/components/ResourceExplorer/ResourceExplorer.vue @@ -46,6 +46,7 @@ :resources="flatResources" :resource-to="resourceTo" :explore-to="exploreTo" + :resource-external-url="resourceExternalUrl" replace :fullscreen /> @@ -56,6 +57,7 @@ :resources="flatResources" :resource-to="resourceTo" :explore-to="exploreTo" + :resource-external-url="resourceExternalUrl" replace :fullscreen /> @@ -119,6 +121,8 @@ const props = withDefaults(defineProps<{ // Inline mode only: link builder for the "Explorer" button in the viewer header // that opens the fullscreen explorer on the current resource. exploreTo?: (resource: Resource) => string + // Overrides the "Copier le lien" target. + resourceExternalUrl?: (resource: Resource) => string }>(), { noResultsImage: '', fullscreen: false, diff --git a/datagouv-components/src/components/ResourceExplorer/ResourceExplorerViewer.vue b/datagouv-components/src/components/ResourceExplorer/ResourceExplorerViewer.vue index c449ce094..cb8a81865 100644 --- a/datagouv-components/src/components/ResourceExplorer/ResourceExplorerViewer.vue +++ b/datagouv-components/src/components/ResourceExplorer/ResourceExplorerViewer.vue @@ -6,6 +6,7 @@ :resources :resource-to :explore-to="exploreTo" + :resource-external-url="resourceExternalUrl" :replace :fullscreen /> @@ -217,6 +218,8 @@ const props = withDefaults(defineProps<{ // When provided (inline mode), shows an "Explorer" button next to the download // action that opens the fullscreen explorer on the current resource. exploreTo?: (resource: Resource) => string + // Overrides the "Copier le lien" target. + resourceExternalUrl?: (resource: Resource) => string replace?: boolean // Fullscreen mode: make the viewer a flex column so the table fills down to the // bottom, and hide the inline download/visit/copy actions — they're shown in the diff --git a/datagouv-components/src/components/ResourceExplorer/ResourceViewerHeader.vue b/datagouv-components/src/components/ResourceExplorer/ResourceViewerHeader.vue index 0a7558064..5f97a6773 100644 --- a/datagouv-components/src/components/ResourceExplorer/ResourceViewerHeader.vue +++ b/datagouv-components/src/components/ResourceExplorer/ResourceViewerHeader.vue @@ -53,7 +53,7 @@