chore: satisfy upgraded biome checks
This commit is contained in:
1 parent
c7891b60c3
commit
b413e62085
30 files changed
+162
-74
No files matched your search
@@ -64,6 +64,7 @@ export function isSafeHousekeepingHref(href: string): boolean {
|
||||
}
|
||||
return (
|
||||
normalized.origin === HOUSEKEEPING_ORIGIN &&
|
||||
(normalized.pathname === "/ase-next" || normalized.pathname.startsWith("/ase-next/"))
|
||||
(normalized.pathname === "/ase-next" ||
|
||||
normalized.pathname.startsWith("/ase-next/"))
|
||||
);
|
||||
}
|
||||
@@ -3,7 +3,10 @@ import { PERMS } from "@/lib/permission-slugs";
|
||||
import { HOUSEKEEPING_MANIFESTS } from "../manifests";
|
||||
import { anyCapability, type HousekeepingCapabilityContext } from "./contracts";
|
||||
import { buildHousekeepingNavigation } from "./navigation";
|
||||
import { createHousekeepingRegistry, type HousekeepingRegistry } from "./registry";
|
||||
import {
|
||||
createHousekeepingRegistry,
|
||||
type HousekeepingRegistry,
|
||||
} from "./registry";
|
||||
import type { HousekeepingRouteHandler } from "./routing/route-handler";
|
||||
import { createHousekeepingRouteRuntime } from "./routing/runtime";
|
||||
|
||||
@@ -208,4 +211,4 @@ describe("housekeeping navigation", () => {
|
||||
items: [{ id: "users", href: "/ase-next/people/users" }],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -54,4 +54,4 @@ export function buildHousekeepingNavigation(
|
||||
|
||||
function isConcreteNavigationHref(href: string): boolean {
|
||||
return !href.split("/").some((segment) => segment.startsWith(":"));
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,10 @@ describe("housekeeping recent work", () => {
|
||||
|
||||
expect(allowed).toMatchObject({
|
||||
ok: true,
|
||||
data: { routeId: "people.users", canonicalHref: "/ase-next/people/users" },
|
||||
data: {
|
||||
routeId: "people.users",
|
||||
canonicalHref: "/ase-next/people/users",
|
||||
},
|
||||
});
|
||||
expect(writeAudit).toHaveBeenCalledOnce();
|
||||
expect(writeAudit).toHaveBeenCalledWith(
|
||||
|
||||
@@ -9,7 +9,9 @@ describe("toHousekeepingHref", () => {
|
||||
});
|
||||
|
||||
it("keeps canonical domain routes unchanged", () => {
|
||||
expect(toHousekeepingHref("/ase-next/people/users")).toBe("/ase-next/people/users");
|
||||
expect(toHousekeepingHref("/ase-next/people/users")).toBe(
|
||||
"/ase-next/people/users",
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects paths outside the canonical ase namespace", () => {
|
||||
|
||||
@@ -44,7 +44,10 @@ const registry = createHousekeepingRegistry([
|
||||
route("people.user-detail", "/ase-next/people/users/:id"),
|
||||
route("people.user-create", "/ase-next/people/users/new"),
|
||||
route("people.users", "/ase-next/people/users"),
|
||||
route("people.ticket-note", "/ase-next/people/tickets/:ticketId/notes/:noteId"),
|
||||
route(
|
||||
"people.ticket-note",
|
||||
"/ase-next/people/tickets/:ticketId/notes/:noteId",
|
||||
),
|
||||
route("people.literal-tool", "/ase-next/people/tools/a+b[1]"),
|
||||
]),
|
||||
]);
|
||||
@@ -60,7 +63,9 @@ describe("matchHousekeepingRoute", () => {
|
||||
});
|
||||
|
||||
it("prefers a static route over a dynamic route with the same depth", () => {
|
||||
expect(matchHousekeepingRoute(registry, "/ase-next/people/users/new")).toEqual({
|
||||
expect(
|
||||
matchHousekeepingRoute(registry, "/ase-next/people/users/new"),
|
||||
).toEqual({
|
||||
routeId: "people.user-create",
|
||||
domain: "people",
|
||||
params: {},
|
||||
@@ -123,7 +128,10 @@ describe("matchHousekeepingRoute", () => {
|
||||
]);
|
||||
|
||||
expect(
|
||||
matchHousekeepingRoute(orderedRegistry, "/ase-next/people/users/settings"),
|
||||
matchHousekeepingRoute(
|
||||
orderedRegistry,
|
||||
"/ase-next/people/users/settings",
|
||||
),
|
||||
)?.toMatchObject({
|
||||
routeId: "people.user-detail",
|
||||
params: { id: "settings" },
|
||||
|
||||
@@ -184,4 +184,4 @@ function matchSegments(
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
}
|
||||
@@ -26,4 +26,4 @@ export interface HousekeepingRouteRenderInput {
|
||||
export interface HousekeepingRouteHandler {
|
||||
routeId: string;
|
||||
render(input: HousekeepingRouteRenderInput): Promise<ReactNode>;
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,9 @@ const domains: readonly HousekeepingNavigationDomain[] = [
|
||||
iconId: "inbox",
|
||||
label: "Operations",
|
||||
description: "Manage operations",
|
||||
items: [{ id: "queue", href: "/ase-next/operations/queue", label: "Queue" }],
|
||||
items: [
|
||||
{ id: "queue", href: "/ase-next/operations/queue", label: "Queue" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "people",
|
||||
|
||||
@@ -110,8 +110,8 @@ describe("OperationalInbox", () => {
|
||||
});
|
||||
|
||||
it("projects canonical hrefs without changing production destinations", () => {
|
||||
expect(projectOperationalInboxHref("/ase-next/system/operations/alerts")).toBe(
|
||||
"/ase-next/system/operations/alerts",
|
||||
);
|
||||
expect(
|
||||
projectOperationalInboxHref("/ase-next/system/operations/alerts"),
|
||||
).toBe("/ase-next/system/operations/alerts");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user