Delete-program confirm enumerates each action
The confirm dialog (window.confirm in FormFooter) now spells out exactly what cascade will do — uninstall the tool from PATH / drop the static route / stop, disable and remove named service+job deployments, and remove the catalog entry — each as its own bullet, ending with the reassurance that source on disk is kept.
This commit is contained in:
@@ -169,17 +169,22 @@ export function ProgramFields({ program, onSave, onDelete }: Props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Deleting a program cascades to its deployments (tear down + remove), so the
|
/** Deleting a program cascades to its deployments (tear down + remove), so the
|
||||||
* confirm names exactly what will go. Source on disk is always left untouched. */
|
* confirm enumerates exactly what will happen. Source on disk is always kept. */
|
||||||
function deleteConfirm(program: ProgramDetail): string {
|
function deleteConfirm(program: ProgramDetail): string {
|
||||||
const deps = [...program.services, ...program.jobs]
|
const actions: string[] = []
|
||||||
const kind = program.kind
|
// The program's own 1:1 deployment (tool/static) isn't listed in services/jobs.
|
||||||
const own =
|
if (program.kind === "tool") actions.push(`uninstall ${program.id} from your PATH`)
|
||||||
kind === "tool"
|
else if (program.kind === "static")
|
||||||
? " This uninstalls it from PATH."
|
actions.push(`stop serving ${program.id} (drop its gateway route)`)
|
||||||
: kind === "static"
|
// Named service/job deployments that reference this program.
|
||||||
? " This stops serving it."
|
const named = [...program.services, ...program.jobs]
|
||||||
: ""
|
if (named.length) actions.push(`stop, disable, and remove: ${named.join(", ")}`)
|
||||||
const also =
|
// Always: the catalog entry itself.
|
||||||
deps.length > 0 ? ` Its deployments (${deps.join(", ")}) are torn down and removed too.` : ""
|
actions.push(`remove "${program.id}" from the catalog`)
|
||||||
return `Delete "${program.id}"?${own}${also} (Source on disk is untouched.)`
|
|
||||||
|
const lines = actions.map((a) => ` • ${a}`).join("\n")
|
||||||
|
return (
|
||||||
|
`Delete "${program.id}"? This will:\n\n${lines}\n\n` +
|
||||||
|
`The source code on disk is left untouched.`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user