From 67ff1058e9579f1c08b539185be34e531d084f22 Mon Sep 17 00:00:00 2001 From: martylukyy <35452459+martylukyy@users.noreply.github.com> Date: Sun, 5 Mar 2023 16:13:19 +0100 Subject: [PATCH] feat(downloadclients): make fields required (#715) * initial commit for DownloadClientForms field validation * changed behaviour of required fields * removed validate from download clients * removed unused const * removed unused vars --------- Co-authored-by: soup --- web/src/components/inputs/input_wide.tsx | 2 ++ web/src/forms/settings/DownloadClientForms.tsx | 15 +++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/web/src/components/inputs/input_wide.tsx b/web/src/components/inputs/input_wide.tsx index a2270a4..6a1ce42 100644 --- a/web/src/components/inputs/input_wide.tsx +++ b/web/src/components/inputs/input_wide.tsx @@ -58,6 +58,7 @@ export const TextFieldWide = ({ className={classNames(meta.touched && meta.error ? "focus:ring-red-500 focus:border-red-500 border-red-500" : "focus:ring-blue-500 dark:focus:ring-blue-500 focus:border-blue-500 dark:focus:border-blue-500 border-gray-300 dark:border-gray-700", "block w-full shadow-sm dark:bg-gray-800 sm:text-sm dark:text-white rounded-md")} placeholder={placeholder} hidden={hidden} + required={required} /> )} @@ -120,6 +121,7 @@ export const PasswordFieldWide = ({ type={isVisible ? "text" : "password"} className={classNames(meta.touched && meta.error ? "focus:ring-red-500 focus:border-red-500 border-red-500" : "focus:ring-blue-500 dark:focus:ring-blue-500 focus:border-blue-500 dark:focus:border-blue-500 border-gray-300 dark:border-gray-700", "block w-full pr-10 dark:bg-gray-800 shadow-sm dark:text-gray-100 sm:text-sm rounded-md")} placeholder={placeholder} + required={required} />
{!isVisible ?
} + required={true} /> - + @@ -126,6 +128,7 @@ function FormFieldsQbit() { label="Host" help="Eg. http(s)://client.domain.ltd, http(s)://domain.ltd/qbittorrent, http://domain.ltd:port" tooltip={

See guides for how to connect to qBittorrent for various server types in our docs.


Dedicated servers:

https://autobrr.com/configuration/download-clients/dedicated#qbittorrent

Shared seedbox providers:

https://autobrr.com/configuration/download-clients/shared-seedboxes#qbittorrent
} + required={true} /> {port > 0 && ( @@ -171,11 +174,13 @@ function FormFieldsPorla() { name="host" label="Host" help="Eg. http(s)://client.domain.ltd, http(s)://domain.ltd/porla, http://domain.ltd:port" + required={true} /> + - + {tls && (

See guides for how to connect to rTorrent for various server types in our docs.


Dedicated servers:

https://autobrr.com/configuration/download-clients/dedicated#rtorrent--rutorrent

Shared seedbox providers:

https://autobrr.com/configuration/download-clients/shared-seedboxes#rtorrent} + required={true} /> ); @@ -221,6 +227,7 @@ function FormFieldsTransmission() { label="Host" help="Eg. client.domain.ltd, domain.ltd/client, domain.ltd" tooltip={

See guides for how to connect to Transmission for various server types in our docs.


Dedicated servers:

https://autobrr.com/configuration/download-clients/dedicated#transmission

Shared seedbox providers:

https://autobrr.com/configuration/download-clients/shared-seedboxes#transmisison
} + required={true} /> @@ -636,7 +643,7 @@ export function DownloadClientAddForm({ isOpen, toggle }: formProps) {
- +
- +