@movalib/movalib-commons 1.65.0 → 1.65.2

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.
@@ -56,6 +56,7 @@ var CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded")
56
56
  var EditRounded_1 = __importDefault(require("@mui/icons-material/EditRounded"));
57
57
  var material_1 = require("@mui/material");
58
58
  var x_date_pickers_1 = require("@mui/x-date-pickers");
59
+ var moment_1 = __importDefault(require("moment"));
59
60
  var react_1 = require("react");
60
61
  var car_plate_bg_png_1 = __importDefault(require("../../assets/images/car_plate_bg.png"));
61
62
  var ConfirmationDialog_1 = __importDefault(require("../../ConfirmationDialog"));
@@ -339,9 +340,19 @@ var VehicleFullCard = function (_a) {
339
340
  "& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
340
341
  } }) }))), !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) !== ""
341
342
  ? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
342
- : "-" }) })) }))] }))), 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, format: "dd/MM/yyyy", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) { return handleChange("lastInspectionDate", e); } }) })) }))), !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) !== ""
343
+ : "-" }) })) }))] }))), 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
344
+ ? (0, moment_1.default)(form.lastInspectionDate.value)
345
+ : null, format: "DD/MM/YYYY", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) {
346
+ var _a;
347
+ return handleChange("lastInspectionDate", (_a = e === null || e === void 0 ? void 0 : e.toDate()) !== null && _a !== void 0 ? _a : null);
348
+ } }) })) }))), !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) !== ""
343
349
  ? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
344
- : "-" }) })) }))] }))), 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, format: "dd/MM/yyyy", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) { return handleChange("lastMaintenanceDate", e); } }) })) })))] })), !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 &&
350
+ : "-" }) })) }))] }))), 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
351
+ ? (0, moment_1.default)(form.lastMaintenanceDate.value)
352
+ : null, format: "DD/MM/YYYY", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) {
353
+ var _a;
354
+ return handleChange("lastMaintenanceDate", (_a = e === null || e === void 0 ? void 0 : e.toDate()) !== null && _a !== void 0 ? _a : null);
355
+ } }) })) })))] })), !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 &&
345
356
  ((_b = vehicle.documents) === null || _b === void 0 ? void 0 : _b.filter(function (doc) { return doc.fileSignedUrl; }).map(function (invoice, index) { return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: {
346
357
  justifyContent: "space-between",
347
358
  alignItems: "center",
@@ -44,7 +44,8 @@ export default class Subscription {
44
44
  movaPackage: string;
45
45
  packInfo: boolean;
46
46
  smsCampaign: boolean;
47
+ expertMonthly: boolean;
47
48
  checkList: any;
48
- constructor(id: string, garageId: string, type: SubscriptionType, state: SubscriptionState, companyName: string, companyEmail: string, companySiren: string, companyLegalForm: string, trialDays: number, startDate: Date, activationDate: Date, cancellationDate: Date, paymentInterval: SubscriptionPaymentInterval, paymentIban: string, roi: roiInterface, additionalFormationQuantity: number, webPage: boolean, smsCampaign: boolean, trainingOptionalOne: Date, trainingOptionalTwo: Date, webcam: boolean, billing: boolean, movaPackage: string, packInfo: boolean, checkList: any);
49
+ constructor(id: string, garageId: string, type: SubscriptionType, state: SubscriptionState, companyName: string, companyEmail: string, companySiren: string, companyLegalForm: string, trialDays: number, startDate: Date, activationDate: Date, cancellationDate: Date, paymentInterval: SubscriptionPaymentInterval, paymentIban: string, roi: roiInterface, additionalFormationQuantity: number, webPage: boolean, smsCampaign: boolean, trainingOptionalOne: Date, trainingOptionalTwo: Date, webcam: boolean, billing: boolean, movaPackage: string, packInfo: boolean, checkList: any, expertMonthly: boolean);
49
50
  }
50
51
  export {};
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Subscription = /** @class */ (function () {
4
- function Subscription(id, garageId, type, state, companyName, companyEmail, companySiren, companyLegalForm, trialDays, startDate, activationDate, cancellationDate, paymentInterval, paymentIban, roi, additionalFormationQuantity, webPage, smsCampaign, trainingOptionalOne, trainingOptionalTwo, webcam, billing, movaPackage, packInfo, checkList) {
4
+ function Subscription(id, garageId, type, state, companyName, companyEmail, companySiren, companyLegalForm, trialDays, startDate, activationDate, cancellationDate, paymentInterval, paymentIban, roi, additionalFormationQuantity, webPage, smsCampaign, trainingOptionalOne, trainingOptionalTwo, webcam, billing, movaPackage, packInfo, checkList, expertMonthly) {
5
5
  this.id = id;
6
6
  this.garageId = garageId;
7
7
  this.type = type;
@@ -27,6 +27,7 @@ var Subscription = /** @class */ (function () {
27
27
  this.packInfo = packInfo;
28
28
  this.smsCampaign = smsCampaign;
29
29
  this.checkList = checkList;
30
+ this.expertMonthly = expertMonthly;
30
31
  }
31
32
  return Subscription;
32
33
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.65.0",
3
+ "version": "1.65.2",
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",
@@ -27,6 +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
31
  import { useEffect, useRef, useState, type FC } from "react";
31
32
  import CatPlateBg from "../../assets/images/car_plate_bg.png";
32
33
  import ConfirmationDialog from "../../ConfirmationDialog";
@@ -824,12 +825,21 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
824
825
  <DatePicker
825
826
  label={"Dernier contrôle technique"}
826
827
  name={"lastInspectionDate"}
827
- value={form.lastInspectionDate.value}
828
- format="dd/MM/yyyy"
828
+ value={
829
+ form.lastInspectionDate.value
830
+ ? moment(form.lastInspectionDate.value)
831
+ : null
832
+ }
833
+ format="DD/MM/YYYY"
829
834
  formatDensity="dense"
830
835
  views={["day"]}
831
836
  displayWeekNumber
832
- onChange={(e) => handleChange("lastInspectionDate", e)}
837
+ onChange={(e) =>
838
+ handleChange(
839
+ "lastInspectionDate",
840
+ (e?.toDate() as any) ?? null
841
+ )
842
+ }
833
843
  />
834
844
  </FormControl>
835
845
  </Grid>
@@ -868,12 +878,21 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
868
878
  <DatePicker
869
879
  label={"Dernier entretien"}
870
880
  name={"lastMaintenanceDate"}
871
- value={form.lastMaintenanceDate.value}
872
- format="dd/MM/yyyy"
881
+ value={
882
+ form.lastMaintenanceDate.value
883
+ ? moment(form.lastMaintenanceDate.value)
884
+ : null
885
+ }
886
+ format="DD/MM/YYYY"
873
887
  formatDensity="dense"
874
888
  views={["day"]}
875
889
  displayWeekNumber
876
- onChange={(e) => handleChange("lastMaintenanceDate", e)}
890
+ onChange={(e) =>
891
+ handleChange(
892
+ "lastMaintenanceDate",
893
+ (e?.toDate() as any) ?? null
894
+ )
895
+ }
877
896
  />
878
897
  </FormControl>
879
898
  </Grid>
@@ -49,6 +49,7 @@ export default class Subscription {
49
49
  movaPackage: string;
50
50
  packInfo: boolean;
51
51
  smsCampaign: boolean;
52
+ expertMonthly: boolean;
52
53
  checkList: any;
53
54
 
54
55
  constructor(
@@ -76,7 +77,8 @@ export default class Subscription {
76
77
  billing: boolean,
77
78
  movaPackage: string,
78
79
  packInfo: boolean,
79
- checkList: any
80
+ checkList: any,
81
+ expertMonthly: boolean
80
82
  ) {
81
83
  this.id = id;
82
84
  this.garageId = garageId;
@@ -103,5 +105,6 @@ export default class Subscription {
103
105
  this.packInfo = packInfo;
104
106
  this.smsCampaign = smsCampaign;
105
107
  this.checkList = checkList;
108
+ this.expertMonthly = expertMonthly;
106
109
  }
107
110
  }