@movalib/movalib-commons 1.59.23 → 1.59.24
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.
|
@@ -39,9 +39,7 @@ var initialFormState = {
|
|
|
39
39
|
acceptsTerms: { value: false, isValid: true },
|
|
40
40
|
};
|
|
41
41
|
// ATTENTION : s'assurer de la présence des documents suivants à la racine du composant porteur (dossier 'public')
|
|
42
|
-
var CGUPath = "/
|
|
43
|
-
var proCGUPath = "/Movalib_Pro_CGU.pdf";
|
|
44
|
-
var proCGVPath = "/Movalib_Pro_CGV.pdf";
|
|
42
|
+
var CGUPath = "/documents/CGU.pdf";
|
|
45
43
|
var AccountValidation = function (_a) {
|
|
46
44
|
var _b, _c, _d, _e;
|
|
47
45
|
var movaAppType = _a.movaAppType, smsValidation = _a.smsValidation, resetPassword = _a.resetPassword, onSubmit = _a.onSubmit, onResendSecurityCode = _a.onResendSecurityCode;
|
|
@@ -180,8 +178,8 @@ var AccountValidation = function (_a) {
|
|
|
180
178
|
if (smsValidation)
|
|
181
179
|
newForm.securityCode = (0, Tools_1.validateField)(validationForm.securityCode, function (value) { return value.length === 6; }, "Le code doit contenir 6 chiffres");
|
|
182
180
|
// Validator pour les CGU
|
|
183
|
-
if (!resetPassword) {
|
|
184
|
-
newForm.acceptsTerms = (0, Tools_1.validateField)(validationForm.acceptsTerms, function (value) { return Boolean(value); },
|
|
181
|
+
if (!resetPassword && movaAppType !== Enums_1.MovaAppType.GARAGE) {
|
|
182
|
+
newForm.acceptsTerms = (0, Tools_1.validateField)(validationForm.acceptsTerms, function (value) { return Boolean(value); }, 'Vous devez accepter les termes de nos CGU');
|
|
185
183
|
}
|
|
186
184
|
setValidationForm(newForm);
|
|
187
185
|
return newForm.password.isValid && newForm.confirmation.isValid && (smsValidation ? newForm.securityCode.isValid : true) &&
|
|
@@ -274,9 +272,8 @@ var AccountValidation = function (_a) {
|
|
|
274
272
|
endAdornment: ((0, jsx_runtime_1.jsx)(InputAdornment_1.default, __assign({ position: "end" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ edge: "end", onClick: function (e) { return setShowPassword(function (prev) { return !prev; }); } }, { children: showPassword ? (0, jsx_runtime_1.jsx)(VisibilityOff_1.default, {}) : (0, jsx_runtime_1.jsx)(Visibility_1.default, {}) })) }))),
|
|
275
273
|
} }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", required: true, fullWidth: true, name: "confirmation", label: "Confirmation mot de passe", type: showPassword ? 'text' : 'password', id: "confirmation", onChange: function (e) { return handleInputChange(e); }, value: validationForm.confirmation.value, error: !validationForm.confirmation.isValid, helperText: Boolean(validationForm.confirmation.error) ? validationForm.confirmation.error : "", InputProps: {
|
|
276
274
|
endAdornment: ((0, jsx_runtime_1.jsx)(InputAdornment_1.default, __assign({ position: "end" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ edge: "end", onClick: function (e) { return setShowPassword(function (prev) { return !prev; }); } }, { children: showPassword ? (0, jsx_runtime_1.jsx)(VisibilityOff_1.default, {}) : (0, jsx_runtime_1.jsx)(Visibility_1.default, {}) })) }))),
|
|
277
|
-
} }) })), !resetPassword &&
|
|
278
|
-
(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 2, display: 'flex', justifyContent: 'start' } }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, __assign({ error: !validationForm.acceptsTerms.isValid }, { children: [(0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { name: "acceptsTerms", color: "primary", checked: validationForm.acceptsTerms.value, onChange: function (e, checked) { return handleCheckboxChange(e, checked); }, sx: { pr: 2 } }), label: (0, jsx_runtime_1.jsxs)("span", { children: ["J'accepte
|
|
279
|
-
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u00A0", (0, jsx_runtime_1.jsx)("br", {}), "et les ", ' ', (0, jsx_runtime_1.jsx)("a", __assign({ href: proCGVPath, target: "_blank", style: { color: theme.palette.primary.main } }, { children: "Conditions G\u00E9n\u00E9rales de Vente" }))] })] }) }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: validationForm.acceptsTerms.error })] })) }))] })) })), loading &&
|
|
275
|
+
} }) })), !resetPassword && movaAppType !== Enums_1.MovaAppType.GARAGE &&
|
|
276
|
+
(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 2, display: 'flex', justifyContent: 'start' } }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, __assign({ error: !validationForm.acceptsTerms.isValid }, { children: [(0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { name: "acceptsTerms", color: "primary", checked: validationForm.acceptsTerms.value, onChange: function (e, checked) { return handleCheckboxChange(e, checked); }, sx: { pr: 2 } }), label: (0, jsx_runtime_1.jsxs)("span", { children: ["J'accepte les", ' ', (0, jsx_runtime_1.jsx)("a", __assign({ href: CGUPath, target: "_blank", style: { color: theme.palette.primary.main } }, { children: "Conditions G\u00E9n\u00E9rales d'Utilisation" }))] }) }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: validationForm.acceptsTerms.error })] })) }))] })) })), loading &&
|
|
280
277
|
(0, jsx_runtime_1.jsx)(material_1.Box, __assign({ display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh" }, { children: (0, jsx_runtime_1.jsx)(material_1.CircularProgress, {}) })), openPhoneNumberInput && (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openPhoneNumberInput, confirmLabel: "Envoyer", closeLabel: "Annuler", onClose: function () { return setOpenPhoneNumberInput(false); }, onConfirm: resendCode, message: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { children: [(0, jsx_runtime_1.jsx)("b", { children: "Indiquez nous votre num\u00E9ro de t\u00E9l\u00E9phone" }), (0, jsx_runtime_1.jsx)("br", {})] }), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { margin: "normal", fullWidth: true, required: true, id: "phoneNumber", label: "N\u00B0 de t\u00E9l\u00E9phone", name: "phoneNumber", autoComplete: "tel", onChange: function (e) { return handleInputChange(e); }, value: validationForm.phoneNumber.value, error: Boolean(validationForm.phoneNumber.error), helperText: validationForm.phoneNumber.error }) }))] }) })] }));
|
|
281
278
|
};
|
|
282
279
|
exports.default = AccountValidation;
|
package/dist/src/MovaSignUp.js
CHANGED
|
@@ -71,7 +71,7 @@ var VisibilityOff_1 = __importDefault(require("@mui/icons-material/VisibilityOff
|
|
|
71
71
|
var Info_1 = __importDefault(require("@mui/icons-material/Info"));
|
|
72
72
|
var UserService_1 = __importDefault(require("./services/UserService"));
|
|
73
73
|
// ATTENTION : s'assurer de la présence des documents suivants à la racine du composant porteur (dossier 'public')
|
|
74
|
-
var CGUPath = "/
|
|
74
|
+
var CGUPath = "/documents/CGU.pdf";
|
|
75
75
|
// Permet de centrer le contenu de l'application
|
|
76
76
|
var styles = {
|
|
77
77
|
display: 'flex',
|
package/package.json
CHANGED
|
@@ -33,9 +33,8 @@ interface AccountValidationProps {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// ATTENTION : s'assurer de la présence des documents suivants à la racine du composant porteur (dossier 'public')
|
|
36
|
-
const CGUPath:string = "/
|
|
37
|
-
|
|
38
|
-
const proCGVPath:string = "/Movalib_Pro_CGV.pdf";
|
|
36
|
+
const CGUPath:string = "/documents/CGU.pdf";
|
|
37
|
+
|
|
39
38
|
|
|
40
39
|
const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppType, smsValidation, resetPassword, onSubmit, onResendSecurityCode }) => {
|
|
41
40
|
|
|
@@ -204,9 +203,8 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
204
203
|
newForm.securityCode = validateField(validationForm.securityCode, value => value.length === 6, "Le code doit contenir 6 chiffres");
|
|
205
204
|
|
|
206
205
|
// Validator pour les CGU
|
|
207
|
-
if(!resetPassword){
|
|
208
|
-
newForm.acceptsTerms = validateField(validationForm.acceptsTerms, value => Boolean(value),
|
|
209
|
-
movaAppType == MovaAppType.GARAGE ? 'Vous devez accepter les termes de nos CGU et de nos CGV' : 'Vous devez accepter les termes de nos CGU');
|
|
206
|
+
if(!resetPassword && movaAppType !== MovaAppType.GARAGE){
|
|
207
|
+
newForm.acceptsTerms = validateField(validationForm.acceptsTerms, value => Boolean(value),'Vous devez accepter les termes de nos CGU');
|
|
210
208
|
}
|
|
211
209
|
|
|
212
210
|
setValidationForm(newForm);
|
|
@@ -430,7 +428,7 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
430
428
|
}}
|
|
431
429
|
/>
|
|
432
430
|
</Grid>
|
|
433
|
-
{!resetPassword &&
|
|
431
|
+
{!resetPassword && movaAppType !== MovaAppType.GARAGE &&
|
|
434
432
|
<Grid item xs={12} sx={{mt: 2, display:'flex', justifyContent:'start'}} >
|
|
435
433
|
<FormControl error={!validationForm.acceptsTerms.isValid} >
|
|
436
434
|
<FormControlLabel
|
|
@@ -445,19 +443,12 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
445
443
|
}
|
|
446
444
|
label={
|
|
447
445
|
<span>
|
|
448
|
-
J'accepte
|
|
449
|
-
<a href={
|
|
446
|
+
J'accepte les{' '}
|
|
447
|
+
<a href={ CGUPath} target="_blank"
|
|
450
448
|
style={{ color:theme.palette.primary.main}}>
|
|
451
449
|
Conditions Générales d'Utilisation
|
|
452
450
|
</a>
|
|
453
|
-
|
|
454
|
-
<>
|
|
455
|
-
<br />et les {' '}
|
|
456
|
-
<a href={proCGVPath} target="_blank" style={{ color:theme.palette.primary.main}}>
|
|
457
|
-
Conditions Générales de Vente
|
|
458
|
-
</a>
|
|
459
|
-
</>
|
|
460
|
-
}
|
|
451
|
+
|
|
461
452
|
</span>
|
|
462
453
|
}
|
|
463
454
|
/>
|
package/src/MovaSignUp.tsx
CHANGED
|
@@ -26,7 +26,7 @@ import User from "./models/User";
|
|
|
26
26
|
import UserService from "./services/UserService";
|
|
27
27
|
|
|
28
28
|
// ATTENTION : s'assurer de la présence des documents suivants à la racine du composant porteur (dossier 'public')
|
|
29
|
-
const CGUPath:string = "/
|
|
29
|
+
const CGUPath:string = "/documents/CGU.pdf";
|
|
30
30
|
|
|
31
31
|
// Permet de centrer le contenu de l'application
|
|
32
32
|
const styles: CSSProperties = {
|