Skip to content

Commit 898af1f

Browse files
gentslavaclaude
andcommitted
feat(domains): show redeploy hint on all compose domain actions
Compose domains are rendered as docker labels and only take effect on the next deployment. Extract the "redeploy required" notice into a reusable component/strings and surface it consistently: as a banner in the domains list, in the add/edit dialog (replacing the inline copy), and in the toast shown after create/update/delete. Unify grid deletion onto the shared handler so the hint applies in both grid and table views. Groundwork for the upcoming domain enable/disable toggle. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 9142127 commit 898af1f

3 files changed

Lines changed: 40 additions & 20 deletions

File tree

‎apps/dokploy/components/dashboard/application/domains/handle-domain.tsx‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {
4646
TooltipTrigger,
4747
} from "@/components/ui/tooltip";
4848
import { api } from "@/utils/api";
49+
import { COMPOSE_REDEPLOY_TOAST, ComposeRedeployAlert } from "./redeploy-hint";
4950

5051
export type CacheType = "fetch" | "cache";
5152

@@ -300,7 +301,12 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
300301
customEntrypoint: data.useCustomEntrypoint ? data.customEntrypoint : null,
301302
})
302303
.then(async () => {
303-
toast.success(dictionary.success);
304+
toast.success(
305+
dictionary.success,
306+
data.domainType === "compose"
307+
? { description: COMPOSE_REDEPLOY_TOAST }
308+
: undefined,
309+
);
304310

305311
if (data.domainType === "application") {
306312
await utils.domain.byApplicationId.invalidate({
@@ -337,12 +343,7 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
337343
</DialogHeader>
338344
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
339345

340-
{type === "compose" && (
341-
<AlertBlock type="info" className="mb-4">
342-
Whenever you make changes to domains, remember to redeploy your
343-
compose to apply the changes.
344-
</AlertBlock>
345-
)}
346+
{type === "compose" && <ComposeRedeployAlert className="mb-4" />}
346347

347348
<Form {...form}>
348349
<form
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { AlertBlock } from "@/components/shared/alert-block";
2+
3+
/**
4+
* Domains attached to a compose service are rendered as docker labels and only
5+
* take effect on the next deployment. These strings keep the "redeploy required"
6+
* wording consistent across the add/edit dialog, the domains list and the
7+
* toasts shown after create/update/delete/toggle operations.
8+
*/
9+
export const COMPOSE_REDEPLOY_HINT =
10+
"Whenever you make changes to domains, remember to redeploy your compose to apply the changes.";
11+
12+
export const COMPOSE_REDEPLOY_TOAST =
13+
"Redeploy the compose to apply the changes.";
14+
15+
export const ComposeRedeployAlert = ({ className }: { className?: string }) => (
16+
<AlertBlock type="info" className={className}>
17+
{COMPOSE_REDEPLOY_HINT}
18+
</AlertBlock>
19+
);

‎apps/dokploy/components/dashboard/application/domains/show-domains.tsx‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import { createColumns } from "./columns";
6363
import { DnsHelperModal } from "./dns-helper-modal";
6464
import { AddDomain } from "./handle-domain";
6565
import { HandleForwardAuth } from "./handle-forward-auth";
66+
import { COMPOSE_REDEPLOY_TOAST, ComposeRedeployAlert } from "./redeploy-hint";
6667

6768
export type ValidationState = {
6869
isLoading: boolean;
@@ -151,7 +152,12 @@ export const ShowDomains = ({ id, type }: Props) => {
151152
try {
152153
await deleteDomain({ domainId });
153154
refetch();
154-
toast.success("Domain deleted successfully");
155+
toast.success(
156+
"Domain deleted successfully",
157+
type === "compose"
158+
? { description: COMPOSE_REDEPLOY_TOAST }
159+
: undefined,
160+
);
155161
} catch {
156162
toast.error("Error deleting domain");
157163
}
@@ -265,6 +271,11 @@ export const ShowDomains = ({ id, type }: Props) => {
265271
)}
266272
</div>
267273
</CardHeader>
274+
{type === "compose" && data && data.length > 0 && (
275+
<div className="px-6 pb-4">
276+
<ComposeRedeployAlert />
277+
</div>
278+
)}
268279
<CardContent className="flex w-full flex-row gap-4">
269280
{isLoadingDomains ? (
270281
<div className="flex w-full flex-row gap-4 min-h-[40vh] justify-center items-center">
@@ -466,18 +477,7 @@ export const ShowDomains = ({ id, type }: Props) => {
466477
description="Are you sure you want to delete this domain?"
467478
type="destructive"
468479
onClick={async () => {
469-
await deleteDomain({
470-
domainId: item.domainId,
471-
})
472-
.then((_data) => {
473-
refetch();
474-
toast.success(
475-
"Domain deleted successfully",
476-
);
477-
})
478-
.catch(() => {
479-
toast.error("Error deleting domain");
480-
});
480+
await handleDeleteDomain(item.domainId);
481481
}}
482482
>
483483
<Button

0 commit comments

Comments
 (0)