Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Jan 7, 2025
1 parent 8595dec commit 2638257
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const LDAPCredentialCard = ({
<span>LDAP</span>
</div>
<div className="flex px-8 py-4">
<span className="w-[100px] shrink-0">Domain</span>
<span className="w-[100px] shrink-0">Host</span>
<span className="truncate">{data?.host}</span>
</div>
</CardContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ export function SubTitle({
className,
...rest
}: React.HTMLAttributes<HTMLDivElement>) {
return (
<div className={cn('mt-4 text-xl font-semibold', className)} {...rest} />
)
return <div className={cn('text-xl font-semibold', className)} {...rest} />
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,6 @@ export function LDAPCredentialForm({
const deleteLdapCredential = useMutation(deleteLdapCredentialMutation)

const onSubmit = async (values: LDAPFormValues) => {
const hasPassword = !isEmpty(values.bindPassword)
// test ldap connection
// if (submitTypeRef.current === 'test') {
// return testLdapConnection({ input: values })

// }

// update ldap credential
if (isNew) {
const hasExistingProvider = await client
Expand All @@ -170,11 +163,6 @@ export function LDAPCredentialForm({
})
return
}

if (!hasPassword) {
form.setError('bindPassword', { message: 'Required' })
return
}
}
return updateOauthCredential({ input: values })
}
Expand Down Expand Up @@ -285,7 +273,7 @@ export function LDAPCredentialForm({
<FormLabel required>Bind DN</FormLabel>
<FormControl>
<Input
placeholder="e.g uid=system,ou=Users,dc=example,dc=com"
placeholder="e.g. uid=system,ou=Users,dc=example,dc=com"
autoCapitalize="none"
autoComplete="off"
autoCorrect="off"
Expand Down Expand Up @@ -330,7 +318,7 @@ export function LDAPCredentialForm({
<FormLabel required>Base DN</FormLabel>
<FormControl>
<Input
placeholder="e.g ou=Users,dc=example,dc=com"
placeholder="e.g. ou=Users,dc=example,dc=com"
autoCapitalize="none"
autoComplete="off"
autoCorrect="off"
Expand All @@ -350,7 +338,7 @@ export function LDAPCredentialForm({
<FormLabel required>User Filter</FormLabel>
<FormControl>
<Input
placeholder="e.g ou=Users,dc=example,dc=com"
placeholder="e.g. (uid=%s)"
autoCapitalize="none"
autoComplete="off"
autoCorrect="off"
Expand Down Expand Up @@ -415,7 +403,7 @@ export function LDAPCredentialForm({
</FormItem>
)}
/>
<div className="mt-2">
<div className="mt-4">
<SubTitle>User information mapping</SubTitle>
<FormDescription>
Maps the field names from user info API to the Tabby user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default function OAuthCredentialForm({
<Form {...form}>
<div className={cn('grid gap-2', className)} {...props}>
<form className="grid gap-4" onSubmit={form.handleSubmit(onSubmit)}>
<SubTitle className="mt-2">Basic information</SubTitle>
<SubTitle>Basic information</SubTitle>
<FormField
control={form.control}
name="provider"
Expand Down Expand Up @@ -258,7 +258,7 @@ export default function OAuthCredentialForm({
</FormItem>
)}

<div className="mt-2">
<div className="mt-4">
<SubTitle>OAuth provider information</SubTitle>
<FormDescription>
The information is provided by your identity provider.
Expand Down

0 comments on commit 2638257

Please sign in to comment.