diff --git a/components/dashboard/application/advanced/traefik/update-traefik-config.tsx b/components/dashboard/application/advanced/traefik/update-traefik-config.tsx index 13bec2424..659353ec0 100644 --- a/components/dashboard/application/advanced/traefik/update-traefik-config.tsx +++ b/components/dashboard/application/advanced/traefik/update-traefik-config.tsx @@ -19,7 +19,7 @@ import { import { api } from "@/utils/api"; import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; @@ -58,6 +58,7 @@ export const validateAndFormatYAML = (yamlText: string) => { }; export const UpdateTraefikConfig = ({ applicationId }: Props) => { + const [open, setOpen] = useState(false); const { data, refetch } = api.application.readTraefikConfig.useQuery( { applicationId, @@ -81,7 +82,7 @@ export const UpdateTraefikConfig = ({ applicationId }: Props) => { traefikConfig: data || "", }); } - }, [form, form.reset, data]); + }, [data]); const onSubmit = async (data: UpdateTraefikConfig) => { const { valid, error } = validateAndFormatYAML(data.traefikConfig); @@ -100,6 +101,8 @@ export const UpdateTraefikConfig = ({ applicationId }: Props) => { .then(async () => { toast.success("Traefik config Updated"); refetch(); + setOpen(false); + form.reset(); }) .catch(() => { toast.error("Error to update the traefik config"); @@ -107,7 +110,12 @@ export const UpdateTraefikConfig = ({ applicationId }: Props) => { }; return ( - + { + setOpen(open) + if (!open) { + form.reset(); + } + }}> @@ -122,7 +130,7 @@ export const UpdateTraefikConfig = ({ applicationId }: Props) => {
@@ -209,7 +209,7 @@ export const AddVolumes = ({ /> @@ -233,7 +233,7 @@ export const AddVolumes = ({ /> diff --git a/components/dashboard/application/environment/show.tsx b/components/dashboard/application/environment/show.tsx index 72f25d2e7..1e91e491e 100644 --- a/components/dashboard/application/environment/show.tsx +++ b/components/dashboard/application/environment/show.tsx @@ -124,7 +124,7 @@ export const ShowEnvironment = ({ applicationId }: Props) => { { { { {
{ { { { { { Space - + Actions diff --git a/components/dashboard/settings/web-server/show-main-traefik-config.tsx b/components/dashboard/settings/web-server/show-main-traefik-config.tsx index 4a14d2207..16f69b773 100644 --- a/components/dashboard/settings/web-server/show-main-traefik-config.tsx +++ b/components/dashboard/settings/web-server/show-main-traefik-config.tsx @@ -95,7 +95,7 @@ export const ShowMainTraefikConfig = ({ children }: Props) => {
{
{
{props.disabled && ( -
+
)}
); diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index 775c93a96..3c9ec7412 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -36,12 +36,14 @@ const DialogContent = React.forwardRef< - {children} +
+ {children} +
Close diff --git a/styles/globals.css b/styles/globals.css index 629d29850..5b71cdff2 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -127,10 +127,8 @@ background-color: transparent; } - .compose-file-editor .cm-editor { @apply min-h-[25rem]; - }