diff --git a/jams-react-client/src/components/PasswordDialog/PasswordDialog.js b/jams-react-client/src/components/PasswordDialog/PasswordDialog.js index 741ac49286470c5717c6913a630b14f151e10d11..5fc9da569e490517071043e16e0e7d52aa4db257 100644 --- a/jams-react-client/src/components/PasswordDialog/PasswordDialog.js +++ b/jams-react-client/src/components/PasswordDialog/PasswordDialog.js @@ -184,6 +184,9 @@ export default function PasswordDialog(props) { </IconButton> </div> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> <FormikField name="passwordConfirmation" @@ -208,6 +211,9 @@ export default function PasswordDialog(props) { )} </IconButton> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </DialogContent> <DialogActions> diff --git a/jams-react-client/src/views/Settings/General.js b/jams-react-client/src/views/Settings/General.js index f5f0c61a3d6e4292b71119cb8b0ee45c0fa201b2..7e37b2a4870249f9a58de83ad7c139f949026d24 100644 --- a/jams-react-client/src/views/Settings/General.js +++ b/jams-react-client/src/views/Settings/General.js @@ -176,6 +176,9 @@ export default function General(props) { )} </IconButton> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> {touched.password && errors.password ? ( <span>{errors.password}</span> @@ -204,6 +207,9 @@ export default function General(props) { )} </IconButton> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> {touched.confirmPassword && errors.confirmPassword ? ( <span>{errors.confirmPassword}</span> diff --git a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js index 4fcd0bec6d78a71ffe77d2013c661a5aa0092a20..6cf7c40d8625b3d71be9921e31731c4d838f71ad 100644 --- a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js +++ b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js @@ -245,19 +245,7 @@ export default function EditCreateUserProfile(props) { const [aspect, setAspect] = React.useState(1); const [rotation, setRotation] = React.useState(0); const [passwordVisible, setPasswordVisible] = React.useState(false); - - const passwordGenerator = () => { - return generator.generate({ - length: 10, - uppercase: false, - numbers: true, - symbols: true, - }); - }; - - const intialyGeneratedPassword = passwordGenerator(); - - const initialValues = { + const [initialValues, setInitialValues] = React.useState({ username: "", password: intialyGeneratedPassword, confirmPassword: intialyGeneratedPassword, @@ -271,8 +259,19 @@ export default function EditCreateUserProfile(props) { phoneNumberExtension: "", mobileNumber: "", jamiId: "", + }); + + const passwordGenerator = () => { + return generator.generate({ + length: 10, + uppercase: false, + numbers: true, + symbols: true, + }); }; + const intialyGeneratedPassword = passwordGenerator(); + React.useEffect(() => { if (!createUser) { @@ -297,11 +296,19 @@ export default function EditCreateUserProfile(props) { ) .then((response) => { const user = response.data; - initialValues.username = user.username; - initialValues.firstName = user.firstName; - initialValues.lastName = user.lastName; - initialValues.email = user.email; - initialValues.profilePicture = user.profilePicture; + const values ={ + username: user.username, + firstName: user.firstName, + lastName: user.lastName, + email: user.email, + profilePicture: user.profilePicture, + organization: user.organization, + faxNumber: user.faxNumber, + phoneNumber: user.phoneNumber, + phoneNumberExtension: user.phoneNumberExtension, + mobileNumber: user.mobileNumber, + } + setInitialValues(values); setProfilePicture(user.profilePicture); if (user.profilePicture != "") { setProfilePicturePreview( @@ -310,12 +317,6 @@ export default function EditCreateUserProfile(props) { } else { setProfilePicturePreview(noProfilePicture); } - - initialValues.organization = user.organization; - initialValues.faxNumber = user.faxNumber; - initialValues.phoneNumber = user.phoneNumber; - initialValues.phoneNumberExtension = user.phoneNumberExtension; - initialValues.mobileNumber = user.mobileNumber; setLoading(false); }) .catch((error) => { @@ -690,6 +691,9 @@ export default function EditCreateUserProfile(props) { } required autoComplete="off" + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> )} @@ -720,6 +724,9 @@ export default function EditCreateUserProfile(props) { } required autoComplete="off" + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> )} @@ -789,6 +796,9 @@ export default function EditCreateUserProfile(props) { <PersonIcon /> </InputAdornment> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> <Grid item align="center" xs={12} sm={12} md={6}> @@ -801,6 +811,9 @@ export default function EditCreateUserProfile(props) { <PersonOutlinedIcon /> </InputAdornment> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> <Grid item align="center" xs={12} sm={12} md={6}> @@ -813,6 +826,9 @@ export default function EditCreateUserProfile(props) { <AlternateEmailOutlinedIcon /> </InputAdornment> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> <Grid item align="center" xs={12} sm={12} md={6}> @@ -825,6 +841,9 @@ export default function EditCreateUserProfile(props) { <BusinessCenterOutlinedIcon /> </InputAdornment> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> <Grid item align="center" xs={12} sm={12} md={6}> @@ -837,6 +856,9 @@ export default function EditCreateUserProfile(props) { <LocalPrintshopOutlinedIcon /> </InputAdornment> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> <Grid item align="center" xs={12} sm={12} md={6}> @@ -849,6 +871,9 @@ export default function EditCreateUserProfile(props) { <PhoneInTalkOutlinedIcon /> </InputAdornment> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> <Grid item align="center" xs={12} sm={12} md={6}> @@ -861,6 +886,9 @@ export default function EditCreateUserProfile(props) { <PhoneForwardedOutlinedIcon /> </InputAdornment> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> <Grid item align="center" xs={12} sm={12} md={6}> @@ -873,6 +901,9 @@ export default function EditCreateUserProfile(props) { <SmartphoneOutlinedIcon /> </InputAdornment> } + handleChange={() => {}} + onKeyUpError={false} + onKeyUpErrorMessage="" /> </Grid> </Grid> @@ -895,7 +926,7 @@ export default function EditCreateUserProfile(props) { ) : ( <Button type="submit" - disabled={!isValid || !dirty} + disabled={!isValid} color="info" > {i18next.t("save_profile", "Save Profile")}