| | |
| | | import { |
| | | useTranslate, |
| | | useNotify, |
| | | useRefresh, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | const { open, setOpen } = props; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const { |
| | | control, |
| | | handleSubmit, |
| | |
| | | notify(msg, { type: 'success', messageArgs: { _: msg } }); |
| | | setOpen(false); |
| | | reset(); |
| | | refresh(); |
| | | } else { |
| | | notify(msg, { type: 'error', messageArgs: { _: msg } }); |
| | | } |
| | |
| | | message: translate('ra.validation.required'), |
| | | }, |
| | | pattern: { |
| | | value: /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,13}$/, |
| | | value: /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d\.]{6,13}$/, |
| | | message: translate('page.settings.resetPwd.tip.pwdInputLimit'), |
| | | }, |
| | | }} |