@movalib/movalib-commons 1.68.6 → 1.68.8

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.
@@ -23,7 +23,6 @@ var Logger_1 = __importDefault(require("./helpers/Logger"));
23
23
  var InputAdornment_1 = __importDefault(require("@mui/material/InputAdornment"));
24
24
  var Visibility_1 = __importDefault(require("@mui/icons-material/Visibility"));
25
25
  var VisibilityOff_1 = __importDefault(require("@mui/icons-material/VisibilityOff"));
26
- var lab_1 = require("@mui/lab");
27
26
  var Enums_1 = require("./helpers/Enums");
28
27
  var Tools_1 = require("./helpers/Tools");
29
28
  var MovaDialog_1 = __importDefault(require("./MovaDialog"));
@@ -260,7 +259,7 @@ var AccountValidation = function (_a) {
260
259
  return ((0, jsx_runtime_1.jsxs)("div", { children: [(emptyPwd || smsValidation || resetPassword || true) &&
261
260
  (0, jsx_runtime_1.jsx)(MovaDialog_1.default, __assign({ leafImageColor: 'pink', titleStyle: getTitleStyle(), fullScreen: isMobile, open: emptyPwd || smsValidation || resetPassword || true, closable: false, onClose: function () {
262
261
  throw new Error('Function not implemented.');
263
- }, actions: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, __assign({ loading: loadingBtn, type: "submit", onClick: handleValidateAccount, fullWidth: true, variant: "contained", sx: { mt: 4, mb: 0 } }, { children: resetPassword ? (0, jsx_runtime_1.jsx)("span", { children: "R\u00E9initialiser mon mot de passe" }) : (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.jsxs)(material_1.Box, __assign({ sx: {
262
+ }, actions: (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ loading: loadingBtn, type: "submit", onClick: handleValidateAccount, fullWidth: true, variant: "contained", sx: { mt: 4, mb: 0 } }, { children: resetPassword ? (0, jsx_runtime_1.jsx)("span", { children: "R\u00E9initialiser mon mot de passe" }) : (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.jsxs)(material_1.Box, __assign({ sx: {
264
263
  display: 'flex',
265
264
  flexDirection: 'column',
266
265
  alignItems: 'center',
@@ -52,7 +52,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  var jsx_runtime_1 = require("react/jsx-runtime");
54
54
  var react_1 = require("react");
55
- var lab_1 = require("@mui/lab");
56
55
  var logo_large_border_png_1 = __importDefault(require("./assets/images/logo/logo_large_border.png"));
57
56
  var logo_pro_large_border_png_1 = __importDefault(require("./assets/images/logo/logo_pro_large_border.png"));
58
57
  var logo_admin_large_png_1 = __importDefault(require("./assets/images/logo/logo_admin_large.png"));
@@ -262,7 +261,7 @@ var MovaLogin = function (_a) {
262
261
  '& .MuiOutlinedInput-notchedOutline': {
263
262
  borderColor: darkMode ? 'white' : 'default', // Couleur de la bordure
264
263
  }
265
- } }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { value: "remember", color: "primary" }), label: "Se souvenir de moi" }), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, __assign({ loading: loading, type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2, backgroundColor: darkMode ? theme.palette.primary.dark : theme.palette.primary.main } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "Se connecter" }) })), movaAppType === Enums_1.MovaAppType.INDIVIDUAL && (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ fullWidth: true, variant: "outlined", onClick: function (e) { return handleOnClickSignUp(); }, sx: { mb: 2, color: theme.palette.primary.dark } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "CR\u00C9ER MON COMPTE" }) })), alertMessage && alertSeverity && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: alertSeverity, sx: { mb: 2 } }, { children: alertMessage })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ variant: "body2", color: "text.secondary", onClick: function (e) { return handleOnClickForgotPassword(); }, sx: { cursor: 'pointer' } }, { children: "Mot de passe oubli\u00E9 ?" })) })) }))] })), (0, jsx_runtime_1.jsx)(MovaCopyright_1.default, { sx: { mt: 8, mb: 1 } }), version && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'body2', color: theme.palette.grey[200], sx: { textAlign: 'center' } }, { children: version })), openForgotPassword &&
264
+ } }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { value: "remember", color: "primary" }), label: "Se souvenir de moi" }), (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ loading: loading, type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2, backgroundColor: darkMode ? theme.palette.primary.dark : theme.palette.primary.main } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "Se connecter" }) })), movaAppType === Enums_1.MovaAppType.INDIVIDUAL && (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ fullWidth: true, variant: "outlined", onClick: function (e) { return handleOnClickSignUp(); }, sx: { mb: 2, color: theme.palette.primary.dark } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "CR\u00C9ER MON COMPTE" }) })), alertMessage && alertSeverity && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: alertSeverity, sx: { mb: 2 } }, { children: alertMessage })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ variant: "body2", color: "text.secondary", onClick: function (e) { return handleOnClickForgotPassword(); }, sx: { cursor: 'pointer' } }, { children: "Mot de passe oubli\u00E9 ?" })) })) }))] })), (0, jsx_runtime_1.jsx)(MovaCopyright_1.default, { sx: { mt: 8, mb: 1 } }), version && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'body2', color: theme.palette.grey[200], sx: { textAlign: 'center' } }, { children: version })), openForgotPassword &&
266
265
  (0, jsx_runtime_1.jsx)(DialogForgotPassword_1.default, { openForgotPassword: openForgotPassword, setOpenForgotPassword: setOpenForgotPassword, movaAppType: movaAppType, form: form, handleInputChange: handleInputChange, handleSubmitForgotPassword: handleSubmitForgotPassword })] })), (0, jsx_runtime_1.jsx)("img", { src: leaf_pink_large_png_1.default, style: { position: 'fixed',
267
266
  float: 'right',
268
267
  width: '250px',
@@ -52,7 +52,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  var jsx_runtime_1 = require("react/jsx-runtime");
54
54
  var react_1 = require("react");
55
- var lab_1 = require("@mui/lab");
56
55
  var logo_large_border_png_1 = __importDefault(require("./assets/images/logo/logo_large_border.png"));
57
56
  var logo_pro_large_border_png_1 = __importDefault(require("./assets/images/logo/logo_pro_large_border.png"));
58
57
  var logo_large_dm_png_1 = __importDefault(require("./assets/images/logo/logo_large_dm.png"));
@@ -278,7 +277,7 @@ var MovaSignUp = function (_a) {
278
277
  '& .MuiOutlinedInput-notchedOutline': {
279
278
  borderColor: darkMode ? 'white' : 'default', // Couleur de la bordure
280
279
  }
281
- } }), (0, jsx_runtime_1.jsxs)(material_1.FormControl, __assign({ error: !userForm.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: userForm.acceptsTerms.value, onChange: function (e, checked) { return handleCheckboxChange(e, checked); } }), label: (0, jsx_runtime_1.jsxs)("span", { children: ["J'accepte les", ' ', (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ href: CGUPath, target: "_blank" }, { children: "Conditions G\u00E9n\u00E9rales d'Utilisation" }))] }) }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: userForm.acceptsTerms.error })] })), alertMessage && alertSeverity && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: alertSeverity, sx: { mb: 2 } }, { children: alertMessage })), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, __assign({ loading: loading, type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2, backgroundColor: darkMode ? theme.palette.primary.dark : theme.palette.primary.main } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "Cr\u00E9er mon compte" }) })), showLoginButton && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ variant: "body2", color: "text.secondary", onClick: function (e) { return handleOnClickLogin(e); }, sx: { cursor: 'pointer' } }, { children: "Se connecter" })) })) }))] })), showCopyright && (0, jsx_runtime_1.jsx)(MovaCopyright_1.default, { sx: { mt: 8, mb: 4 } })] })), showLeafs && (0, jsx_runtime_1.jsx)("img", { src: leaf_pink_large_png_1.default, style: { position: 'fixed',
280
+ } }), (0, jsx_runtime_1.jsxs)(material_1.FormControl, __assign({ error: !userForm.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: userForm.acceptsTerms.value, onChange: function (e, checked) { return handleCheckboxChange(e, checked); } }), label: (0, jsx_runtime_1.jsxs)("span", { children: ["J'accepte les", ' ', (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ href: CGUPath, target: "_blank" }, { children: "Conditions G\u00E9n\u00E9rales d'Utilisation" }))] }) }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: userForm.acceptsTerms.error })] })), alertMessage && alertSeverity && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: alertSeverity, sx: { mb: 2 } }, { children: alertMessage })), (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ loading: loading, type: "submit", fullWidth: true, variant: "contained", sx: { mt: 3, mb: 2, backgroundColor: darkMode ? theme.palette.primary.dark : theme.palette.primary.main } }, { children: (0, jsx_runtime_1.jsx)("span", { children: "Cr\u00E9er mon compte" }) })), showLoginButton && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ variant: "body2", color: "text.secondary", onClick: function (e) { return handleOnClickLogin(e); }, sx: { cursor: 'pointer' } }, { children: "Se connecter" })) })) }))] })), showCopyright && (0, jsx_runtime_1.jsx)(MovaCopyright_1.default, { sx: { mt: 8, mb: 4 } })] })), showLeafs && (0, jsx_runtime_1.jsx)("img", { src: leaf_pink_large_png_1.default, style: { position: 'fixed',
282
281
  float: 'right',
283
282
  width: '250px',
284
283
  height: '400px',
@@ -190,7 +190,7 @@ var ScheduleFields = function (_a) {
190
190
  onChange(newSchedule);
191
191
  setSchedule(newSchedule);
192
192
  }; };
193
- return ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true, spacing: 1, sx: { minWidth: '650px', maxWidth: '800px' } }, { children: schedule.map(function (daySchedule, dayIndex) { return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: daySchedule.checked, onChange: handleDayChecked(dayIndex) }), label: (0, Tools_1.getDayOfWeekLabel)(daySchedule.day) }) }), dayIndex + 1), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 7 }, { children: daySchedule.intervals.map(function (interval, intervalIndex) { return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, style: { paddingTop: intervalIndex > 0 ? theme_1.default.spacing(1) : 0 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { textAlign: 'center' } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.TimePicker, { views: ['hours', 'minutes'], minutesStep: timePickerStep !== null && timePickerStep !== void 0 ? timePickerStep : 30, disabled: !daySchedule.checked, value: interval.startTime, formatDensity: 'dense', closeOnSelect: false, onChange: handleIntervalChange(dayIndex, intervalIndex, 'startTime'), slotProps: {
193
+ return ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true, spacing: 1, sx: { minWidth: '650px', maxWidth: '800px' } }, { children: schedule.map(function (daySchedule, dayIndex) { return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: daySchedule.checked, onChange: handleDayChecked(dayIndex) }), label: (0, Tools_1.getDayOfWeekLabel)(daySchedule.day) }) }), dayIndex + 1), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 7 }, { children: daySchedule.intervals.map(function (interval, intervalIndex) { return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, style: { paddingTop: intervalIndex > 0 ? theme_1.default.spacing(1) : 0 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { textAlign: 'center' } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.TimePicker, { views: ['hours', 'minutes'], minutesStep: timePickerStep !== null && timePickerStep !== void 0 ? timePickerStep : 30, disabled: !daySchedule.checked, value: interval.startTime ? new Date(interval.startTime) : null, formatDensity: 'dense', closeOnSelect: false, onChange: handleIntervalChange(dayIndex, intervalIndex, 'startTime'), slotProps: {
194
194
  textField: {
195
195
  size: 'small',
196
196
  sx: {
@@ -202,7 +202,7 @@ var ScheduleFields = function (_a) {
202
202
  actionBar: {
203
203
  sx: { display: 'none' },
204
204
  },
205
- } }) }), (intervalIndex + 1) * Math.random()), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { display: 'contents' } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.TimePicker, { minutesStep: timePickerStep !== null && timePickerStep !== void 0 ? timePickerStep : 30, disabled: !(interval.startTime instanceof Date), value: interval.endTime, formatDensity: 'dense', onChange: handleIntervalChange(dayIndex, intervalIndex, 'endTime'), closeOnSelect: false, slotProps: {
205
+ } }) }), (intervalIndex + 1) * Math.random()), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { display: 'contents' } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.TimePicker, { minutesStep: timePickerStep !== null && timePickerStep !== void 0 ? timePickerStep : 30, disabled: !(interval.startTime instanceof Date), value: interval.endTime ? new Date(interval.endTime) : null, formatDensity: 'dense', onChange: handleIntervalChange(dayIndex, intervalIndex, 'endTime'), closeOnSelect: false, slotProps: {
206
206
  textField: {
207
207
  size: 'small',
208
208
  sx: {
@@ -346,16 +346,15 @@ var VehicleFullCard = function (_a) {
346
346
  "& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
347
347
  } }) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier contr\u00F4le technique :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
348
348
  ? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
349
- : "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier contrôle technique", name: "lastInspectionDate", value: form.lastInspectionDate.value
349
+ : "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier contrôle technique", name: "lastInspectionDate", value: (form.lastInspectionDate.value
350
350
  ? (0, moment_1.default)(form.lastInspectionDate.value)
351
- : null, format: "DD/MM/YYYY", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) {
352
- var _a;
353
- return handleChange("lastInspectionDate", (_a = e === null || e === void 0 ? void 0 : e.toDate()) !== null && _a !== void 0 ? _a : null);
354
- } }) })) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier entretien :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
351
+ : null), onChange: function (e) {
352
+ return handleChange("lastInspectionDate", e ? (0, moment_1.default)(e).toISOString() : "");
353
+ }, format: "DD/MM/YYYY", formatDensity: "dense", views: ["day"], displayWeekNumber: true }) })) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier entretien :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
355
354
  ? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
356
- : "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier entretien", name: "lastMaintenanceDate", value: form.lastMaintenanceDate.value
355
+ : "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier entretien", name: "lastMaintenanceDate", value: (form.lastMaintenanceDate.value
357
356
  ? (0, moment_1.default)(form.lastMaintenanceDate.value)
358
- : null, format: "DD/MM/YYYY", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) {
357
+ : null), format: "DD/MM/YYYY", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) {
359
358
  var _a;
360
359
  return handleChange("lastMaintenanceDate", (_a = e === null || e === void 0 ? void 0 : e.toDate()) !== null && _a !== void 0 ? _a : null);
361
360
  } }) })) })))] })), !localEditMode && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mt: 3, mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: "CARNET DU V\u00C9HICULE" })) })), vehicle.documents &&
@@ -1,4 +1,3 @@
1
- /// <reference types="date-fns" />
2
1
  import { DateFormatTypes } from './Enums';
3
2
  export declare function isValidDate(date: unknown): date is Date;
4
3
  export declare const countryTimeZones: {
@@ -96,6 +96,7 @@ export default class Event {
96
96
  orderComment?: string;
97
97
  vehicleReceived?: boolean;
98
98
  garageVehicleId?: number;
99
+ goodForAgreement?: boolean;
99
100
  garageVehicleRequest?: boolean;
100
101
  origin?: string;
101
102
  quoteLastSendingTime?: Date;
@@ -106,7 +107,7 @@ export default class Event {
106
107
  quoteFirstSendingTime?: Date;
107
108
  lastQuoteCreationDate?: Date;
108
109
  urgent?: boolean;
109
- constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, color: string, state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date, quoteLastSendingTime?: Date, invoiceSendingDate?: Date, orders?: Order[], creationDate?: Date, updatedDate?: Date, lastQuoteCreationDate?: Date, quoteFirstSendingTime?: Date, urgent?: boolean, garageVehicleBookings?: LoanVehicle[]);
110
+ constructor(id: string, ownerId: number, type: EventType, title: string, garageName: string, garageId: number, color: string, state: EventState, garageAddress?: Address, start?: Date, end?: Date, prestations?: Prestation[], operations?: Operation[], products?: Product[], guestsId?: string[], vehicleId?: number, quoteId?: number, notes?: string, vehicleAvailableNotified?: boolean, editable?: boolean, resourceId?: number, garageVehicleId?: number, garageVehicleRequest?: boolean, vehicleAvailableNotificationTime?: Date, interventionEndTime?: Date, quoteLastSendingTime?: Date, invoiceSendingDate?: Date, orders?: Order[], creationDate?: Date, updatedDate?: Date, lastQuoteCreationDate?: Date, quoteFirstSendingTime?: Date, urgent?: boolean, garageVehicleBookings?: LoanVehicle[], goodForAgreement?: boolean);
110
111
  static getPrestationsList(event: Event): string[];
111
112
  static getCurrentQuote(event: Event): Document | null;
112
113
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Enums_1 = require("../helpers/Enums");
4
4
  var Event = /** @class */ (function () {
5
- function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest, vehicleAvailableNotificationTime, interventionEndTime, quoteLastSendingTime, invoiceSendingDate, orders, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime, urgent, garageVehicleBookings) {
5
+ function Event(id, ownerId, type, title, garageName, garageId, color, state, garageAddress, start, end, prestations, operations, products, guestsId, vehicleId, quoteId, notes, vehicleAvailableNotified, editable, resourceId, garageVehicleId, garageVehicleRequest, vehicleAvailableNotificationTime, interventionEndTime, quoteLastSendingTime, invoiceSendingDate, orders, creationDate, updatedDate, lastQuoteCreationDate, quoteFirstSendingTime, urgent, garageVehicleBookings, goodForAgreement) {
6
6
  this.id = id;
7
7
  this.notes = notes;
8
8
  this.ownerId = ownerId;
@@ -49,6 +49,7 @@ var Event = /** @class */ (function () {
49
49
  : undefined;
50
50
  this.urgent = urgent;
51
51
  this.garageVehicleBookings = garageVehicleBookings;
52
+ this.goodForAgreement = goodForAgreement;
52
53
  }
53
54
  Event.getPrestationsList = function (event) {
54
55
  if (event && event.prestations) {
@@ -57,29 +58,29 @@ var Event = /** @class */ (function () {
57
58
  return [];
58
59
  };
59
60
  Event.getCurrentQuote = function (event) {
60
- var _a, _b, _c, _d;
61
+ var _a, _b, _c, _d, _e;
61
62
  if (event.documents) {
62
63
  var quoteDocument = event.documents.filter(function (doc) { return doc.type === Enums_1.DocumentType.USER_APPOINTMENT_QUOTE; });
63
64
  if (event.type === Enums_1.EventType.QUOTE) {
64
65
  var state = event.state;
65
66
  if (state === Enums_1.QuoteState.QUOTE_DRAFT ||
66
67
  state === Enums_1.QuoteState.QUOTE_SENT) {
67
- return ((_a = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.PENDING; })) !== null && _a !== void 0 ? _a : null);
68
+ return ((_b = (_a = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.PENDING; })) !== null && _a !== void 0 ? _a : quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _b !== void 0 ? _b : null);
68
69
  }
69
70
  else if (state === Enums_1.QuoteState.QUOTE_REJECTED) {
70
- return ((_b = quoteDocument
71
+ return ((_c = quoteDocument
71
72
  .filter(function (doc) { return doc.state === Enums_1.DocumentState.REJECTED; })
72
73
  .sort(function (a, b) {
73
74
  return new Date(b.creationDate).getTime() -
74
75
  new Date(a.creationDate).getTime();
75
- })[0]) !== null && _b !== void 0 ? _b : null);
76
+ })[0]) !== null && _c !== void 0 ? _c : null);
76
77
  }
77
78
  else if (state === Enums_1.QuoteState.QUOTE_ACCEPTED) {
78
- return ((_c = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _c !== void 0 ? _c : null);
79
+ return ((_d = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _d !== void 0 ? _d : null);
79
80
  }
80
81
  }
81
82
  else {
82
- return ((_d = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _d !== void 0 ? _d : null);
83
+ return ((_e = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _e !== void 0 ? _e : null);
83
84
  }
84
85
  }
85
86
  return null;
@@ -62,7 +62,6 @@ export default class Garage {
62
62
  billingSimulationActive?: boolean;
63
63
  demoBillingActive?: boolean;
64
64
  appId?: number;
65
- quoteRequestStart?: Date;
66
65
  companyRegistrationNumber?: string;
67
66
  establishmentRegistrationNumber?: string;
68
67
  reopeningDate?: Date;
@@ -70,6 +69,8 @@ export default class Garage {
70
69
  onlyBilling?: boolean;
71
70
  settings: Settings[];
72
71
  newDocumentEditor?: boolean;
73
- constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, prestationCategories: CategoryPrestation[], dayPeriodFastServiceExcluded: boolean, loanerVehicleFastServiceExcluded: boolean, fastServiceThreshold: number, timezone: string, settings: Settings[], vehicles?: VehicleGarage[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[], loanerVehicleActive?: boolean, loanerVehicleRequestActive?: boolean, customStyle?: string, subscription?: Subscription, partialWorkforce?: number, mailCustomization?: boolean, billingActive?: boolean, billingToken?: string, billingSimulationActive?: boolean, appId?: number, establishmentRegistrationNumber?: string, companyRegistrationNumber?: string, quoteRequestStart?: Date, reopeningDate?: Date, targetMargin?: number, demoBillingActive?: boolean, onlyBilling?: boolean, newDocumentEditor?: boolean, googleReviewUrl?: string);
72
+ isOnlineAppointment?: boolean;
73
+ isOnlineQuote?: boolean;
74
+ constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, prestationCategories: CategoryPrestation[], dayPeriodFastServiceExcluded: boolean, loanerVehicleFastServiceExcluded: boolean, fastServiceThreshold: number, timezone: string, settings: Settings[], vehicles?: VehicleGarage[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[], loanerVehicleActive?: boolean, loanerVehicleRequestActive?: boolean, customStyle?: string, subscription?: Subscription, partialWorkforce?: number, mailCustomization?: boolean, billingActive?: boolean, billingToken?: string, billingSimulationActive?: boolean, appId?: number, establishmentRegistrationNumber?: string, companyRegistrationNumber?: string, reopeningDate?: Date, targetMargin?: number, demoBillingActive?: boolean, onlyBilling?: boolean, newDocumentEditor?: boolean, googleReviewUrl?: string, isOnlineAppointment?: boolean, isOnlineQuote?: boolean);
74
75
  }
75
76
  export declare function isStockActive(g: Garage): boolean;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isStockActive = void 0;
4
4
  var Settings_1 = require("./Settings");
5
5
  var Garage = /** @class */ (function () {
6
- function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, settings, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, billingSimulationActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, quoteRequestStart, reopeningDate, targetMargin, demoBillingActive, onlyBilling, newDocumentEditor, googleReviewUrl) {
6
+ function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, settings, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, billingSimulationActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, reopeningDate, targetMargin, demoBillingActive, onlyBilling, newDocumentEditor, googleReviewUrl, isOnlineAppointment, isOnlineQuote) {
7
7
  if (onlyBilling === void 0) { onlyBilling = false; }
8
8
  if (newDocumentEditor === void 0) { newDocumentEditor = false; }
9
9
  this.id = id;
@@ -35,7 +35,6 @@ var Garage = /** @class */ (function () {
35
35
  this.billingToken = billingToken;
36
36
  this.billingSimulationActive = billingSimulationActive;
37
37
  this.appId = appId;
38
- this.quoteRequestStart = quoteRequestStart;
39
38
  this.companyRegistrationNumber = companyRegistrationNumber;
40
39
  this.establishmentRegistrationNumber = establishmentRegistrationNumber;
41
40
  this.reopeningDate = reopeningDate;
@@ -45,6 +44,8 @@ var Garage = /** @class */ (function () {
45
44
  this.googleReviewUrl = googleReviewUrl;
46
45
  this.settings = settings;
47
46
  this.newDocumentEditor = newDocumentEditor;
47
+ this.isOnlineAppointment = isOnlineAppointment;
48
+ this.isOnlineQuote = isOnlineQuote;
48
49
  }
49
50
  return Garage;
50
51
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.68.6",
3
+ "version": "1.68.8",
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",
@@ -18,14 +18,6 @@
18
18
  "author": "",
19
19
  "license": "ISC",
20
20
  "dependencies": {
21
- "@emotion/react": "^11.11.1",
22
- "@emotion/styled": "^11.11.0",
23
- "@mui/icons-material": "^5.11.17",
24
- "@mui/lab": "^5.0.0-alpha.134",
25
- "@mui/material": "^5.13.5",
26
- "@mui/x-date-pickers": "^6.9.1",
27
- "@types/react": "^18.2.22",
28
- "@types/react-dom": "^18.2.7",
29
21
  "@types/react-router-dom": "^5.3.0",
30
22
  "date-fns": "^2.29.3",
31
23
  "date-fns-tz": "^2.0.0",
@@ -38,13 +30,10 @@
38
30
  "pdf-lib": "^1.17.1",
39
31
  "pdfjs-dist": "^4.6.82",
40
32
  "qr-code-styling": "^1.4.4",
41
- "react": "^18.2.0",
42
- "react-dom": "^18.2.0",
43
33
  "react-input-mask": "^2.0.4",
44
34
  "react-router-dom": "^5.1.2",
45
35
  "react-scripts": "5.0.1",
46
- "react-to-print": "^2.14.15",
47
- "typescript": "^4.9.5"
36
+ "react-to-print": "^2.14.15"
48
37
  },
49
38
  "eslintConfig": {
50
39
  "extends": [
@@ -52,7 +41,19 @@
52
41
  ]
53
42
  },
54
43
  "peerDependencies": {
55
- "libphonenumber-js": "1.9.52"
44
+ "libphonenumber-js": "1.9.52",
45
+ "@mui/icons-material": "^6.0.0",
46
+ "@mui/x-date-pickers": "^7.0.0",
47
+ "@mui/lab": "6.0.1-beta.34",
48
+ "@mui/material": "^6.0.0",
49
+ "react": "^18.2.0",
50
+ "react-dom": "^18.2.0",
51
+ "react-router-dom": "^5.1.2",
52
+ "typescript": "^4.9.5",
53
+ "@types/react": "^18.2.22",
54
+ "@types/react-dom": "^18.2.7",
55
+ "@emotion/react": "^11.14.0",
56
+ "@emotion/styled": "^11.14.0"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/js-cookie": "^3.0.4",
@@ -1,12 +1,29 @@
1
1
  import { CSSProperties, FunctionComponent, useEffect, useState } from 'react';
2
2
  import { useHistory, useLocation } from 'react-router-dom';
3
3
  import UserService from './services/UserService';
4
- import { Box, Checkbox, CircularProgress, FormControl, FormControlLabel, FormHelperText, Grid, IconButton, Link, SelectChangeEvent, TextField, Typography, colors, darken, useMediaQuery, useTheme } from '@mui/material';
4
+ import {
5
+ Box,
6
+ Checkbox,
7
+ CircularProgress,
8
+ FormControl,
9
+ FormControlLabel,
10
+ FormHelperText,
11
+ Grid,
12
+ IconButton,
13
+ Link,
14
+ SelectChangeEvent,
15
+ TextField,
16
+ Typography,
17
+ colors,
18
+ darken,
19
+ useMediaQuery,
20
+ useTheme,
21
+ Button
22
+ } from '@mui/material';
5
23
  import Logger from './helpers/Logger';
6
24
  import InputAdornment from '@mui/material/InputAdornment';
7
25
  import Visibility from '@mui/icons-material/Visibility';
8
26
  import VisibilityOff from '@mui/icons-material/VisibilityOff';
9
- import { LoadingButton } from '@mui/lab';
10
27
  import { MovaAppType } from './helpers/Enums';
11
28
  import { MovaFormField, MovaValidationForm } from './helpers/Types';
12
29
  import { flexStart, validateField } from './helpers/Tools';
@@ -314,7 +331,7 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
314
331
  throw new Error('Function not implemented.');
315
332
  }}
316
333
  actions={
317
- <LoadingButton
334
+ <Button
318
335
  loading={loadingBtn}
319
336
  type="submit"
320
337
  onClick={handleValidateAccount}
@@ -322,7 +339,7 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
322
339
  variant="contained"
323
340
  sx={{ mt: 4, mb: 0 }}>
324
341
  {resetPassword ? <span>Réinitialiser mon mot de passe</span> : <span>Activer mon compte</span>}
325
- </LoadingButton>
342
+ </Button>
326
343
  }>
327
344
  <Grid container>
328
345
  <Grid item xs={12}>
package/src/MovaLogin.tsx CHANGED
@@ -1,5 +1,4 @@
1
1
  import { CSSProperties, ChangeEvent, FormEvent, FunctionComponent, MouseEvent, ReactNode, SetStateAction, useState } from "react";
2
- import { LoadingButton } from '@mui/lab';
3
2
  import LogoLarge from './assets/images/logo/logo_large_border.png';
4
3
  import LogoProLarge from './assets/images/logo/logo_pro_large_border.png';
5
4
  import LogoAdminLarge from './assets/images/logo/logo_admin_large.png';
@@ -337,14 +336,14 @@ const MovaLogin: FunctionComponent<MovaLoginProps> = ({ loading, movaAppType, on
337
336
  label="Se souvenir de moi"
338
337
  />
339
338
 
340
- <LoadingButton
339
+ <Button
341
340
  loading={loading}
342
341
  type="submit"
343
342
  fullWidth
344
343
  variant="contained"
345
344
  sx={{ mt: 3, mb: 2, backgroundColor: darkMode ? theme.palette.primary.dark : theme.palette.primary.main }}>
346
345
  <span>Se connecter</span>
347
- </LoadingButton>
346
+ </Button>
348
347
 
349
348
  {movaAppType === MovaAppType.INDIVIDUAL && <Button
350
349
  fullWidth
@@ -1,5 +1,4 @@
1
1
  import { CSSProperties, ChangeEvent, FormEvent, FunctionComponent, ReactNode, useState } from "react";
2
- import { LoadingButton } from '@mui/lab';
3
2
  import { DatePicker } from '@mui/x-date-pickers/DatePicker';
4
3
  import LogoLarge from './assets/images/logo/logo_large_border.png';
5
4
  import LogoProLarge from './assets/images/logo/logo_pro_large_border.png';
@@ -8,7 +7,7 @@ import LogoProLargeDarkMode from './assets/images/logo/logo_pro_large_dm.png';
8
7
  import GreenLeafImage from "./assets/images/leaf_green_large.png";
9
8
  import PinkLeafImage from "./assets/images/leaf_pink_large.png";
10
9
  import { Alert, AlertColor, Box, Checkbox, Container, CssBaseline, FormControl, FormControlLabel, FormHelperText, Grid,
11
- IconButton, Link, SelectChangeEvent, TextField, Typography, TextFieldProps, useTheme } from "@mui/material";
10
+ IconButton, Link, SelectChangeEvent, TextField, Typography, TextFieldProps, useTheme, Button } from "@mui/material";
12
11
  import MovaCopyright from "./MovaCopyright";
13
12
  import { MovaFormField, MovaUserSignUpForm } from "./helpers/Types";
14
13
  import { MovaAppType } from "./helpers/Enums";
@@ -469,14 +468,14 @@ const MovaSignUp: FunctionComponent<MovaSignUpProps> = ({ loading, movaAppType,
469
468
 
470
469
  {alertMessage && alertSeverity && <Alert severity={alertSeverity} sx={{ mb: 2 }}>{alertMessage}</Alert>}
471
470
 
472
- <LoadingButton
471
+ <Button
473
472
  loading={loading}
474
473
  type="submit"
475
474
  fullWidth
476
475
  variant="contained"
477
476
  sx={{ mt: 3, mb: 2, backgroundColor: darkMode ? theme.palette.primary.dark : theme.palette.primary.main }}>
478
477
  <span>Créer mon compte</span>
479
- </LoadingButton>
478
+ </Button>
480
479
 
481
480
  {showLoginButton && <Grid container>
482
481
  <Grid item xs>
@@ -259,34 +259,34 @@ const ScheduleFields: FunctionComponent<ScheduleFieldsProps> = ({ timePickerStep
259
259
  <Grid container key={intervalIndex+1}
260
260
  style={{ paddingTop: intervalIndex > 0 ? theme.spacing(1) : 0 }}>
261
261
  <Grid item xs={6} key={(intervalIndex+1)*Math.random()} sx={{ textAlign: 'center' }}>
262
- <TimePicker
263
- views={['hours', 'minutes']}
264
- minutesStep={timePickerStep ?? 30} // Valeur par défaut de 30 minutes au cas ou
265
- disabled={!daySchedule.checked}
266
- value={interval.startTime}
267
- formatDensity='dense'
268
- closeOnSelect={false}
269
- onChange={handleIntervalChange(dayIndex, intervalIndex, 'startTime')}
270
- slotProps={{
271
- textField: {
272
- size: 'small',
273
- sx: {
274
- width:'150px',
275
- minWidth:'100px',
276
- padding: 0,
277
- },
262
+ <TimePicker
263
+ views={['hours', 'minutes']}
264
+ minutesStep={timePickerStep ?? 30}
265
+ disabled={!daySchedule.checked}
266
+ value={interval.startTime ? new Date(interval.startTime) : null}
267
+ formatDensity='dense'
268
+ closeOnSelect={false}
269
+ onChange={handleIntervalChange(dayIndex, intervalIndex, 'startTime')}
270
+ slotProps={{
271
+ textField: {
272
+ size: 'small',
273
+ sx: {
274
+ width:'150px',
275
+ minWidth:'100px',
276
+ padding: 0,
278
277
  },
279
- actionBar: {
280
- sx: { display: 'none' },
281
- },
282
- }}
283
- />
278
+ },
279
+ actionBar: {
280
+ sx: { display: 'none' },
281
+ },
282
+ }}
283
+ />
284
284
  </Grid>
285
285
  <Grid item xs={6} key={(intervalIndex+1)*Math.random()} sx={{ display: 'contents'}}>
286
286
  <TimePicker
287
287
  minutesStep={timePickerStep ?? 30} // Valeur par défaut de 30 minutes au cas ou
288
288
  disabled={!(interval.startTime instanceof Date)}
289
- value={interval.endTime}
289
+ value={interval.endTime ? new Date(interval.endTime) : null}
290
290
  formatDensity='dense'
291
291
  onChange={handleIntervalChange(dayIndex, intervalIndex, 'endTime')}
292
292
  closeOnSelect={false}
@@ -27,7 +27,7 @@ import {
27
27
  useTheme,
28
28
  } from "@mui/material";
29
29
  import { DatePicker } from "@mui/x-date-pickers";
30
- import moment from "moment";
30
+ import moment, { Moment } from 'moment';
31
31
  import { useEffect, useRef, useState, type FC } from "react";
32
32
  import CatPlateBg from "../../assets/images/car_plate_bg.png";
33
33
  import ConfirmationDialog from "../../ConfirmationDialog";
@@ -850,21 +850,19 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
850
850
  <DatePicker
851
851
  label={"Dernier contrôle technique"}
852
852
  name={"lastInspectionDate"}
853
- value={
854
- form.lastInspectionDate.value
853
+ value={
854
+ (form.lastInspectionDate.value
855
855
  ? moment(form.lastInspectionDate.value)
856
- : null
856
+ : null) as any
857
857
  }
858
+ onChange={(e: any) =>
859
+ handleChange("lastInspectionDate", e ? moment(e).toISOString() : "")
860
+ }
858
861
  format="DD/MM/YYYY"
859
862
  formatDensity="dense"
860
863
  views={["day"]}
861
864
  displayWeekNumber
862
- onChange={(e) =>
863
- handleChange(
864
- "lastInspectionDate",
865
- (e?.toDate() as any) ?? null
866
- )
867
- }
865
+
868
866
  />
869
867
  </FormControl>
870
868
  </Grid>
@@ -904,15 +902,15 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
904
902
  label={"Dernier entretien"}
905
903
  name={"lastMaintenanceDate"}
906
904
  value={
907
- form.lastMaintenanceDate.value
905
+ (form.lastMaintenanceDate.value
908
906
  ? moment(form.lastMaintenanceDate.value)
909
- : null
907
+ : null) as any
910
908
  }
911
909
  format="DD/MM/YYYY"
912
910
  formatDensity="dense"
913
911
  views={["day"]}
914
912
  displayWeekNumber
915
- onChange={(e) =>
913
+ onChange={(e: any) =>
916
914
  handleChange(
917
915
  "lastMaintenanceDate",
918
916
  (e?.toDate() as any) ?? null
@@ -109,6 +109,7 @@ export default class Event {
109
109
  orderComment?: string;
110
110
  vehicleReceived?: boolean;
111
111
  garageVehicleId?: number;
112
+ goodForAgreement?:boolean
112
113
  garageVehicleRequest?: boolean;
113
114
  origin?: string;
114
115
  quoteLastSendingTime?: Date;
@@ -155,7 +156,8 @@ export default class Event {
155
156
  lastQuoteCreationDate?: Date,
156
157
  quoteFirstSendingTime?: Date,
157
158
  urgent?: boolean,
158
- garageVehicleBookings?: LoanVehicle[]
159
+ garageVehicleBookings?: LoanVehicle[],
160
+ goodForAgreement?:boolean,
159
161
  ) {
160
162
  this.id = id;
161
163
  this.notes = notes;
@@ -204,6 +206,7 @@ export default class Event {
204
206
  : undefined;
205
207
  this.urgent = urgent;
206
208
  this.garageVehicleBookings = garageVehicleBookings;
209
+ this.goodForAgreement = goodForAgreement;
207
210
  }
208
211
 
209
212
  static getPrestationsList(event: Event): string[] {
@@ -226,7 +229,7 @@ export default class Event {
226
229
  ) {
227
230
  return (
228
231
  quoteDocument.find((doc) => doc.state === DocumentState.PENDING) ??
229
- null
232
+ quoteDocument.find((doc) => doc.state === DocumentState.APPROVED) ?? null
230
233
  );
231
234
  } else if (state === QuoteState.QUOTE_REJECTED) {
232
235
  return (
@@ -238,13 +241,15 @@ export default class Event {
238
241
  new Date(a.creationDate!).getTime()
239
242
  )[0] ?? null
240
243
  );
241
- } else if (state === QuoteState.QUOTE_ACCEPTED) {
244
+ }
245
+ else if (state === QuoteState.QUOTE_ACCEPTED) {
242
246
  return (
243
247
  quoteDocument.find((doc) => doc.state === DocumentState.APPROVED) ??
244
248
  null
245
249
  );
246
250
  }
247
- } else {
251
+ }
252
+ else {
248
253
  return (
249
254
  quoteDocument.find((doc) => doc.state === DocumentState.APPROVED) ??
250
255
  null
@@ -63,7 +63,6 @@ export default class Garage {
63
63
  billingSimulationActive?: boolean;
64
64
  demoBillingActive?: boolean;
65
65
  appId?: number;
66
- quoteRequestStart?: Date;
67
66
  companyRegistrationNumber?: string;
68
67
  establishmentRegistrationNumber?: string;
69
68
  reopeningDate?: Date;
@@ -71,6 +70,8 @@ export default class Garage {
71
70
  onlyBilling?: boolean;
72
71
  settings: Settings[];
73
72
  newDocumentEditor?: boolean;
73
+ isOnlineAppointment?:boolean;
74
+ isOnlineQuote?:boolean;
74
75
  constructor(
75
76
  id: string,
76
77
  adminId: string,
@@ -104,14 +105,14 @@ export default class Garage {
104
105
  appId?: number,
105
106
  establishmentRegistrationNumber?: string,
106
107
  companyRegistrationNumber?: string,
107
- quoteRequestStart?: Date,
108
108
  reopeningDate?: Date,
109
109
  targetMargin?: number,
110
110
  demoBillingActive?: boolean,
111
111
  onlyBilling: boolean = false,
112
112
  newDocumentEditor: boolean = false,
113
113
  googleReviewUrl?:string,
114
-
114
+ isOnlineAppointment?: boolean,
115
+ isOnlineQuote?: boolean,
115
116
  ) {
116
117
  this.id = id;
117
118
  this.adminId = adminId;
@@ -142,7 +143,6 @@ export default class Garage {
142
143
  this.billingToken = billingToken;
143
144
  this.billingSimulationActive = billingSimulationActive;
144
145
  this.appId = appId;
145
- this.quoteRequestStart = quoteRequestStart;
146
146
  this.companyRegistrationNumber = companyRegistrationNumber;
147
147
  this.establishmentRegistrationNumber = establishmentRegistrationNumber;
148
148
  this.reopeningDate = reopeningDate;
@@ -152,6 +152,8 @@ export default class Garage {
152
152
  this.googleReviewUrl = googleReviewUrl;
153
153
  this.settings = settings;
154
154
  this.newDocumentEditor = newDocumentEditor;
155
+ this.isOnlineAppointment = isOnlineAppointment;
156
+ this.isOnlineQuote = isOnlineQuote;
155
157
  }
156
158
 
157
159