diff --git a/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/delete-permission.tsx b/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/delete-permission.tsx index a19d2efd0f..421309b107 100644 --- a/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/delete-permission.tsx +++ b/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/delete-permission.tsx @@ -68,8 +68,13 @@ export const DeletePermission: React.FC = ({ trigger, permission }) => { deletePermission.mutate({ permissionId: permission.id }); } + function handleDialogOpenChange(newState: boolean) { + setOpen(newState); + form.reset(); + } + return ( - setOpen(o)}> + {trigger} diff --git a/apps/dashboard/app/(app)/authorization/permissions/create-new-permission.tsx b/apps/dashboard/app/(app)/authorization/permissions/create-new-permission.tsx index 089349cd67..29dbbe29b8 100644 --- a/apps/dashboard/app/(app)/authorization/permissions/create-new-permission.tsx +++ b/apps/dashboard/app/(app)/authorization/permissions/create-new-permission.tsx @@ -75,9 +75,13 @@ export const CreateNewPermission: React.FC = ({ trigger }) => { async function onSubmit(values: z.infer) { createPermission.mutate(values); } + function handleDialogOpenChange(newState: boolean) { + setOpen(newState); + form.reset(); + } return ( - + {trigger} diff --git a/apps/dashboard/app/(app)/authorization/roles/[roleId]/delete-role.tsx b/apps/dashboard/app/(app)/authorization/roles/[roleId]/delete-role.tsx index 5fc71addd7..3d8255b197 100644 --- a/apps/dashboard/app/(app)/authorization/roles/[roleId]/delete-role.tsx +++ b/apps/dashboard/app/(app)/authorization/roles/[roleId]/delete-role.tsx @@ -69,8 +69,13 @@ export const DeleteRole: React.FC = ({ trigger, role }) => { deleteRole.mutate({ roleId: role.id }); } + function handleDialogOpenChange(newState: boolean) { + setOpen(newState); + form.reset(); + } + return ( - setOpen(o)}> + {trigger} diff --git a/apps/dashboard/app/(app)/authorization/roles/create-new-role.tsx b/apps/dashboard/app/(app)/authorization/roles/create-new-role.tsx index b65f6e8e80..66fda68f60 100644 --- a/apps/dashboard/app/(app)/authorization/roles/create-new-role.tsx +++ b/apps/dashboard/app/(app)/authorization/roles/create-new-role.tsx @@ -92,9 +92,13 @@ export const CreateNewRole: React.FC = ({ trigger, permissions }) => { permissionIds: values.permissionOptions?.map((o) => o.value), }); } + function handleDialogOpenChange(newState: boolean) { + setOpen(newState); + form.reset(); + } return ( - + {trigger} diff --git a/apps/dashboard/app/(app)/ratelimits/[namespaceId]/settings/delete-namespace.tsx b/apps/dashboard/app/(app)/ratelimits/[namespaceId]/settings/delete-namespace.tsx index 2fd3ab462e..e2354bfcb1 100644 --- a/apps/dashboard/app/(app)/ratelimits/[namespaceId]/settings/delete-namespace.tsx +++ b/apps/dashboard/app/(app)/ratelimits/[namespaceId]/settings/delete-namespace.tsx @@ -76,6 +76,11 @@ export const DeleteNamespace: React.FC = ({ namespace }) => { deleteNamespace.mutate({ namespaceId: namespace.id }); } + function handleDialogOpenChange(newState: boolean) { + setOpen(newState); + form.reset(); + } + return ( <> @@ -93,7 +98,7 @@ export const DeleteNamespace: React.FC = ({ namespace }) => { - setOpen(o)}> + Delete namespace @@ -118,7 +123,7 @@ export const DeleteNamespace: React.FC = ({ namespace }) => { {" "} - Enter the namespcae name{" "} + Enter the namespace name{" "} {namespace.name} to continue: diff --git a/apps/dashboard/app/(app)/semantic-cache/[gatewayId]/settings/delete-gateway.tsx b/apps/dashboard/app/(app)/semantic-cache/[gatewayId]/settings/delete-gateway.tsx index 9ec6c59c0b..2e8fdb016c 100644 --- a/apps/dashboard/app/(app)/semantic-cache/[gatewayId]/settings/delete-gateway.tsx +++ b/apps/dashboard/app/(app)/semantic-cache/[gatewayId]/settings/delete-gateway.tsx @@ -81,6 +81,10 @@ export const DeleteGateway: React.FC = ({ gateway }) => { async function onSubmit(_values: z.infer) { deleteGateway.mutate({ gatewayId: gateway.id }); } + function handleDialogOpenChange(newState: boolean) { + setOpen(newState); + form.reset(); + } return ( <> @@ -98,7 +102,7 @@ export const DeleteGateway: React.FC = ({ gateway }) => { - setOpen(o)}> + Delete gateway