@@ -147,6 +147,10 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
147
147
) ;
148
148
} , [ autofillParameters ] ) ;
149
149
150
+ const hasAllRequiredExternalAuth = externalAuth . every (
151
+ ( auth ) => auth . optional || auth . authenticated ,
152
+ ) ;
153
+
150
154
return (
151
155
< Margins size = "medium" >
152
156
< PageHeader actions = { < Button onClick = { onCancel } > Cancel</ Button > } >
@@ -251,13 +255,15 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
251
255
description = "This template requires authentication to external services."
252
256
>
253
257
< FormFields >
254
- { requiresExternalAuth && (
255
- // This should really be a `notice` but `severity` is a MUI prop, and we'd need
256
- // to basically make our own `Alert` component.
258
+ { hasAllRequiredExternalAuth ? (
257
259
< Alert severity = "info" >
258
- To create a workspace using the selected template, please
259
- ensure you are authenticated with all the external providers
260
- listed below.
260
+ This template can connect to the external authentication
261
+ providers listed below.
262
+ </ Alert >
263
+ ) : (
264
+ < Alert severity = "error" >
265
+ To create a workspace using this template, please connect to
266
+ all required external authentication providers listed below.
261
267
</ Alert >
262
268
) }
263
269
{ externalAuth . map ( ( auth ) => (
@@ -313,6 +319,7 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
313
319
< FormFooter
314
320
onCancel = { onCancel }
315
321
isLoading = { creatingWorkspace }
322
+ submitDisabled = { ! hasAllRequiredExternalAuth }
316
323
submitLabel = "Create Workspace"
317
324
/>
318
325
</ HorizontalForm >
0 commit comments