@movalib/movalib-commons 1.1.5 → 1.1.7

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.
package/PV_README.md CHANGED
@@ -21,7 +21,3 @@ Pour lier la librairie aux projets qui l'utilise, executer la commande suivnte
21
21
  Les commandes exécutées (ci-dessous) permettent de contourner un problème de double référence vers react et react-dom lorsque les deux appli utilisent des Hook
22
22
 
23
23
  "link": "npm link --only=production && npm link \"/home/dimitri/Projets/5 - MOVALIB/02 - Développement/Front-End/movalib-user-app/node_modules/react\" && npm link \"/home/dimitri/Projets/5 - MOVALIB/02 - Développement/Front-End/movalib-user-app/node_modules/react-dom\"",
24
-
25
-
26
- gsutil setmeta -h "Cache-Control:no-cache, must-revalidate" gs://app.movalib.com/*
27
- gsutil setmeta -h "Cache-Control:no-cache, must-revalidate" gs://pro.movalib.com/*
@@ -44,7 +44,9 @@ var AccountValidation = function (_a) {
44
44
  (0, react_1.useEffect)(function () {
45
45
  var params = new URLSearchParams(location.search);
46
46
  var token = params.get('token');
47
- // Si cette variable est transmise, ecla signifie que le compte a été créé sans mot de passe
47
+ // Si cette variable est transmise, cela signifie que le compte a été créé sans mot de passe
48
+ Logger_1.default.info(params);
49
+ Logger_1.default.info(Boolean(params.get('emptyPwd')));
48
50
  var localEmptyPwd = Boolean(params.get('emptyPwd'));
49
51
  setEmptyPwd(localEmptyPwd);
50
52
  if (token) {
@@ -116,13 +118,13 @@ var AccountValidation = function (_a) {
116
118
  return {
117
119
  color: (0, material_1.darken)(theme.palette.secondary.main, 0.4),
118
120
  fontFamily: 'Dancing Script, cursive',
119
- fontSize: 40
121
+ fontSize: 30
120
122
  };
121
123
  };
122
124
  return ((0, jsx_runtime_1.jsxs)("div", { children: [emptyPwd &&
123
125
  (0, jsx_runtime_1.jsx)(MovaDialog_1.default, __assign({ leafImageColor: 'pink', title: movaAppType === Enums_1.MovaAppType.GARAGE ? "Bienvenue sur Movalib PRO !" : "Bienvenue sur Movalib !", titleStyle: getTitleStyle(), fullScreen: isMobile, open: emptyPwd, closable: false, onClose: function () {
124
126
  throw new Error('Function not implemented.');
125
- }, actions: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, __assign({ type: "submit", onClick: handleValidateAccount, fullWidth: true, variant: "contained", sx: { mt: 4, mb: 0 } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "Valider mon compte" }) })) }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ sx: { mt: 2, mb: 2 } }, { children: movaAppType === Enums_1.MovaAppType.GARAGE ?
127
+ }, actions: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, __assign({ type: "submit", onClick: handleValidateAccount, fullWidth: true, variant: "contained", sx: { mt: 4, mb: 0 } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "Activer mon compte" }) })) }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ sx: { mt: 2, mb: 2 } }, { children: movaAppType === Enums_1.MovaAppType.INDIVIDUAL ?
126
128
  "Pour commencer, définis ton mot de passe et active ton compte 😉"
127
129
  :
128
130
  "Pour commencer, définissez votre mot de passe et activez votre compte 😉" })) })), (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: "password", label: "Mot de passe", type: showPassword ? 'text' : 'password', id: "password", autoComplete: "current-password", onChange: function (e) { return handleInputChange(e); }, value: passwordForm.password.value, error: !passwordForm.password.isValid, helperText: Boolean(passwordForm.password.error) ? passwordForm.password.error : "10 caractères minimum, 1 majuscule, 1 minuscule", InputProps: {
@@ -102,7 +102,9 @@ var ScheduleFields = function (_a) {
102
102
  newSchedule[dayIndex].checked = event.target.checked;
103
103
  // On réinitialise aussi les intervals
104
104
  newSchedule[dayIndex].intervals = [{ startTime: null, endTime: null, countryCode: 'fr', error: null }];
105
- onChange(newSchedule);
105
+ // L'activation ne doit pas déclencher le onChange
106
+ if (!event.target.checked)
107
+ onChange(newSchedule);
106
108
  setSchedule(newSchedule);
107
109
  }; };
108
110
  var handleAllDayChecked = function (e, value, dayIndex) { return function (event) {
@@ -124,7 +126,6 @@ var ScheduleFields = function (_a) {
124
126
  var sortedIntervals = __spreadArray([], intervals, true).sort(function (a, b) {
125
127
  return a.startTime && b.startTime ? a.startTime.toISOString().localeCompare(b.startTime.toISOString()) : 0;
126
128
  });
127
- console.log(sortedIntervals);
128
129
  for (var i = 0; i < sortedIntervals.length; i++) {
129
130
  if (((_a = sortedIntervals[i].startTime) === null || _a === void 0 ? void 0 : _a.toString().localeCompare((_b = sortedIntervals[i].endTime) === null || _b === void 0 ? void 0 : _b.toString())) >= 0 ||
130
131
  (i < sortedIntervals.length - 1 &&
@@ -146,7 +147,9 @@ var ScheduleFields = function (_a) {
146
147
  newSchedule[dayIndex].intervals[intervalIndex].error = validateIntervals(newSchedule[dayIndex].intervals);
147
148
  }
148
149
  setSchedule(newSchedule);
149
- onChange(newSchedule);
150
+ // On invoque la callback de mise à jour uniquement sur l'intervalle de fin
151
+ if (type === 'endTime')
152
+ onChange(newSchedule);
150
153
  };
151
154
  };
152
155
  var addInterval = function (dayIndex) { return function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
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",
@@ -38,7 +38,9 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
38
38
  const params = new URLSearchParams(location.search);
39
39
  const token = params.get('token');
40
40
 
41
- // Si cette variable est transmise, ecla signifie que le compte a été créé sans mot de passe
41
+ // Si cette variable est transmise, cela signifie que le compte a été créé sans mot de passe
42
+ Logger.info(params);
43
+ Logger.info(Boolean(params.get('emptyPwd')));
42
44
  let localEmptyPwd = Boolean(params.get('emptyPwd'));
43
45
  setEmptyPwd(localEmptyPwd);
44
46
 
@@ -133,7 +135,7 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
133
135
  return {
134
136
  color:darken(theme.palette.secondary.main, 0.4),
135
137
  fontFamily: 'Dancing Script, cursive',
136
- fontSize: 40
138
+ fontSize: 30
137
139
  }
138
140
  }
139
141
 
@@ -157,13 +159,13 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
157
159
  fullWidth
158
160
  variant="contained"
159
161
  sx={{ mt: 4, mb: 0 }}>
160
- <span>Valider mon compte</span>
162
+ <span>Activer mon compte</span>
161
163
  </LoadingButton>
162
164
  }>
163
165
  <Grid container>
164
166
  <Grid item xs={12}>
165
167
  <Typography sx={{ mt: 2, mb: 2 }}>
166
- {movaAppType === MovaAppType.GARAGE ?
168
+ {movaAppType === MovaAppType.INDIVIDUAL ?
167
169
  "Pour commencer, définis ton mot de passe et active ton compte 😉"
168
170
  :
169
171
  "Pour commencer, définissez votre mot de passe et activez votre compte 😉"
@@ -116,7 +116,10 @@ const ScheduleFields: FunctionComponent<ScheduleFieldsProps> = ({ timePickerStep
116
116
  newSchedule[dayIndex].checked = event.target.checked;
117
117
  // On réinitialise aussi les intervals
118
118
  newSchedule[dayIndex].intervals = [{startTime: null, endTime: null, countryCode: 'fr', error: null}];
119
- onChange(newSchedule);
119
+ // L'activation ne doit pas déclencher le onChange
120
+ if(!event.target.checked)
121
+ onChange(newSchedule);
122
+
120
123
  setSchedule(newSchedule);
121
124
  };
122
125
 
@@ -142,7 +145,6 @@ const ScheduleFields: FunctionComponent<ScheduleFieldsProps> = ({ timePickerStep
142
145
  const sortedIntervals = [...intervals].sort((a, b) =>
143
146
  a.startTime && b.startTime ? a.startTime.toISOString().localeCompare(b.startTime.toISOString()) : 0);
144
147
 
145
- console.log(sortedIntervals)
146
148
  for (let i = 0; i < sortedIntervals.length; i++) {
147
149
  if (
148
150
  sortedIntervals[i].startTime?.toString().localeCompare(sortedIntervals[i].endTime?.toString()!)! >= 0 ||
@@ -177,7 +179,10 @@ const ScheduleFields: FunctionComponent<ScheduleFieldsProps> = ({ timePickerStep
177
179
  }
178
180
 
179
181
  setSchedule(newSchedule);
180
- onChange(newSchedule);
182
+
183
+ // On invoque la callback de mise à jour uniquement sur l'intervalle de fin
184
+ if(type === 'endTime')
185
+ onChange(newSchedule);
181
186
  };
182
187
 
183
188
  const addInterval = (dayIndex: number) => () => {