Skip to content

Commit 766277c

Browse files
authored
fix: disable submit button on diagnostics error (#17900)
1 parent 4e0fc6e commit 766277c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,18 @@ export const CreateWorkspacePageViewExperimental: FC<
516516
<div className="flex flex-row justify-end">
517517
<Button
518518
type="submit"
519-
disabled={creatingWorkspace || !hasAllRequiredExternalAuth}
519+
disabled={
520+
creatingWorkspace ||
521+
!hasAllRequiredExternalAuth ||
522+
diagnostics.some(
523+
(diagnostic) => diagnostic.severity === "error",
524+
) ||
525+
parameters.some((parameter) =>
526+
parameter.diagnostics.some(
527+
(diagnostic) => diagnostic.severity === "error",
528+
),
529+
)
530+
}
520531
>
521532
<Spinner loading={creatingWorkspace} />
522533
Create workspace

0 commit comments

Comments
 (0)