Skip to content

Commit

Permalink
fix(ui): use the correct select structure in the form to resolve warn…
Browse files Browse the repository at this point in the history
…ings and errors (#1637)

* fix: disable signout button during loading

* Resolve errors and warnings

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
liangfung and autofix-ci[bot] authored Mar 7, 2024
1 parent 1a52e89 commit 0dbe591
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,22 @@ const MailForm = React.forwardRef<MailFormRef, MailFormProps>((props, ref) => {
render={({ field }) => (
<FormItem>
<FormLabel required>Authentication Method</FormLabel>
<FormControl>
<Select
onValueChange={field.onChange}
defaultValue={field.value}
>
<Select
onValueChange={field.onChange}
defaultValue={field.value}
name={field.name}
>
<FormControl>
<SelectTrigger className="w-80 min-w-max">
<SelectValue placeholder="Select a method" />
</SelectTrigger>
<SelectContent>
<SelectItem value={AuthMethod.None}>NONE</SelectItem>
<SelectItem value={AuthMethod.Plain}>PLAIN</SelectItem>
<SelectItem value={AuthMethod.Login}>LOGIN</SelectItem>
</SelectContent>
</Select>
</FormControl>
</FormControl>
<SelectContent>
<SelectItem value={AuthMethod.None}>NONE</SelectItem>
<SelectItem value={AuthMethod.Plain}>PLAIN</SelectItem>
<SelectItem value={AuthMethod.Login}>LOGIN</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
Expand Down Expand Up @@ -279,23 +280,24 @@ const MailForm = React.forwardRef<MailFormRef, MailFormProps>((props, ref) => {
render={({ field }) => (
<FormItem>
<FormLabel required>Encryption</FormLabel>
<FormControl>
<Select
onValueChange={field.onChange}
defaultValue={field.value}
>
<Select
onValueChange={field.onChange}
defaultValue={field.value}
name={field.name}
>
<FormControl>
<SelectTrigger className="w-80 min-w-max">
<SelectValue placeholder="Select an encryption" />
</SelectTrigger>
<SelectContent>
<SelectItem value={Encryption.None}>NONE</SelectItem>
<SelectItem value={Encryption.SslTls}>SSL/TLS</SelectItem>
<SelectItem value={Encryption.StartTls}>
STARTTLS
</SelectItem>
</SelectContent>
</Select>
</FormControl>
</FormControl>
<SelectContent>
<SelectItem value={Encryption.None}>NONE</SelectItem>
<SelectItem value={Encryption.SslTls}>SSL/TLS</SelectItem>
<SelectItem value={Encryption.StartTls}>
STARTTLS
</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/app/files/components/source-code-browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ function isReadableTextFile(blob: Blob) {
resolve(false)
}

reader.readAsText(blobPart, 'UTF-8') // 假设文件是 UTF-8 编码
reader.readAsText(blobPart, 'UTF-8')
})
}

Expand Down
6 changes: 5 additions & 1 deletion ee/tabby-ui/components/user-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export default function UserPanel() {
<span className="ml-2">API Docs</span>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem onClick={handleSignOut} className="cursor-pointer">
<DropdownMenuItem
disabled={signOutLoading}
onClick={handleSignOut}
className="cursor-pointer"
>
<IconLogout />
<span className="ml-2">Logout</span>
{signOutLoading && <IconSpinner className="ml-1" />}
Expand Down

0 comments on commit 0dbe591

Please sign in to comment.