From 4a5530c32f06c64daec60af7c90baacc0e43744e Mon Sep 17 00:00:00 2001 From: Haris Rozajac Date: Tue, 25 Nov 2025 22:37:34 -0700 Subject: [PATCH] Simplify export by allowing only one resource export based on dashboard schema version --- .../sharing/ExportButton/ResourceExport.tsx | 31 +++---------------- .../sharing/ShareExportTab.tsx | 4 --- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/public/app/features/dashboard-scene/sharing/ExportButton/ResourceExport.tsx b/public/app/features/dashboard-scene/sharing/ExportButton/ResourceExport.tsx index 226c6074bb8..155fb72451e 100644 --- a/public/app/features/dashboard-scene/sharing/ExportButton/ResourceExport.tsx +++ b/public/app/features/dashboard-scene/sharing/ExportButton/ResourceExport.tsx @@ -40,7 +40,6 @@ export function ResourceExport({ onViewYAML, }: Props) { const hasLibraryPanels = dashboardJson.value?.hasLibraryPanels; - const initialSaveModelVersion = dashboardJson.value?.initialSaveModelVersion; const isV2Dashboard = dashboardJson.value?.json && 'spec' in dashboardJson.value.json && 'elements' in dashboardJson.value.json.spec; const showV2LibPanelAlert = isV2Dashboard && isSharingExternally && hasLibraryPanels; @@ -55,34 +54,14 @@ export function ResourceExport({ return ( - {initialSaveModelVersion === 'v1' && ( - - - onExportModeChange(value)} - /> - - )} - {initialSaveModelVersion === 'v2' && ( + {!isV2Dashboard && ( )} - {(isV2Dashboard || - exportMode === ExportMode.Classic || - (initialSaveModelVersion === 'v2' && exportMode === ExportMode.V1Resource)) && ( + {exportMode !== ExportMode.V1Resource && ( impleme const metadata = getMetadata(scene, Boolean(isSharingExternally)); if (isDashboardV2Spec(origDashboard) && 'elements' in exportable && exportMode !== ExportMode.V1Resource) { - this.setState({ - exportMode: ExportMode.V2Resource, - }); - // For automatic V2 path, also process library panels when sharing externally let finalSpec = exportable; if (isSharingExternally && isDashboardV2Spec(exportable)) {