@paro.io/expert-shared-components 1.7.8 → 1.7.9

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 (38) 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/DocumentCenter.js +1 -1
  12. package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
  13. package/lib/components/DocumentCenter/DocumentTable.js +350 -350
  14. package/lib/components/DocumentCenter/DocumentUploadRow.d.ts +4 -1
  15. package/lib/components/DocumentCenter/DocumentUploadRow.js +63 -34
  16. package/lib/components/DocumentCenter/ParoDocumentsTable.d.ts +1 -0
  17. package/lib/components/DocumentCenter/ParoDocumentsTable.js +1 -44
  18. package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
  19. package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
  20. package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
  21. package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
  22. package/lib/components/OrganizationChart/OrganizationChart.js +7 -7
  23. package/lib/components/Reviews/Pagination.js +6 -6
  24. package/lib/components/ReviewsTab/RatingHeader.js +6 -6
  25. package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
  26. package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
  27. package/lib/components/ServiceLinesTemplate/index.d.ts +2 -1
  28. package/lib/components/ServiceLinesTemplate/index.js +17 -17
  29. package/lib/components/shared/Error.d.ts +6 -6
  30. package/lib/components/shared/Error.js +40 -40
  31. package/lib/components/shared/Image.js +13 -13
  32. package/lib/components/shared/ProfileTextField.d.ts +18 -18
  33. package/lib/components/shared/ProfileTextField.js +16 -16
  34. package/lib/components/shared/StyledActionButtons.d.ts +7 -7
  35. package/lib/components/shared/StyledActionButtons.js +15 -15
  36. package/lib/components/shared/ToastNotification.d.ts +10 -10
  37. package/lib/components/shared/ToastNotification.js +63 -63
  38. package/package.json +59 -59
@@ -16,6 +16,9 @@ interface DocumentUploadProps {
16
16
  error?: string | null;
17
17
  clientAndProjectsList?: any[];
18
18
  uploadExpertClientFiles?: any;
19
+ uploadInternalFile?: any;
20
+ foldername?: string;
21
+ insuranceExpiryDate?: any;
19
22
  refetchFiles?: any;
20
23
  legacyFreelancerId?: any;
21
24
  freelancerName?: string;
@@ -23,5 +26,5 @@ interface DocumentUploadProps {
23
26
  isClientPortal?: boolean;
24
27
  documentUploadUrl?: string;
25
28
  }
26
- export declare const DocumentUploadRow: ({ clientAndProject, setClientAndProject, docType, setDocType, paroDocuments, expiryDate, handleDateChange, error, clientAndProjectsList, uploadExpertClientFiles, refetchFiles, legacyFreelancerId, freelancerName, freelancerEmail, isClientPortal, documentUploadUrl, }: DocumentUploadProps) => JSX.Element;
29
+ export declare const DocumentUploadRow: ({ clientAndProject, setClientAndProject, docType, setDocType, paroDocuments, expiryDate, handleDateChange, error, clientAndProjectsList, uploadExpertClientFiles, uploadInternalFile, foldername, insuranceExpiryDate, refetchFiles, legacyFreelancerId, freelancerName, freelancerEmail, isClientPortal, documentUploadUrl, }: DocumentUploadProps) => JSX.Element;
27
30
  export {};
@@ -78,7 +78,7 @@ const generateOptions = (array, clientOptions, isClientPortal) => {
78
78
  }
79
79
  });
80
80
  };
81
- const DocumentUploadRow = ({ clientAndProject, setClientAndProject, docType, setDocType, paroDocuments, expiryDate, handleDateChange, error, clientAndProjectsList, uploadExpertClientFiles, refetchFiles, legacyFreelancerId, freelancerName, freelancerEmail, isClientPortal = false, documentUploadUrl, }) => {
81
+ const DocumentUploadRow = ({ clientAndProject, setClientAndProject, docType, setDocType, paroDocuments, expiryDate, handleDateChange, error, clientAndProjectsList, uploadExpertClientFiles, uploadInternalFile, foldername, insuranceExpiryDate, refetchFiles, legacyFreelancerId, freelancerName, freelancerEmail, isClientPortal = false, documentUploadUrl, }) => {
82
82
  const [isUploading, setIsUploading] = (0, react_1.useState)(false);
83
83
  const [documentName, setDocumentName] = (0, react_1.useState)('');
84
84
  const fileInputRef = (0, react_1.useRef)(null);
@@ -93,40 +93,69 @@ const DocumentUploadRow = ({ clientAndProject, setClientAndProject, docType, set
93
93
  const disableButton = !(documentName && checkField) && !isUploading;
94
94
  const uploadFile = (fileForUpload, fileExtension, isLargeFile, selectedFile) => {
95
95
  var _a, _b, _c, _d, _e;
96
- uploadExpertClientFiles({
97
- variables: {
98
- input: {
99
- clientId: (_a = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.client) === null || _a === void 0 ? void 0 : _a.id,
100
- clientName: (_b = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.client) === null || _b === void 0 ? void 0 : _b.name,
101
- email: isClientPortal ? (_c = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.freelancer) === null || _c === void 0 ? void 0 : _c.name : freelancerEmail,
102
- fileName: `${documentName}.${fileExtension}`,
103
- fileSize: selectedFile === null || selectedFile === void 0 ? void 0 : selectedFile.size,
104
- fileType: utils_1.DOCUMENT_TYPE_CONSTANTS[docType],
105
- freelancerId: isClientPortal ? (_d = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.freelancer) === null || _d === void 0 ? void 0 : _d.id : legacyFreelancerId,
106
- freelancerName: isClientPortal ? (_e = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.freelancer) === null || _e === void 0 ? void 0 : _e.name : freelancerName,
107
- projectId: clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.id,
108
- projectName: clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.name,
109
- uploadedBy: isClientPortal ? 'CLIENT' : 'FREELANCER',
110
- data: isLargeFile ? "" : fileForUpload,
111
- },
112
- }
113
- })
114
- .then((res) => {
115
- var _a;
116
- if ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.uploadExpertClientFilesData) {
117
- refetchFiles();
118
- (0, utils_1.showToast)('success', 'File Uploaded successfully!');
119
- }
120
- else {
96
+ paroDocuments ?
97
+ uploadInternalFile({
98
+ variables: {
99
+ input: {
100
+ foldername,
101
+ subfolder: docType,
102
+ filename: `${documentName}.${fileExtension}`,
103
+ data: fileForUpload,
104
+ expirationDate: ((docType === 'EO Insurance') && insuranceExpiryDate) ? insuranceExpiryDate : '',
105
+ valid: true,
106
+ sourceOfEOInsurance: 'Dashboard',
107
+ },
108
+ }
109
+ }).then((res) => {
110
+ var _a;
111
+ if ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.uploadFileData) {
112
+ refetchFiles();
113
+ (0, utils_1.showToast)('success', 'File Uploaded successfully!');
114
+ }
115
+ else {
116
+ (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
117
+ }
118
+ })
119
+ .catch((err) => {
121
120
  (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
122
- }
123
- })
124
- .catch((err) => {
125
- (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
126
- }).finally(() => {
127
- setIsUploading(false);
128
- setDocumentName('');
129
- });
121
+ }).finally(() => {
122
+ setIsUploading(false);
123
+ setDocumentName('');
124
+ })
125
+ : uploadExpertClientFiles({
126
+ variables: {
127
+ input: {
128
+ clientId: (_a = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.client) === null || _a === void 0 ? void 0 : _a.id,
129
+ clientName: (_b = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.client) === null || _b === void 0 ? void 0 : _b.name,
130
+ email: isClientPortal ? (_c = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.freelancer) === null || _c === void 0 ? void 0 : _c.name : freelancerEmail,
131
+ fileName: `${documentName}.${fileExtension}`,
132
+ fileSize: selectedFile === null || selectedFile === void 0 ? void 0 : selectedFile.size,
133
+ fileType: utils_1.DOCUMENT_TYPE_CONSTANTS[docType],
134
+ freelancerId: isClientPortal ? (_d = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.freelancer) === null || _d === void 0 ? void 0 : _d.id : legacyFreelancerId,
135
+ freelancerName: isClientPortal ? (_e = clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.freelancer) === null || _e === void 0 ? void 0 : _e.name : freelancerName,
136
+ projectId: clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.id,
137
+ projectName: clientAndProject === null || clientAndProject === void 0 ? void 0 : clientAndProject.name,
138
+ uploadedBy: isClientPortal ? 'CLIENT' : 'FREELANCER',
139
+ data: isLargeFile ? "" : fileForUpload,
140
+ },
141
+ }
142
+ })
143
+ .then((res) => {
144
+ var _a;
145
+ if ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.uploadExpertClientFilesData) {
146
+ refetchFiles();
147
+ (0, utils_1.showToast)('success', 'File Uploaded successfully!');
148
+ }
149
+ else {
150
+ (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
151
+ }
152
+ })
153
+ .catch((err) => {
154
+ (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
155
+ }).finally(() => {
156
+ setIsUploading(false);
157
+ setDocumentName('');
158
+ });
130
159
  };
131
160
  const uploadFileRouter = (fileForUpload, fileExtension, selectedFile) => {
132
161
  setIsUploading(true);
@@ -4,6 +4,7 @@ interface DocumentTableProps {
4
4
  setExpiryDate: (expiryDate: string) => void;
5
5
  expertFiles: any[];
6
6
  setExpertFiles: (expertFiles: any[]) => void;
7
+ uploadExpertClientFiles: any;
7
8
  uploadFileData: any;
8
9
  deleteFileMutation: any;
9
10
  updateFreelancerExpiryMutation: any;
@@ -263,49 +263,6 @@ const ParoDocumentsTable = ({ legacyFreelancerId, expiryDate, setExpiryDate, exp
263
263
  setApiFoldername((_c = segments === null || segments === void 0 ? void 0 : segments.slice(0, segments.length - 1)) === null || _c === void 0 ? void 0 : _c.join('/'));
264
264
  }
265
265
  };
266
- const uploadFile = (fileForUpload, fileExtension) => {
267
- setIsUploading(true);
268
- uploadFileData({
269
- variables: {
270
- input: {
271
- foldername,
272
- subfolder: docType,
273
- filename: `${documentName}.${fileExtension}`,
274
- data: fileForUpload,
275
- expirationDate: ((docType === 'EO Insurance') && insuranceExpiryDate) ? insuranceExpiryDate : '',
276
- valid: true,
277
- sourceOfEOInsurance: 'Dashboard',
278
- },
279
- },
280
- onCompleted: () => __awaiter(void 0, void 0, void 0, function* () {
281
- refetchFiles(true);
282
- })
283
- })
284
- .then(() => {
285
- (0, utils_1.showToast)('success', 'File Uploaded successfully!');
286
- })
287
- .catch((err) => {
288
- (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
289
- });
290
- setIsUploading(false);
291
- setApiFoldername('');
292
- setDocumentName('');
293
- };
294
- const handleUpload = (event) => {
295
- const selectedFile = event.target.files && event.target.files[0];
296
- if (!(0, utils_1.validateFileUpload)(selectedFile, false)) {
297
- return;
298
- }
299
- if (selectedFile) {
300
- const fileExtension = selectedFile.name.substring(selectedFile.name.lastIndexOf('.') + 1);
301
- const reader = new FileReader();
302
- reader.onloadend = () => {
303
- const fileForUpload = String(reader.result).split(';base64,')[1];
304
- uploadFile(fileForUpload, fileExtension);
305
- };
306
- reader.readAsDataURL(selectedFile);
307
- }
308
- };
309
266
  const handleDateChange = (date) => {
310
267
  if (date) {
311
268
  const currentDate = (0, date_fns_1.startOfDay)(new Date);
@@ -319,7 +276,7 @@ const ParoDocumentsTable = ({ legacyFreelancerId, expiryDate, setExpiryDate, exp
319
276
  }
320
277
  };
321
278
  return (react_1.default.createElement(react_1.default.Fragment, null,
322
- react_1.default.createElement(DocumentUploadRow_1.DocumentUploadRow, { documentName: documentName, setDocumentName: setDocumentName, clientAndProject: clientAndProject, setClientAndProject: setClientAndProject, docType: docType, setDocType: setDocType, searchText: searchText, setSearchText: setSearchText, paroDocuments: paroDocuments, handleUpload: handleUpload, expiryDate: insuranceExpiryDate, handleDateChange: handleDateChange, error: error, isUploading: isUploading }),
279
+ react_1.default.createElement(DocumentUploadRow_1.DocumentUploadRow, { documentName: documentName, setDocumentName: setDocumentName, clientAndProject: clientAndProject, setClientAndProject: setClientAndProject, uploadInternalFile: uploadFileData, docType: docType, foldername: foldername, insuranceExpiryDate: insuranceExpiryDate, refetchFiles: refetchFiles, setDocType: setDocType, searchText: searchText, setSearchText: setSearchText, paroDocuments: paroDocuments, expiryDate: insuranceExpiryDate, handleDateChange: handleDateChange, error: error, isUploading: isUploading }),
323
280
  react_1.default.createElement(utils_1.CustomPaper, null,
324
281
  react_1.default.createElement("div", { className: 'w-1/4' },
325
282
  react_1.default.createElement(base_ui_1.Input, { placeholder: "Search Documents", type: "text", value: searchText, onChange: (e) => setSearchText(e.target.value) })),
@@ -1,6 +1,6 @@
1
- interface UploadFilesButtonProps {
2
- onFileSelect: (file: File) => void;
3
- isLoading?: boolean;
4
- }
5
- export declare const UploadFilesButton: ({ onFileSelect, isLoading, }: UploadFilesButtonProps) => JSX.Element;
6
- export {};
1
+ interface UploadFilesButtonProps {
2
+ onFileSelect: (file: File) => void;
3
+ isLoading?: boolean;
4
+ }
5
+ export declare const UploadFilesButton: ({ onFileSelect, isLoading, }: UploadFilesButtonProps) => JSX.Element;
6
+ export {};
@@ -1,29 +1,29 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UploadFilesButton = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const base_ui_1 = require("@paro.io/base-ui");
9
- const react_2 = require("react");
10
- const UploadFilesButton = ({ onFileSelect, isLoading, }) => {
11
- const fileInputRef = (0, react_2.useRef)(null);
12
- const handleClick = () => {
13
- var _a;
14
- (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
15
- };
16
- const handleFileChange = (event) => {
17
- var _a;
18
- const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
19
- if (file) {
20
- onFileSelect(file);
21
- }
22
- // Reset input value to allow uploading the same file again
23
- event.target.value = '';
24
- };
25
- return (react_1.default.createElement("div", null,
26
- react_1.default.createElement("input", { type: "file", ref: fileInputRef, onChange: handleFileChange, className: "hidden", accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx" }),
27
- react_1.default.createElement(base_ui_1.Button, { onClick: handleClick, disabled: isLoading })));
28
- };
29
- exports.UploadFilesButton = UploadFilesButton;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UploadFilesButton = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const base_ui_1 = require("@paro.io/base-ui");
9
+ const react_2 = require("react");
10
+ const UploadFilesButton = ({ onFileSelect, isLoading, }) => {
11
+ const fileInputRef = (0, react_2.useRef)(null);
12
+ const handleClick = () => {
13
+ var _a;
14
+ (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
15
+ };
16
+ const handleFileChange = (event) => {
17
+ var _a;
18
+ const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
19
+ if (file) {
20
+ onFileSelect(file);
21
+ }
22
+ // Reset input value to allow uploading the same file again
23
+ event.target.value = '';
24
+ };
25
+ return (react_1.default.createElement("div", null,
26
+ react_1.default.createElement("input", { type: "file", ref: fileInputRef, onChange: handleFileChange, className: "hidden", accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx" }),
27
+ react_1.default.createElement(base_ui_1.Button, { onClick: handleClick, disabled: isLoading })));
28
+ };
29
+ exports.UploadFilesButton = UploadFilesButton;
@@ -11,12 +11,12 @@ const CopyToClipboardAlert_1 = __importDefault(require("../shared/CopyToClipboar
11
11
  const colors_1 = __importDefault(require("../ClientReferencesSection/constants/colors"));
12
12
  const Banner_1 = __importDefault(require("./Banner"));
13
13
  const base_icons_1 = require("@paro.io/base-icons");
14
- const StyledButton = (0, styled_components_1.default)(core_1.Button) `
15
- margin: 0px !important;
16
- padding: 26px 0 18px 0 !important;
17
- span {
18
- color: ${colors_1.default.buttonText} !important
19
- }
14
+ const StyledButton = (0, styled_components_1.default)(core_1.Button) `
15
+ margin: 0px !important;
16
+ padding: 26px 0 18px 0 !important;
17
+ span {
18
+ color: ${colors_1.default.buttonText} !important
19
+ }
20
20
  `;
21
21
  const ActionButton = ({ title, ariaLabel, onClick, icon: Icon }) => (react_1.default.createElement(core_1.Tooltip, { arrow: true, placement: "top", interactive: true, className: "whitespace-nowrap", title: title },
22
22
  react_1.default.createElement(core_1.IconButton, { "aria-label": ariaLabel, onClick: onClick },
@@ -53,13 +53,13 @@ const formatPhoneNumber = (phone) => {
53
53
  return `(${numericPhone.slice(0, 3)}) ${numericPhone.slice(3, 6)} - ${numericPhone.slice(6)}`;
54
54
  };
55
55
  exports.formatPhoneNumber = formatPhoneNumber;
56
- exports.ProfilePhotoPreview = styled_components_1.default.img `
57
- height: 86px;
58
- width: 86px;
59
- border: 1px solid ${colors_1.default.lightGray};
60
- border-radius: 50%;
61
- object-fit: cover;
62
- object-position: top;
56
+ exports.ProfilePhotoPreview = styled_components_1.default.img `
57
+ height: 86px;
58
+ width: 86px;
59
+ border: 1px solid ${colors_1.default.lightGray};
60
+ border-radius: 50%;
61
+ object-fit: cover;
62
+ object-position: top;
63
63
  `;
64
64
  const ProfileSection = ({ legacyFreelancerId, imageUrl, shouldAllowEditProfile, firstName, lastName, primaryServiceLine, editServiceLine, city, stateAbbreviation, email, phone, setOpen, paroProjectsData, getUserDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, isInternal, getUserByEmail, updateUserEmail, updateUserMutation, getUserByEmailLazyQuery, updateUserPassword, verifyUserPassword, getExpertRates, }) => {
65
65
  var _a;
@@ -34,13 +34,13 @@ const Close_1 = __importDefault(require("@material-ui/icons/Close"));
34
34
  const cdn_1 = require("../shared/constants/cdn");
35
35
  const styled_components_1 = __importDefault(require("styled-components"));
36
36
  const defaultAvatar = cdn_1.CDN_URL + 'defaultAvatar.png';
37
- const ProfilePhotoPreview = styled_components_1.default.img `
38
- height: 86px;
39
- width: 86px;
40
- border: 1px solid #e4e5e4;
41
- border-radius: 50%;
42
- object-fit: cover;
43
- object-position: top;
37
+ const ProfilePhotoPreview = styled_components_1.default.img `
38
+ height: 86px;
39
+ width: 86px;
40
+ border: 1px solid #e4e5e4;
41
+ border-radius: 50%;
42
+ object-fit: cover;
43
+ object-position: top;
44
44
  `;
45
45
  const CustomDialog = (0, core_1.styled)(Dialog_1.default)(({ theme }) => ({
46
46
  '& .MuiDialog-paper': {
@@ -51,12 +51,12 @@ const Pagination = ({ total, currentPage = 1, setCurrentPage, perPageItems = 10,
51
51
  };
52
52
  const numberOfPages = Math.ceil(total / perPageItems);
53
53
  return (react_1.default.createElement("div", { className: "bg-white px-4 py-3 border-t border-gray-200 sm:px-6 flex flex-col md:flex-row md:items-center md:justify-between" },
54
- react_1.default.createElement("div", { className: "pb-2 md:pb-0" }, `Showing
55
- ${perPageItems * (currentPage - 1) + 1}
56
- to
57
- ${Math.min(total, perPageItems * currentPage)}
58
- of
59
- ${total}
54
+ react_1.default.createElement("div", { className: "pb-2 md:pb-0" }, `Showing
55
+ ${perPageItems * (currentPage - 1) + 1}
56
+ to
57
+ ${Math.min(total, perPageItems * currentPage)}
58
+ of
59
+ ${total}
60
60
  ${displayText}`),
61
61
  react_1.default.createElement("div", { className: "flex items-center justify-between" },
62
62
  react_1.default.createElement("div", { className: "flex-1 flex justify-between sm:hidden" },
@@ -51,12 +51,12 @@ const isRatingExists = (rating) => {
51
51
  return false;
52
52
  };
53
53
  exports.isRatingExists = isRatingExists;
54
- const StyledButton = (0, styled_components_1.default)(core_2.Button) `
55
- margin: 0px !important;
56
- padding: 26px 0 18px 0 !important;
57
- span {
58
- color: #248384 !important
59
- }
54
+ const StyledButton = (0, styled_components_1.default)(core_2.Button) `
55
+ margin: 0px !important;
56
+ padding: 26px 0 18px 0 !important;
57
+ span {
58
+ color: #248384 !important
59
+ }
60
60
  `;
61
61
  const RatingHeader = ({ ratings, project, index, highlightedRatings, requestStatus, handleRatingRequest, loadingSubmitId, handleAddToProfile, ratingReviewButtonlabel, setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects, enableReviewModal, disableReviewModal, isClientPortal, isInternal, createOrUpdateRating, getParoProjectsDocument, projectIdToShow, }) => {
62
62
  var _a, _b, _c, _d;
@@ -1,20 +1,20 @@
1
- {
2
- "folders": [
3
- {
4
- "path": "../../.."
5
- },
6
- {
7
- "path": "../../../../internal-profile-app"
8
- },
9
- {
10
- "path": "../../../../availability-gantt-chart"
11
- },
12
- {
13
- "path": "../../../../client-portal"
14
- },
15
- {
16
- "path": "../../../../expert-portal"
17
- }
18
- ],
19
- "settings": {}
20
- }
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "../../.."
5
+ },
6
+ {
7
+ "path": "../../../../internal-profile-app"
8
+ },
9
+ {
10
+ "path": "../../../../availability-gantt-chart"
11
+ },
12
+ {
13
+ "path": "../../../../client-portal"
14
+ },
15
+ {
16
+ "path": "../../../../expert-portal"
17
+ }
18
+ ],
19
+ "settings": {}
20
+ }
@@ -34,11 +34,11 @@ const react_hot_toast_1 = __importDefault(require("react-hot-toast"));
34
34
  const ReviewRequestModal = ({ project, requestModal, setRequestModal, expertName, freelancerId, setRequestStatus, selectedProject, setSelectedProject, clientId, refetchParoProjects, setHighlightedRatings, createOrUpdateRatingRequestMutation, getParoProjectsDocument, }) => {
35
35
  var _a;
36
36
  const [showError, setShowError] = (0, react_1.useState)(false);
37
- const [textareaValue, setTextareaValue] = (0, react_1.useState)(`Hi ${(_a = project === null || project === void 0 ? void 0 : project.client) === null || _a === void 0 ? void 0 : _a.name},
38
- I hope you are satisfied with the work I provided on ${project === null || project === void 0 ? void 0 : project.name}. Your feedback is very important to me and helps me improve my services and build my reputation on Paro. Could you please take a moment to leave a review of you experience? Your input is greatly appreciated!
39
-
40
- Thank you in advance for your time and feedback.
41
- Best regards,
37
+ const [textareaValue, setTextareaValue] = (0, react_1.useState)(`Hi ${(_a = project === null || project === void 0 ? void 0 : project.client) === null || _a === void 0 ? void 0 : _a.name},
38
+ I hope you are satisfied with the work I provided on ${project === null || project === void 0 ? void 0 : project.name}. Your feedback is very important to me and helps me improve my services and build my reputation on Paro. Could you please take a moment to leave a review of you experience? Your input is greatly appreciated!
39
+
40
+ Thank you in advance for your time and feedback.
41
+ Best regards,
42
42
  ${expertName}`);
43
43
  const handleTextArea = (e) => {
44
44
  setTextareaValue(e.target.value);
@@ -3,6 +3,7 @@ type ServiceLinesTemplateProps = {
3
3
  getFreelancerDataResult?: any;
4
4
  createOrUpdateRates?: any;
5
5
  updateExpert?: any;
6
+ currentFeatureStatus?: any;
6
7
  openServiceLinesTemplate?: boolean;
7
8
  setOpenServiceLinesTemplate?: any;
8
9
  getRatesByExpertId?: any;
@@ -18,5 +19,5 @@ type ServiceLinesTemplateProps = {
18
19
  updateFreelancerPreferences?: any;
19
20
  getExpertVanityTitles?: any;
20
21
  };
21
- export declare const ServiceLinesTemplate: ({ getFreelancerDataResult, createOrUpdateRates, getRatesByExpertId, updateExpert, openServiceLinesTemplate, setOpenServiceLinesTemplate, getServiceLines, legacyFreelancerId, expertId, isFirmProfile, serviceLineData, selectedServicesList, isInternalProfile, updateFreelancerPreferences, getExpertVanityTitles, }: ServiceLinesTemplateProps) => false | React.JSX.Element | undefined;
22
+ export declare const ServiceLinesTemplate: ({ getFreelancerDataResult, createOrUpdateRates, getRatesByExpertId, updateExpert, currentFeatureStatus, openServiceLinesTemplate, setOpenServiceLinesTemplate, getServiceLines, legacyFreelancerId, expertId, isFirmProfile, serviceLineData, selectedServicesList, isInternalProfile, updateFreelancerPreferences, getExpertVanityTitles, }: ServiceLinesTemplateProps) => false | React.JSX.Element | undefined;
22
23
  export {};
@@ -41,7 +41,7 @@ const base_ui_1 = require("@paro.io/base-ui");
41
41
  const utils_1 = require("../shared/utils");
42
42
  const lab_1 = require("@material-ui/lab");
43
43
  const react_hot_toast_1 = require("react-hot-toast");
44
- const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, getRatesByExpertId, updateExpert, openServiceLinesTemplate, setOpenServiceLinesTemplate, getServiceLines, legacyFreelancerId, expertId, isFirmProfile, serviceLineData, selectedServicesList = [], isInternalProfile = false, updateFreelancerPreferences, getExpertVanityTitles, }) => {
44
+ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, getRatesByExpertId, updateExpert, currentFeatureStatus, openServiceLinesTemplate, setOpenServiceLinesTemplate, getServiceLines, legacyFreelancerId, expertId, isFirmProfile, serviceLineData, selectedServicesList = [], isInternalProfile = false, updateFreelancerPreferences, getExpertVanityTitles, }) => {
45
45
  const [selectedServices, dispatch] = (0, react_1.useReducer)(utils_1.selectedServicesReducer, selectedServicesList);
46
46
  const [updateClicked, setUpdateClicked] = (0, react_1.useState)(false);
47
47
  const [loading, setLoading] = (0, react_1.useState)(false);
@@ -51,28 +51,26 @@ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, ge
51
51
  const [titleOptions, setTitleOptions] = (0, react_1.useState)([]);
52
52
  const [selectedTitle, setSelectedTitle] = (0, react_1.useState)(null);
53
53
  const [customTitle, setCustomTitle] = (0, react_1.useState)(null);
54
+ const [featureStatus, setCurrentFeatureStatus] = (0, react_1.useState)(currentFeatureStatus);
54
55
  const fetchServiceLineData = () => __awaiter(void 0, void 0, void 0, function* () {
55
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
56
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
56
57
  try {
57
58
  setLoading(true);
58
- if (!isInternalProfile) {
59
- const [expertVanityTitles] = yield Promise.all([
60
- getExpertVanityTitles({ fetchPolicy: 'network-only' }),
61
- ]);
62
- const expertTitles = (_a = expertVanityTitles === null || expertVanityTitles === void 0 ? void 0 : expertVanityTitles.data) === null || _a === void 0 ? void 0 : _a.getExpertVanityTitles;
63
- setTitleOptions(expertTitles);
64
- }
65
- const [freelancerResponse, serviceLinesResponse, ratesResponse] = yield Promise.all([
59
+ const [expertVanityTitles, freelancerResponse, serviceLinesResponse, ratesResponse] = yield Promise.all([
60
+ getExpertVanityTitles({ fetchPolicy: 'network-only' }),
66
61
  getFreelancerDataResult({ variables: { legacyFreelancerId: legacyFreelancerId }, skip: !legacyFreelancerId, fetchPolicy: 'network-only' }),
67
62
  getServiceLines({ fetchPolicy: 'network-only', }),
68
63
  getRatesByExpertId({ variables: { expertId }, skip: !expertId, fetchPolicy: 'network-only' }),
69
64
  ]);
70
- setServiceLines(((_b = serviceLinesResponse === null || serviceLinesResponse === void 0 ? void 0 : serviceLinesResponse.data) === null || _b === void 0 ? void 0 : _b.getServiceLines) || serviceLineData);
71
- const currentService = (_e = (_d = (_c = freelancerResponse === null || freelancerResponse === void 0 ? void 0 : freelancerResponse.data) === null || _c === void 0 ? void 0 : _c.getExpertByLegacyFreelancerId) === null || _d === void 0 ? void 0 : _d.legacyMetadata) === null || _e === void 0 ? void 0 : _e.primaryServiceLine;
72
- const currentRate = (_h = (_g = (_f = freelancerResponse === null || freelancerResponse === void 0 ? void 0 : freelancerResponse.data) === null || _f === void 0 ? void 0 : _f.getExpertByLegacyFreelancerId) === null || _g === void 0 ? void 0 : _g.legacyMetadata) === null || _h === void 0 ? void 0 : _h.defaultHourlyRate;
73
- const expertRates = (_j = ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.data) === null || _j === void 0 ? void 0 : _j.getRatesByExpertId;
65
+ setServiceLines(((_a = serviceLinesResponse === null || serviceLinesResponse === void 0 ? void 0 : serviceLinesResponse.data) === null || _a === void 0 ? void 0 : _a.getServiceLines) || serviceLineData);
66
+ const currentService = (_d = (_c = (_b = freelancerResponse === null || freelancerResponse === void 0 ? void 0 : freelancerResponse.data) === null || _b === void 0 ? void 0 : _b.getExpertByLegacyFreelancerId) === null || _c === void 0 ? void 0 : _c.legacyMetadata) === null || _d === void 0 ? void 0 : _d.primaryServiceLine;
67
+ const currentRate = (_g = (_f = (_e = freelancerResponse === null || freelancerResponse === void 0 ? void 0 : freelancerResponse.data) === null || _e === void 0 ? void 0 : _e.getExpertByLegacyFreelancerId) === null || _f === void 0 ? void 0 : _f.legacyMetadata) === null || _g === void 0 ? void 0 : _g.defaultHourlyRate;
68
+ const expertRates = (_h = ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.data) === null || _h === void 0 ? void 0 : _h.getRatesByExpertId;
69
+ setCurrentFeatureStatus((_k = (_j = freelancerResponse === null || freelancerResponse === void 0 ? void 0 : freelancerResponse.data) === null || _j === void 0 ? void 0 : _j.getExpertByLegacyFreelancerId) === null || _k === void 0 ? void 0 : _k.featureStatus);
74
70
  setCurrentServiceRate(currentRate);
75
- const isTitleExists = (_l = (_k = freelancerResponse === null || freelancerResponse === void 0 ? void 0 : freelancerResponse.data) === null || _k === void 0 ? void 0 : _k.getExpertByLegacyFreelancerId) === null || _l === void 0 ? void 0 : _l.vanityTitle;
71
+ const expertTitles = (_l = expertVanityTitles === null || expertVanityTitles === void 0 ? void 0 : expertVanityTitles.data) === null || _l === void 0 ? void 0 : _l.getExpertVanityTitles;
72
+ setTitleOptions(expertTitles);
73
+ const isTitleExists = (_o = (_m = freelancerResponse === null || freelancerResponse === void 0 ? void 0 : freelancerResponse.data) === null || _m === void 0 ? void 0 : _m.getExpertByLegacyFreelancerId) === null || _o === void 0 ? void 0 : _o.vanityTitle;
76
74
  isTitleExists ? setSelectedTitle(isTitleExists) : setValue(1);
77
75
  dispatch({
78
76
  currentService,
@@ -124,7 +122,8 @@ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, ge
124
122
  variables: {
125
123
  expertId: expertId,
126
124
  input: {
127
- vanityTitle: selectedTitle === 'Other' ? customTitle : selectedTitle
125
+ vanityTitle: selectedTitle === 'Other' ? customTitle : selectedTitle,
126
+ featureStatus: Object.assign({}, featureStatus)
128
127
  }
129
128
  },
130
129
  }).then(() => {
@@ -173,6 +172,7 @@ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, ge
173
172
  }
174
173
  finally {
175
174
  setOpenServiceLinesTemplate && setOpenServiceLinesTemplate(false);
175
+ setUpdateClicked(false);
176
176
  }
177
177
  ;
178
178
  });
@@ -181,7 +181,7 @@ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, ge
181
181
  variables: {
182
182
  expertId: expertId,
183
183
  input: {
184
- featureStatus: { "serviceLines": true }
184
+ featureStatus: Object.assign({ "serviceLines": true }, featureStatus)
185
185
  }
186
186
  },
187
187
  }).then(() => {
@@ -1,6 +1,6 @@
1
- type SectionContents = {
2
- handleClose?: (...args: any) => void;
3
- formError?: boolean;
4
- };
5
- declare const Error: ({ handleClose }: SectionContents) => JSX.Element;
6
- export default Error;
1
+ type SectionContents = {
2
+ handleClose?: (...args: any) => void;
3
+ formError?: boolean;
4
+ };
5
+ declare const Error: ({ handleClose }: SectionContents) => JSX.Element;
6
+ export default Error;