Skip to content

Commit 0144db6

Browse files
Etsijasschuberth
authored andcommitted
feat(ui): Make the primary input field get the initial keyboard focus
Do this for all organization, product, repository and ORT run creation forms, as well as secret creation forms for organization, product and repository, and additionally to organization infrastructure service creation form. Resolves #890. While at it, partially resolve also #832 by proving GIT as the default repository type in the repository creation form. Signed-off-by: Jyrki Keisala <[email protected]>
1 parent 4bd2e62 commit 0144db6

File tree

8 files changed

+11
-8
lines changed

8 files changed

+11
-8
lines changed

ui/src/routes/_layout/create-organization.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const CreateOrganizationPage = () => {
101101
<FormItem>
102102
<FormLabel>Name</FormLabel>
103103
<FormControl>
104-
<Input {...field} />
104+
<Input {...field} autoFocus />
105105
</FormControl>
106106
<FormDescription>
107107
Enter the name of your organization

ui/src/routes/_layout/organizations/$orgId/create-product.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const CreateProductPage = () => {
105105
render={({ field }) => (
106106
<FormItem>
107107
<FormLabel>Name</FormLabel>
108-
<FormControl>
108+
<FormControl autoFocus>
109109
<Input {...field} />
110110
</FormControl>
111111
<FormDescription>

ui/src/routes/_layout/organizations/$orgId/infrastructure-services/create.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const CreateInfrastructureServicePage = () => {
140140
render={({ field }) => (
141141
<FormItem>
142142
<FormLabel>Name</FormLabel>
143-
<FormControl>
143+
<FormControl autoFocus>
144144
<Input {...field} />
145145
</FormControl>
146146
<FormDescription>

ui/src/routes/_layout/organizations/$orgId/products/$productId/create-repository.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ const CreateRepositoryPage = () => {
9090

9191
const form = useForm<z.infer<typeof formSchema>>({
9292
resolver: zodResolver(formSchema),
93+
defaultValues: {
94+
type: 'GIT',
95+
},
9396
});
9497

9598
async function onSubmit(values: z.infer<typeof formSchema>) {
@@ -116,7 +119,7 @@ const CreateRepositoryPage = () => {
116119
render={({ field }) => (
117120
<FormItem>
118121
<FormLabel>URL</FormLabel>
119-
<FormControl>
122+
<FormControl autoFocus>
120123
<Input {...field} />
121124
</FormControl>
122125
<FormDescription>URL of the repository</FormDescription>

ui/src/routes/_layout/organizations/$orgId/products/$productId/repositories/$repoId/create-run.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ const CreateRunPage = () => {
545545
render={({ field }) => (
546546
<FormItem>
547547
<FormLabel>Revision</FormLabel>
548-
<FormControl>
548+
<FormControl autoFocus>
549549
<Input {...field} />
550550
</FormControl>
551551
<FormDescription>

ui/src/routes/_layout/organizations/$orgId/products/$productId/repositories/$repoId/secrets/create-secret.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const CreateRepositorySecretPage = () => {
108108
render={({ field }) => (
109109
<FormItem>
110110
<FormLabel>Name</FormLabel>
111-
<FormControl>
111+
<FormControl autoFocus>
112112
<Input {...field} />
113113
</FormControl>
114114
<FormDescription>

ui/src/routes/_layout/organizations/$orgId/products/$productId/secrets/create-secret.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const CreateProductSecretPage = () => {
104104
render={({ field }) => (
105105
<FormItem>
106106
<FormLabel>Name</FormLabel>
107-
<FormControl>
107+
<FormControl autoFocus>
108108
<Input {...field} />
109109
</FormControl>
110110
<FormDescription>

ui/src/routes/_layout/organizations/$orgId/secrets/create-secret.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const CreateOrganizationSecretPage = () => {
106106
render={({ field }) => (
107107
<FormItem>
108108
<FormLabel>Name</FormLabel>
109-
<FormControl>
109+
<FormControl autoFocus>
110110
<Input {...field} />
111111
</FormControl>
112112
<FormDescription>

0 commit comments

Comments
 (0)