Add computer settings pages and restore workspace pages
This commit is contained in:
@@ -14,6 +14,11 @@ describe("parseSettingsRecordPath", () => {
|
||||
expect(
|
||||
parseSettingsRecordPath({ pathname: "/admin/settings/users/8" }),
|
||||
).toEqual({ kind: "users", id: "8" });
|
||||
expect(
|
||||
parseSettingsRecordPath({
|
||||
pathname: "/admin/settings/computers/2",
|
||||
}),
|
||||
).toEqual({ kind: "computers", id: "2" });
|
||||
});
|
||||
|
||||
test("ignores settings list pages and other paths", () => {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
export type SettingsRecordKind = "bots" | "workspaces" | "users";
|
||||
export type SettingsRecordKind =
|
||||
| "bots"
|
||||
| "workspaces"
|
||||
| "users"
|
||||
| "computers";
|
||||
|
||||
export type SettingsRecordPath = {
|
||||
kind: SettingsRecordKind;
|
||||
@@ -21,7 +25,9 @@ export default function parseSettingsRecordPath({
|
||||
|
||||
const match = pathname
|
||||
.replace(/\/$/, "")
|
||||
.match(/^\/admin\/settings\/(bots|workspaces|users)\/([^/]+)$/);
|
||||
.match(
|
||||
/^\/admin\/settings\/(bots|workspaces|users|computers)\/([^/]+)$/,
|
||||
);
|
||||
|
||||
if (!match) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user