Skip to content

Commit 854ef5b

Browse files
authored
fix: improve create workspace page for dynamic parameters (coder#18139)
- Avoid scrolling on workspace creation - hide auth required badge when authenticated
1 parent 19745a2 commit 854ef5b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

site/src/pages/CreateWorkspacePage/CreateWorkspacePageViewExperimental.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export const CreateWorkspacePageViewExperimental: FC<
179179
}, [error]);
180180

181181
useEffect(() => {
182-
if (form.submitCount > 0 && form.errors) {
182+
if (form.submitCount > 0 && Object.keys(form.errors).length > 0) {
183183
workspaceNameInputRef.current?.scrollIntoView({
184184
behavior: "smooth",
185185
block: "center",

site/src/pages/CreateWorkspacePage/ExternalAuthButton.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ export const ExternalAuthButton: FC<ExternalAuthButtonProps> = ({
3838
/>
3939
)}
4040
<p className="font-semibold text-sm m-0">{auth.display_name}</p>
41-
{!auth.optional && (
42-
<Badge size="sm" variant={error ? "destructive" : "warning"}>
41+
{!auth.authenticated && !auth.optional && (
42+
<Badge
43+
size="sm"
44+
border="none"
45+
variant={error ? "destructive" : "warning"}
46+
>
4347
Required
4448
</Badge>
4549
)}

0 commit comments

Comments
 (0)