@movalib/movalib-commons 1.1.30 → 1.1.32

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.
@@ -1,4 +1,5 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import { SxProps, Theme } from '@mui/material';
2
3
  interface ConfirmationDialogProps {
3
4
  open: boolean;
4
5
  onClose: () => void;
@@ -8,6 +9,7 @@ interface ConfirmationDialogProps {
8
9
  closeLabel?: string;
9
10
  title?: React.ReactNode;
10
11
  message?: React.ReactNode;
12
+ sx?: SxProps<Theme>;
11
13
  }
12
14
  declare const ConfirmationDialog: FunctionComponent<ConfirmationDialogProps>;
13
15
  export default ConfirmationDialog;
@@ -24,13 +24,13 @@ var Button_1 = __importDefault(require("@mui/material/Button"));
24
24
  var material_1 = require("@mui/material");
25
25
  var Tools_1 = require("./helpers/Tools");
26
26
  var ConfirmationDialog = function (_a) {
27
- var open = _a.open, onClose = _a.onClose, onConfirm = _a.onConfirm, title = _a.title, message = _a.message, _b = _a.showConfirm, showConfirm = _b === void 0 ? true : _b, confirmLabel = _a.confirmLabel, closeLabel = _a.closeLabel;
27
+ var open = _a.open, onClose = _a.onClose, onConfirm = _a.onConfirm, title = _a.title, message = _a.message, _b = _a.showConfirm, showConfirm = _b === void 0 ? true : _b, confirmLabel = _a.confirmLabel, closeLabel = _a.closeLabel, sx = _a.sx;
28
28
  var theme = (0, material_1.useTheme)();
29
29
  var defaultMessage = "Êtes-vous sûr de vouloir continuer ?";
30
30
  var defaultTitle = "Confirmation";
31
31
  var defaultConfirmLabel = "Oui";
32
32
  var defaultCloseLabel = "Non";
33
- return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, __assign({ open: open, onClose: onClose, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" }, { children: [(0, jsx_runtime_1.jsx)(DialogTitle_1.default, __assign({ id: "alert-dialog-title", sx: {
33
+ return ((0, jsx_runtime_1.jsxs)(Dialog_1.default, __assign({ open: open, onClose: onClose, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description", sx: __assign({}, sx) }, { children: [(0, jsx_runtime_1.jsx)(DialogTitle_1.default, __assign({ id: "alert-dialog-title", sx: {
34
34
  backgroundColor: theme.palette.grey[200]
35
35
  }, style: Tools_1.flexLeftRow }, { children: title || defaultTitle })), (0, jsx_runtime_1.jsxs)(DialogContent_1.default, __assign({ sx: { textAlign: 'center' } }, { children: [(0, jsx_runtime_1.jsx)(DialogContentText_1.default, __assign({ id: "alert-dialog-description", sx: { pt: 2 } }, { children: message || defaultMessage })), (0, jsx_runtime_1.jsx)(DialogContent_1.default, {})] })), (0, jsx_runtime_1.jsxs)(DialogActions_1.default, __assign({ sx: {
36
36
  py: 1,
@@ -1,6 +1,7 @@
1
1
  import { APIResponse } from "../helpers/ApiHelper";
2
2
  import Garage from "../models/Garage";
3
3
  export default class GarageService {
4
+ static sendNewEventQuote(garageId: string, eventId: string, formData: FormData): Promise<APIResponse<string>>;
4
5
  static sendCustomerReminder(garageId: string, eventId: string, message: string): Promise<APIResponse<string>>;
5
6
  static updateGarageEvent(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
6
7
  static sendSupplierRequest(garageId: string, eventId: string, req: any): Promise<APIResponse<string>>;
@@ -5,6 +5,13 @@ var Enums_1 = require("../helpers/Enums");
5
5
  var GarageService = /** @class */ (function () {
6
6
  function GarageService() {
7
7
  }
8
+ GarageService.sendNewEventQuote = function (garageId, eventId, formData) {
9
+ return (0, ApiHelper_1.request)({
10
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/quote"),
11
+ method: Enums_1.APIMethod.PATCH,
12
+ body: formData
13
+ });
14
+ };
8
15
  GarageService.sendCustomerReminder = function (garageId, eventId, message) {
9
16
  return (0, ApiHelper_1.request)({
10
17
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/event/").concat(eventId, "/customer-reminder"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
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",
@@ -5,7 +5,7 @@ import DialogContent from '@mui/material/DialogContent';
5
5
  import DialogContentText from '@mui/material/DialogContentText';
6
6
  import DialogTitle from '@mui/material/DialogTitle';
7
7
  import Button from '@mui/material/Button';
8
- import { useTheme } from '@mui/material';
8
+ import { SxProps, Theme, useTheme } from '@mui/material';
9
9
  import { flexLeftRow } from './helpers/Tools';
10
10
 
11
11
  interface ConfirmationDialogProps {
@@ -17,10 +17,11 @@ interface ConfirmationDialogProps {
17
17
  closeLabel?: string;
18
18
  title?: React.ReactNode;
19
19
  message?: React.ReactNode;
20
+ sx?: SxProps<Theme>;
20
21
  }
21
22
 
22
23
  const ConfirmationDialog: FunctionComponent<ConfirmationDialogProps> = ({ open, onClose, onConfirm, title, message, showConfirm = true,
23
- confirmLabel, closeLabel }) => {
24
+ confirmLabel, closeLabel, sx }) => {
24
25
 
25
26
  const theme = useTheme();
26
27
  const defaultMessage = "Êtes-vous sûr de vouloir continuer ?";
@@ -34,6 +35,7 @@ const ConfirmationDialog: FunctionComponent<ConfirmationDialogProps> = ({ open,
34
35
  onClose={onClose}
35
36
  aria-labelledby="alert-dialog-title"
36
37
  aria-describedby="alert-dialog-description"
38
+ sx={{ ...sx }}
37
39
  >
38
40
  <DialogTitle id="alert-dialog-title" sx={{
39
41
  backgroundColor: theme.palette.grey[200]
@@ -4,6 +4,14 @@ import Garage from "../models/Garage";
4
4
 
5
5
  export default class GarageService {
6
6
 
7
+ static sendNewEventQuote(garageId: string, eventId: string, formData: FormData): Promise<APIResponse<string>> {
8
+ return request({
9
+ url: `${API_BASE_URL}/garage/${garageId}/event/${eventId}/quote`,
10
+ method: APIMethod.PATCH,
11
+ body: formData
12
+ });
13
+ }
14
+
7
15
  static sendCustomerReminder(garageId: string, eventId: string, message: string): Promise<APIResponse<string>> {
8
16
 
9
17
  return request({