Skip to content

Commit

Permalink
Merge pull request #1102 from DeepBlueCLtd/1099_1097_edit_pwd_guidanc…
Browse files Browse the repository at this point in the history
…e_cancel

1099 1097 edit pwd guidance cancel
  • Loading branch information
IanMayo authored May 3, 2024
2 parents ee2dba7 + 3e6a10a commit fc52533
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
19 changes: 16 additions & 3 deletions src/ChangePassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { type AxiosError, isAxiosError } from 'axios'
import { AuditType } from './utils/activity-types'
import { trackEvent } from './utils/audit'
import { encryptData } from './utils/encryption'
import FlexBox from './components/FlexBox'

interface ChangePasswordForm {
currentPassword: string
Expand Down Expand Up @@ -63,6 +64,10 @@ const ChangePassword = ({
resolver: yupResolver(schema)
})

const handleClose = (): void => {
setOpenChangePasswordModal(false)
}

const { notify } = useContext(NotificationContext)

const onSubmit = async (data: ChangePasswordForm): Promise<void> => {
Expand Down Expand Up @@ -239,9 +244,17 @@ const ChangePassword = ({
)
}}
/>
<Button type='submit' variant='contained' sx={buttonPrimaryStyle}>
Submit
</Button>
<FlexBox marginTop='20px'>
<Button type='submit' variant='contained' sx={buttonPrimaryStyle}>
Submit
</Button>
<Button
variant='outlined'
color='secondary'
onClick={handleClose}>
Cancel
</Button>
</FlexBox>
</form>
</Box>
</Modal>
Expand Down
4 changes: 3 additions & 1 deletion src/resources/users/UserShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const EditPassword = ({ handleClose, audit }: Props): React.ReactElement => {
p: 4
}}>
<Typography>
<b>Edit User Password</b>
<b>Provide Temporary Password</b>
</Typography>
<Typography>
The password should include these items:
Expand All @@ -214,6 +214,8 @@ const EditPassword = ({ handleClose, audit }: Props): React.ReactElement => {
<li>At least one digit</li>
<li>At least one special character</li>
</ul>
The temporary password will be valid for one hour. If not updated in
that time a new one must be provided.
</Typography>
<SimpleForm toolbar={false}>
<TextInput
Expand Down

0 comments on commit fc52533

Please sign in to comment.