@portnet/ui 5.0.17 → 5.0.18

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.
@@ -79,6 +79,15 @@ const reclamationApi = axiosInstance => ({
79
79
  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");
80
80
  }
81
81
  },
82
+ getListServiceReclamationByPortailApi: async portailId => {
83
+ try {
84
+ const response = await axiosInstance.get("/reclamation/list-service/".concat(portailId));
85
+ return response.data.body;
86
+ } catch (error) {
87
+ var _error$response5;
88
+ 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");
89
+ }
90
+ },
82
91
  cloturerReclamation: id => axiosInstance.patch("/reclamation/".concat(id, "/cloturer")).then(r => r.data),
83
92
  reourrirReclamation: (id, formData) => axiosInstance.patch("/reclamation/".concat(id, "/reouvrir"), formData, {
84
93
  headers: {
@@ -34,6 +34,7 @@ const PuiHelpWidgetProvider = _ref => {
34
34
  showReclamation = true,
35
35
  showGuides = true,
36
36
  currentProjectCode = null,
37
+ portailId = null,
37
38
  children
38
39
  } = _ref;
39
40
  const axiosInstance = (0, _react.useMemo)(() => {
@@ -76,7 +77,8 @@ const PuiHelpWidgetProvider = _ref => {
76
77
  showReclamation: showReclamation,
77
78
  showGuides: showGuides,
78
79
  currentProjectCode: currentProjectCode,
79
- guideBaseUrl: guideBaseUrl
80
+ guideBaseUrl: guideBaseUrl,
81
+ portailId: portailId
80
82
  })]
81
83
  })
82
84
  })
@@ -1243,7 +1243,8 @@ const CustomChatInterface = _ref3 => {
1243
1243
  const ReclamationFormModal = _ref4 => {
1244
1244
  let {
1245
1245
  open,
1246
- onClose
1246
+ onClose,
1247
+ portailId = null
1247
1248
  } = _ref4;
1248
1249
  const [activeStep, setActiveStep] = (0, _react.useState)(0);
1249
1250
  const [formData, setFormData] = (0, _react.useState)({
@@ -1262,7 +1263,7 @@ const ReclamationFormModal = _ref4 => {
1262
1263
  const {
1263
1264
  data: listServiceReclamation,
1264
1265
  isFetching: isFetchingListServiceReclamation
1265
- } = (0, _useReclamation.useListServiceReclamation)();
1266
+ } = (0, _useReclamation.useListServiceReclamation)(portailId);
1266
1267
  const [error, setError] = (0, _react.useState)(null);
1267
1268
  const errorRef = (0, _react.useRef)(null);
1268
1269
  const CustomPopper = props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Popper, _objectSpread(_objectSpread({}, props), {}, {
@@ -3402,7 +3403,8 @@ const PuiHelpWidget = _ref7 => {
3402
3403
  showReclamation = true,
3403
3404
  showGuides = false,
3404
3405
  currentProjectCode = null,
3405
- guideBaseUrl
3406
+ guideBaseUrl,
3407
+ portailId = null
3406
3408
  } = _ref7;
3407
3409
  const [dropdownOpen, setDropdownOpen] = (0, _react.useState)(false);
3408
3410
  const [isTourActive, setIsTourActive] = (0, _react.useState)(false);
@@ -4093,7 +4095,8 @@ const PuiHelpWidget = _ref7 => {
4093
4095
  })]
4094
4096
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ReclamationFormModal, {
4095
4097
  open: reclamationModalOpen,
4096
- onClose: () => setReclamationModalOpen(false)
4098
+ onClose: () => setReclamationModalOpen(false),
4099
+ portailId: portailId
4097
4100
  })]
4098
4101
  });
4099
4102
  };
@@ -52,20 +52,22 @@ const useDownloadDocument = () => {
52
52
  });
53
53
  };
54
54
  exports.useDownloadDocument = useDownloadDocument;
55
- const useListServiceReclamation = () => {
55
+ const useListServiceReclamation = exports.useListServiceReclamation = function useListServiceReclamation() {
56
+ let portailId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
56
57
  const {
57
58
  reclamationApi
58
59
  } = (0, _PuiHelpWidgetContext.useHelpWidget)();
59
60
  return (0, _reactQuery.useQuery)({
60
- queryKey: ["get_list_service_reclamation"],
61
- queryFn: () => reclamationApi.getListServiceReclamationApi(),
61
+ queryKey: ["get_list_service_reclamation", portailId],
62
+ queryFn: () =>
63
+ // portailId === ID_PMPCE
64
+ portailId ? reclamationApi.getListServiceReclamationByPortailApi(portailId) : reclamationApi.getListServiceReclamationApi(),
62
65
  initialData: {},
63
66
  retry: 1,
64
67
  refetchOnWindowFocus: false,
65
68
  refetchOnReconnect: false
66
69
  });
67
70
  };
68
- exports.useListServiceReclamation = useListServiceReclamation;
69
71
  const useClotureReclamation = () => {
70
72
  const {
71
73
  reclamationApi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portnet/ui",
3
- "version": "5.0.17",
3
+ "version": "5.0.18",
4
4
  "description": "Portnet UI",
5
5
  "keywords": [
6
6
  "react",