@paro.io/expert-shared-components 1.6.7 → 1.6.8
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.
|
@@ -80,17 +80,18 @@ const CustomDialogContent = (0, core_1.styled)(core_1.DialogContent)(({ theme })
|
|
|
80
80
|
background: '#707070',
|
|
81
81
|
},
|
|
82
82
|
}));
|
|
83
|
-
const DocumentCenter = ({ legacyFreelancerId, openModal, setOpenModal, expertClientFilesLazyQuery, getClientAndProjectsLazyQuery, clientFilesData, uploadExpertClientFiles, uploadFileData, deleteFileMutation, updateFreelancerExpiryMutation, foldername, getFilesLazyQuery, getFileLazyQuery, freelancerName, freelancerEmail, updateFileLastViewed, deleteExpertClientFile, isClientPortal = false, expertProjectsList, getFreelancerLazyQuery, documentUploadUrl, downloadDocumentUrl, loading, }) => {
|
|
83
|
+
const DocumentCenter = ({ legacyFreelancerId, openModal, setOpenModal, expertClientFilesLazyQuery, getClientAndProjectsLazyQuery, clientFilesData, uploadExpertClientFiles, uploadFileData, deleteFileMutation, updateFreelancerExpiryMutation, foldername, getFilesLazyQuery, getFileLazyQuery, freelancerName, freelancerEmail, updateFileLastViewed, deleteExpertClientFile, isClientPortal = false, expertProjectsList, getFreelancerLazyQuery, documentUploadUrl, downloadDocumentUrl, loading = false, }) => {
|
|
84
84
|
var _a;
|
|
85
85
|
const [value, setValue] = (0, react_1.useState)(0);
|
|
86
86
|
const [expertClientFiles, setExpertClientFiles] = (0, react_1.useState)(clientFilesData !== null && clientFilesData !== void 0 ? clientFilesData : []);
|
|
87
87
|
const [expertFiles, setExpertFiles] = (0, react_1.useState)([]);
|
|
88
88
|
const [clientAndProjects, setClientAndProjects] = (0, react_1.useState)([]);
|
|
89
89
|
const [insuranceExpiryDate, setInsuranceExpiryDate] = (0, react_1.useState)();
|
|
90
|
+
const [expertLoading, setExpertLoading] = (0, react_1.useState)(false);
|
|
90
91
|
const fetchQueries = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
91
92
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
92
93
|
try {
|
|
93
|
-
|
|
94
|
+
setExpertLoading(true);
|
|
94
95
|
const freelancerIds = Array.isArray(legacyFreelancerId) ? legacyFreelancerId : [legacyFreelancerId];
|
|
95
96
|
let clientFiles = [];
|
|
96
97
|
let clientAndProjects = [];
|
|
@@ -107,6 +108,7 @@ const DocumentCenter = ({ legacyFreelancerId, openModal, setOpenModal, expertCli
|
|
|
107
108
|
expertFiles = (_g = (_f = expertFilesResponse === null || expertFilesResponse === void 0 ? void 0 : expertFilesResponse.data) === null || _f === void 0 ? void 0 : _f.getFiles) !== null && _g !== void 0 ? _g : [];
|
|
108
109
|
expiryDate = (_j = (_h = freelancerData === null || freelancerData === void 0 ? void 0 : freelancerData.data) === null || _h === void 0 ? void 0 : _h.getFreelancer) === null || _j === void 0 ? void 0 : _j.insuranceExpiryDate;
|
|
109
110
|
const filterProjects = clientAndProjects.filter((p) => p.status !== 'Complete');
|
|
111
|
+
setExpertClientFiles(clientFiles);
|
|
110
112
|
setClientAndProjects(isClientPortal ? expertProjectsList : filterProjects);
|
|
111
113
|
setExpertFiles(expertFiles);
|
|
112
114
|
setInsuranceExpiryDate(expiryDate ? (0, utils_1.formatDate)(expiryDate) : '');
|
|
@@ -115,7 +117,7 @@ const DocumentCenter = ({ legacyFreelancerId, openModal, setOpenModal, expertCli
|
|
|
115
117
|
console.error("Error fetching queries:", error);
|
|
116
118
|
}
|
|
117
119
|
finally {
|
|
118
|
-
|
|
120
|
+
setExpertLoading(false);
|
|
119
121
|
}
|
|
120
122
|
});
|
|
121
123
|
(0, react_1.useEffect)(() => {
|
|
@@ -152,7 +154,7 @@ const DocumentCenter = ({ legacyFreelancerId, openModal, setOpenModal, expertCli
|
|
|
152
154
|
react_1.default.createElement(core_1.IconButton, { onClick: () => setOpenModal(false) },
|
|
153
155
|
react_1.default.createElement(core_1.Box, { style: { backgroundColor: 'white', width: 40, height: 40, borderRadius: '4px' } },
|
|
154
156
|
react_1.default.createElement(Close_1.default, null))))),
|
|
155
|
-
react_1.default.createElement(CustomDialogContent, { style: { width: '100%' } }, loading
|
|
157
|
+
react_1.default.createElement(CustomDialogContent, { style: { width: '100%' } }, loading || expertLoading
|
|
156
158
|
?
|
|
157
159
|
react_1.default.createElement(core_1.CircularProgress, { size: 24 })
|
|
158
160
|
:
|