1+ import { faInfoCircle } from "@fortawesome/free-solid-svg-icons" ;
2+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
13import { useQueryClient } from "@tanstack/react-query" ;
24import { Field , Form , Formik , FormikProps } from "formik" ;
35import { useEffect , useRef , useState } from "react" ;
@@ -47,7 +49,7 @@ const SettingsPage = () => {
4749 setSaved ( true ) ;
4850 } }
4951 >
50- { ( { submitForm, touched, errors } ) => (
52+ { ( { submitForm, touched, errors, values } ) => (
5153 < >
5254 < Form >
5355 < div className = "flex flex-col gap-y-1" >
@@ -76,6 +78,7 @@ const SettingsPage = () => {
7678 </ a >
7779 </ div >
7880 </ fieldset >
81+
7982 < fieldset className = "p-1.5 rounded-lg border border-gray-300 dark:border-gray-600" >
8083 < legend className = "px-2 text-base font-semibold" >
8184 < FormattedMessage id = "settings.redmine" />
@@ -99,7 +102,21 @@ const SettingsPage = () => {
99102 as = { InputField }
100103 error = { touched . redmineApiKey && errors . redmineApiKey }
101104 />
102-
105+ { values . redmineURL && ! errors . redmineURL && ! values . redmineApiKey && (
106+ < p >
107+ < FontAwesomeIcon icon = { faInfoCircle } className = "mr-1 text-yellow-500 dark:text-yellow-400" />
108+ < FormattedMessage
109+ id = "settings.redmine.api-key.hint"
110+ values = { {
111+ link : ( children ) => (
112+ < a href = { `${ values . redmineURL } /my/account` } target = "_blank" tabIndex = { - 1 } className = "text-blue-500 hover:underline" >
113+ { children }
114+ </ a >
115+ ) ,
116+ } }
117+ />
118+ </ p >
119+ ) }
103120 < div className = "flex items-center gap-x-2" >
104121 { myAccount . isLoading && (
105122 < >
@@ -141,6 +158,7 @@ const SettingsPage = () => {
141158 </ div >
142159 </ div >
143160 </ fieldset >
161+
144162 < fieldset className = "p-1.5 rounded-lg border border-gray-300 dark:border-gray-600" >
145163 < legend className = "px-2 text-base font-semibold" >
146164 < FormattedMessage id = "settings.options" />
0 commit comments