Space Manager: navigate to space list after hitting Save

This commit is contained in:
Zef Hemel
2026-07-31 15:40:55 +02:00
parent e9ff819735
commit 992f2617ec
3 changed files with 10 additions and 8 deletions
+3 -1
View File
@@ -57,7 +57,9 @@ export function SpaceEditor({
// screen, so its remaining settings are one step away rather than
// behind another round trip through the list.
onSaved={(savedId) =>
navigate(id ? spacesUrl("/") : spacesUrl(`/${encodeURIComponent(savedId)}`))
navigate(
id ? spacesUrl("/") : spacesUrl(`/${encodeURIComponent(savedId)}`),
)
}
onDeleted={() => navigate(spacesUrl("/"))}
onUnauthorized={onUnauthorized}
+4 -6
View File
@@ -75,9 +75,8 @@ export function SpaceForm({
);
// Matches the server's own `runtimeApi` default for a fresh space.
const [runtimeApi, setRuntimeApi] = useState(initial?.runtimeApi ?? true);
const [runtimeAvailability, setRuntimeAvailability] = useState<
RuntimeAvailability | null
>(null);
const [runtimeAvailability, setRuntimeAvailability] =
useState<RuntimeAvailability | null>(null);
const [indexPage, setIndexPage] = useState(initial?.indexPage ?? "index");
const [errors, setErrors] = useState<FieldError[]>([]);
// Only ever "saving": a successful save navigates away — to the space list
@@ -149,9 +148,8 @@ export function SpaceForm({
.then((info) => setRuntimeAvailability(info.runtimeApi))
.catch(() => {});
}, []);
const runtimeApiUnavailable = runtimeApiUnavailableReason(
runtimeAvailability,
);
const runtimeApiUnavailable =
runtimeApiUnavailableReason(runtimeAvailability);
return (
<form
+3 -1
View File
@@ -149,7 +149,9 @@ test("saving an existing space returns to the list showing the change", async ({
// they just edited carrying its new name, rather than an unchanged-looking
// form they have to take on trust.
await expect(page).toHaveURL(`${base}/.spaces/`);
await expect(page.getByRole("link", { name: "Feedback Renamed" })).toBeVisible();
await expect(
page.getByRole("link", { name: "Feedback Renamed" }),
).toBeVisible();
});
test("the shell allow list is editable, and only shown when shell is enabled", async ({