@paro.io/expert-shared-components 1.6.6 → 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.
Files changed (36) hide show
  1. package/lib/components/ClientReferencesSection/DeleteButton.js +11 -11
  2. package/lib/components/ClientReferencesSection/ParoError.js +10 -10
  3. package/lib/components/ClientReferencesSection/TagsSection.js +2 -2
  4. package/lib/components/ClientReferencesSection/styles/BrandedTypography.js +2 -2
  5. package/lib/components/ClientReferencesSection/styles/Buttons.js +15 -15
  6. package/lib/components/ClientReferencesSection/styles/Name.js +5 -5
  7. package/lib/components/ClientReferencesSection/styles/NullContentConditionalColor.js +4 -4
  8. package/lib/components/ClientReferencesSection/styles/SectionBody.js +11 -11
  9. package/lib/components/ClientReferencesSection/styles/SectionTitle.js +6 -6
  10. package/lib/components/ClientReferencesSection/styles/Tags.js +2 -2
  11. package/lib/components/DocumentCenter/ClientDocumentsTable.js +6 -1
  12. package/lib/components/DocumentCenter/DocumentCenter.d.ts +3 -1
  13. package/lib/components/DocumentCenter/DocumentCenter.js +26 -24
  14. package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
  15. package/lib/components/DocumentCenter/DocumentTable.js +350 -350
  16. package/lib/components/DocumentCenter/ParoDocumentsTable.js +1 -1
  17. package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
  18. package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
  19. package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
  20. package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
  21. package/lib/components/OrganizationChart/OrganizationChart.js +7 -7
  22. package/lib/components/Reviews/Pagination.js +6 -6
  23. package/lib/components/ReviewsTab/RatingHeader.js +6 -6
  24. package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
  25. package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
  26. package/lib/components/shared/Error.d.ts +6 -6
  27. package/lib/components/shared/Error.js +40 -40
  28. package/lib/components/shared/Image.js +13 -13
  29. package/lib/components/shared/ProfileTextField.d.ts +18 -18
  30. package/lib/components/shared/ProfileTextField.js +16 -16
  31. package/lib/components/shared/StyledActionButtons.d.ts +7 -7
  32. package/lib/components/shared/StyledActionButtons.js +15 -15
  33. package/lib/components/shared/ToastNotification.d.ts +10 -10
  34. package/lib/components/shared/ToastNotification.js +63 -63
  35. package/lib/components/shared/utils.js +1 -1
  36. package/package.json +59 -59
@@ -15,26 +15,26 @@ const omitDeleteButtonIconProps = ["isDisabled"];
15
15
  const omitDeleteButtonTypographyProps = ["isDisabled"];
16
16
  const DeleteButtonTypography = (0, styled_components_1.default)((props) => {
17
17
  return react_1.default.createElement(Typography_1.default, Object.assign({}, (0, omit_1.default)(props, omitDeleteButtonTypographyProps)));
18
- }) `
19
- padding-right: 17px;
20
- color: ${colors_1.default.deleteButtonRed} !important ;
18
+ }) `
19
+ padding-right: 17px;
20
+ color: ${colors_1.default.deleteButtonRed} !important ;
21
21
  ${({ isDisabled }) => {
22
22
  return (isDisabled &&
23
- `
24
- color: ${colors_1.default.notice} !important;
23
+ `
24
+ color: ${colors_1.default.notice} !important;
25
25
  `);
26
- }}
26
+ }}
27
27
  `;
28
28
  const DeleteButtonIcon = (0, styled_components_1.default)((props) => {
29
29
  return react_1.default.createElement(Clear_1.default, Object.assign({}, (0, omit_1.default)(props, omitDeleteButtonIconProps)));
30
- }) `
31
- color: ${colors_1.default.deleteButtonRed} !important ;
30
+ }) `
31
+ color: ${colors_1.default.deleteButtonRed} !important ;
32
32
  ${({ isDisabled }) => {
33
33
  return (isDisabled &&
34
- `
35
- color: ${colors_1.default.notice} !important;
34
+ `
35
+ color: ${colors_1.default.notice} !important;
36
36
  `);
37
- }}
37
+ }}
38
38
  `;
39
39
  const DeleteButton = ({ buttonText, onClick, variant = "text", isDisabled, className }) => {
40
40
  return (react_1.default.createElement(Buttons_1.StyledEditOrDeleteButton, { onClick: () => {
@@ -9,18 +9,18 @@ const core_1 = require("@material-ui/core");
9
9
  const styled_components_1 = __importDefault(require("styled-components"));
10
10
  const colors_1 = __importDefault(require("./constants/colors"));
11
11
  const AlertSnackBarButton_1 = require("./AlertSnackBarButton");
12
- const ErrorBox = (0, styled_components_1.default)(core_1.Box) `
13
- width: 100%;
14
- padding-bottom: 100;
12
+ const ErrorBox = (0, styled_components_1.default)(core_1.Box) `
13
+ width: 100%;
14
+ padding-bottom: 100;
15
15
  `;
16
- const ParoTitle = (0, styled_components_1.default)(core_1.Box) `
17
- color: ${colors_1.default.paroBlack};
18
- padding: 0px 0px 18px 0px;
16
+ const ParoTitle = (0, styled_components_1.default)(core_1.Box) `
17
+ color: ${colors_1.default.paroBlack};
18
+ padding: 0px 0px 18px 0px;
19
19
  `;
20
- const ParoSubtitle = styled_components_1.default.div `
21
- color: ${colors_1.default.paroBlack};
22
- margin-bottom: 24px;
23
- font-size: 1rem;
20
+ const ParoSubtitle = styled_components_1.default.div `
21
+ color: ${colors_1.default.paroBlack};
22
+ margin-bottom: 24px;
23
+ font-size: 1rem;
24
24
  `;
25
25
  const ParoError = ({ handleClose }) => {
26
26
  const handleCancelLanguage = handleClose ? "Close" : "Retry";
@@ -9,8 +9,8 @@ const core_1 = require("@material-ui/core");
9
9
  const styled_components_1 = __importDefault(require("styled-components"));
10
10
  const NullContentConditionalColor_1 = require("./styles/NullContentConditionalColor");
11
11
  const Tags_1 = require("./styles/Tags");
12
- const ProfileTags = (0, styled_components_1.default)(Tags_1.Tags) `
13
- margin: 0 5px 8px 0;
12
+ const ProfileTags = (0, styled_components_1.default)(Tags_1.Tags) `
13
+ margin: 0 5px 8px 0;
14
14
  `;
15
15
  const TagsSection = ({ multiLine, tags = [], tagsExpected, }) => {
16
16
  if ((tags === null || tags === void 0 ? void 0 : tags.length) < 1) {
@@ -7,6 +7,6 @@ exports.StyledTypography = void 0;
7
7
  const Typography_1 = __importDefault(require("@material-ui/core/Typography"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const colors_1 = __importDefault(require("../constants/colors"));
10
- exports.StyledTypography = (0, styled_components_1.default)(Typography_1.default) `
11
- color: ${colors_1.default.paroDeepblue} !important ;
10
+ exports.StyledTypography = (0, styled_components_1.default)(Typography_1.default) `
11
+ color: ${colors_1.default.paroDeepblue} !important ;
12
12
  `;
@@ -7,21 +7,21 @@ exports.StyledEditOrDeleteButton = exports.HeaderButtonUnderline = exports.Heade
7
7
  const core_1 = require("@material-ui/core");
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const colors_1 = __importDefault(require("../constants/colors"));
10
- exports.HeaderButtons = (0, styled_components_1.default)(core_1.Button) `
11
- margin-left: 0px !important;
12
- padding-left: 0px !important;
13
- span {
14
- color: ${colors_1.default.buttonText} !important;
15
- }
10
+ exports.HeaderButtons = (0, styled_components_1.default)(core_1.Button) `
11
+ margin-left: 0px !important;
12
+ padding-left: 0px !important;
13
+ span {
14
+ color: ${colors_1.default.buttonText} !important;
15
+ }
16
16
  `;
17
- exports.HeaderButtonUnderline = (0, styled_components_1.default)(exports.HeaderButtons) `
18
- text-decoration: underline;
17
+ exports.HeaderButtonUnderline = (0, styled_components_1.default)(exports.HeaderButtons) `
18
+ text-decoration: underline;
19
19
  `;
20
- exports.StyledEditOrDeleteButton = (0, styled_components_1.default)(core_1.Button) `
21
- margin: 10px 0px !important;
22
- background-color: ${colors_1.default.primary};
23
- color: ${colors_1.default.white};
24
- :hover {
25
- color: ${colors_1.default.primary} !important;
26
- }
20
+ exports.StyledEditOrDeleteButton = (0, styled_components_1.default)(core_1.Button) `
21
+ margin: 10px 0px !important;
22
+ background-color: ${colors_1.default.primary};
23
+ color: ${colors_1.default.white};
24
+ :hover {
25
+ color: ${colors_1.default.primary} !important;
26
+ }
27
27
  `;
@@ -11,12 +11,12 @@ const styled_components_1 = __importDefault(require("styled-components"));
11
11
  const colors_1 = __importDefault(require("../constants/colors"));
12
12
  exports.Name = (0, styled_components_1.default)((props) => {
13
13
  return react_1.default.createElement(core_1.Typography, Object.assign({}, (0, omit_1.default)(props, ["isNull"])));
14
- }) `
15
- font-family: Roboto-Bold;
14
+ }) `
15
+ font-family: Roboto-Bold;
16
16
  ${({ isNull }) => {
17
17
  return (isNull &&
18
- `
19
- color: ${colors_1.default.paroRed} !important;
18
+ `
19
+ color: ${colors_1.default.paroRed} !important;
20
20
  `);
21
- }}
21
+ }}
22
22
  `;
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.NullContentConditionalColor = void 0;
7
7
  const styled_components_1 = __importDefault(require("styled-components"));
8
8
  const colors_1 = __importDefault(require("../constants/colors"));
9
- exports.NullContentConditionalColor = styled_components_1.default.span `
9
+ exports.NullContentConditionalColor = styled_components_1.default.span `
10
10
  ${(props) => {
11
11
  return (props.isNull &&
12
- `
13
- color: ${colors_1.default.paroRed} !important
12
+ `
13
+ color: ${colors_1.default.paroRed} !important
14
14
  `);
15
- }}
15
+ }}
16
16
  `;
@@ -10,18 +10,18 @@ const styled_components_1 = __importDefault(require("styled-components"));
10
10
  const colors_1 = __importDefault(require("../constants/colors"));
11
11
  exports.SectionBody = (0, styled_components_1.default)((props) => {
12
12
  return react_1.default.createElement("div", Object.assign({}, (0, omit_1.default)(props, ["atLeastOneValueIsNull"])));
13
- }) `
14
- background-color: ${colors_1.default.white};
15
- border-radius: 2px;
16
- border: 1px Solid ${colors_1.default.lightGray};
17
- color: ${colors_1.default.paroBlack};
18
- font-family: Roboto;
19
- padding: 32.5px 42.5px 32.5px 42.5px;
20
- width: 100%;
13
+ }) `
14
+ background-color: ${colors_1.default.white};
15
+ border-radius: 2px;
16
+ border: 1px Solid ${colors_1.default.lightGray};
17
+ color: ${colors_1.default.paroBlack};
18
+ font-family: Roboto;
19
+ padding: 32.5px 42.5px 32.5px 42.5px;
20
+ width: 100%;
21
21
  ${({ atLeastOneValueIsNull }) => {
22
22
  return (atLeastOneValueIsNull &&
23
- `
24
- border-color: ${colors_1.default.paroRed} !important;
23
+ `
24
+ border-color: ${colors_1.default.paroRed} !important;
25
25
  `);
26
- }}
26
+ }}
27
27
  `;
@@ -10,12 +10,12 @@ const styled_components_1 = __importDefault(require("styled-components"));
10
10
  const colors_1 = __importDefault(require("../constants/colors"));
11
11
  exports.SectionTitle = (0, styled_components_1.default)((props) => {
12
12
  return react_1.default.createElement("div", Object.assign({}, (0, omit_1.default)(props, ["noBottomPadding"])));
13
- }) `
14
- font-family: Roboto-Bold;
15
- font-size: 20px;
16
- color: ${colors_1.default.paroBlack};
17
- padding: 23px 0px 15.5px 0px;
13
+ }) `
14
+ font-family: Roboto-Bold;
15
+ font-size: 20px;
16
+ color: ${colors_1.default.paroBlack};
17
+ padding: 23px 0px 15.5px 0px;
18
18
  ${({ noBottomPadding }) => {
19
19
  return noBottomPadding && "padding-bottom: 0 !important;";
20
- }}
20
+ }}
21
21
  `;
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Tags = void 0;
7
7
  const core_1 = require("@material-ui/core");
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
- exports.Tags = (0, styled_components_1.default)(core_1.Chip) `
10
- font-family: Roboto-Bold;
9
+ exports.Tags = (0, styled_components_1.default)(core_1.Chip) `
10
+ font-family: Roboto-Bold;
11
11
  `;
@@ -322,6 +322,11 @@ const ClientDocumentsTable = ({ legacyFreelancerId, expertFiles, setExpertClient
322
322
  }
323
323
  }
324
324
  });
325
+ (0, react_1.useEffect)(() => {
326
+ if (expertFiles && expertFiles.length > 0) {
327
+ setFiles(expertFiles);
328
+ }
329
+ }, [expertFiles]);
325
330
  const toggleDeleteModal = (fileName, fileId) => {
326
331
  setDeleteModalOpen(!isDeleteModalOpen);
327
332
  if (fileName) {
@@ -332,7 +337,7 @@ const ClientDocumentsTable = ({ legacyFreelancerId, expertFiles, setExpertClient
332
337
  return (react_1.default.createElement(react_1.default.Fragment, null,
333
338
  react_1.default.createElement(DocumentUploadRow_1.DocumentUploadRow, { clientAndProject: clientAndProject, setClientAndProject: setClientAndProject, clientAndProjectsList: clientAndProjectsList, docType: docType, setDocType: setDocType, paroDocuments: paroDocuments, uploadExpertClientFiles: uploadExpertClientFiles, refetchFiles: refetchFiles, legacyFreelancerId: legacyFreelancerId, freelancerName: freelancerName, freelancerEmail: freelancerEmail, isClientPortal: isClientPortal, documentUploadUrl: documentUploadUrl }),
334
339
  react_1.default.createElement(utils_1.CustomPaper, { style: { height: `${(files === null || files === void 0 ? void 0 : files.length) === 0 ? '30vh' : 'auto'}` } },
335
- (files === null || files === void 0 ? void 0 : files.length) > 0 && react_1.default.createElement("div", { className: 'w-1/3' },
340
+ react_1.default.createElement("div", { className: 'w-1/3' },
336
341
  react_1.default.createElement(base_ui_1.Input, { placeholder: "Search Documents", type: "text", value: searchText, onChange: (e) => setSearchText(e.target.value) })),
337
342
  react_1.default.createElement(core_1.Box, { mt: 2 }, (files === null || files === void 0 ? void 0 : files.length) > 0 ? react_1.default.createElement(core_1.Table, { style: { overflow: 'auto' } },
338
343
  react_1.default.createElement(core_1.TableHead, null,
@@ -4,6 +4,7 @@ interface DocumentCenterProps {
4
4
  setOpenModal: (openModal: boolean) => void;
5
5
  expertClientFilesLazyQuery: any;
6
6
  getClientAndProjectsLazyQuery?: any;
7
+ clientFilesData?: any[];
7
8
  uploadExpertClientFiles: any;
8
9
  uploadFileData?: any;
9
10
  deleteFileMutation?: any;
@@ -20,6 +21,7 @@ interface DocumentCenterProps {
20
21
  getFreelancerLazyQuery?: any;
21
22
  documentUploadUrl?: string;
22
23
  downloadDocumentUrl?: string;
24
+ loading?: boolean;
23
25
  }
24
- export declare const DocumentCenter: ({ legacyFreelancerId, openModal, setOpenModal, expertClientFilesLazyQuery, getClientAndProjectsLazyQuery, uploadExpertClientFiles, uploadFileData, deleteFileMutation, updateFreelancerExpiryMutation, foldername, getFilesLazyQuery, getFileLazyQuery, freelancerName, freelancerEmail, updateFileLastViewed, deleteExpertClientFile, isClientPortal, expertProjectsList, getFreelancerLazyQuery, documentUploadUrl, downloadDocumentUrl, }: DocumentCenterProps) => JSX.Element;
26
+ export declare const DocumentCenter: ({ legacyFreelancerId, openModal, setOpenModal, expertClientFilesLazyQuery, getClientAndProjectsLazyQuery, clientFilesData, uploadExpertClientFiles, uploadFileData, deleteFileMutation, updateFreelancerExpiryMutation, foldername, getFilesLazyQuery, getFileLazyQuery, freelancerName, freelancerEmail, updateFileLastViewed, deleteExpertClientFile, isClientPortal, expertProjectsList, getFreelancerLazyQuery, documentUploadUrl, downloadDocumentUrl, loading, }: DocumentCenterProps) => JSX.Element;
25
27
  export {};
@@ -80,39 +80,33 @@ 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, uploadExpertClientFiles, uploadFileData, deleteFileMutation, updateFreelancerExpiryMutation, foldername, getFilesLazyQuery, getFileLazyQuery, freelancerName, freelancerEmail, updateFileLastViewed, deleteExpertClientFile, isClientPortal = false, expertProjectsList, getFreelancerLazyQuery, documentUploadUrl, downloadDocumentUrl, }) => {
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
- const [expertClientFiles, setExpertClientFiles] = (0, react_1.useState)([]);
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
- const [loading, setLoading] = (0, react_1.useState)(false);
90
89
  const [insuranceExpiryDate, setInsuranceExpiryDate] = (0, react_1.useState)();
90
+ const [expertLoading, setExpertLoading] = (0, react_1.useState)(false);
91
91
  const fetchQueries = () => __awaiter(void 0, void 0, void 0, function* () {
92
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
92
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
93
93
  try {
94
- setLoading(true);
94
+ setExpertLoading(true);
95
95
  const freelancerIds = Array.isArray(legacyFreelancerId) ? legacyFreelancerId : [legacyFreelancerId];
96
96
  let clientFiles = [];
97
97
  let clientAndProjects = [];
98
98
  let expertFiles = [];
99
99
  let expiryDate = [];
100
- if (isClientPortal) {
101
- const clientFilesResponse = yield expertClientFilesLazyQuery();
102
- clientFiles = (_c = (_b = (_a = clientFilesResponse === null || clientFilesResponse === void 0 ? void 0 : clientFilesResponse.data) === null || _a === void 0 ? void 0 : _a.getExpertClientFiles) === null || _b === void 0 ? void 0 : _b.files) !== null && _c !== void 0 ? _c : [];
103
- }
104
- else {
105
- const [clientFilesResponse, clientAndProjectsResponse, expertFilesResponse, freelancerData] = yield Promise.all([
106
- expertClientFilesLazyQuery && expertClientFilesLazyQuery({ variables: { freelancerIds }, fetchPolicy: 'network-only', }),
107
- getClientAndProjectsLazyQuery && getClientAndProjectsLazyQuery({ variables: { legacyFreelancerId: legacyFreelancerId, forReviews: true }, fetchPolicy: 'network-only', }),
108
- getFilesLazyQuery && getFilesLazyQuery({ variables: { input: { foldername: foldername }, fetchPolicy: 'network-only', } }),
109
- getFreelancerLazyQuery && getFreelancerLazyQuery({ variables: { id: legacyFreelancerId }, fetchPolicy: 'network-only', })
110
- ]);
111
- clientFiles = (_f = (_e = (_d = clientFilesResponse === null || clientFilesResponse === void 0 ? void 0 : clientFilesResponse.data) === null || _d === void 0 ? void 0 : _d.getExpertClientFiles) === null || _e === void 0 ? void 0 : _e.files) !== null && _f !== void 0 ? _f : [];
112
- clientAndProjects = (_h = (_g = clientAndProjectsResponse === null || clientAndProjectsResponse === void 0 ? void 0 : clientAndProjectsResponse.data) === null || _g === void 0 ? void 0 : _g.getParoProjects) !== null && _h !== void 0 ? _h : [];
113
- expertFiles = (_k = (_j = expertFilesResponse === null || expertFilesResponse === void 0 ? void 0 : expertFilesResponse.data) === null || _j === void 0 ? void 0 : _j.getFiles) !== null && _k !== void 0 ? _k : [];
114
- expiryDate = (_m = (_l = freelancerData === null || freelancerData === void 0 ? void 0 : freelancerData.data) === null || _l === void 0 ? void 0 : _l.getFreelancer) === null || _m === void 0 ? void 0 : _m.insuranceExpiryDate;
115
- }
100
+ const [clientFilesResponse, clientAndProjectsResponse, expertFilesResponse, freelancerData] = yield Promise.all([
101
+ expertClientFilesLazyQuery && expertClientFilesLazyQuery({ variables: { freelancerIds }, fetchPolicy: 'network-only', }),
102
+ getClientAndProjectsLazyQuery && getClientAndProjectsLazyQuery({ variables: { legacyFreelancerId: legacyFreelancerId, forReviews: true }, fetchPolicy: 'network-only', }),
103
+ getFilesLazyQuery && getFilesLazyQuery({ variables: { input: { foldername: foldername }, fetchPolicy: 'network-only', } }),
104
+ getFreelancerLazyQuery && getFreelancerLazyQuery({ variables: { id: legacyFreelancerId }, fetchPolicy: 'network-only', })
105
+ ]);
106
+ clientFiles = (_c = (_b = (_a = clientFilesResponse === null || clientFilesResponse === void 0 ? void 0 : clientFilesResponse.data) === null || _a === void 0 ? void 0 : _a.getExpertClientFiles) === null || _b === void 0 ? void 0 : _b.files) !== null && _c !== void 0 ? _c : [];
107
+ clientAndProjects = (_e = (_d = clientAndProjectsResponse === null || clientAndProjectsResponse === void 0 ? void 0 : clientAndProjectsResponse.data) === null || _d === void 0 ? void 0 : _d.getParoProjects) !== null && _e !== void 0 ? _e : [];
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 : [];
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;
116
110
  const filterProjects = clientAndProjects.filter((p) => p.status !== 'Complete');
117
111
  setExpertClientFiles(clientFiles);
118
112
  setClientAndProjects(isClientPortal ? expertProjectsList : filterProjects);
@@ -123,14 +117,22 @@ const DocumentCenter = ({ legacyFreelancerId, openModal, setOpenModal, expertCli
123
117
  console.error("Error fetching queries:", error);
124
118
  }
125
119
  finally {
126
- setLoading(false);
120
+ setExpertLoading(false);
127
121
  }
128
122
  });
129
123
  (0, react_1.useEffect)(() => {
130
- if (openModal) {
124
+ if (openModal && !isClientPortal) {
131
125
  fetchQueries();
132
126
  }
133
127
  }, [openModal]);
128
+ (0, react_1.useEffect)(() => {
129
+ if (clientFilesData && clientFilesData.length > 0) {
130
+ setExpertClientFiles(clientFilesData !== null && clientFilesData !== void 0 ? clientFilesData : []);
131
+ setClientAndProjects(expertProjectsList !== null && expertProjectsList !== void 0 ? expertProjectsList : []);
132
+ setExpertFiles(clientFilesData);
133
+ loading = false;
134
+ }
135
+ }, [clientFilesData]);
134
136
  const handleChange = (event, newValue) => {
135
137
  if (newValue >= 0) {
136
138
  setValue(newValue);
@@ -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
  :
@@ -1,15 +1,15 @@
1
- interface DocumentTableProps {
2
- legacyFreelancerId: number;
3
- paroProjectsData: any;
4
- expiryDate: string;
5
- expertFiles: any[];
6
- uploadExpertClientFiles: any;
7
- uploadFileData: any;
8
- deleteFileMutation: any;
9
- updateFreelancerExpiryMutation: any;
10
- GetFilesDocument: any;
11
- foldername: string;
12
- paroDocuments: boolean;
13
- }
14
- export declare const DocumentTable: ({ legacyFreelancerId, paroProjectsData, expiryDate, expertFiles, uploadExpertClientFiles, uploadFileData, deleteFileMutation, updateFreelancerExpiryMutation, GetFilesDocument, foldername, paroDocuments }: DocumentTableProps) => JSX.Element;
15
- export {};
1
+ interface DocumentTableProps {
2
+ legacyFreelancerId: number;
3
+ paroProjectsData: any;
4
+ expiryDate: string;
5
+ expertFiles: any[];
6
+ uploadExpertClientFiles: any;
7
+ uploadFileData: any;
8
+ deleteFileMutation: any;
9
+ updateFreelancerExpiryMutation: any;
10
+ GetFilesDocument: any;
11
+ foldername: string;
12
+ paroDocuments: boolean;
13
+ }
14
+ export declare const DocumentTable: ({ legacyFreelancerId, paroProjectsData, expiryDate, expertFiles, uploadExpertClientFiles, uploadFileData, deleteFileMutation, updateFreelancerExpiryMutation, GetFilesDocument, foldername, paroDocuments }: DocumentTableProps) => JSX.Element;
15
+ export {};