mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboards: Allow dashboards with same name in different folders (#70378)
* Dashboards: Allow dashboards with same name in different folders Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com> Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com> Co-authored-by: joshhunt <josh@trtr.co> * fix --------- Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com> Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
@@ -52,8 +52,9 @@ export const SaveDashboardAsForm = ({ dashboard, isNew, onSubmit, onCancel, onSu
|
||||
if (dashboardName && dashboardName === getFormValues().$folder.title?.trim()) {
|
||||
return 'Dashboard name cannot be the same as folder name';
|
||||
}
|
||||
|
||||
try {
|
||||
await validationSrv.validateNewDashboardName(getFormValues().$folder.uid, dashboardName);
|
||||
await validationSrv.validateNewDashboardName(getFormValues().$folder.uid ?? 'general', dashboardName);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return e instanceof Error ? e.message : 'Dashboard name is invalid';
|
||||
|
||||
Reference in New Issue
Block a user