8000 Redirect organization auditing page · coder/coder@933b85a · GitHub
[go: up one dir, main page]

Skip to content

Commit 933b85a

Browse files
committed
Redirect organization auditing page
1 parent 2c49c58 commit 933b85a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

site/src/modules/navigation.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
* @fileoverview TODO: centralize navigation code here! URL constants, URL formatting, all of it
33
*/
44

5+
export function withFilter(path: string, filter: string) {
6+
return path + (filter ? `?filter=${encodeURIComponent(filter)}` : "");
7+
}
8+
59
export const AUDIT_LINK = "/audit";
610

7-
export const USERS_LINK = `/users?filter=${encodeURIComponent(
8-
"status:active",
9-
)}`;
11+
export const USERS_LINK = withFilter("/users", "status:active");

site/src/pages/ManagementSettingsPage/Sidebar.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Sidebar as BaseSidebar } from "components/Sidebar/Sidebar";
99
import { Stack } from "components/Stack/Stack";
1010
import { UserAvatar } from "components/UserAvatar/UserAvatar";
1111
import { type ClassName, useClassName } from "hooks/useClassName";
12-
import { AUDIT_LINK, USERS_LINK } from "modules/navigation";
12+
import { AUDIT_LINK, USERS_LINK, withFilter } from "modules/navigation";
1313
import { useOrganizationSettings } from "./ManagementSettingsLayout";
1414

1515
export const Sidebar: FC = () => {
@@ -129,8 +129,14 @@ export const OrganizationSettingsNavigation: FC<
129129
<SidebarNavSubItem href={urlForSubpage(organization.name, "groups")}>
130130
Groups
131131
</SidebarNavSubItem>
132+
{/* For now redirect to the site-wide audit page with the organization
133+
pre-filled into the filter. Based on user feedback we might want
134+
to serve a copy of the audit page or even delete this link. */}
132135
<SidebarNavSubItem
133-
href={urlForSubpage(organization.name, "auditing")}
136+
href={`/deployment${withFilter(
137+
AUDIT_LINK,
138+
`organization:${organization.name}`,
139+
)}`}
134140
>
135141
Auditing
136142
</SidebarNavSubItem>

0 commit comments

Comments
 (0)
0