mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: improve create workspace page for dynamic parameters (#18139)
- Avoid scrolling on workspace creation - hide auth required badge when authenticated
This commit is contained in:
@@ -179,7 +179,7 @@ export const CreateWorkspacePageViewExperimental: FC<
|
||||
}, [error]);
|
||||
|
||||
useEffect(() => {
|
||||
if (form.submitCount > 0 && form.errors) {
|
||||
if (form.submitCount > 0 && Object.keys(form.errors).length > 0) {
|
||||
workspaceNameInputRef.current?.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
block: "center",
|
||||
|
||||
@@ -38,8 +38,12 @@ export const ExternalAuthButton: FC<ExternalAuthButtonProps> = ({
|
||||
/>
|
||||
)}
|
||||
<p className="font-semibold text-sm m-0">{auth.display_name}</p>
|
||||
{!auth.optional && (
|
||||
<Badge size="sm" variant={error ? "destructive" : "warning"}>
|
||||
{!auth.authenticated && !auth.optional && (
|
||||
<Badge
|
||||
size="sm"
|
||||
border="none"
|
||||
variant={error ? "destructive" : "warning"}
|
||||
>
|
||||
Required
|
||||
</Badge>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user