@portnet/ui 5.0.28 → 5.0.30

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.
@@ -37,14 +37,31 @@ const reclamationApi = axiosInstance => ({
37
37
  throw (error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data) || new Error("Impossible de charger les réclamations");
38
38
  }
39
39
  },
40
+ getListNatureReclamationApi: async (portailId, serviceCode) => {
41
+ try {
42
+ const response = await axiosInstance.get("/reclamation/list-nature", {
43
+ params: {
44
+ portailId,
45
+ service: serviceCode || undefined
46
+ }
47
+ });
48
+ return response.data.body;
49
+ } catch (error) {
50
+ var _error$response2;
51
+ throw (error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data) || new Error("Impossible de charger les natures");
52
+ }
53
+ },
40
54
  createReclamationApi: async (data, portailId) => {
41
55
  try {
56
+ var _data$nature;
42
57
  const formData = new FormData();
43
58
  const serviceConcerne = data.service.codigo;
44
59
  formData.append("type", data.type);
45
60
  formData.append("service", serviceConcerne);
46
61
  formData.append("objet", data.objet);
47
62
  formData.append("description", data.sujet);
63
+ formData.append("telephone", data.telephone);
64
+ formData.append("nature", ((_data$nature = data.nature) === null || _data$nature === void 0 ? void 0 : _data$nature.codigo) || "");
48
65
  if (data.files && data.files.length > 0) {
49
66
  data.files.forEach(file => {
50
67
  formData.append("files", file);
@@ -61,8 +78,8 @@ const reclamationApi = axiosInstance => ({
61
78
  });
62
79
  return response.data.body;
63
80
  } catch (error) {
64
- var _error$response2;
65
- throw (error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data) || new Error("Impossible de create nouvelle réclamation");
81
+ var _error$response3;
82
+ throw (error === null || error === void 0 || (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data) || new Error("Impossible de créer une nouvelle réclamation");
66
83
  }
67
84
  },
68
85
  downloadDocumentApi: async documentGuid => {
@@ -70,8 +87,8 @@ const reclamationApi = axiosInstance => ({
70
87
  const response = await axiosInstance.post("/reclamation/download?guid=".concat(documentGuid));
71
88
  return response.data.body;
72
89
  } catch (error) {
73
- var _error$response3;
74
- throw (error === null || error === void 0 || (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data) || new Error("Impossible de charger les réclamations");
90
+ var _error$response4;
91
+ throw (error === null || error === void 0 || (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : _error$response4.data) || new Error("Impossible de charger les réclamations");
75
92
  }
76
93
  },
77
94
  getListServiceReclamationApi: async () => {
@@ -79,8 +96,8 @@ const reclamationApi = axiosInstance => ({
79
96
  const response = await axiosInstance.get("/reclamation/list-service");
80
97
  return response.data.body;
81
98
  } catch (error) {
82
- var _error$response4;
83
- throw (error === null || error === void 0 || (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : _error$response4.data) || new Error("Impossible de charger les réclamations");
99
+ var _error$response5;
100
+ throw (error === null || error === void 0 || (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : _error$response5.data) || new Error("Impossible de charger les réclamations");
84
101
  }
85
102
  },
86
103
  getListServiceReclamationByPortailApi: async portailId => {
@@ -88,8 +105,8 @@ const reclamationApi = axiosInstance => ({
88
105
  const response = await axiosInstance.get("/reclamation/list-service/".concat(portailId));
89
106
  return response.data.body;
90
107
  } catch (error) {
91
- var _error$response5;
92
- throw (error === null || error === void 0 || (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : _error$response5.data) || new Error("Impossible de charger les réclamations");
108
+ var _error$response6;
109
+ throw (error === null || error === void 0 || (_error$response6 = error.response) === null || _error$response6 === void 0 ? void 0 : _error$response6.data) || new Error("Impossible de charger les réclamations");
93
110
  }
94
111
  },
95
112
  cloturerReclamation: id => axiosInstance.patch("/reclamation/".concat(id, "/cloturer")).then(r => r.data),
@@ -12,6 +12,7 @@ require("core-js/modules/es.promise.js");
12
12
  require("core-js/modules/es.regexp.exec.js");
13
13
  require("core-js/modules/es.regexp.test.js");
14
14
  require("core-js/modules/es.string.includes.js");
15
+ require("core-js/modules/es.string.replace.js");
15
16
  require("core-js/modules/es.string.split.js");
16
17
  require("core-js/modules/es.string.trim.js");
17
18
  require("core-js/modules/es.typed-array.uint8-array.js");
@@ -53,6 +54,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
53
54
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
54
55
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
55
56
  const WIDGET_FONT = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";
57
+ const PHONE_RE = /^(0|\+212|0212)[5-7]\d{8}$/;
56
58
  const ContentPanel = _ref => {
57
59
  let {
58
60
  isOpen,
@@ -1253,6 +1255,7 @@ const CustomChatInterface = _ref3 => {
1253
1255
  });
1254
1256
  };
1255
1257
  const ReclamationFormModal = _ref4 => {
1258
+ var _formData$service;
1256
1259
  let {
1257
1260
  open,
1258
1261
  onClose
@@ -1261,8 +1264,10 @@ const ReclamationFormModal = _ref4 => {
1261
1264
  const [formData, setFormData] = (0, _react.useState)({
1262
1265
  type: "",
1263
1266
  service: "",
1267
+ nature: "",
1264
1268
  objet: "",
1265
1269
  sujet: "",
1270
+ telephone: "",
1266
1271
  files: []
1267
1272
  });
1268
1273
  const [submitted, setSubmitted] = (0, _react.useState)(false);
@@ -1275,6 +1280,10 @@ const ReclamationFormModal = _ref4 => {
1275
1280
  data: listServiceReclamation,
1276
1281
  isFetching: isFetchingListServiceReclamation
1277
1282
  } = (0, _useReclamation.useListServiceReclamation)();
1283
+ const {
1284
+ data: listNatureReclamation,
1285
+ isFetching: isFetchingListNatureReclamation
1286
+ } = (0, _useReclamation.useListNatureReclamation)((_formData$service = formData.service) === null || _formData$service === void 0 ? void 0 : _formData$service.codigo);
1278
1287
  const [error, setError] = (0, _react.useState)(null);
1279
1288
  const errorRef = (0, _react.useRef)(null);
1280
1289
  const CustomPopper = props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Popper, _objectSpread(_objectSpread({}, props), {}, {
@@ -1296,6 +1305,12 @@ const ReclamationFormModal = _ref4 => {
1296
1305
  extensions: ".pdf,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif",
1297
1306
  mimeTypes: ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "image/jpeg", "image/png", "image/gif"]
1298
1307
  };
1308
+ const dialogContentRef = (0, _react.useRef)(null);
1309
+ (0, _react.useEffect)(() => {
1310
+ if (dialogContentRef.current) {
1311
+ dialogContentRef.current.scrollTop = 0;
1312
+ }
1313
+ }, [activeStep]);
1299
1314
  (0, _react.useEffect)(() => {
1300
1315
  if (!open) {
1301
1316
  setTimeout(() => {
@@ -1312,6 +1327,11 @@ const ReclamationFormModal = _ref4 => {
1312
1327
  }, 300);
1313
1328
  }
1314
1329
  }, [open]);
1330
+ (0, _react.useEffect)(() => {
1331
+ setFormData(prev => _objectSpread(_objectSpread({}, prev), {}, {
1332
+ nature: ""
1333
+ }));
1334
+ }, [formData.service]);
1315
1335
  (0, _react.useEffect)(() => {
1316
1336
  if (error && errorRef.current) {
1317
1337
  errorRef.current.scrollIntoView({
@@ -1392,8 +1412,8 @@ const ReclamationFormModal = _ref4 => {
1392
1412
  onClose();
1393
1413
  };
1394
1414
  const canProceedStep1 = formData.type !== "";
1395
- const canProceedStep2 = formData.service !== "";
1396
- const canSubmit = formData.objet && formData.sujet;
1415
+ const canProceedStep2 = formData.service !== "" && formData.nature !== "";
1416
+ const canSubmit = formData.objet && formData.sujet && PHONE_RE.test(formData.telephone.replace(/[\s.-]/g, ""));
1397
1417
  const renderStepContent = () => {
1398
1418
  switch (activeStep) {
1399
1419
  case 0:
@@ -1486,34 +1506,72 @@ const ReclamationFormModal = _ref4 => {
1486
1506
  sx: {
1487
1507
  mt: 3
1488
1508
  }
1489
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Autocomplete, {
1490
- options: listServiceReclamation || [],
1491
- loading: isFetchingListServiceReclamation,
1492
- value: formData.service || "",
1493
- onChange: handleServiceChange,
1494
- getOptionLabel: option => (option === null || option === void 0 ? void 0 : option.libelle) || "",
1495
- renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, _objectSpread(_objectSpread({}, params), {}, {
1496
- label: "Rechercher un service",
1497
- placeholder: "Commencez \xE0 taper...",
1498
- variant: "outlined",
1499
- fullWidth: true
1500
- })),
1501
- renderOption: (props, option) => /*#__PURE__*/(0, _jsxRuntime.jsx)("li", _objectSpread(_objectSpread({}, props), {}, {
1502
- className: "service-option",
1503
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
1504
- display: "flex",
1505
- alignItems: "center",
1506
- gap: 1,
1507
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
1508
- className: "service-bullet"
1509
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
1510
- children: option === null || option === void 0 ? void 0 : option.libelle
1511
- })]
1512
- })
1513
- })),
1514
- PopperComponent: CustomPopper,
1515
- noOptionsText: "Aucun service trouv\xE9",
1516
- className: "service-autocomplete"
1509
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
1510
+ sx: {
1511
+ display: "flex",
1512
+ flexDirection: "column",
1513
+ gap: 3
1514
+ },
1515
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Autocomplete, {
1516
+ options: listServiceReclamation || [],
1517
+ loading: isFetchingListServiceReclamation,
1518
+ value: formData.service || "",
1519
+ onChange: handleServiceChange,
1520
+ getOptionLabel: option => (option === null || option === void 0 ? void 0 : option.libelle) || "",
1521
+ renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, _objectSpread(_objectSpread({}, params), {}, {
1522
+ label: "Rechercher un service",
1523
+ placeholder: "Commencez \xE0 taper...",
1524
+ variant: "outlined",
1525
+ fullWidth: true
1526
+ })),
1527
+ renderOption: (props, option) => /*#__PURE__*/(0, _jsxRuntime.jsx)("li", _objectSpread(_objectSpread({}, props), {}, {
1528
+ className: "service-option",
1529
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
1530
+ display: "flex",
1531
+ alignItems: "center",
1532
+ gap: 1,
1533
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
1534
+ className: "service-bullet"
1535
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
1536
+ children: option === null || option === void 0 ? void 0 : option.libelle
1537
+ })]
1538
+ })
1539
+ })),
1540
+ PopperComponent: CustomPopper,
1541
+ noOptionsText: "Aucun service trouv\xE9",
1542
+ className: "service-autocomplete"
1543
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Autocomplete, {
1544
+ options: listNatureReclamation || [],
1545
+ loading: isFetchingListNatureReclamation,
1546
+ value: formData.nature || "",
1547
+ disabled: !formData.service,
1548
+ onChange: (e, value) => setFormData(prev => _objectSpread(_objectSpread({}, prev), {}, {
1549
+ nature: value
1550
+ })),
1551
+ getOptionLabel: option => (option === null || option === void 0 ? void 0 : option.libelle) || "",
1552
+ renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, _objectSpread(_objectSpread({}, params), {}, {
1553
+ label: "Nature de la demande",
1554
+ placeholder: formData.service ? "Commencez à taper..." : "Sélectionnez d'abord un service",
1555
+ variant: "outlined",
1556
+ fullWidth: true
1557
+ })),
1558
+ renderOption: (props, option) => /*#__PURE__*/(0, _jsxRuntime.jsx)("li", _objectSpread(_objectSpread({}, props), {}, {
1559
+ className: "service-option",
1560
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
1561
+ display: "flex",
1562
+ alignItems: "center",
1563
+ gap: 1,
1564
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
1565
+ className: "service-bullet"
1566
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
1567
+ children: option === null || option === void 0 ? void 0 : option.libelle
1568
+ })]
1569
+ })
1570
+ })),
1571
+ PopperComponent: CustomPopper,
1572
+ noOptionsText: "Aucune nature trouv\xE9e",
1573
+ className: "service-autocomplete"
1574
+ })]
1517
1575
  })]
1518
1576
  })
1519
1577
  });
@@ -1538,6 +1596,18 @@ const ReclamationFormModal = _ref4 => {
1538
1596
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
1539
1597
  className: "form-fields",
1540
1598
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, {
1599
+ fullWidth: true,
1600
+ required: true,
1601
+ label: "T\xE9l\xE9phone",
1602
+ value: formData.telephone,
1603
+ onChange: e => setFormData(prev => _objectSpread(_objectSpread({}, prev), {}, {
1604
+ telephone: e.target.value
1605
+ })),
1606
+ error: Boolean(formData.telephone) && !PHONE_RE.test(formData.telephone.replace(/[\s.-]/g, "")),
1607
+ helperText: "Format : 06 61 00 00 00, +212 6 61 00 00 00 ou 0212 6 61 00 00 00.",
1608
+ variant: "outlined",
1609
+ className: "form-field"
1610
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, {
1541
1611
  fullWidth: true,
1542
1612
  required: true,
1543
1613
  label: "Objet",
@@ -1566,6 +1636,9 @@ const ReclamationFormModal = _ref4 => {
1566
1636
  }
1567
1637
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
1568
1638
  className: "file-upload-section",
1639
+ sx: {
1640
+ mb: 3
1641
+ },
1569
1642
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
1570
1643
  type: "file",
1571
1644
  id: "file-upload",
@@ -1695,7 +1768,7 @@ const ReclamationFormModal = _ref4 => {
1695
1768
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
1696
1769
  variant: "h6",
1697
1770
  className: "header-title",
1698
- children: "Nouvelle r\xE9clamation"
1771
+ children: "Nouvelle demande d'assistance"
1699
1772
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Typography, {
1700
1773
  variant: "caption",
1701
1774
  color: "white",
@@ -1723,6 +1796,7 @@ const ReclamationFormModal = _ref4 => {
1723
1796
  }, label))
1724
1797
  })]
1725
1798
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.DialogContent, {
1799
+ ref: dialogContentRef,
1726
1800
  className: "modal-content",
1727
1801
  style: {
1728
1802
  overflow: activeStep === 1 ? "visible" : "auto"
@@ -1829,16 +1903,18 @@ const ReclamationsList = _ref5 => {
1829
1903
  return "#757575";
1830
1904
  }
1831
1905
  };
1832
- const isHtml = str => /<\/?[a-z][\s\S]*>/i.test(str);
1906
+ const URL_RE = /(https?:\/\/[^\s)]+)/g;
1833
1907
  const renderTextWithLinks = text => {
1834
1908
  if (!text) return null;
1835
- const parts = text.split(/(https?:\/\/[^\s)]+)/g);
1909
+ const parts = text.split(URL_RE);
1836
1910
  return parts.map((part, i) => /^https?:\/\//.test(part) ? /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
1837
1911
  href: part,
1838
1912
  target: "_blank",
1839
1913
  rel: "noopener noreferrer",
1840
1914
  style: {
1841
1915
  color: "var(--primary-color, #222f67)",
1916
+ fontWeight: 600,
1917
+ textDecoration: "underline",
1842
1918
  wordBreak: "break-all"
1843
1919
  },
1844
1920
  children: part
@@ -1846,6 +1922,7 @@ const ReclamationsList = _ref5 => {
1846
1922
  children: part
1847
1923
  }, i));
1848
1924
  };
1925
+ const isHtml = str => /<\/?[a-z][\s\S]*>/i.test(str);
1849
1926
  const handleReclamationClick = reclamation => {
1850
1927
  setSelectedReclamation(reclamation);
1851
1928
  setDetailsDialogOpen(true);
@@ -1993,7 +2070,7 @@ const ReclamationsList = _ref5 => {
1993
2070
  margin: 0,
1994
2071
  lineHeight: "normal"
1995
2072
  },
1996
- children: "Mes r\xE9clamations"
2073
+ children: "Mes demandes d'assistance"
1997
2074
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Typography, {
1998
2075
  component: "div",
1999
2076
  sx: {
@@ -2347,6 +2424,29 @@ const ReclamationsList = _ref5 => {
2347
2424
  },
2348
2425
  children: selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.service
2349
2426
  })]
2427
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2428
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
2429
+ component: "div",
2430
+ sx: {
2431
+ fontSize: "11px",
2432
+ color: "#999",
2433
+ fontWeight: "500",
2434
+ marginBottom: "6px",
2435
+ textTransform: "uppercase",
2436
+ letterSpacing: "0.5px",
2437
+ fontFamily: WIDGET_FONT
2438
+ },
2439
+ children: "Nature de la demande"
2440
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
2441
+ component: "div",
2442
+ sx: {
2443
+ fontSize: "14px",
2444
+ color: "#333",
2445
+ fontWeight: "500",
2446
+ fontFamily: WIDGET_FONT
2447
+ },
2448
+ children: selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.nature
2449
+ })]
2350
2450
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2351
2451
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
2352
2452
  component: "div",
@@ -2419,7 +2519,7 @@ const ReclamationsList = _ref5 => {
2419
2519
  whiteSpace: "pre-line",
2420
2520
  fontFamily: WIDGET_FONT
2421
2521
  },
2422
- children: selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.description
2522
+ children: renderTextWithLinks(selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.description)
2423
2523
  })]
2424
2524
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2425
2525
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
@@ -2638,7 +2738,7 @@ const ReclamationsList = _ref5 => {
2638
2738
  fontFamily: WIDGET_FONT
2639
2739
  },
2640
2740
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
2641
- children: [entry.changedByNom ? entry.changedByNom : "Service Odoo", " \xB7 "]
2741
+ children: [entry.changedByNom ? entry.changedByNom : "Service Odoo", " ", "\xB7", " "]
2642
2742
  }), formatDate(entry.dateChangement)]
2643
2743
  })]
2644
2744
  })
@@ -2654,7 +2754,7 @@ const ReclamationsList = _ref5 => {
2654
2754
  border: "1px solid #e0e0e0",
2655
2755
  whiteSpace: "pre-line"
2656
2756
  },
2657
- children: entry.commentaire
2757
+ children: renderTextWithLinks(entry.commentaire)
2658
2758
  }), entry.reponse && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2659
2759
  style: {
2660
2760
  marginTop: "8px",
@@ -2688,7 +2788,7 @@ const ReclamationsList = _ref5 => {
2688
2788
  style: {
2689
2789
  whiteSpace: "pre-line"
2690
2790
  },
2691
- children: entry.reponse
2791
+ children: renderTextWithLinks(entry.reponse)
2692
2792
  })]
2693
2793
  }), ((_entry$documents = entry.documents) === null || _entry$documents === void 0 ? void 0 : _entry$documents.length) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2694
2794
  style: {
@@ -3740,7 +3840,7 @@ const PuiHelpWidget = _ref7 => {
3740
3840
  action: handleFaqClick
3741
3841
  }, ...(showReclamation ? [{
3742
3842
  icon: _freeSolidSvgIcons.faClipboardList,
3743
- title: "Mes réclamations",
3843
+ title: "Mes demandes d'assistance",
3744
3844
  id: "mes-reclamations",
3745
3845
  action: () => {
3746
3846
  queryClient.invalidateQueries("get_list_reclamation");
@@ -3748,7 +3848,7 @@ const PuiHelpWidget = _ref7 => {
3748
3848
  }
3749
3849
  }, {
3750
3850
  icon: _freeSolidSvgIcons.faBullhorn,
3751
- title: "Nouvelle réclamation",
3851
+ title: "Nouvelle demande d'assistance",
3752
3852
  id: "nouvelle-reclamation",
3753
3853
  action: () => setReclamationModalOpen(true)
3754
3854
  }] : []), {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useReouvreReclamation = exports.useListServiceReclamation = exports.useListReclamation = exports.useDownloadDocument = exports.useCreateReclamation = exports.useClotureReclamation = void 0;
6
+ exports.useReouvreReclamation = exports.useListServiceReclamation = exports.useListReclamation = exports.useListNatureReclamation = exports.useDownloadDocument = exports.useCreateReclamation = exports.useClotureReclamation = void 0;
7
7
  var _reactQuery = require("react-query");
8
8
  var _PuiHelpWidgetContext = require("../components/common/PuiHelpWidgetContext");
9
9
  const useListReclamation = (page, search) => {
@@ -24,6 +24,22 @@ const useListReclamation = (page, search) => {
24
24
  });
25
25
  };
26
26
  exports.useListReclamation = useListReclamation;
27
+ const useListNatureReclamation = serviceCode => {
28
+ const {
29
+ reclamationApi,
30
+ portailId
31
+ } = (0, _PuiHelpWidgetContext.useHelpWidget)();
32
+ return (0, _reactQuery.useQuery)({
33
+ queryKey: ["get_list_nature_reclamation", portailId, serviceCode],
34
+ queryFn: () => reclamationApi.getListNatureReclamationApi(portailId, serviceCode),
35
+ enabled: Boolean(serviceCode),
36
+ initialData: [],
37
+ retry: 1,
38
+ refetchOnWindowFocus: false,
39
+ refetchOnReconnect: false
40
+ });
41
+ };
42
+ exports.useListNatureReclamation = useListNatureReclamation;
27
43
  const useCreateReclamation = () => {
28
44
  const {
29
45
  reclamationApi,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portnet/ui",
3
- "version": "5.0.28",
3
+ "version": "5.0.30",
4
4
  "description": "Portnet UI",
5
5
  "keywords": [
6
6
  "react",
@@ -103,6 +103,7 @@
103
103
  "@storybook/testing-library": "^0.2.2",
104
104
  "ajv": "^8.17.1",
105
105
  "ajv-keywords": "^5.1.0",
106
+ "axios": "^0.27.2",
106
107
  "cross-env": "^7.0.3",
107
108
  "husky": "^4.3.8",
108
109
  "prop-types": "^15.8.1",
@@ -110,4 +111,4 @@
110
111
  "storybook": "^7.6.4",
111
112
  "webpack": "^5.75.0"
112
113
  }
113
- }
114
+ }