@movalib/movalib-commons 1.59.19 → 1.59.21
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/dist/src/MovaDialog.d.ts +1 -1
- package/dist/src/MovaDialog.js +1 -1
- package/dist/src/assets/images/car_plate_bg.png +0 -0
- package/dist/src/components/vehicle/VehicleFullCard.js +4 -15
- package/dist/src/models/Garage.d.ts +4 -1
- package/dist/src/models/Garage.js +4 -1
- package/dist/src/services/GarageService.d.ts +3 -0
- package/dist/src/services/GarageService.js +22 -0
- package/package.json +1 -1
- package/src/MovaDialog.tsx +5 -4
- package/src/assets/images/car_plate_bg.png +0 -0
- package/src/components/vehicle/VehicleFullCard.tsx +24 -26
- package/src/models/Garage.ts +10 -0
- package/src/services/GarageService.ts +33 -0
package/dist/src/MovaDialog.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ interface MovaDialogProps {
|
|
|
11
11
|
message?: string;
|
|
12
12
|
transition?: "fade";
|
|
13
13
|
leafImageColor?: "green" | "yellow" | "pink";
|
|
14
|
-
title?: string;
|
|
14
|
+
title?: string | React.ReactNode;
|
|
15
15
|
titleStyle?: CSSProperties;
|
|
16
16
|
sx?: SxProps<Theme>;
|
|
17
17
|
maxWidth?: Breakpoint | false;
|
package/dist/src/MovaDialog.js
CHANGED
|
@@ -60,6 +60,6 @@ var MovaDialog = function (_a) {
|
|
|
60
60
|
zIndex: 0,
|
|
61
61
|
left: 0,
|
|
62
62
|
opacity: '0.2'
|
|
63
|
-
}, alt: 'Feuille Movalib' }), title && (0, jsx_runtime_1.jsx)(material_1.DialogTitle, __assign({ id: "garage-dialog-title", sx: { textAlign: 'center', p: 0, pt: 1, mt: 0, mb: 0, zIndex: 10 } }, { children: (0, jsx_runtime_1.jsx)(material_1.AppBar, __assign({ sx: { position: 'relative' }, color: "transparent", elevation: 0 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Toolbar, { children: [closable && (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ edge: "start", color: "inherit", onClick: handleOnBack, "aria-label": "close" }, { children: (0, jsx_runtime_1.jsx)(ArrowBackIosNewRounded_1.default, {}) })), (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ sx: { textAlign: 'center', fontSize: 20, flexGrow: 1, pl: closable ? '20px' : 'Opx', pr: closable ? '40px' : '0px' }, style: titleStyle }, { children: title }))] }) })) })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, __assign({ sx: { zIndex: 20 } }, { children: [children, message && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: "error", sx: { mb: 2 } }, { children: message }))] })), actions && (0, jsx_runtime_1.jsx)(material_1.DialogActions, __assign({ sx: { justifyContent: 'center' } }, { children: actions }))] })));
|
|
63
|
+
}, alt: 'Feuille Movalib' }), title && (0, jsx_runtime_1.jsx)(material_1.DialogTitle, __assign({ id: "garage-dialog-title", sx: { textAlign: 'center', p: 0, pt: 1, mt: 0, mb: 0, zIndex: 10 } }, { children: (0, jsx_runtime_1.jsx)(material_1.AppBar, __assign({ sx: { position: 'relative' }, color: "transparent", elevation: 0 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Toolbar, { children: [closable && (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ edge: "start", color: "inherit", onClick: handleOnBack, "aria-label": "close" }, { children: (0, jsx_runtime_1.jsx)(ArrowBackIosNewRounded_1.default, {}) })), typeof title === typeof 'poney' && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ sx: { textAlign: 'center', fontSize: 20, flexGrow: 1, pl: closable ? '20px' : 'Opx', pr: closable ? '40px' : '0px' }, style: titleStyle }, { children: title })), typeof title !== typeof 'poney' && title] }) })) })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, __assign({ sx: { zIndex: 20 } }, { children: [children, message && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: "error", sx: { mb: 2 } }, { children: message }))] })), actions && (0, jsx_runtime_1.jsx)(material_1.DialogActions, __assign({ sx: { justifyContent: 'center' } }, { children: actions }))] })));
|
|
64
64
|
};
|
|
65
65
|
exports.default = MovaDialog;
|
|
Binary file
|
|
@@ -17,12 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
18
|
var material_1 = require("@mui/material");
|
|
19
19
|
var react_1 = require("react");
|
|
20
|
-
var car_figure_png_1 = __importDefault(require("../../assets/images/car_figure.png"));
|
|
21
20
|
var MovaVehicleTireField_1 = __importDefault(require("../../MovaVehicleTireField"));
|
|
22
21
|
var ConfirmationDialog_1 = __importDefault(require("../../ConfirmationDialog"));
|
|
23
22
|
var Enums_1 = require("../../helpers/Enums");
|
|
24
23
|
var Tools_1 = require("../../helpers/Tools");
|
|
25
|
-
var MovaDigitalPassport_1 = __importDefault(require("../../MovaDigitalPassport"));
|
|
26
24
|
var DateUtils_1 = require("../../helpers/DateUtils");
|
|
27
25
|
var CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded"));
|
|
28
26
|
var EditRounded_1 = __importDefault(require("@mui/icons-material/EditRounded"));
|
|
@@ -30,6 +28,7 @@ var CloseRounded_2 = __importDefault(require("@mui/icons-material/CloseRounded")
|
|
|
30
28
|
var Logger_1 = __importDefault(require("../../helpers/Logger"));
|
|
31
29
|
var icons_material_1 = require("@mui/icons-material");
|
|
32
30
|
var LinkedDocumentDialog_1 = require("../LinkedDocumentDialog");
|
|
31
|
+
var car_plate_bg_png_1 = __importDefault(require("../../assets/images/car_plate_bg.png"));
|
|
33
32
|
var initialUserFormState = {
|
|
34
33
|
currentMileage: { value: null, isValid: true },
|
|
35
34
|
averageMileagePerYear: { value: null, isValid: true },
|
|
@@ -224,16 +223,10 @@ var VehicleFullCard = function (_a) {
|
|
|
224
223
|
};
|
|
225
224
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [vehicle &&
|
|
226
225
|
(0, jsx_runtime_1.jsxs)(material_1.Card, __assign({ variant: 'outlined', sx: {
|
|
227
|
-
maxWidth: fullwidth ? '80%' :
|
|
226
|
+
maxWidth: fullwidth ? '80%' : 500,
|
|
228
227
|
backgroundColor: focused ? theme.palette.primary.light : 'white',
|
|
229
228
|
overflow: 'visible', mt: 4, pb: 1
|
|
230
|
-
} }, { children: [(0, jsx_runtime_1.jsx)("img", { src:
|
|
231
|
-
position: 'relative',
|
|
232
|
-
width: '40%',
|
|
233
|
-
top: '-25px',
|
|
234
|
-
left: '-15px',
|
|
235
|
-
zIndex: 200
|
|
236
|
-
}, alt: 'Icone Voiture' }), (0, jsx_runtime_1.jsx)(MovaDigitalPassport_1.default, { digitalPassportIndex: vehicle.digitalPassportIndex }), (0, jsx_runtime_1.jsxs)(material_1.CardContent, __assign({ sx: { pt: 0, pb: 0 } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: [vehicle.brand && "".concat(vehicle.brand, " "), vehicle.model && "".concat(vehicle.model, " "), vehicle.version && "".concat(vehicle.version)] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, justifyContent: "space-between" }, { 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: "body1", color: "text.primary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatFrenchVehiclePlate)(vehicle.plate) }) })) })), !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: "Km actuel :" })) })), (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.jsxs)("b", { children: [vehicle.currentMileage, " km"] }) })) }))] })), localEditMode && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Kilom\u00E9trage actuel", name: "currentMileage", variant: "outlined", type: "number", required: true, value: form.currentMileage.value, onChange: function (e) { return handleInputChange(e); }, error: (Boolean(form.currentMileage.error)), sx: {
|
|
229
|
+
} }, { children: [(0, jsx_runtime_1.jsxs)(material_1.CardContent, __assign({ sx: { pt: 0, pb: 0 } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: [vehicle.brand && "".concat(vehicle.brand, " "), vehicle.model && "".concat(vehicle.model, " "), vehicle.version && "".concat(vehicle.version)] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: { mb: 1, alignItems: 'center', justifyContent: 'center' } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ item: true, xs: 6, sx: { position: 'relative' } }, { children: [(0, jsx_runtime_1.jsx)("img", { src: car_plate_bg_png_1.default, alt: "Plaque d'immatriculation", style: { height: '50px', position: 'relative', } }), (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'h6', color: theme.palette.text.primary, sx: { position: 'absolute', top: '8px', left: '76px' } }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatFrenchVehiclePlate)(vehicle.plate) }) }))] })), onDelete && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, style: { display: 'flex', alignItems: 'center', justifyContent: 'center' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ variant: 'contained', color: 'error', onClick: function (e) { return handleOnClickDeleteVehicle(e); } }, { children: "Supprimer" })) }))] })), !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: "Km actuel :" })) })), (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.jsxs)("b", { children: [vehicle.currentMileage, " km"] }) })) }))] })), localEditMode && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Kilom\u00E9trage actuel", name: "currentMileage", variant: "outlined", type: "number", required: true, value: form.currentMileage.value, onChange: function (e) { return handleInputChange(e); }, error: (Boolean(form.currentMileage.error)), sx: {
|
|
237
230
|
width: '100%',
|
|
238
231
|
mt: 2,
|
|
239
232
|
'& input': { textTransform: 'uppercase' } // CSS pour forcer les majuscules dans l'input
|
|
@@ -241,10 +234,6 @@ var VehicleFullCard = function (_a) {
|
|
|
241
234
|
? form.currentMileage.error : "Sur votre tableau de bord 😉" }) })), !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: "Km moyen annuel :" })) })), (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.jsxs)("b", { children: [vehicle.averageMileagePerYear, " km"] }) })) }))] })), localEditMode && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, __assign({ fullWidth: true, margin: "normal", error: Boolean(form.averageMileagePerYear.error) }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, __assign({ id: "averageMileagePerYear-label" }, { children: "Kilom\u00E9trage moyen annuel" })), (0, jsx_runtime_1.jsxs)(material_1.Select, __assign({ labelId: "averageMileagePerYear-label", id: "averageMileagePerYear", name: "averageMileagePerYear", value: form.averageMileagePerYear.value ?
|
|
242
235
|
String(form.averageMileagePerYear.value) : '', onChange: function (e) { return handleSelectChange(e); }, label: "Kilom\u00E9trage moyen annuel" }, { children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 5000 }, { children: "5 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 10000 }, { children: "10 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 15000 }, { children: "15 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 20000 }, { children: "20 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 25000 }, { children: "25 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 30000 }, { children: "30 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 50000 }, { children: "50 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 75000 }, { children: "75 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 100000 }, { children: "100 000" })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, __assign({ value: 999999 }, { children: "+100 000" }))] })), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: form.averageMileagePerYear.error })] })) })), !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: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Pneumatiques :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 6, sx: { textAlign: 'right' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: isVehicleTireSizeDefined(vehicle) ? (0, jsx_runtime_1.jsx)("b", { children: (0, Tools_1.formatVehicleTire)(vehicle.tireSize) }) : '-' })) }))] })), localEditMode && (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 1 } }, { children: (0, jsx_runtime_1.jsx)(MovaVehicleTireField_1.default, { vehicleTire: form.tireSize.value, onChangeVehicleTire: handleOnChangeVehicleTire }) }))] })), !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 && ((_b = vehicle.documents) === null || _b === void 0 ? void 0 : _b.map(function (invoice, index) { return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: { justifyContent: 'space-between', alignItems: 'center' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 11, sx: { textAlign: 'left' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, __assign({ title: invoice.originalFileName }, { children: (0, jsx_runtime_1.jsx)(material_1.Link, __assign({ color: (0, material_1.darken)('#F29ABA', 0.2), href: invoice.fileSignedUrl, target: "_blank", rel: "noopener" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1" }, { children: invoice.fileName + ' ' + (0, DateUtils_1.formatDateByCountryCode)(invoice.creationDate, 'fr', Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) })) })) })) }), (index + 1) * 50), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 1, sx: { textAlign: 'right' } }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ disabled: !(invoice.ownerId.toString() == currentUser.id), onClick: function (e) { return handleDeleteDocument(e, invoice === null || invoice === void 0 ? void 0 : invoice.id); } }, { children: (0, jsx_runtime_1.jsx)(CloseRounded_2.default, {}) })) }), (index + 1) * 100)] }), index + 1)); })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ container: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12, sx: { mt: 2, textAlign: 'center' } }, { children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("input", { accept: "image/*, application/pdf", type: "file", style: { display: 'none' }, ref: invoiceInputRef, id: "raised-button-invoice", onChange: function (e) { return handleFileChange(e, docTypeCurrent.current); } }), (0, jsx_runtime_1.jsx)(material_1.Button, __assign({ size: 'large', disabled: currentUpload, onClick: function () { return setShowLinkedDocument(true); }, component: "span", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(icons_material_1.AttachFile, {}), sx: { alignItems: 'center', width: '90%', mt: 2, mb: 1, height: '50px', p: 1, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) } }, { children: "Ajouter un document" })), currentUpload && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'body2', sx: { animation: 'blink 1.5s infinite' } }, { children: "Document en cours d'importation..." })), sizeLimit && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'body1', sx: { animation: 'blink 1.5s infinite' }, color: theme.palette.warning.dark }, { children: "Echec de l'importation car la taille du fichier d\u00E9passe 10Mo" })), !sizeLimit && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: 'body2' }, { children: "Taille maximale du fichier : 10Mo" }))] }) })) }))] })] })), (0, jsx_runtime_1.jsxs)(material_1.CardActions, __assign({ sx: { mt: 3, justifyContent: localEditMode ? 'center' : 'end' } }, { children: [!localEditMode &&
|
|
243
236
|
(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickEdit, color: "inherit", sx: { width: '45%' }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { mr: 1 } }), "MODIFIER"] })) }), localEditMode &&
|
|
244
|
-
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickCancel, sx: { width: '45%', color: theme.palette.text.secondary }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(CloseRounded_1.default, { sx: { mr: 1 } }), "ANNULER"] })), (0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickValidate, sx: { width: '45%', color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { mr: 1 } }), "VALIDER"] }))] })] }))] })), isShowLinkedDocument && (0, jsx_runtime_1.jsx)(LinkedDocumentDialog_1.LinkedDocumentDialog, { isVehicle: true, isShowLinkedDocument: isShowLinkedDocument, appType: appType, toggleShowLinkedDocument: toggleShowLinkedDocument, message: messageRGPD }),
|
|
245
|
-
(0, jsx_runtime_1.jsx)(material_1.Button, __assign({ onClick: function (e) { return handleOnClickDeleteVehicle(e); }, sx: {
|
|
246
|
-
width: '90', mt: 4, color: theme.palette.error.light,
|
|
247
|
-
borderColor: theme.palette.error.light
|
|
248
|
-
}, variant: 'outlined' }, { children: "Supprimer le v\u00E9hicule" })), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmDocumentDelete, onClose: handleCloseConfirmDocumentDelete, onConfirm: handleConfirmDocumentDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce document ?" }), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmVehicleDelete, onClose: handleCloseConfirmVehicleDelete, onConfirm: handleConfirmVehicleDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce v\u00E9hicule ?" })] }));
|
|
237
|
+
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickCancel, sx: { width: '45%', color: theme.palette.text.secondary }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(CloseRounded_1.default, { sx: { mr: 1 } }), "ANNULER"] })), (0, jsx_runtime_1.jsxs)(material_1.Button, __assign({ onClick: handleOnClickValidate, sx: { width: '45%', color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, variant: 'text' }, { children: [(0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { mr: 1 } }), "VALIDER"] }))] })] }))] })), isShowLinkedDocument && (0, jsx_runtime_1.jsx)(LinkedDocumentDialog_1.LinkedDocumentDialog, { isVehicle: true, isShowLinkedDocument: isShowLinkedDocument, appType: appType, toggleShowLinkedDocument: toggleShowLinkedDocument, message: messageRGPD }), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmDocumentDelete, onClose: handleCloseConfirmDocumentDelete, onConfirm: handleConfirmDocumentDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce document ?" }), (0, jsx_runtime_1.jsx)(ConfirmationDialog_1.default, { open: openConfirmVehicleDelete, onClose: handleCloseConfirmVehicleDelete, onConfirm: handleConfirmVehicleDelete, message: "\u00CAtes-vous s\u00FBr de vouloir supprimer ce v\u00E9hicule ?" })] }));
|
|
249
238
|
};
|
|
250
239
|
exports.default = VehicleFullCard;
|
|
@@ -20,6 +20,9 @@ export default class Garage {
|
|
|
20
20
|
prestationCategories: CategoryPrestation[];
|
|
21
21
|
prestations: Prestation[];
|
|
22
22
|
schedules: Schedule[];
|
|
23
|
+
dayPeriodFastServiceExcluded: boolean;
|
|
24
|
+
loanerVehicleFastServiceExcluded: boolean;
|
|
25
|
+
fastServiceThreshold: number;
|
|
23
26
|
vehicles?: VehicleGarage[];
|
|
24
27
|
countryCode?: string;
|
|
25
28
|
contactEmail?: string;
|
|
@@ -52,5 +55,5 @@ export default class Garage {
|
|
|
52
55
|
paymentAuthorizationActive?: boolean;
|
|
53
56
|
paymentAuthorizationMinDowntime?: number;
|
|
54
57
|
customStyle?: string;
|
|
55
|
-
constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, prestationCategories: CategoryPrestation[], vehicles?: VehicleGarage[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[], loanerVehicleActive?: boolean, loanerVehicleRequestActive?: boolean, customStyle?: string, subscription?: Subscription, partialWorkforce?: number);
|
|
58
|
+
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, vehicles?: VehicleGarage[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[], loanerVehicleActive?: boolean, loanerVehicleRequestActive?: boolean, customStyle?: string, subscription?: Subscription, partialWorkforce?: number);
|
|
56
59
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Garage = /** @class */ (function () {
|
|
4
|
-
function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce) {
|
|
4
|
+
function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce) {
|
|
5
5
|
this.id = id;
|
|
6
6
|
this.adminId = adminId;
|
|
7
7
|
this.name = name;
|
|
@@ -21,6 +21,9 @@ var Garage = /** @class */ (function () {
|
|
|
21
21
|
this.loanerVehicleRequestActive = loanerVehicleRequestActive;
|
|
22
22
|
this.subscription = subscription;
|
|
23
23
|
this.partialWorkforce = partialWorkforce;
|
|
24
|
+
this.dayPeriodFastServiceExcluded = dayPeriodFastServiceExcluded;
|
|
25
|
+
this.loanerVehicleFastServiceExcluded = loanerVehicleFastServiceExcluded;
|
|
26
|
+
this.fastServiceThreshold = fastServiceThreshold;
|
|
24
27
|
this.customStyle = customStyle;
|
|
25
28
|
}
|
|
26
29
|
return Garage;
|
|
@@ -54,6 +54,9 @@ export default class GarageService {
|
|
|
54
54
|
static addCustomerVehicle({ garageId, customerId, ...payload }: AddCustomerVehicleParams): Promise<APIResponse<string>>;
|
|
55
55
|
static deleteCustomerVehicle({ garageId, customerId, vehicleId, }: DeleteCustomerVehicleParams): Promise<APIResponse<string>>;
|
|
56
56
|
static toogleGarageLoanerVehicleRequest(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
57
|
+
static toogleGarageLoanerVehicleFastServiceExclusion(garageId: string): Promise<APIResponse<string>>;
|
|
58
|
+
static updateFastServiceThresholdRequest(garageId: string, value: any): Promise<APIResponse<string>>;
|
|
59
|
+
static updateSlotAlogrithm(garageId: string, req: any): Promise<APIResponse<string>>;
|
|
57
60
|
static toogleGarageLoanerVehicle(garageId: string): Promise<APIResponse<string>>;
|
|
58
61
|
static addGarageVehicle({ garageId, req, }: {
|
|
59
62
|
garageId: string;
|
|
@@ -359,6 +359,28 @@ var GarageService = /** @class */ (function () {
|
|
|
359
359
|
body: JSON.stringify(req),
|
|
360
360
|
});
|
|
361
361
|
};
|
|
362
|
+
GarageService.toogleGarageLoanerVehicleFastServiceExclusion = function (garageId) {
|
|
363
|
+
return (0, ApiHelper_1.request)({
|
|
364
|
+
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings/loaner-vehicle-fast-service-exclusion"),
|
|
365
|
+
method: Enums_1.APIMethod.PATCH,
|
|
366
|
+
appType: Enums_1.MovaAppType.GARAGE,
|
|
367
|
+
});
|
|
368
|
+
};
|
|
369
|
+
GarageService.updateFastServiceThresholdRequest = function (garageId, value) {
|
|
370
|
+
return (0, ApiHelper_1.request)({
|
|
371
|
+
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings/fast-service-threshold?fastServiceThreshold=").concat(encodeURIComponent(value)),
|
|
372
|
+
method: Enums_1.APIMethod.PATCH,
|
|
373
|
+
appType: Enums_1.MovaAppType.GARAGE,
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
GarageService.updateSlotAlogrithm = function (garageId, req) {
|
|
377
|
+
return (0, ApiHelper_1.request)({
|
|
378
|
+
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings/slot-algorithm"),
|
|
379
|
+
method: Enums_1.APIMethod.PATCH,
|
|
380
|
+
appType: Enums_1.MovaAppType.GARAGE,
|
|
381
|
+
body: JSON.stringify(req),
|
|
382
|
+
});
|
|
383
|
+
};
|
|
362
384
|
GarageService.toogleGarageLoanerVehicle = function (garageId) {
|
|
363
385
|
return (0, ApiHelper_1.request)({
|
|
364
386
|
url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings/loaner-vehicle"),
|
package/package.json
CHANGED
package/src/MovaDialog.tsx
CHANGED
|
@@ -14,10 +14,10 @@ interface MovaDialogProps {
|
|
|
14
14
|
onClose: () => void,
|
|
15
15
|
closable?: boolean,
|
|
16
16
|
actions?: React.ReactNode,
|
|
17
|
-
message?:string,
|
|
17
|
+
message?: string,
|
|
18
18
|
transition?: "fade",
|
|
19
19
|
leafImageColor?: "green" | "yellow" | "pink",
|
|
20
|
-
title?: string,
|
|
20
|
+
title?: string | React.ReactNode,
|
|
21
21
|
titleStyle?: CSSProperties;
|
|
22
22
|
sx?: SxProps<Theme>;
|
|
23
23
|
maxWidth? : Breakpoint | false;
|
|
@@ -99,9 +99,10 @@ const MovaDialog: FC<MovaDialogProps> = ({fullScreen, open, onClose, closable =
|
|
|
99
99
|
>
|
|
100
100
|
<BackIcon />
|
|
101
101
|
</IconButton>}
|
|
102
|
-
<Typography sx={{ textAlign:'center', fontSize: 20, flexGrow: 1, pl: closable ? '20px' : 'Opx', pr: closable ? '40px' : '0px' }} style={titleStyle}>
|
|
102
|
+
{typeof title === typeof 'poney' && <Typography sx={{ textAlign:'center', fontSize: 20, flexGrow: 1, pl: closable ? '20px' : 'Opx', pr: closable ? '40px' : '0px' }} style={titleStyle}>
|
|
103
103
|
{title}
|
|
104
|
-
</Typography>
|
|
104
|
+
</Typography>}
|
|
105
|
+
{typeof title !== typeof 'poney' && title}
|
|
105
106
|
</Toolbar>
|
|
106
107
|
</AppBar>
|
|
107
108
|
</DialogTitle>
|
|
Binary file
|
|
@@ -22,6 +22,7 @@ import Logger from '../../helpers/Logger';
|
|
|
22
22
|
import { AttachFile } from '@mui/icons-material';
|
|
23
23
|
import { LinkedDocumentDialog } from '../LinkedDocumentDialog';
|
|
24
24
|
import User from '../../models/User';
|
|
25
|
+
import CatPlateBg from '../../assets/images/car_plate_bg.png';
|
|
25
26
|
|
|
26
27
|
interface VehicleFullCardProps {
|
|
27
28
|
currentUser: User,
|
|
@@ -94,7 +95,8 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({ vehicle, fullwidth, onError
|
|
|
94
95
|
setForm(prevForm => (
|
|
95
96
|
{ ...prevForm, ['tireSpeedIndex']: { ...prevForm['tireSpeedIndex'], value: vehicle.tireSpeedIndex } }));
|
|
96
97
|
|
|
97
|
-
if (isVehicleTireSizeDefined(vehicle))
|
|
98
|
+
if (isVehicleTireSizeDefined(vehicle))
|
|
99
|
+
{
|
|
98
100
|
setForm(prevForm => (
|
|
99
101
|
{ ...prevForm, ['tireSize']: { ...prevForm['tireSize'], value: vehicle.tireSize } }));
|
|
100
102
|
}
|
|
@@ -265,22 +267,11 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({ vehicle, fullwidth, onError
|
|
|
265
267
|
<>
|
|
266
268
|
{vehicle &&
|
|
267
269
|
<Card variant='outlined' sx={{
|
|
268
|
-
maxWidth: fullwidth ? '80%' :
|
|
270
|
+
maxWidth: fullwidth ? '80%' : 500,
|
|
269
271
|
backgroundColor: focused ? theme.palette.primary.light : 'white',
|
|
270
272
|
overflow: 'visible', mt: 4, pb: 1
|
|
271
273
|
}}
|
|
272
274
|
>
|
|
273
|
-
<img src={CarFigure} style={{
|
|
274
|
-
position: 'relative',
|
|
275
|
-
width: '40%',
|
|
276
|
-
top: '-25px',
|
|
277
|
-
left: '-15px',
|
|
278
|
-
zIndex: 200
|
|
279
|
-
}} alt='Icone Voiture'>
|
|
280
|
-
</img>
|
|
281
|
-
|
|
282
|
-
<MovaDigitalPassport digitalPassportIndex={vehicle.digitalPassportIndex} />
|
|
283
|
-
|
|
284
275
|
<CardContent sx={{ pt: 0, pb: 0 }}>
|
|
285
276
|
<Typography variant="h6" component="div" align="center" sx={{ mb: 1 }} color={darken(theme.palette.primary.main, 0.2)}>
|
|
286
277
|
{vehicle.brand && `${vehicle.brand} `}
|
|
@@ -289,10 +280,26 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({ vehicle, fullwidth, onError
|
|
|
289
280
|
</Typography>
|
|
290
281
|
<Grid container justifyContent="space-between">
|
|
291
282
|
|
|
292
|
-
<Grid
|
|
293
|
-
<
|
|
294
|
-
<
|
|
295
|
-
|
|
283
|
+
<Grid container sx={{ mb: 1, alignItems: 'center', justifyContent: 'center' }}>
|
|
284
|
+
<Grid item xs={6} sx={{ position: 'relative'}}>
|
|
285
|
+
<img
|
|
286
|
+
src={CatPlateBg}
|
|
287
|
+
alt="Plaque d'immatriculation"
|
|
288
|
+
style={{ height: '50px', position: 'relative', }}
|
|
289
|
+
/>
|
|
290
|
+
<Typography
|
|
291
|
+
variant='h6'
|
|
292
|
+
color={theme.palette.text.primary}
|
|
293
|
+
sx={{ position: 'absolute', top: '8px', left: '76px' }}
|
|
294
|
+
>
|
|
295
|
+
<b>{formatFrenchVehiclePlate(vehicle.plate)}</b>
|
|
296
|
+
</Typography>
|
|
297
|
+
</Grid>
|
|
298
|
+
{onDelete && <Grid item xs={6} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
299
|
+
<Button variant='contained' color='error' onClick={(e) => handleOnClickDeleteVehicle(e)}>
|
|
300
|
+
Supprimer
|
|
301
|
+
</Button>
|
|
302
|
+
</Grid>}
|
|
296
303
|
</Grid>
|
|
297
304
|
|
|
298
305
|
{!localEditMode && <Grid container textAlign='justify' sx={{ pt: 2 }}>
|
|
@@ -522,15 +529,6 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({ vehicle, fullwidth, onError
|
|
|
522
529
|
message={messageRGPD}
|
|
523
530
|
/>}
|
|
524
531
|
|
|
525
|
-
{localEditMode && onDelete &&
|
|
526
|
-
<Button onClick={(e) => handleOnClickDeleteVehicle(e)} sx={{
|
|
527
|
-
width: '90', mt: 4, color: theme.palette.error.light,
|
|
528
|
-
borderColor: theme.palette.error.light
|
|
529
|
-
}} variant='outlined'>
|
|
530
|
-
Supprimer le véhicule
|
|
531
|
-
</Button>
|
|
532
|
-
}
|
|
533
|
-
|
|
534
532
|
<ConfirmationDialog
|
|
535
533
|
open={openConfirmDocumentDelete}
|
|
536
534
|
onClose={handleCloseConfirmDocumentDelete}
|
package/src/models/Garage.ts
CHANGED
|
@@ -22,6 +22,9 @@ export default class Garage {
|
|
|
22
22
|
prestationCategories: CategoryPrestation[];
|
|
23
23
|
prestations: Prestation[];
|
|
24
24
|
schedules: Schedule[];
|
|
25
|
+
dayPeriodFastServiceExcluded: boolean;
|
|
26
|
+
loanerVehicleFastServiceExcluded: boolean;
|
|
27
|
+
fastServiceThreshold: number;
|
|
25
28
|
vehicles?: VehicleGarage[];
|
|
26
29
|
countryCode?: string;
|
|
27
30
|
contactEmail?: string;
|
|
@@ -53,6 +56,7 @@ export default class Garage {
|
|
|
53
56
|
loanerVehicleRequestActive?: boolean;
|
|
54
57
|
paymentAuthorizationActive?: boolean;
|
|
55
58
|
paymentAuthorizationMinDowntime?: number;
|
|
59
|
+
|
|
56
60
|
customStyle?: string;
|
|
57
61
|
|
|
58
62
|
constructor(
|
|
@@ -65,6 +69,9 @@ export default class Garage {
|
|
|
65
69
|
schedules: Schedule[],
|
|
66
70
|
contactPhone: string,
|
|
67
71
|
prestationCategories: CategoryPrestation[],
|
|
72
|
+
dayPeriodFastServiceExcluded: boolean,
|
|
73
|
+
loanerVehicleFastServiceExcluded: boolean,
|
|
74
|
+
fastServiceThreshold: number,
|
|
68
75
|
vehicles?: VehicleGarage[],
|
|
69
76
|
contactEmail?: string,
|
|
70
77
|
logo?:string,
|
|
@@ -96,6 +103,9 @@ export default class Garage {
|
|
|
96
103
|
this.loanerVehicleRequestActive = loanerVehicleRequestActive;
|
|
97
104
|
this.subscription = subscription;
|
|
98
105
|
this.partialWorkforce = partialWorkforce;
|
|
106
|
+
this.dayPeriodFastServiceExcluded = dayPeriodFastServiceExcluded;
|
|
107
|
+
this.loanerVehicleFastServiceExcluded = loanerVehicleFastServiceExcluded;
|
|
108
|
+
this.fastServiceThreshold = fastServiceThreshold;
|
|
99
109
|
this.customStyle = customStyle;
|
|
100
110
|
}
|
|
101
111
|
}
|
|
@@ -507,6 +507,39 @@ export default class GarageService {
|
|
|
507
507
|
});
|
|
508
508
|
}
|
|
509
509
|
|
|
510
|
+
static toogleGarageLoanerVehicleFastServiceExclusion(
|
|
511
|
+
garageId: string,
|
|
512
|
+
): Promise<APIResponse<string>> {
|
|
513
|
+
return request({
|
|
514
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/loaner-vehicle-fast-service-exclusion`,
|
|
515
|
+
method: APIMethod.PATCH,
|
|
516
|
+
appType: MovaAppType.GARAGE,
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
static updateFastServiceThresholdRequest(
|
|
521
|
+
garageId: string,
|
|
522
|
+
value: any,
|
|
523
|
+
): Promise<APIResponse<string>> {
|
|
524
|
+
return request({
|
|
525
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/fast-service-threshold?fastServiceThreshold=${encodeURIComponent(value)}`,
|
|
526
|
+
method: APIMethod.PATCH,
|
|
527
|
+
appType: MovaAppType.GARAGE,
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
static updateSlotAlogrithm(
|
|
532
|
+
garageId: string,
|
|
533
|
+
req: any,
|
|
534
|
+
): Promise<APIResponse<string>> {
|
|
535
|
+
return request({
|
|
536
|
+
url: `${API_BASE_URL}/garage/${garageId}/settings/slot-algorithm`,
|
|
537
|
+
method: APIMethod.PATCH,
|
|
538
|
+
appType: MovaAppType.GARAGE,
|
|
539
|
+
body: JSON.stringify(req),
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
|
|
510
543
|
static toogleGarageLoanerVehicle(
|
|
511
544
|
garageId: string,
|
|
512
545
|
): Promise<APIResponse<string>> {
|