@@ -9,10 +9,11 @@ import Menu from "@mui/material/Menu";
9
9
import MenuItem from "@mui/material/MenuItem" ;
10
10
import Skeleton from "@mui/material/Skeleton" ;
11
11
import { visuallyHidden } from "@mui/utils" ;
12
- import { type FC , type ReactNode , useRef , useState } from "react" ;
12
+ import { type FC , useRef , useState } from "react" ;
13
13
import { NavLink , useLocation , useNavigate } from "react-router-dom" ;
14
14
import type * as TypesGen from "api/typesGenerated" ;
15
15
import { Abbr } from "components/Abbr/Abbr" ;
16
+ import { DropdownArrow } from "components/DropdownArrow/DropdownArrow" ;
16
17
import { ExternalImage } from "components/ExternalImage/ExternalImage" ;
17
18
import { displayError } from "components/GlobalSnackbar/utils" ;
18
19
import { CoderIcon } from "components/Icons/CoderIcon" ;
@@ -21,10 +22,7 @@ import { useAuthenticated } from "contexts/auth/RequireAuth";
21
22
import type { ProxyContextValue } from "contexts/ProxyContext" ;
22
23
import { BUTTON_SM_HEIGHT , navHeight } from "theme/constants" ;
23
24
import { UserDropdown } from "./UserDropdown/UserDropdown" ;
24
-
25
- export const USERS_LINK = `/users?filter=${ encodeURIComponent (
26
- "status:active" ,
27
- ) } `;
25
+ import { DeploymentDropdown } from "./DeploymentDropdown" ;
28
26
29
27
export interface NavbarViewProps {
30
28
logo_url ?: string ;
@@ -44,25 +42,14 @@ export const Language = {
44
42
templates : "Templates" ,
45
43
users : "Users" ,
46
44
audit : "Audit" ,
47
- deployment : "Deployment " ,
45
+ deployment : "Settings " ,
48
46
} ;
49
47
50
48
interface NavItemsProps {
51
- children ?: ReactNode ;
52
49
className ?: string ;
53
- canViewAuditLog : boolean ;
54
- canViewDeployment : boolean ;
55
- canViewAllUsers : boolean ;
56
- canViewHealth : boolean ;
57
50
}
58
51
59
- const NavItems : FC < NavItemsProps > = ( {
60
- className,
61
- canViewAuditLog,
62
- canViewDeployment,
63
- canViewAllUsers,
64
- canViewHealth,
65
- } ) => {
52
+ const NavItems : FC < NavItemsProps > = ( { className } ) => {
66
53
const location = useLocation ( ) ;
67
54
const theme = useTheme ( ) ;
68
55
@@ -83,26 +70,6 @@ const NavItems: FC<NavItemsProps> = ({
83
70
< NavLink css = { styles . link } to = "/templates" >
84
71
{ Language . templates }
85
72
</ NavLink >
86
- { canViewAllUsers && (
87
- < NavLink css = { styles . link } to = { USERS_LINK } >
88
- { Language . users }
89
- </ NavLink >
90
- ) }
91
- { canViewAuditLog && (
92
- < NavLink css = { styles . link } to = "/audit" >
93
- { Language . audit }
94
- </ NavLink >
95
- ) }
96
- { canViewDeployment && (
97
- < NavLink css = { styles . link } to = "/deployment/general" >
98
- { Language . deployment }
99
- </ NavLink >
100
- ) }
101
- { canViewHealth && (
102
- < NavLink css = { styles . link } to = "/health" >
103
- Health
104
- </ NavLink >
105
- ) }
106
73
</ nav >
107
74
) ;
108
75
} ;
@@ -157,12 +124,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
157
124
) }
158
125
</ div >
159
126
</ div >
160
- < NavItems
161
- canViewAuditLog = { canViewAuditLog }
162
- canViewDeployment = { canViewDeployment }
163
- canViewAllUsers = { canViewAllUsers }
164
- canViewHealth = { canViewHealth }
165
- />
127
+ < NavItems />
166
128
</ div >
167
129
</ Drawer >
168
130
@@ -174,18 +136,20 @@ export const NavbarView: FC<NavbarViewProps> = ({
174
136
) }
175
137
</ NavLink >
176
138
177
- < NavItems
178
- css = { styles . desktopNavItems }
179
- canViewAuditLog = { canViewAuditLog }
180
- canViewDeployment = { canViewDeployment }
181
- canViewAllUsers = { canViewAllUsers }
182
- canViewHealth = { canViewHealth }
183
- />
139
+ < NavItems css = { styles . desktopNavItems } />
184
140
185
141
< div css = { styles . navMenus } >
186
142
{ proxyContextValue && (
187
143
< ProxyMenu proxyContextValue = { proxyContextValue } />
188
144
) }
145
+
146
+ < DeploymentDropdown
147
+ canViewAuditLog = { canViewAuditLog }
148
+ canViewDeployment = { canViewDeployment }
149
+ canViewAllUsers = { canViewAllUsers }
150
+ canViewHealth = { canViewHealth }
151
+ />
152
+
189
153
{ user && (
190
154
< UserDropdown
191
155
user = { user }
0 commit comments