Skip to content

Commit 2675fb0

Browse files
committed
frontend refactor
1 parent 3d09cb6 commit 2675fb0

File tree

8 files changed

+95
-95
lines changed

8 files changed

+95
-95
lines changed

site/src/AppRouter.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export const AppRouter: FC = () => {
256256
element={
257257
<AuthAndFrame>
258258
<RequirePermission
259-
isFeatureVisible={Boolean(permissions?.viewDeploymentFlags)}
259+
isFeatureVisible={Boolean(permissions?.viewDeploymentConfig)}
260260
>
261261
<DeploySettingsLayout>
262262
<GeneralSettingsPage />
@@ -270,7 +270,7 @@ export const AppRouter: FC = () => {
270270
element={
271271
<AuthAndFrame>
272272
<RequirePermission
273-
isFeatureVisible={Boolean(permissions?.viewDeploymentFlags)}
273+
isFeatureVisible={Boolean(permissions?.viewDeploymentConfig)}
274274
>
275275
<DeploySettingsLayout>
276276
<SecuritySettingsPage />
@@ -284,7 +284,7 @@ export const AppRouter: FC = () => {
284284
element={
285285
<AuthAndFrame>
286286
<RequirePermission
287-
isFeatureVisible={Boolean(permissions?.viewDeploymentFlags)}
287+
isFeatureVisible={Boolean(permissions?.viewDeploymentConfig)}
288288
>
289289
<DeploySettingsLayout>
290290
<NetworkSettingsPage />
@@ -298,7 +298,7 @@ export const AppRouter: FC = () => {
298298
element={
299299
<AuthAndFrame>
300300
<RequirePermission
301-
isFeatureVisible={Boolean(permissions?.viewDeploymentFlags)}
301+
isFeatureVisible={Boolean(permissions?.viewDeploymentConfig)}
302302
>
303303
<DeploySettingsLayout>
304304
<AuthSettingsPage />

site/src/components/DeploySettingsLayout/DeploySettingsLayout.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import React, {
1111
import { useActor } from "@xstate/react"
1212
import { XServiceContext } from "xServices/StateContext"
1313
import { Loader } from "components/Loader/Loader"
14-
import { DeploymentFlags } from "api/typesGenerated"
14+
import { DeploymentConfig } from "api/typesGenerated"
1515

16-
type DeploySettingsContextValue = { deploymentFlags: DeploymentFlags }
16+
type DeploySettingsContextValue = { deploymentConfig: DeploymentConfig }
1717

1818
const DeploySettingsContext = createContext<
1919
DeploySettingsContextValue | undefined
@@ -33,9 +33,9 @@ export const DeploySettingsLayout: React.FC<PropsWithChildren> = ({
3333
children,
3434
}) => {
3535
const xServices = useContext(XServiceContext)
36-
const [state, send] = useActor(xServices.deploymentFlagsXService)
36+
const [state, send] = useActor(xServices.deploymentConfigXService)
3737
const styles = useStyles()
38-
const { deploymentFlags } = state.context
38+
const { deploymentConfig } = state.context
3939

4040
useEffect(() => {
4141
if (state.matches("idle")) {
@@ -48,8 +48,8 @@ export const DeploySettingsLayout: React.FC<PropsWithChildren> = ({
4848
<Stack className={styles.wrapper} direction="row" spacing={5}>
4949
<Sidebar />
5050
<main className={styles.content}>
51-
{deploymentFlags ? (
52-
<DeploySettingsContext.Provider value={{ deploymentFlags }}>
51+
{deploymentConfig ? (
52+
<DeploySettingsContext.Provider value={{ deploymentConfig }}>
5353
{children}
5454
</DeploySettingsContext.Provider>
5555
) : (

site/src/components/Navbar/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const Navbar: React.FC = () => {
2222
featureVisibility[FeatureNames.AuditLog] &&
2323
Boolean(permissions?.viewAuditLog)
2424
const canViewDeployment =
25-
experimental && Boolean(permissions?.viewDeploymentFlags)
25+
experimental && Boolean(permissions?.viewDeploymentConfig)
2626
const onSignOut = () => authSend("SIGN_OUT")
2727

2828
return (

site/src/pages/DeploySettingsPage/AuthSettingsPage.tsx

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Stack } from "components/Stack/Stack"
2020
import React from "react"
2121

2222
const AuthSettingsPage: React.FC = () => {
23-
const { deploymentFlags } = useDeploySettings()
23+
const { deploymentConfig } = useDeploySettings()
2424

2525
return (
2626
<>
@@ -34,7 +34,7 @@ const AuthSettingsPage: React.FC = () => {
3434
/>
3535

3636
<Badges>
37-
{deploymentFlags.oidc_client_id.value ? (
37+
{deploymentConfig.oidc_client_id.value ? (
3838
<EnabledBadge />
3939
) : (
4040
<DisabledBadge />
@@ -53,100 +53,100 @@ const AuthSettingsPage: React.FC = () => {
5353
<TableRow>
5454
<TableCell>
5555
<OptionName>
56-
{deploymentFlags.oidc_client_id.name}
56+
{deploymentConfig.oidc_client_id.name}
5757
</OptionName>
5858
<OptionDescription>
59-
{deploymentFlags.oidc_client_id.description}
59+
{deploymentConfig.oidc_client_id.description}
6060
</OptionDescription>
6161
</TableCell>
6262

6363
<TableCell>
6464
<OptionValue>
65-
{deploymentFlags.oidc_client_id.value}
65+
{deploymentConfig.oidc_client_id.value}
6666
</OptionValue>
6767
</TableCell>
6868
</TableRow>
6969

7070
<TableRow>
7171
<TableCell>
7272
<OptionName>
73-
{deploymentFlags.oidc_client_secret.name}
73+
{deploymentConfig.oidc_client_secret.name}
7474
</OptionName>
7575
<OptionDescription>
76-
{deploymentFlags.oidc_client_secret.description}
76+
{deploymentConfig.oidc_client_secret.description}
7777
</OptionDescription>
7878
</TableCell>
7979

8080
<TableCell>
8181
<OptionValue>
82-
{deploymentFlags.oidc_client_secret.value}
82+
{deploymentConfig.oidc_client_secret.value}
8383
</OptionValue>
8484
</TableCell>
8585
</TableRow>
8686

8787
<TableRow>
8888
<TableCell>
8989
<OptionName>
90-
{deploymentFlags.oidc_allow_signups.name}
90+
{deploymentConfig.oidc_allow_signups.name}
9191
</OptionName>
9292
<OptionDescription>
93-
{deploymentFlags.oidc_allow_signups.description}
93+
{deploymentConfig.oidc_allow_signups.description}
9494
</OptionDescription>
9595
</TableCell>
9696

9797
<TableCell>
9898
<OptionValue>
99-
{deploymentFlags.oidc_allow_signups.value.toString()}
99+
{deploymentConfig.oidc_allow_signups.value.toString()}
100100
</OptionValue>
101101
</TableCell>
102102
</TableRow>
103103

104104
<TableRow>
105105
<TableCell>
106106
<OptionName>
107-
{deploymentFlags.oidc_email_domain.name}
107+
{deploymentConfig.oidc_email_domain.name}
108108
</OptionName>
109109
<OptionDescription>
110-
{deploymentFlags.oidc_email_domain.description}
110+
{deploymentConfig.oidc_email_domain.description}
111111
</OptionDescription>
112112
</TableCell>
113113

114114
<TableCell>
115115
<OptionValue>
116-
{deploymentFlags.oidc_email_domain.value}
116+
{deploymentConfig.oidc_email_domain.value}
117117
</OptionValue>
118118
</TableCell>
119119
</TableRow>
120120

121121
<TableRow>
122122
<TableCell>
123123
<OptionName>
124-
{deploymentFlags.oidc_issuer_url.name}
124+
{deploymentConfig.oidc_issuer_url.name}
125125
</OptionName>
126126
<OptionDescription>
127-
{deploymentFlags.oidc_issuer_url.description}
127+
{deploymentConfig.oidc_issuer_url.description}
128128
</OptionDescription>
129129
</TableCell>
130130

131131
<TableCell>
132132
<OptionValue>
133-
{deploymentFlags.oidc_issuer_url.value}
133+
{deploymentConfig.oidc_issuer_url.value}
134134
</OptionValue>
135135
</TableCell>
136136
</TableRow>
137137

138138
<TableRow>
139139
<TableCell>
140-
<OptionName>{deploymentFlags.oidc_scopes.name}</OptionName>
140+
<OptionName>{deploymentConfig.oidc_scopes.name}</OptionName>
141141
<OptionDescription>
142-
{deploymentFlags.oidc_scopes.description}
142+
{deploymentConfig.oidc_scopes.description}
143143
</OptionDescription>
144144
</TableCell>
145145

146146
<TableCell>
147147
<OptionValue>
148148
<ul>
149-
{deploymentFlags.oidc_scopes.value.map((scope) => (
149+
{deploymentConfig.oidc_scopes.value.map((scope) => (
150150
<li key={scope}>{scope}</li>
151151
))}
152152
</ul>
@@ -167,7 +167,7 @@ const AuthSettingsPage: React.FC = () => {
167167
/>
168168

169169
<Badges>
170-
{deploymentFlags.oauth2_github_client_id.value ? (
170+
{deploymentConfig.oauth2_github_client_id.value ? (
171171
<EnabledBadge />
172172
) : (
173173
<DisabledBadge />
@@ -186,62 +186,62 @@ const AuthSettingsPage: React.FC = () => {
186186
<TableRow>
187187
<TableCell>
188188
<OptionName>
189-
{deploymentFlags.oauth2_github_client_id.name}
189+
{deploymentConfig.oauth2_github_client_id.name}
190190
</OptionName>
191191
<OptionDescription>
192-
{deploymentFlags.oauth2_github_client_id.description}
192+
{deploymentConfig.oauth2_github_client_id.description}
193193
</OptionDescription>
194194
</TableCell>
195195

196196
<TableCell>
197197
<OptionValue>
198-
{deploymentFlags.oauth2_github_client_id.value}
198+
{deploymentConfig.oauth2_github_client_id.value}
199199
</OptionValue>
200200
</TableCell>
201201
</TableRow>
202202

203203
<TableRow>
204204
<TableCell>
205205
<OptionName>
206-
{deploymentFlags.oauth2_github_client_secret.name}
206+
{deploymentConfig.oauth2_github_client_secret.name}
207207
</OptionName>
208208
<OptionDescription>
209-
{deploymentFlags.oauth2_github_client_secret.description}
209+
{deploymentConfig.oauth2_github_client_secret.description}
210210
</OptionDescription>
211211
</TableCell>
212212

213213
<TableCell>
214214
<OptionValue>
215-
{deploymentFlags.oauth2_github_client_secret.value}
215+
{deploymentConfig.oauth2_github_client_secret.value}
216216
</OptionValue>
217217
</TableCell>
218218
</TableRow>
219219

220220
<TableRow>
221221
<TableCell>
222222
<OptionName>
223-
{deploymentFlags.oauth2_github_allow_signups.name}
223+
{deploymentConfig.oauth2_github_allow_signups.name}
224224
</OptionName>
225225
<OptionDescription>
226-
{deploymentFlags.oauth2_github_allow_signups.description}
226+
{deploymentConfig.oauth2_github_allow_signups.description}
227227
</OptionDescription>
228228
</TableCell>
229229

230230
<TableCell>
231231
<OptionValue>
232-
{deploymentFlags.oauth2_github_allow_signups.value.toString()}
232+
{deploymentConfig.oauth2_github_allow_signups.value.toString()}
233233
</OptionValue>
234234
</TableCell>
235235
</TableRow>
236236

237237
<TableRow>
238238
<TableCell>
239239
<OptionName>
240-
{deploymentFlags.oauth2_github_allowed_organizations.name}
240+
{deploymentConfig.oauth2_github_allowed_organizations.name}
241241
</OptionName>
242242
<OptionDescription>
243243
{
244-
deploymentFlags.oauth2_github_allowed_organizations
244+
deploymentConfig.oauth2_github_allowed_organizations
245245
.description
246246
}
247247
</OptionDescription>
@@ -250,7 +250,7 @@ const AuthSettingsPage: React.FC = () => {
250250
<TableCell>
251251
<OptionValue>
252252
<ul>
253-
{deploymentFlags.oauth2_github_allowed_organizations.value.map(
253+
{deploymentConfig.oauth2_github_allowed_organizations.value.map(
254254
(org) => (
255255
<li key={org}>{org}</li>
256256
),
@@ -263,17 +263,17 @@ const AuthSettingsPage: React.FC = () => {
263263
<TableRow>
264264
<TableCell>
265265
<OptionName>
266-
{deploymentFlags.oauth2_github_allowed_teams.name}
266+
{deploymentConfig.oauth2_github_allowed_teams.name}
267267
</OptionName>
268268
<OptionDescription>
269-
{deploymentFlags.oauth2_github_allowed_teams.description}
269+
{deploymentConfig.oauth2_github_allowed_teams.description}
270270
</OptionDescription>
271271
</TableCell>
272272

273273
<TableCell>
274274
<OptionValue>
275275
<ul>
276-
{deploymentFlags.oauth2_github_allowed_teams.value.map(
276+
{deploymentConfig.oauth2_github_allowed_teams.value.map(
277277
(team) => (
278278
<li key={team}>{team}</li>
279279
),
@@ -286,19 +286,19 @@ const AuthSettingsPage: React.FC = () => {
286286
<TableRow>
287287
<TableCell>
288288
<OptionName>
289-
{deploymentFlags.oauth2_github_enterprise_base_url.name}
289+
{deploymentConfig.oauth2_github_enterprise_base_url.name}
290290
</OptionName>
291291
<OptionDescription>
292292
{
293-
deploymentFlags.oauth2_github_enterprise_base_url
293+
deploymentConfig.oauth2_github_enterprise_base_url
294294
.description
295295
}
296296
</OptionDescription>
297297
</TableCell>
298298

299299
<TableCell>
300300
<OptionValue>
301-
{deploymentFlags.oauth2_github_enterprise_base_url.value}
301+
{deploymentConfig.oauth2_github_enterprise_base_url.value}
302302
</OptionValue>
303303
</TableCell>
304304
</TableRow>

0 commit comments

Comments
 (0)