diff --git a/client/src/components/Filters/Check/index.tsx b/client/src/components/Filters/Check/index.tsx index b3e0220d..4b8ac018 100644 --- a/client/src/components/Filters/Check/index.tsx +++ b/client/src/components/Filters/Check/index.tsx @@ -44,7 +44,7 @@ const Check = ({ onSubmit }: Props) => { type="text" className="form-control" placeholder={t('form_enter_host') ?? ''} - {...register('name', { required: true })} + {...register('name', { required: t('form_error_required') })} /> @@ -98,10 +127,4 @@ const Form = (props: FormProps) => { ); }; -export default flow([ - withTranslation(), - reduxForm({ - form: FORM_NAME.REWRITES, - enableReinitialize: true, - }), -])(Form); +export default Form; diff --git a/client/src/components/Filters/Rewrites/Modal.tsx b/client/src/components/Filters/Rewrites/Modal.tsx index 3ef309f6..fd636844 100644 --- a/client/src/components/Filters/Rewrites/Modal.tsx +++ b/client/src/components/Filters/Rewrites/Modal.tsx @@ -14,7 +14,7 @@ interface ModalProps { processingAdd: boolean; processingDelete: boolean; modalType: string; - currentRewrite?: object; + currentRewrite?: { answer: string, domain: string; }; } const Modal = (props: ModalProps) => { @@ -23,7 +23,6 @@ const Modal = (props: ModalProps) => { handleSubmit, toggleRewritesModal, processingAdd, - processingDelete, modalType, currentRewrite, } = props; @@ -50,11 +49,10 @@ const Modal = (props: ModalProps) => { diff --git a/client/src/components/Settings/Settings.css b/client/src/components/Settings/Settings.css index 7cdf3548..39efcddf 100644 --- a/client/src/components/Settings/Settings.css +++ b/client/src/components/Settings/Settings.css @@ -63,6 +63,7 @@ } .form__message { + margin-top: 4px; font-size: 11px; } diff --git a/client/src/helpers/validators.ts b/client/src/helpers/validators.ts index a96199d7..87d441ee 100644 --- a/client/src/helpers/validators.ts +++ b/client/src/helpers/validators.ts @@ -292,7 +292,7 @@ export const validateIsSafePort = (value: any) => { */ export const validateDomain = (value: any) => { if (value && !R_HOST.test(value)) { - return 'form_error_domain_format'; + return i18next.t('form_error_domain_format'); } return undefined; }; @@ -303,7 +303,7 @@ export const validateDomain = (value: any) => { */ export const validateAnswer = (value: any) => { if (value && !R_IPV4.test(value) && !R_IPV6.test(value) && !R_HOST.test(value)) { - return 'form_error_answer_format'; + return i18next.t('form_error_answer_format'); } return undefined; }; diff --git a/client/src/install/Setup/Auth.tsx b/client/src/install/Setup/Auth.tsx index ec9933af..64bc9b87 100644 --- a/client/src/install/Setup/Auth.tsx +++ b/client/src/install/Setup/Auth.tsx @@ -55,17 +55,14 @@ const Auth = (props: Props) => { install_auth_username {errors.username && ( -
+
{errors.username.message}
)} @@ -77,10 +74,7 @@ const Auth = (props: Props) => { { autoComplete="new-password" /> {errors.password && ( -
- {errors.password.message || i18n.t('form_error_password_length')} +
+ {errors.password.message}
)}
@@ -101,10 +95,7 @@ const Auth = (props: Props) => { = ({ )} /> {errors.web?.port && ( -
+
{errors.web.port.message}
)} @@ -376,7 +376,7 @@ const Settings: React.FC = ({ )} /> {errors.dns?.port.message && ( -
+
{t(errors.dns.port.message)}
)}