File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
pages/ManagementSettingsPage Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 2
2
* @fileoverview TODO: centralize navigation code here! URL constants, URL formatting, all of it
3
3
*/
4
4
5
+ export function withFilter ( path : string , filter : string ) {
6
+ return path + ( filter ? `?filter=${ encodeURIComponent ( filter ) } ` : "" ) ;
7
+ }
8
+
5
9
export const AUDIT_LINK = "/audit" ;
6
10
7
- export const USERS_LINK = `/users?filter=${ encodeURIComponent (
8
- "status:active" ,
9
- ) } `;
11
+ export const USERS_LINK = withFilter ( "/users" , "status:active" ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { Sidebar as BaseSidebar } from "components/Sidebar/Sidebar";
9
9
import { Stack } from "components/Stack/Stack" ;
10
10
import { UserAvatar } from "components/UserAvatar/UserAvatar" ;
11
11
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" ;
13
13
import { useOrganizationSettings } from "./ManagementSettingsLayout" ;
14
14
15
15
export const Sidebar : FC = ( ) => {
@@ -129,8 +129,14 @@ export const OrganizationSettingsNavigation: FC<
129
129
< SidebarNavSubItem href = { urlForSubpage ( organization . name , "groups" ) } >
130
130
Groups
131
131
</ 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. */ }
132
135
< SidebarNavSubItem
133
- href = { urlForSubpage ( organization . name , "auditing" ) }
136
+ href = { `/deployment${ withFilter (
137
+ AUDIT_LINK ,
138
+ `organization:${ organization . name } ` ,
139
+ ) } `}
134
140
>
135
141
Auditing
136
142
</ SidebarNavSubItem >
You can’t perform that action at this time.
0 commit comments