Skip to content

Commit 709598a

Browse files
fix: forward port dont autofill rename
1 parent d410506 commit 709598a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

web/src/components/dashboards/perses/dashboard-action-modals.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ import {
3737

3838
import { Controller, FormProvider, SubmitHandler, useForm } from 'react-hook-form';
3939
import { zodResolver } from '@hookform/resolvers/zod';
40-
import {
41-
DashboardResource,
42-
getResourceDisplayName,
43-
getResourceExtendedDisplayName,
44-
} from '@perses-dev/core';
40+
import { DashboardResource, getResourceExtendedDisplayName } from '@perses-dev/core';
4541
import { useToast } from './ToastProvider';
4642
import { generateMetadataName } from './dashboard-utils';
4743
import { useEditableProjects } from './hooks/useEditableProjects';
@@ -72,7 +68,7 @@ export const RenameActionModal = ({ dashboard, isOpen, onClose }: ActionModalPro
7268
const form = useForm<RenameDashboardValidationType>({
7369
resolver: zodResolver(renameDashboardDialogValidationSchema(t)),
7470
mode: 'onBlur',
75-
defaultValues: { dashboardName: dashboard ? getResourceDisplayName(dashboard) : '' },
71+
defaultValues: { dashboardName: '' },
7672
});
7773

7874
const updateDashboardMutation = useUpdateDashboardMutation();
@@ -108,7 +104,7 @@ export const RenameActionModal = ({ dashboard, isOpen, onClose }: ActionModalPro
108104

109105
const handleClose = () => {
110106
onClose();
111-
form.reset();
107+
form.reset({ dashboardName: '' });
112108
};
113109

114110
return (

0 commit comments

Comments
 (0)