@movalib/movalib-commons 1.1.78 → 1.1.80

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.
@@ -161,7 +161,7 @@ var MovaLogin = function (_a) {
161
161
  setOpenForgotPassword(false);
162
162
  // On appel de callback de soumission de la demande de réinitialisation du mot de passe
163
163
  if (onSubmitForgotPassword) {
164
- onSubmitForgotPassword(form.email.value);
164
+ onSubmitForgotPassword(movaAppType === Enums_1.MovaAppType.GARAGE ? form.email.value : form.phoneNumberEmail.value);
165
165
  }
166
166
  };
167
167
  var handleClickShowPassword = function () {
@@ -172,7 +172,11 @@ var MovaLogin = function (_a) {
172
172
  */
173
173
  var dialogForgotPassword = function () {
174
174
  var defaultMessage = "Êtes-vous sûr de vouloir continuer ?";
175
- return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, __assign({ open: openForgotPassword, onClose: function () { return setOpenForgotPassword(false); }, "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: "Saisissez votre email pour proc\u00E9der \u00E0 la r\u00E9initialisation de votre mot de passe." })), (0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", autoFocus: true, required: true, fullWidth: true, id: "email", label: "Adresse email", name: "email", autoComplete: "email", onChange: function (e) { return handleInputChange(e); }, value: form.email.value, error: !form.email.isValid, helperText: form.email.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: !(form.email.value && (0, Validator_1.validateEmail)(form.email.value)), sx: { ml: 1 } }, { children: "Envoyer ma demande" })) })] })));
175
+ return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, __assign({ open: openForgotPassword, onClose: function () { return setOpenForgotPassword(false); }, "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 ?
176
+ "Saisissez votre email pour procéder à la réinitialisation de votre mot de passe."
177
+ :
178
+ "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: "email", label: movaAppType === Enums_1.MovaAppType.GARAGE ? "Adresse email" : "N° de téléphone ou adresse email", name: "email", 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))
179
+ : !(form.phoneNumberEmail.value), sx: { ml: 1 } }, { children: "Envoyer ma demande" })) })] })));
176
180
  };
177
181
  return ((0, jsx_runtime_1.jsxs)("div", __assign({ style: styles }, { children: [(0, jsx_runtime_1.jsx)("img", { src: leaf_green_large_png_1.default, style: { position: 'fixed',
178
182
  float: 'left',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.1.78",
3
+ "version": "1.1.80",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/MovaLogin.tsx CHANGED
@@ -147,7 +147,7 @@ const MovaLogin: FunctionComponent<MovaLoginProps> = ({ loading, movaAppType, on
147
147
  setOpenForgotPassword(false);
148
148
  // On appel de callback de soumission de la demande de réinitialisation du mot de passe
149
149
  if(onSubmitForgotPassword){
150
- onSubmitForgotPassword(form.email.value);
150
+ onSubmitForgotPassword(movaAppType === MovaAppType.GARAGE ? form.email.value : form.phoneNumberEmail.value);
151
151
  }
152
152
  }
153
153
 
@@ -171,7 +171,11 @@ const MovaLogin: FunctionComponent<MovaLoginProps> = ({ loading, movaAppType, on
171
171
  <DialogTitle id="forgot-password-title">Récupération du mot de passe</DialogTitle>
172
172
  <DialogContent>
173
173
  <DialogContentText id="forgot-password-dialog-description" sx={{ mb: 2 }}>
174
- Saisissez votre email pour procéder à la réinitialisation de votre mot de passe.
174
+ {movaAppType === MovaAppType.GARAGE ?
175
+ "Saisissez votre email pour procéder à la réinitialisation de votre mot de passe."
176
+ :
177
+ "Saisissez votre n° de téléphone ou votre email pour procéder à la réinitialisation de votre mot de passe."
178
+ }
175
179
  </DialogContentText>
176
180
  <TextField
177
181
  margin="normal"
@@ -179,21 +183,21 @@ const MovaLogin: FunctionComponent<MovaLoginProps> = ({ loading, movaAppType, on
179
183
  required
180
184
  fullWidth
181
185
  id="email"
182
- label="Adresse email"
186
+ label={movaAppType === MovaAppType.GARAGE ? "Adresse email" : "N° de téléphone ou adresse email"}
183
187
  name="email"
184
188
  autoComplete="email"
185
189
  onChange={e => handleInputChange(e)}
186
- value={form.email.value}
187
- error={!form.email.isValid}
188
- helperText={form.email.error}
190
+ value={movaAppType === MovaAppType.GARAGE ? form.email.value : form.phoneNumberEmail.value}
191
+ error={movaAppType === MovaAppType.GARAGE ? !form.email.isValid : !form.phoneNumberEmail.isValid}
192
+ helperText={movaAppType === MovaAppType.GARAGE ? form.email.error : form.phoneNumberEmail.error}
189
193
  />
190
194
  </DialogContent>
191
195
  <DialogActions>
192
196
  <Button onClick={(e) => handleSubmitForgotPassword(e)}
193
197
  color="primary"
194
- disabled={!(form.email.value && validateEmail(form.email.value))}
198
+ disabled={movaAppType === MovaAppType.GARAGE ? !(form.email.value && validateEmail(form.email.value))
199
+ : !(form.phoneNumberEmail.value)}
195
200
  sx={{ ml: 1}}>
196
-
197
201
  Envoyer ma demande
198
202
  </Button>
199
203
  </DialogActions>