Reserve the locale param, carry it on breadcrumbs, translate the permissions detail view
CI / full-gate (push) Successful in 2m38s

This commit is contained in:
2026-08-03 23:21:38 +02:00
parent 6440c543e5
commit b3df7084c4
13 changed files with 62 additions and 27 deletions
+5
View File
@@ -51,3 +51,8 @@ test("parseListQuery honours custom reserved names and page-size bounds", () =>
assert.equal(parseListQuery("?n=999", { maxPageSize: 50, pageSizeParam: "n" }).pageSize, 50);
assert.deepEqual(parseListQuery("?q=hi", { qParam: "search" }).filters, { q: ["hi"] });
});
test("`locale` is the host's, not a filter — every localized list link carries it", () => {
const query = parseListQuery("/admin/users?locale=sv-SE&status=active");
assert.deepEqual(Object.keys(query.filters), ["status"]);
});
+3 -1
View File
@@ -31,7 +31,9 @@ export function parseListQuery(url: URL | URLSearchParams | string, options: Lis
const sortParam = options.sortParam ?? "sort";
const pageParam = options.pageParam ?? "page";
const pageSizeParam = options.pageSizeParam ?? "pageSize";
const reserved = new Set([pageParam, pageSizeParam, qParam, sortParam]);
// `locale` is host-owned (README → Languages): every list link and both GET forms carry it, so
// without this it would arrive as a phantom filter on every localized list page.
const reserved = new Set([pageParam, pageSizeParam, qParam, sortParam, "locale"]);
const filters: Record<string, string[]> = {};
for (const key of new Set(params.keys())) {