diff --git a/jams-react-client/src/components/CaSetup/CaSetup.js b/jams-react-client/src/components/CaSetup/CaSetup.js index 46b3ce8dfb2eb12a156f475e5aca9620487b4316..e57b1cb3156f603a34829f416e2128866f0520a6 100644 --- a/jams-react-client/src/components/CaSetup/CaSetup.js +++ b/jams-react-client/src/components/CaSetup/CaSetup.js @@ -108,7 +108,7 @@ export default function CaSetup(props) { const handleValidPeriodChange = (event) => { props.setError(false); - setValidityPeriod(validityPeriods[event.target.value]); + setValidityPeriod(tool.retrieveArrayElement(event.target.value, validityPeriods)); }; const handleSubmit = (values) => { @@ -165,7 +165,7 @@ export default function CaSetup(props) { accounts generated on this JAMS instance. </h4> <Select - labelId="demo-simple-select-label" + labelId="certificate-option-select-label" fullWidth value={certificateOpt.value} onChange={handleCertifOptionChange} @@ -254,7 +254,7 @@ export default function CaSetup(props) { /> <Select - labelId="demo-simple-select-label" + labelId="validity-period-select-label" margin="normal" fullWidth variant="outlined" diff --git a/jams-react-client/src/components/ServerParameters/ServerParameters.js b/jams-react-client/src/components/ServerParameters/ServerParameters.js index 9dc877f7f3cfea15397cd52d2e4b67826ba0650a..784fdb8886312acbbdc2997fe9992af3bffc4402 100644 --- a/jams-react-client/src/components/ServerParameters/ServerParameters.js +++ b/jams-react-client/src/components/ServerParameters/ServerParameters.js @@ -41,12 +41,10 @@ const useStyles = makeStyles((theme) => ({ export default function ServerParameters(props) { // Formik validation fields - const initialValues = {domain: "", sipconfig:""}; + const initialValues = {domain: ""}; const validationSchema = Yup.object().shape({ domain: Yup.string() .required("Domain is required."), - sipconfig: Yup.mixed() - .required("Sip configuration file is required."), }); const certificateRevocationTypes = [ @@ -80,6 +78,7 @@ export default function ServerParameters(props) { const [certificateRevocation, setCertificateRevocation] = React.useState(certificateRevocationTypes[0]) const [deviceLifetime, setDeviceLifetime] = React.useState(deviceLifetimeTypes[0]) const [userAccountLifetime, setUserAccountLifetime] = React.useState(userAccountLifetimeTypes[0]) + const [sipConfigurationTemplate, setSIPCertificateTemplate] = React.useState(null); const [userlifeDisabled, setUserlifeDisabled] = React.useState(false); React.useEffect(() => { @@ -109,7 +108,7 @@ export default function ServerParameters(props) { 'crlLifetime': certificateRevocation.value, 'deviceLifetime': deviceLifetime.value, 'userLifetime': userAccountLifetime.value, - 'sipConfig': values.sipconfig, + 'sipConfig': sipConfigurationTemplate, 'signingAlgorithm': "SHA512WITHRSA" } axios(configApiCall(api_path_post_install_server, "POST", jsonData, null)).then((response)=>{ @@ -137,6 +136,10 @@ export default function ServerParameters(props) { setUserAccountLifetime(tool.retrieveArrayElement(event.target.value, userAccountLifetimeTypes)); } + const handleSipConfigurationTemplateChange = (event) => { + setSIPCertificateTemplate(event.target.files[0]) + } + return ( <Formik validationSchema={validationSchema} @@ -210,20 +213,11 @@ export default function ServerParameters(props) { /> {userlifeDisabled ? <span class="spanError"> Account lifetime should be > to device lifetime.</span> : null} <Typography variant="subtitle1" gutterBottom>SIP Configuration Template</Typography> - <Field name="sipconfig"> - {({field, form}) => ( - <div> - <Input - fullWidth - type="file" - onChange={handleChange} - {...field} - /> - {form.errors.sipconfig && form.touched.sipconfig? <span class="spanError">{form.errors.sipconfig}</span> : null} - </div> - ) - } - </Field> + <Input + fullWidth + type="file" + onChange={handleSipConfigurationTemplateChange} + /> <Button type="submit" diff --git a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js index c503aca352115af366162c575a6c762052b318b4..97516ec80f4e334b4970f2b5cbc7b0dce80211d7 100644 --- a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js +++ b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js @@ -322,7 +322,6 @@ export default function EditCreateUserProfile(props) { } else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(emailvalue)) { error = 'Invalid email address'; - console.log("blurring email false here") } return error; }