@portnet/ui 5.0.24 → 5.0.27
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.
|
@@ -1772,6 +1772,7 @@ const ReclamationsList = _ref5 => {
|
|
|
1772
1772
|
const [search, setSearch] = (0, _react.useState)();
|
|
1773
1773
|
const [searchKey, setSearchKey] = (0, _react.useState)("");
|
|
1774
1774
|
const STATUT_REPONDUE = "REPONDUE";
|
|
1775
|
+
const STATUT_EN_ATTENTE_COMPLEMENT = "EN_ATTENTE_COMPLEMENT";
|
|
1775
1776
|
const STATUT_COLOR_MAP = {
|
|
1776
1777
|
EN_ATTENTE: "#2196F3",
|
|
1777
1778
|
EN_COURS: "#FF9800",
|
|
@@ -1897,11 +1898,11 @@ const ReclamationsList = _ref5 => {
|
|
|
1897
1898
|
queryClient.invalidateQueries("reclamations");
|
|
1898
1899
|
handleCloseReouvreDialog();
|
|
1899
1900
|
handleCloseDetails();
|
|
1900
|
-
_reactToastify.toast.success("Réclamation réouverte avec succès.");
|
|
1901
|
+
_reactToastify.toast.success((selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.statutCode) === STATUT_EN_ATTENTE_COMPLEMENT ? "Compléments ajoutés avec succès." : "Réclamation réouverte avec succès.");
|
|
1901
1902
|
},
|
|
1902
1903
|
onError: err => {
|
|
1903
1904
|
var _err$response$data$me3, _err$response3;
|
|
1904
|
-
const msg = (_err$response$data$me3 = (_err$response3 = err.response) === null || _err$response3 === void 0 || (_err$response3 = _err$response3.data) === null || _err$response3 === void 0 ? void 0 : _err$response3.message) !== null && _err$response$data$me3 !== void 0 ? _err$response$data$me3 : "Une erreur est survenue lors de la réouverture.";
|
|
1905
|
+
const msg = (_err$response$data$me3 = (_err$response3 = err.response) === null || _err$response3 === void 0 || (_err$response3 = _err$response3.data) === null || _err$response3 === void 0 ? void 0 : _err$response3.message) !== null && _err$response$data$me3 !== void 0 ? _err$response$data$me3 : (selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.statutCode) === STATUT_EN_ATTENTE_COMPLEMENT ? "Une erreur est survenue lors de l'ajout des compléments." : "Une erreur est survenue lors de la réouverture.";
|
|
1905
1906
|
_reactToastify.toast.error(msg);
|
|
1906
1907
|
}
|
|
1907
1908
|
});
|
|
@@ -2809,6 +2810,24 @@ const ReclamationsList = _ref5 => {
|
|
|
2809
2810
|
},
|
|
2810
2811
|
children: "R\xE9ouverture"
|
|
2811
2812
|
})]
|
|
2813
|
+
}), (selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.statutCode) === STATUT_EN_ATTENTE_COMPLEMENT && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
2814
|
+
variant: "contained",
|
|
2815
|
+
onClick: handleOpenReouvreDialog,
|
|
2816
|
+
sx: {
|
|
2817
|
+
backgroundColor: "var(--primary-color, #222f67)",
|
|
2818
|
+
color: "white",
|
|
2819
|
+
padding: "5.5px 23px",
|
|
2820
|
+
borderRadius: "6px",
|
|
2821
|
+
fontWeight: "500",
|
|
2822
|
+
fontSize: "14px",
|
|
2823
|
+
textTransform: "none",
|
|
2824
|
+
boxShadow: "none",
|
|
2825
|
+
"&:hover": {
|
|
2826
|
+
backgroundColor: "var(--secondary-color, #2d3d7f)",
|
|
2827
|
+
boxShadow: "none"
|
|
2828
|
+
}
|
|
2829
|
+
},
|
|
2830
|
+
children: "Ajouter compl\xE9ments"
|
|
2812
2831
|
})]
|
|
2813
2832
|
})]
|
|
2814
2833
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Dialog, {
|
|
@@ -2851,7 +2870,7 @@ const ReclamationsList = _ref5 => {
|
|
|
2851
2870
|
fontSize: "16px",
|
|
2852
2871
|
margin: 0
|
|
2853
2872
|
},
|
|
2854
|
-
children: "
|
|
2873
|
+
children: (selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.statutCode) === STATUT_EN_ATTENTE_COMPLEMENT ? "Ajout de compléments" : "Réouverture de la réclamation"
|
|
2855
2874
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
2856
2875
|
component: "div",
|
|
2857
2876
|
sx: {
|
|
@@ -2877,8 +2896,8 @@ const ReclamationsList = _ref5 => {
|
|
|
2877
2896
|
gap: "20px"
|
|
2878
2897
|
},
|
|
2879
2898
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, {
|
|
2880
|
-
label: "Description",
|
|
2881
|
-
placeholder: "
|
|
2899
|
+
label: (selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.statutCode) === STATUT_EN_ATTENTE_COMPLEMENT ? "Compléments" : "Description",
|
|
2900
|
+
placeholder: (selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.statutCode) === STATUT_EN_ATTENTE_COMPLEMENT ? "Saisissez les compléments..." : "Décrivez la raison de la réouverture...",
|
|
2882
2901
|
value: reouvreDescription,
|
|
2883
2902
|
onChange: e => setReouvreDescription(e.target.value),
|
|
2884
2903
|
multiline: true,
|
|
@@ -3000,7 +3019,7 @@ const ReclamationsList = _ref5 => {
|
|
|
3000
3019
|
sx: {
|
|
3001
3020
|
color: "white"
|
|
3002
3021
|
}
|
|
3003
|
-
}) : "Confirmer la réouverture"
|
|
3022
|
+
}) : (selectedReclamation === null || selectedReclamation === void 0 ? void 0 : selectedReclamation.statutCode) === STATUT_EN_ATTENTE_COMPLEMENT ? "Confirmer" : "Confirmer la réouverture"
|
|
3004
3023
|
})]
|
|
3005
3024
|
})]
|
|
3006
3025
|
})]
|