diff --git a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx
index 29f77c3dda2..834ed63d3fc 100644
--- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx
+++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx
@@ -1,14 +1,18 @@
-import React from 'react';
+import React, { ChangeEvent } from 'react';
-import { Button, Input, Switch, Form, Field, InputControl, HorizontalGroup } from '@grafana/ui';
+import { config } from '@grafana/runtime';
+import { Button, Input, Switch, Form, Field, InputControl, HorizontalGroup, Label, TextArea } from '@grafana/ui';
import { FolderPicker } from 'app/core/components/Select/FolderPicker';
import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
import { validationSrv } from 'app/features/manage-dashboards/services/ValidationSrv';
+import { GenAIDashDescriptionButton } from '../../GenAI/GenAIDashDescriptionButton';
+import { GenAIDashTitleButton } from '../../GenAI/GenAIDashTitleButton';
import { SaveDashboardFormProps } from '../types';
interface SaveDashboardAsFormDTO {
title: string;
+ description: string;
$folder: { uid?: string; title?: string };
copyTags: boolean;
}
@@ -48,6 +52,7 @@ export const SaveDashboardAsForm = ({
}: SaveDashboardAsFormProps) => {
const defaultValues: SaveDashboardAsFormDTO = {
title: isNew ? dashboard.title : `${dashboard.title} Copy`,
+ description: dashboard.description,
$folder: {
uid: dashboard.meta.folderUid,
title: dashboard.meta.folderTitle,
@@ -78,6 +83,7 @@ export const SaveDashboardAsForm = ({
const clone = getSaveAsDashboardClone(dashboard);
clone.title = data.title;
+ clone.description = data.description;
if (!isNew && !data.copyTags) {
clone.tags = [];
}
@@ -97,15 +103,62 @@ export const SaveDashboardAsForm = ({
>
{({ register, control, errors, getValues }) => (
<>
-
-
-
+ (
+
+
+ {config.featureToggles.dashgpt && isNew && (
+ field.onChange(title)} dashboard={dashboard} />
+ )}
+
+ }
+ invalid={!!errors.title}
+ error={errors.title?.message}
+ >
+ ) => field.onChange(e.target.value)}
+ aria-label="Save dashboard title field"
+ autoFocus
+ />
+
+ )}
+ control={control}
+ name="title"
+ rules={{
+ validate: validateDashboardName(getValues),
+ }}
+ />
+ (
+
+
+ {config.featureToggles.dashgpt && isNew && (
+ field.onChange(description)}
+ dashboard={dashboard}
+ />
+ )}
+
+ }
+ invalid={!!errors.description}
+ error={errors.description?.message}
+ >
+
+ )}
+ control={control}
+ name="description"
+ />
(