+
+
A dashboard with the same name in selected folder already exists. Would you still like to save this dashboard?
diff --git a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx
index de6e5d81606..2a5941c82e9 100644
--- a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx
+++ b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx
@@ -2,9 +2,10 @@ import { css } from '@emotion/css';
import * as React from 'react';
import { GrafanaTheme2 } from '@grafana/data';
-import { FetchError } from '@grafana/runtime';
+import { config, FetchError } from '@grafana/runtime';
import { Dashboard } from '@grafana/schema';
import { Button, ConfirmModal, Modal, useStyles2 } from '@grafana/ui';
+import { t, Trans } from 'app/core/internationalization';
import { DashboardModel } from '../../state/DashboardModel';
@@ -30,7 +31,7 @@ export const SaveDashboardErrorProxy = ({
setErrorIsHandled,
}: SaveDashboardErrorProxyProps) => {
const { onDashboardSave } = useDashboardSave();
-
+ const isRestoreDashboardsEnabled = config.featureToggles.dashboardRestore && config.featureToggles.dashboardRestoreUI;
return (
<>
{error.data && error.data.status === 'version-mismatch' && (
@@ -51,22 +52,44 @@ export const SaveDashboardErrorProxy = ({
/>
)}
{error.data && error.data.status === 'name-exists' && (
-
+
+
- Would you still like to save this dashboard?
-
- }
- confirmText="Save and overwrite"
- onConfirm={async () => {
- await onDashboardSave(dashboardSaveModel, { overwrite: true }, dashboard);
- onDismiss();
- }}
- onDismiss={onDismiss}
- />
+ <>
+ {isRestoreDashboardsEnabled ? (
+
+ Would you still like to save this dashboard?
+
+ }
+ confirmText="Save and overwrite"
+ onConfirm={async () => {
+ await onDashboardSave(dashboardSaveModel, { overwrite: true }, dashboard);
+ onDismiss();
+ }}
+ onDismiss={onDismiss}
+ />
+ )}
+ >
)}
{error.data && error.data.status === 'plugin-dashboard' && (