@movalib/movalib-commons 1.2.18 → 1.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,6 +5,7 @@ declare const DialogForgotPassword: React.FC<{
|
|
|
5
5
|
setOpenForgotPassword: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
6
|
movaAppType: MovaAppType;
|
|
7
7
|
form: any;
|
|
8
|
+
onClose?: () => void;
|
|
8
9
|
handleInputChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
9
10
|
handleSubmitForgotPassword: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
10
11
|
}>;
|
|
@@ -17,9 +17,14 @@ var material_1 = require("@mui/material");
|
|
|
17
17
|
var Enums_1 = require("./helpers/Enums");
|
|
18
18
|
var Validator_1 = require("./helpers/Validator");
|
|
19
19
|
var DialogForgotPassword = function (_a) {
|
|
20
|
-
var openForgotPassword = _a.openForgotPassword, setOpenForgotPassword = _a.setOpenForgotPassword, movaAppType = _a.movaAppType, form = _a.form, handleInputChange = _a.handleInputChange, handleSubmitForgotPassword = _a.handleSubmitForgotPassword;
|
|
20
|
+
var openForgotPassword = _a.openForgotPassword, setOpenForgotPassword = _a.setOpenForgotPassword, movaAppType = _a.movaAppType, form = _a.form, handleInputChange = _a.handleInputChange, handleSubmitForgotPassword = _a.handleSubmitForgotPassword, onClose = _a.onClose;
|
|
21
21
|
var defaultMessage = (0, react_1.useState)("Êtes-vous sûr de vouloir continuer ?")[0];
|
|
22
|
-
|
|
22
|
+
var handleOnClose = function () {
|
|
23
|
+
setOpenForgotPassword(false);
|
|
24
|
+
if (onClose)
|
|
25
|
+
onClose();
|
|
26
|
+
};
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, __assign({ open: openForgotPassword, onClose: handleOnClose, "aria-labelledby": "forgot-password-dialog-title", "aria-describedby": "forgot-password-dialog-description" }, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, __assign({ id: "forgot-password-title" }, { children: "R\u00E9cup\u00E9ration du mot de passe" })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogContentText, __assign({ id: "forgot-password-dialog-description", sx: { mb: 2 } }, { children: movaAppType === Enums_1.MovaAppType.GARAGE ?
|
|
23
28
|
"Saisissez votre email pour procéder à la réinitialisation de votre mot de passe."
|
|
24
29
|
:
|
|
25
30
|
"Saisissez votre n° de téléphone ou votre email pour procéder à la réinitialisation de votre mot de passe." })), (0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", autoFocus: true, required: true, fullWidth: true, id: movaAppType === Enums_1.MovaAppType.GARAGE ? "email" : "phoneNumberEmail", label: movaAppType === Enums_1.MovaAppType.GARAGE ? "Adresse email" : "N° de téléphone ou adresse email", name: movaAppType === Enums_1.MovaAppType.GARAGE ? "email" : "phoneNumberEmail", autoComplete: "email", onChange: function (e) { return handleInputChange(e); }, value: movaAppType === Enums_1.MovaAppType.GARAGE ? form.email.value : form.phoneNumberEmail.value, error: movaAppType === Enums_1.MovaAppType.GARAGE ? !form.email.isValid : !form.phoneNumberEmail.isValid, helperText: movaAppType === Enums_1.MovaAppType.GARAGE ? form.email.error : form.phoneNumberEmail.error })] }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ onClick: function (e) { return handleSubmitForgotPassword(e); }, color: "primary", disabled: movaAppType === Enums_1.MovaAppType.GARAGE ? !(form.email.value && (0, Validator_1.validateEmail)(form.email.value))
|
|
@@ -16,6 +16,8 @@ export default class User {
|
|
|
16
16
|
addresses?: Address[];
|
|
17
17
|
phoneNumber?: string;
|
|
18
18
|
vehicles?: Vehicle[];
|
|
19
|
+
isActive?: Boolean;
|
|
20
|
+
hasPassword?: Boolean;
|
|
19
21
|
constructor(id: string, roles: Role[], firstname?: string, lastname?: string, avatar?: string, password?: string, created?: Date, email?: string, gender?: Gender, birthDate?: Date, addresses?: Address[], phoneNumber?: string, vehicles?: Vehicle[]);
|
|
20
22
|
static getFirstLetter: (user: User) => string;
|
|
21
23
|
static isGarageCustomer: (user: User) => boolean;
|
package/package.json
CHANGED
|
@@ -8,16 +8,23 @@ const DialogForgotPassword: React.FC<{
|
|
|
8
8
|
setOpenForgotPassword: React.Dispatch<React.SetStateAction<boolean>>; // Ajout de setOpenForgotPassword
|
|
9
9
|
movaAppType: MovaAppType;
|
|
10
10
|
form: any;
|
|
11
|
+
onClose?: () => void;
|
|
11
12
|
handleInputChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
12
13
|
handleSubmitForgotPassword: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
-
}> = ({ openForgotPassword, setOpenForgotPassword, movaAppType, form, handleInputChange, handleSubmitForgotPassword }) => {
|
|
14
|
+
}> = ({ openForgotPassword, setOpenForgotPassword, movaAppType, form, handleInputChange, handleSubmitForgotPassword, onClose }) => {
|
|
14
15
|
|
|
15
16
|
const [defaultMessage] = useState("Êtes-vous sûr de vouloir continuer ?");
|
|
16
17
|
|
|
18
|
+
const handleOnClose = () => {
|
|
19
|
+
setOpenForgotPassword(false)
|
|
20
|
+
if(onClose)
|
|
21
|
+
onClose();
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
return (
|
|
18
25
|
<Dialog
|
|
19
26
|
open={openForgotPassword}
|
|
20
|
-
onClose={
|
|
27
|
+
onClose={handleOnClose}
|
|
21
28
|
aria-labelledby="forgot-password-dialog-title"
|
|
22
29
|
aria-describedby="forgot-password-dialog-description"
|
|
23
30
|
>
|