Hub 2.18.0: releases picked from a list on New install and Move onto the monorepo

- components/ReleaseSelect.tsx: Latest (with its version) first, then the newest 10 releases,
  Show older versions for the rest; marked latest, running now and what each needs.
- New install and Move onto the monorepo use it (they were free text); the install's Update popup
  and the Updates page use it too. Move onto the monorepo lists Events from 2.2.0 (the first
  monorepo tag).
- docs/VERSION-PICKERS-PLAN.md: this and 2.19.0 (agent releases). Frontend only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 13:11:21 +02:00
co-authored by Claude Opus 5.5
parent 21bda2bb32
commit 65cc06183b
12 changed files with 174 additions and 22 deletions
@@ -145,7 +145,7 @@ export default function DeploymentPage() {
</div>
{popup === "update" && <UpdateModal x={x} releases={releases} onClose={close} onDone={done} />}
{popup === "adopt" && <AdoptModal x={x} onClose={close} onDone={done} />}
{popup === "adopt" && <AdoptModal x={x} releases={releases} onClose={close} onDone={done} />}
{popup === "demo" && <DemoModal x={x} onClose={close} onDone={done} />}
{popup === "uninstall" && <UninstallModal x={x} plan={plan} onClose={close} onDone={done} />}
{(popup === "record" || popup === "forget") && <RemoveModal kind={popup} x={x} stale={d.stale} onClose={close} onRemoved={() => router.push("/servers/installs")} />}
@@ -8,6 +8,8 @@ import { api, errorText } from "@/lib/api";
import { ago } from "@/lib/format";
import { matches, usePaged } from "@/lib/paging";
import { PRODUCT_NAMES } from "@/lib/products";
import type { Release } from "@/lib/types";
import { ReleaseSelect } from "@/components/ReleaseSelect";
import { FormError, Loading, Modal, ModalButtons, PageMessage, PageTitle, Pager, SearchInput, useSubmit } from "@/components/ui";
import { ServersNav, StatusPill, pct, shownStatus, type Deployment, type ServerSummary } from "@/components/servers";
@@ -23,9 +25,13 @@ const changedFrom = <T extends Record<string, string>>(form: T, empty: T) => (Ob
function NewInstallModal({ servers, onClose }: { servers: ServerSummary[]; onClose: () => void }) {
const router = useRouter();
const [customers, setCustomers] = useState<Customer[]>([]);
const [releases, setReleases] = useState<Release[]>([]);
const [form, setForm] = useState(emptyNew);
const { busy, error, run } = useSubmit();
useEffect(() => { api<Customer[]>("/api/admin/customers").then(setCustomers).catch(() => {}); }, []);
useEffect(() => {
api<Customer[]>("/api/admin/customers").then(setCustomers).catch(() => {});
api<Release[]>("/api/admin/releases").then(setReleases).catch(() => {});
}, []);
const submit = (e: React.FormEvent) => {
e.preventDefault();
@@ -48,7 +54,7 @@ function NewInstallModal({ servers, onClose }: { servers: ServerSummary[]; onClo
<form onSubmit={submit} className="grid gap-3 md:grid-cols-2">
<div className="md:col-span-2">
<label className="label" htmlFor="n-product">Product</label>
<select id="n-product" className="input" {...f("product")}>
<select id="n-product" className="input" value={form.product} onChange={e => setForm({ ...form, product: e.target.value, version: "" })}>
<option value="events">Cross Events</option>
<option value="accounts">Accounts (the church&apos;s sign-in)</option>
</select>
@@ -86,7 +92,10 @@ function NewInstallModal({ servers, onClose }: { servers: ServerSummary[]; onClo
})}
</div>
</div>
<div><label className="label" htmlFor="n-ver">Release</label><input id="n-ver" className="input" placeholder="latest" {...f("version")} /></div>
<div>
<label className="label" htmlFor="n-ver">Release</label>
<ReleaseSelect key={form.product} id="n-ver" releases={releases.filter(r => r.product === form.product)} value={form.version} onChange={version => setForm({ ...form, version })} />
</div>
<div className="space-y-3 md:col-span-2">
<p className="text-xs text-slate-500">The Hub makes the licence, picks two ports, and the agent installs within a minute. You get the report and the FastPanel steps by email.</p>
<FormError error={error} />
@@ -6,6 +6,7 @@ import { api, ApiError, errorText } from "@/lib/api";
import { fmtDate } from "@/lib/format";
import { usePaged } from "@/lib/paging";
import { PRODUCT_NAMES } from "@/lib/products";
import { ReleaseSelect } from "@/components/ReleaseSelect";
import type { Release } from "@/lib/types";
import { Loading, Message, PageTitle, Pager, Tabs } from "@/components/ui";
import { ServersNav, StatusPill, toInput, fromInput, type Deployment, type Job } from "@/components/servers";
@@ -44,7 +45,6 @@ export default function UpdatesPage() {
const deployments = useMemo(() => (all || []).filter(d => d.product === product), [all, product]);
const ownReleases = useMemo(() => releases.filter(r => r.product === product), [releases, product]);
const latest = ownReleases.find(r => r.latest)?.version;
const byVersion = useMemo(() => [...new Set(deployments.map(versionOf))].sort(), [deployments]);
const upcomingPaged = usePaged(upcoming, upcoming.length, 20);
@@ -114,10 +114,7 @@ export default function UpdatesPage() {
<div className="grid gap-3 md:grid-cols-2">
<div>
<label className="label" htmlFor="b-v">{name} release</label>
<select id="b-v" className="input" value={form.version} onChange={e => setForm({ ...form, version: e.target.value })}>
<option value="">Latest{latest ? ` (${latest})` : ""}</option>
{ownReleases.map(r => <option key={r.id} value={r.version}>{r.version}{r.latest ? " (latest)" : ""}{r.requires?.length ? ` · needs ${r.requires.map(q => `${PRODUCT_NAMES[q.product]} ${q.version}`).join(", ")}` : ""}</option>)}
</select>
<ReleaseSelect key={product} id="b-v" releases={ownReleases} value={form.version} onChange={version => setForm({ ...form, version })} />
{product === "events" && <p className="mt-1 text-xs text-slate-500">Each church&apos;s Accounts stays on its version, unless this release needs a newer one: then it&apos;s updated first in the same deploy, or installed first if the church has none. The confirmation lists what happens.</p>}
</div>
{form.emergency && form.asap