Skip to content

Commit

Permalink
Feature/2724/password security fixes (#2737)
Browse files Browse the repository at this point in the history
* renamed an interface to match the proper syntax

* Fixed the modal pop up and some other visual stuff

* added dynamic update button disabling

* removed unnecessary log
  • Loading branch information
markgol777 authored Nov 22, 2024
1 parent 5882ab7 commit cca7fee
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/containers/edit-profile/common.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const rootContainer = {
display: 'flex',
flexDirection: 'column',
boxSizing: 'border-box',
rowGap: '10px',
maxWidth: '768px',
width: '100%',
p: '20px 40px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,25 @@ export const styles = {
},
subtitle: {
typography: TypographyVariantEnum.Body1,
mb: '15px'
mb: '24px'
},
form: { display: 'flex', flexDirection: 'column', gap: '8px' },
form: { display: 'flex', flexDirection: 'column', gap: '24px' },

passwordButtonsContainer: {
display: 'flex',
justifyContent: 'flex-end',
alignItems: 'flex-end',
gap: '10px'
gap: '10px',
marginTop: '24px'
},

saveButton: {
gridColumn: { sm: 'span 3', md: 'span 3', lg: 'span 3' }
gridColumn: { sm: 'span 3', md: 'span 3', lg: 'span 3' },
width: '193px'
},
discardButton: {
gridColumn: { sm: 'span 1', md: 'span 2', lg: 'span 2' }
gridColumn: { sm: 'span 1', md: 'span 2', lg: 'span 2' },
width: '101px'
},
modalContainer: {
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ const ChangePasswordModal = () => {
validations: validations
})

const {
inputVisibility: currentPasswordVisibility,
showInputText: showCurrentPassword
} = useInputVisibility(errors.currentPassword)
const { showInputText: showCurrentPassword } = useInputVisibility(
errors.currentPassword
)

const { inputVisibility: passwordVisibility, showInputText: showPassword } =
useInputVisibility(errors.password)
Expand Down Expand Up @@ -150,7 +149,6 @@ const ChangePasswordModal = () => {
<Box component={ComponentEnum.Form} onSubmit={handleSubmit}>
<Box sx={styles.form}>
<AppTextField
InputProps={currentPasswordVisibility}
errorMsg={t(errors.currentPassword)}
fullWidth
label={t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const styles = {
p: '20px 0'
},
appButton: {
mt: '20px'
mt: '20px',
width: '192px',
height: '40px'
}
}
5 changes: 4 additions & 1 deletion src/pages/edit-profile/EditProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ const EditProfile = () => {
const isTabInvalid =
errorTooltipHolders.profile || errorTooltipHolders.professionalInfo

const isPasswordSecurityTab =
activeTab === UserProfileTabsEnum.PasswordAndSecurity

const hasChanges = (
initialData: Partial<EditProfileState>,
currentData: Partial<EditProfileState>
Expand Down Expand Up @@ -211,7 +214,7 @@ const EditProfile = () => {
</Box>
<AppButton
component={Link}
disabled={!isChanged || isTabInvalid}
disabled={!isChanged || isTabInvalid || isPasswordSecurityTab}
onClick={() => void handleUpdateUser()}
size={SizeEnum.Large}
sx={styles.updateBtn}
Expand Down

0 comments on commit cca7fee

Please sign in to comment.