@paro.io/expert-shared-components 1.7.6 → 1.7.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 (46) 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 +1 -4
  15. package/lib/components/DocumentCenter/DocumentUploadRow.js +34 -63
  16. package/lib/components/DocumentCenter/ParoDocumentsTable.d.ts +0 -1
  17. package/lib/components/DocumentCenter/ParoDocumentsTable.js +44 -1
  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/EarningsSection.js +2 -4
  22. package/lib/components/ExpertProfileHeader/ExpertProfileHeader.d.ts +7 -2
  23. package/lib/components/ExpertProfileHeader/ExpertProfileHeader.js +15 -8
  24. package/lib/components/ExpertProfileHeader/NetworkSection.d.ts +8 -1
  25. package/lib/components/ExpertProfileHeader/NetworkSection.js +104 -5
  26. package/lib/components/ExpertProfileHeader/ProfileSection.d.ts +2 -3
  27. package/lib/components/ExpertProfileHeader/ProfileSection.js +24 -18
  28. package/lib/components/ExpertProfileHeader/TeamsSection.d.ts +2 -2
  29. package/lib/components/ExpertProfileHeader/TeamsSection.js +5 -6
  30. package/lib/components/OrganizationChart/OrganizationChart.js +7 -7
  31. package/lib/components/Reviews/Pagination.js +6 -6
  32. package/lib/components/ReviewsTab/RatingHeader.js +6 -6
  33. package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
  34. package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
  35. package/lib/components/ServiceLinesTemplate/index.d.ts +1 -2
  36. package/lib/components/ServiceLinesTemplate/index.js +17 -17
  37. package/lib/components/shared/Error.d.ts +6 -6
  38. package/lib/components/shared/Error.js +40 -40
  39. package/lib/components/shared/Image.js +13 -13
  40. package/lib/components/shared/ProfileTextField.d.ts +18 -18
  41. package/lib/components/shared/ProfileTextField.js +16 -16
  42. package/lib/components/shared/StyledActionButtons.d.ts +7 -7
  43. package/lib/components/shared/StyledActionButtons.js +15 -15
  44. package/lib/components/shared/ToastNotification.d.ts +10 -10
  45. package/lib/components/shared/ToastNotification.js +63 -63
  46. package/package.json +59 -59
@@ -16,9 +16,6 @@ interface DocumentUploadProps {
16
16
  error?: string | null;
17
17
  clientAndProjectsList?: any[];
18
18
  uploadExpertClientFiles?: any;
19
- uploadInternalFile?: any;
20
- foldername?: string;
21
- insuranceExpiryDate?: any;
22
19
  refetchFiles?: any;
23
20
  legacyFreelancerId?: any;
24
21
  freelancerName?: string;
@@ -26,5 +23,5 @@ interface DocumentUploadProps {
26
23
  isClientPortal?: boolean;
27
24
  documentUploadUrl?: string;
28
25
  }
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;
26
+ export declare const DocumentUploadRow: ({ clientAndProject, setClientAndProject, docType, setDocType, paroDocuments, expiryDate, handleDateChange, error, clientAndProjectsList, uploadExpertClientFiles, refetchFiles, legacyFreelancerId, freelancerName, freelancerEmail, isClientPortal, documentUploadUrl, }: DocumentUploadProps) => JSX.Element;
30
27
  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, uploadInternalFile, foldername, insuranceExpiryDate, refetchFiles, legacyFreelancerId, freelancerName, freelancerEmail, isClientPortal = false, documentUploadUrl, }) => {
81
+ const DocumentUploadRow = ({ clientAndProject, setClientAndProject, docType, setDocType, paroDocuments, expiryDate, handleDateChange, error, clientAndProjectsList, uploadExpertClientFiles, 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,69 +93,40 @@ 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
- 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) => {
120
- (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
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) => {
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 {
154
121
  (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
155
- }).finally(() => {
156
- setIsUploading(false);
157
- setDocumentName('');
158
- });
122
+ }
123
+ })
124
+ .catch((err) => {
125
+ (0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
126
+ }).finally(() => {
127
+ setIsUploading(false);
128
+ setDocumentName('');
129
+ });
159
130
  };
160
131
  const uploadFileRouter = (fileForUpload, fileExtension, selectedFile) => {
161
132
  setIsUploading(true);
@@ -4,7 +4,6 @@ interface DocumentTableProps {
4
4
  setExpiryDate: (expiryDate: string) => void;
5
5
  expertFiles: any[];
6
6
  setExpertFiles: (expertFiles: any[]) => void;
7
- uploadExpertClientFiles: any;
8
7
  uploadFileData: any;
9
8
  deleteFileMutation: any;
10
9
  updateFreelancerExpiryMutation: any;
@@ -263,6 +263,49 @@ 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
+ };
266
309
  const handleDateChange = (date) => {
267
310
  if (date) {
268
311
  const currentDate = (0, date_fns_1.startOfDay)(new Date);
@@ -276,7 +319,7 @@ const ParoDocumentsTable = ({ legacyFreelancerId, expiryDate, setExpiryDate, exp
276
319
  }
277
320
  };
278
321
  return (react_1.default.createElement(react_1.default.Fragment, null,
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 }),
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 }),
280
323
  react_1.default.createElement(utils_1.CustomPaper, null,
281
324
  react_1.default.createElement("div", { className: 'w-1/4' },
282
325
  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 },
@@ -129,18 +129,16 @@ const EarningsSection = ({ expertServiceLinesPlus, firmTags, haveATeamProp, expe
129
129
  react_1.default.createElement(core_1.Box, { mb: 1 },
130
130
  react_1.default.createElement("b", null, "Expert Earnings :")),
131
131
  hasCompletedProjects ? (react_1.default.createElement(react_1.default.Fragment, null,
132
- react_1.default.createElement(EarningsInfo, { label: "Monthly Goal", value: currentMonthGoalHours > 0 ? ToLocalStringFn(currentMonthGoalHours) : 'N/A' }),
132
+ react_1.default.createElement(EarningsInfo, { label: "Monthly Goal", value: currentMonthGoalHours > 0 ? `$ ${ToLocalStringFn(currentMonthGoalHours)}` : 'N/A' }),
133
133
  react_1.default.createElement(core_1.Box, { mb: 2 },
134
134
  react_1.default.createElement(core_1.Divider, null)),
135
- react_1.default.createElement(EarningsInfo, { label: "Monthly Earnings", value: (earnings === null || earnings === void 0 ? void 0 : earnings.length) > 0 ? ToLocalStringFn(earning) : 'N/A' }),
135
+ react_1.default.createElement(EarningsInfo, { label: "Monthly Earnings", value: (earnings === null || earnings === void 0 ? void 0 : earnings.length) > 0 ? `$ ${ToLocalStringFn(earning)}` : 'N/A' }),
136
136
  react_1.default.createElement(core_1.Box, { mb: 2 },
137
137
  react_1.default.createElement(core_1.Divider, null)),
138
138
  react_1.default.createElement(EarningsInfo, { label: "% to Goal", value: currentMonthGoalHours && earning ? `${ToLocalStringFn(((earning / currentMonthGoalHours) * 100).toFixed(2))} %` : 'N/A' }),
139
139
  react_1.default.createElement(core_1.Box, { mb: 2 },
140
140
  react_1.default.createElement(core_1.Divider, null)),
141
141
  react_1.default.createElement(EarningsInfo, { label: "Lifetime FSV", value: lifetimeFSV ? ToLocalStringFn(lifetimeFSV) : 'N/A', textColor: backgroundColor }),
142
- react_1.default.createElement(core_1.Box, { mb: 2 },
143
- react_1.default.createElement(core_1.Divider, null)),
144
142
  react_1.default.createElement(core_1.Box, { mb: 2 },
145
143
  react_1.default.createElement(core_1.Divider, null)),
146
144
  react_1.default.createElement(ExpertStatsTable, { expertIRPRRatioPrev: expertIRPRRatioPrev, expertIRPRRatio: expertIRPRRatio, winRatePrev: winRatePrev, winRate: winRate, lifetimeIRPR: lifetimeIRPR, lifetimeWinRate: lifetimeWinRate }))) : (react_1.default.createElement(core_1.Typography, { variant: "body1" }, "This Expert has not billed yet")))));
@@ -6,6 +6,7 @@ type PersonalInformationType = {
6
6
  user: any;
7
7
  };
8
8
  type SectionContents = {
9
+ legacyFreelancerId: string;
9
10
  expertId: string;
10
11
  whiteLabelReserved: boolean;
11
12
  firmTags: string[];
@@ -15,7 +16,8 @@ type SectionContents = {
15
16
  isExpertOps?: boolean;
16
17
  internalUserId?: number;
17
18
  openServiceLinesTemplate?: boolean;
18
- setOpenServiceLinesTemplate: (openServiceLinesTemplate: boolean) => void;
19
+ setOpenServiceLinesTemplate?: any;
20
+ vanityTitle: string;
19
21
  };
20
22
  type QueryAndMutationProps = {
21
23
  getExpertByLegacyFreelancerIdDocument?: any;
@@ -59,6 +61,9 @@ type QueryAndMutationProps = {
59
61
  uploadUserPhotoMutation?: any;
60
62
  loadingNewImage?: boolean;
61
63
  imageUpdateError?: any;
64
+ getExpertVanityTitles?: any;
65
+ getExpertRates?: any;
66
+ updateExpert?: any;
62
67
  };
63
68
  type ChangeEmailPasswordProps = {
64
69
  getUserByEmail?: any;
@@ -73,5 +78,5 @@ type ProfileCompletedPercentageProps = {
73
78
  detailsSectionCompleted: boolean;
74
79
  handleScrollToBottom?: () => void;
75
80
  };
76
- export declare const ExpertProfileHeader: ({ expertId, address: addressForReducer, companyName: companyNameForReducer, legacyMetadata: legacyMetadataForReducer, legacyMetadata: { primaryServiceLine, applicationStatus }, user: userForReducer, user: { id, imageUrl, email }, firmTags, detailsSectionCompleted, preferenceTasks, isWhiteLabel, handleScrollToBottom, haveATeamProp, expertFirms, paroAppUrl, isExpertOps, internalUserId, getExpertByLegacyFreelancerIdDocument, createExpertPublicProfileTrackingRecord, updateFreelancerServiceLine, serviceLineLoading, serviceLineData, serviceLineError, reviewData, profileReviewError, availabilityData, nextMonthAvailabilityData, expertStatusData, expertStatusLoading, expertLevelsData, projectsData, paroProjectsLoading, expertMetricsData, expertMetricsLoading, upSellCrossSellData, upSellCrossSellLoading, projectChangeLogData, projectChangeLogLoading, updateAddressMutation, addressUpdateLoading, updateUserMutation, userUpdateLoading, updateUserError, updateFreelancerMutation, updateFreelancerLoading, updateFreelancerError, getFreelancerEarnings, getQualityKPIs, expertLevelsTrainings, trainingsDataLoading, assignLetterTrainingToExpert, assignTrainingLoading, assignTrainingError, getUserDocument, getExpertStatusDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, getUserByEmail, updateUserEmail, getUserByEmailLazyQuery, updateUserPassword, verifyUserPassword, openServiceLinesTemplate, setOpenServiceLinesTemplate, }: SectionContents & PersonalInformationType & ProfileCompletedPercentageProps & QueryAndMutationProps & ChangeEmailPasswordProps) => JSX.Element;
81
+ export declare const ExpertProfileHeader: ({ expertId, legacyFreelancerId, address: addressForReducer, companyName: companyNameForReducer, legacyMetadata: legacyMetadataForReducer, legacyMetadata: { primaryServiceLine, applicationStatus }, user: userForReducer, user: { id, imageUrl, email }, firmTags, detailsSectionCompleted, preferenceTasks, isWhiteLabel, handleScrollToBottom, haveATeamProp, expertFirms, paroAppUrl, isExpertOps, internalUserId, getExpertByLegacyFreelancerIdDocument, createExpertPublicProfileTrackingRecord, updateFreelancerServiceLine, serviceLineLoading, serviceLineData, serviceLineError, reviewData, profileReviewError, availabilityData, nextMonthAvailabilityData, expertStatusData, expertStatusLoading, expertLevelsData, projectsData, paroProjectsLoading, expertMetricsData, expertMetricsLoading, upSellCrossSellData, upSellCrossSellLoading, projectChangeLogData, projectChangeLogLoading, updateAddressMutation, addressUpdateLoading, updateUserMutation, userUpdateLoading, updateUserError, updateFreelancerMutation, updateFreelancerLoading, updateFreelancerError, getFreelancerEarnings, getQualityKPIs, expertLevelsTrainings, trainingsDataLoading, assignLetterTrainingToExpert, assignTrainingLoading, assignTrainingError, getUserDocument, getExpertStatusDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, getUserByEmail, updateUserEmail, getUserByEmailLazyQuery, updateUserPassword, verifyUserPassword, openServiceLinesTemplate, setOpenServiceLinesTemplate, getExpertVanityTitles, getExpertRates, updateExpert, vanityTitle, }: SectionContents & PersonalInformationType & ProfileCompletedPercentageProps & QueryAndMutationProps & ChangeEmailPasswordProps) => JSX.Element;
77
82
  export {};
@@ -51,6 +51,7 @@ const EarningsSection_1 = __importDefault(require("./EarningsSection"));
51
51
  const NetworkSection_1 = __importDefault(require("./NetworkSection"));
52
52
  const ProfileSection_1 = __importDefault(require("./ProfileSection"));
53
53
  const TeamsSection_1 = __importDefault(require("./TeamsSection"));
54
+ const react_hot_toast_1 = require("react-hot-toast");
54
55
  const CustomPaper = (0, core_1.styled)(core_1.Paper)({
55
56
  overflow: 'auto',
56
57
  scrollbarWidth: 'auto', // For Firefox
@@ -75,7 +76,7 @@ const convertRegionToStateAbbreviation = (region) => {
75
76
  const personalInformationReducer = (state, updatedState) => {
76
77
  return Object.assign(Object.assign({}, state), updatedState);
77
78
  };
78
- const ExpertProfileHeader = ({ expertId, address: addressForReducer, companyName: companyNameForReducer, legacyMetadata: legacyMetadataForReducer, legacyMetadata: { primaryServiceLine, applicationStatus }, user: userForReducer, user: { id, imageUrl, email }, firmTags, detailsSectionCompleted, preferenceTasks, isWhiteLabel, handleScrollToBottom, haveATeamProp, expertFirms, paroAppUrl, isExpertOps, internalUserId, getExpertByLegacyFreelancerIdDocument, createExpertPublicProfileTrackingRecord, updateFreelancerServiceLine, serviceLineLoading, serviceLineData, serviceLineError, reviewData, profileReviewError, availabilityData, nextMonthAvailabilityData, expertStatusData, expertStatusLoading, expertLevelsData, projectsData, paroProjectsLoading, expertMetricsData, expertMetricsLoading, upSellCrossSellData, upSellCrossSellLoading, projectChangeLogData, projectChangeLogLoading, updateAddressMutation, addressUpdateLoading, updateUserMutation, userUpdateLoading, updateUserError, updateFreelancerMutation, updateFreelancerLoading, updateFreelancerError, getFreelancerEarnings, getQualityKPIs, expertLevelsTrainings, trainingsDataLoading, assignLetterTrainingToExpert, assignTrainingLoading, assignTrainingError, getUserDocument, getExpertStatusDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, getUserByEmail, updateUserEmail, getUserByEmailLazyQuery, updateUserPassword, verifyUserPassword, openServiceLinesTemplate, setOpenServiceLinesTemplate, }) => {
79
+ const ExpertProfileHeader = ({ expertId, legacyFreelancerId, address: addressForReducer, companyName: companyNameForReducer, legacyMetadata: legacyMetadataForReducer, legacyMetadata: { primaryServiceLine, applicationStatus }, user: userForReducer, user: { id, imageUrl, email }, firmTags, detailsSectionCompleted, preferenceTasks, isWhiteLabel, handleScrollToBottom, haveATeamProp, expertFirms, paroAppUrl, isExpertOps, internalUserId, getExpertByLegacyFreelancerIdDocument, createExpertPublicProfileTrackingRecord, updateFreelancerServiceLine, serviceLineLoading, serviceLineData, serviceLineError, reviewData, profileReviewError, availabilityData, nextMonthAvailabilityData, expertStatusData, expertStatusLoading, expertLevelsData, projectsData, paroProjectsLoading, expertMetricsData, expertMetricsLoading, upSellCrossSellData, upSellCrossSellLoading, projectChangeLogData, projectChangeLogLoading, updateAddressMutation, addressUpdateLoading, updateUserMutation, userUpdateLoading, updateUserError, updateFreelancerMutation, updateFreelancerLoading, updateFreelancerError, getFreelancerEarnings, getQualityKPIs, expertLevelsTrainings, trainingsDataLoading, assignLetterTrainingToExpert, assignTrainingLoading, assignTrainingError, getUserDocument, getExpertStatusDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, getUserByEmail, updateUserEmail, getUserByEmailLazyQuery, updateUserPassword, verifyUserPassword, openServiceLinesTemplate, setOpenServiceLinesTemplate, getExpertVanityTitles, getExpertRates, updateExpert, vanityTitle, }) => {
79
80
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
80
81
  const [leftSideStatus, setLeftSideStatus] = react_1.default.useState("");
81
82
  const [rightSideStatus, setRightSideStatus] = react_1.default.useState("");
@@ -136,8 +137,8 @@ const ExpertProfileHeader = ({ expertId, address: addressForReducer, companyName
136
137
  const currentMonthAvailabilityHours = (_g = availabilityData === null || availabilityData === void 0 ? void 0 : availabilityData.getFreelancerAvailability) !== null && _g !== void 0 ? _g : {};
137
138
  const nextMonthAvailabilityHours = (_h = nextMonthAvailabilityData === null || nextMonthAvailabilityData === void 0 ? void 0 : nextMonthAvailabilityData.getFreelancerAvailability) !== null && _h !== void 0 ? _h : {};
138
139
  const currentMonthGoalHours = ((_j = currentMonthAvailabilityHours.monthlyHoursAvailable) !== null && _j !== void 0 ? _j : currentMonthAvailabilityHours.monthlyHoursAvailable === 0) ? (currentMonthAvailabilityHours.monthlyHoursAvailable).toFixed(2) : '';
139
- const estimatedAvailability = (currentMonthAvailabilityHours.estimatedAvailability || currentMonthAvailabilityHours.estimatedAvailability === 0) ? +((currentMonthAvailabilityHours.estimatedAvailability).toFixed(2)) : '-';
140
- const nextMonthTrueAvailability = (nextMonthAvailabilityHours.estimatedAvailability || nextMonthAvailabilityHours.estimatedAvailability === 0) ? +((nextMonthAvailabilityHours.estimatedAvailability).toFixed(2)) : '-';
140
+ const estimatedAvailability = (currentMonthAvailabilityHours.estimatedAvailability || currentMonthAvailabilityHours.estimatedAvailability === 0) ? +((currentMonthAvailabilityHours.estimatedAvailability).toFixed(2)) : 0;
141
+ const nextMonthTrueAvailability = (nextMonthAvailabilityHours.estimatedAvailability || nextMonthAvailabilityHours.estimatedAvailability === 0) ? +((nextMonthAvailabilityHours.estimatedAvailability).toFixed(2)) : 0;
141
142
  const expertServiceLinesPlus = (serviceLineData === null || serviceLineData === void 0 ? void 0 : serviceLineData.getExpertByLegacyFreelancerId.serviceLinesPlus) || [];
142
143
  const expertLevels = expertLevelsData === null || expertLevelsData === void 0 ? void 0 : expertLevelsData.getExpertLevelsData;
143
144
  if ((expertStatuses && expertMetricsData && leftSideStatus === "" && rightSideStatus === "") || triggerNewStatus) {
@@ -215,22 +216,28 @@ const ExpertProfileHeader = ({ expertId, address: addressForReducer, companyName
215
216
  react_1.default.createElement(core_1.Divider, null),
216
217
  react_1.default.createElement(core_1.Grid, { container: true, spacing: 2, style: { display: 'flex', flexWrap: isSmallScreen ? 'wrap' : 'nowrap' } },
217
218
  react_1.default.createElement(core_1.Grid, { item: true, container: true, direction: 'column', justify: 'space-between', xs: 12, md: true, style: { flex: '1', width: 'auto' } },
218
- react_1.default.createElement(ProfileSection_1.default, { legacyFreelancerId: Number(expertId), imageUrl: imageUrl, shouldAllowEditProfile: isExpertOps !== null && isExpertOps !== void 0 ? isExpertOps : false, firstName: firstName, lastName: lastName, primaryServiceLine: primaryServiceLine, editServiceLine: editServiceLine, city: city, stateAbbreviation: stateAbbreviation, email: email, phone: phone, paroTenure: paroTenure, hourlyRate: defaultHourlyRate, setOpen: setOpen, paroProjectsData: paroProjectsData, getUserDocument: getUserDocument, uploadUserPhotoMutation: uploadUserPhotoMutation, loadingNewImage: loadingNewImage, imageUpdateError: imageUpdateError, isInternal: isInternal, getUserByEmail: getUserByEmail, updateUserEmail: updateUserEmail, updateUserMutation: updateUserMutation, getUserByEmailLazyQuery: getUserByEmailLazyQuery, updateUserPassword: updateUserPassword, verifyUserPassword: verifyUserPassword }),
219
+ react_1.default.createElement(ProfileSection_1.default, { legacyFreelancerId: Number(legacyFreelancerId), imageUrl: imageUrl, shouldAllowEditProfile: isExpertOps !== null && isExpertOps !== void 0 ? isExpertOps : false, firstName: firstName, lastName: lastName, primaryServiceLine: primaryServiceLine, editServiceLine: editServiceLine, city: city, stateAbbreviation: stateAbbreviation, email: email, phone: phone, setOpen: setOpen, paroProjectsData: paroProjectsData, getUserDocument: getUserDocument, uploadUserPhotoMutation: uploadUserPhotoMutation, loadingNewImage: loadingNewImage, imageUpdateError: imageUpdateError, isInternal: isInternal, getUserByEmail: getUserByEmail, updateUserEmail: updateUserEmail, updateUserMutation: updateUserMutation, getUserByEmailLazyQuery: getUserByEmailLazyQuery, updateUserPassword: updateUserPassword, verifyUserPassword: verifyUserPassword, getExpertRates: getExpertRates }),
219
220
  react_1.default.createElement(core_1.Divider, { orientation: isSmallScreen ? 'horizontal' : 'vertical', style: { marginLeft: '0px !important' } })),
220
221
  react_1.default.createElement(core_1.Grid, { item: true, container: true, direction: 'column', justify: 'space-between', xs: 12, md: true, style: { flex: '1', width: 'auto' } },
221
- react_1.default.createElement(NetworkSection_1.default, { handleScrollToBottom: isInternal && handleScrollToBottom ? handleScrollToBottom : () => { }, preferenceTasks: preferenceTasks, isWhiteLabel: isWhiteLabel, detailsSectionCompleted: detailsSectionCompleted, infoColor: infoColor, leftSideStatus: leftSideStatus, rightSideStatus: rightSideStatus, isInternal: isInternal }),
222
+ react_1.default.createElement(NetworkSection_1.default, { handleScrollToBottom: isInternal && handleScrollToBottom ? handleScrollToBottom : () => { }, preferenceTasks: preferenceTasks, isWhiteLabel: isWhiteLabel, detailsSectionCompleted: detailsSectionCompleted, infoColor: infoColor, leftSideStatus: leftSideStatus, rightSideStatus: rightSideStatus, isInternal: isInternal, paroTenure: paroTenure, getExpertVanityTitles: getExpertVanityTitles, updateExpert: updateExpert, expertId: expertId, legacyFreelancerId: Number(legacyFreelancerId), vanityTitle: vanityTitle, getExpertByLegacyFreelancerIdDocument: getExpertByLegacyFreelancerIdDocument }),
222
223
  react_1.default.createElement(core_1.Divider, { orientation: isSmallScreen ? 'horizontal' : 'vertical' })),
223
224
  react_1.default.createElement(core_1.Grid, { item: true, container: true, direction: 'column', justify: 'space-between', xs: 12, md: true, style: { flex: '1', width: 'auto' } },
224
225
  react_1.default.createElement(EarningsSection_1.default, { expertServiceLinesPlus: expertServiceLinesPlus, firmTags: firmTags, haveATeamProp: haveATeamProp, expertLevels: expertLevels, currentMonthGoalHours: currentMonthGoalHours, expertIRPRRatio: expertIRPRRatio, winRate: winRate, expertIRPRRatioPrev: expertIRPRRatioPrev, winRatePrev: winRatePrev, earnings: earnings, upsell: upsell, crossSell: crossSell, lifetimeIRPR: lifetimeIRPR, lifetimeWinRate: lifetimeWinRate, hasCompletedProjects: (_k = expertMetricsData === null || expertMetricsData === void 0 ? void 0 : expertMetricsData.getExpertMetrics) === null || _k === void 0 ? void 0 : _k.lastProjectCompleted, lifetimeFSV: lifetimeFSV }),
225
226
  react_1.default.createElement(core_1.Divider, { orientation: isSmallScreen ? 'horizontal' : 'vertical' })),
226
- (estimatedAvailability !== '-' || nextMonthTrueAvailability !== '-' || expertFirms) && (react_1.default.createElement(core_1.Grid, { item: true, container: true, direction: 'column', justify: 'space-between', xs: 12, md: true, style: { flex: '1', width: 'auto' } },
227
+ (estimatedAvailability !== 0 || nextMonthTrueAvailability !== 0 || expertFirms) && (react_1.default.createElement(core_1.Grid, { item: true, container: true, direction: 'column', justify: 'space-between', xs: 12, md: true, style: { flex: '1', width: 'auto' } },
227
228
  react_1.default.createElement(TeamsSection_1.default, { estimatedAvailability: estimatedAvailability, nextMonthTrueAvailability: nextMonthTrueAvailability, expertFirms: expertFirms, firstName: firstName, lastName: lastName, primaryServiceLine: primaryServiceLine, city: city, stateAbbreviation: stateAbbreviation, paroTenure: paroTenure, imageUrl: imageUrl }),
228
229
  react_1.default.createElement(core_1.Divider, { orientation: isSmallScreen ? 'horizontal' : 'vertical' }))),
229
230
  react_1.default.createElement(core_1.Grid, { item: true, xs: 12, md: true, style: { flex: '1', width: 'auto' } },
230
231
  react_1.default.createElement(ActivitySection_1.default, { expertMetricsData: expertMetricsData, expertStatuses: expertStatuses, projectTags: (_l = projectChangeLogData === null || projectChangeLogData === void 0 ? void 0 : projectChangeLogData.getProjectChangelog[0]) !== null && _l !== void 0 ? _l : [], projectName: projectName, clientName: clientName })))),
231
232
  isExpertOps && address && legacyMetadata &&
232
- react_1.default.createElement(EditPersonalInformation_1.default, { expertId: expertId, user: user, address: address || {}, legacyMetadata: legacyMetadata, email: email, companyName: companyName, open: open, handleClose: handleClose, updateAddressMutation: updateAddressMutation, addressUpdateLoading: addressUpdateLoading, updateUserMutation: updateUserMutation, userUpdateLoading: userUpdateLoading, updateUserError: updateUserError, updateFreelancerMutation: updateFreelancerMutation, updateFreelancerLoading: updateFreelancerLoading, updateFreelancerError: updateFreelancerError, getExpertStatusDocument: getExpertStatusDocument, isInternal: isInternal, setTriggerNewStatus: setTriggerNewStatus }),
233
+ react_1.default.createElement(EditPersonalInformation_1.default, { expertId: legacyFreelancerId, user: user, address: address || {}, legacyMetadata: legacyMetadata, email: email, companyName: companyName, open: open, handleClose: handleClose, updateAddressMutation: updateAddressMutation, addressUpdateLoading: addressUpdateLoading, updateUserMutation: updateUserMutation, userUpdateLoading: userUpdateLoading, updateUserError: updateUserError, updateFreelancerMutation: updateFreelancerMutation, updateFreelancerLoading: updateFreelancerLoading, updateFreelancerError: updateFreelancerError, getExpertStatusDocument: getExpertStatusDocument, isInternal: isInternal, setTriggerNewStatus: setTriggerNewStatus }),
233
234
  openAssessmentModal && internalUserId &&
234
- react_1.default.createElement(SendAssessmentModal_1.default, { user: user, authUserID: internalUserId, openModal: openAssessmentModal, setOpenModal: setOpenAssessmentModal, expertLevelsTrainings: expertLevelsTrainings, trainingsDataLoading: trainingsDataLoading, assignLetterTrainingToExpert: assignLetterTrainingToExpert, assignTrainingLoading: assignTrainingLoading, assignTrainingError: assignTrainingError }))));
235
+ react_1.default.createElement(SendAssessmentModal_1.default, { user: user, authUserID: internalUserId, openModal: openAssessmentModal, setOpenModal: setOpenAssessmentModal, expertLevelsTrainings: expertLevelsTrainings, trainingsDataLoading: trainingsDataLoading, assignLetterTrainingToExpert: assignLetterTrainingToExpert, assignTrainingLoading: assignTrainingLoading, assignTrainingError: assignTrainingError })),
236
+ react_1.default.createElement(react_hot_toast_1.Toaster, { position: "top-center", toastOptions: {
237
+ style: {
238
+ zIndex: 9999,
239
+ backgroundColor: 'transparent'
240
+ },
241
+ } })));
235
242
  };
236
243
  exports.ExpertProfileHeader = ExpertProfileHeader;
@@ -7,6 +7,13 @@ interface NetworkSectionProps {
7
7
  leftSideStatus: string;
8
8
  rightSideStatus: string;
9
9
  isInternal: boolean;
10
+ paroTenure: string;
11
+ getExpertVanityTitles: any;
12
+ updateExpert: any;
13
+ legacyFreelancerId: number;
14
+ expertId: string;
15
+ vanityTitle: string;
16
+ getExpertByLegacyFreelancerIdDocument: any;
10
17
  }
11
- declare const NetworkSection: ({ handleScrollToBottom, preferenceTasks, isWhiteLabel, detailsSectionCompleted, infoColor, leftSideStatus, rightSideStatus, isInternal }: NetworkSectionProps) => JSX.Element;
18
+ declare const NetworkSection: ({ handleScrollToBottom, preferenceTasks, isWhiteLabel, detailsSectionCompleted, infoColor, leftSideStatus, rightSideStatus, isInternal, paroTenure, getExpertVanityTitles, updateExpert, expertId, legacyFreelancerId, vanityTitle, getExpertByLegacyFreelancerIdDocument, }: NetworkSectionProps) => JSX.Element;
12
19
  export default NetworkSection;
@@ -1,12 +1,44 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
4
33
  };
5
34
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
35
+ const react_1 = __importStar(require("react"));
7
36
  const core_1 = require("@material-ui/core");
8
37
  const styles_1 = require("@material-ui/core/styles");
9
38
  const ProfileCompletedPercentange_1 = require("../ProfileCompletedPercentange");
39
+ const icons_1 = require("@material-ui/icons");
40
+ const ReviewsTab_1 = require("../ReviewsTab/ReviewsTab");
41
+ const base_ui_1 = require("@paro.io/base-ui");
10
42
  const useStyles = (0, styles_1.makeStyles)((theme) => ({
11
43
  textSuccess: {
12
44
  color: '#12756F',
@@ -24,7 +56,59 @@ const StatusItem = ({ label, status, successText, warningText }) => {
24
56
  react_1.default.createElement(core_1.Typography, { variant: "body2" }, label),
25
57
  react_1.default.createElement("b", { className: status ? classes.textSuccess : classes.textWarning }, status ? successText : warningText)));
26
58
  };
27
- const NetworkSection = ({ handleScrollToBottom, preferenceTasks, isWhiteLabel, detailsSectionCompleted, infoColor, leftSideStatus, rightSideStatus, isInternal }) => {
59
+ const ExpertiseTitleModal = ({ openModal, updateTitle, titleOptions, selectedTitle, customTitle, setCustomTitle, handleChangeTitle, handleOnClose, handleUpdateExpertTitle }) => {
60
+ var _a;
61
+ return (react_1.default.createElement(base_ui_1.Modal, { open: openModal, size: "sm", onClose: handleOnClose },
62
+ react_1.default.createElement(core_1.Grid, { xs: 12, container: true, direction: "column", justifyContent: "center", alignItems: "center" },
63
+ react_1.default.createElement(core_1.Box, null,
64
+ react_1.default.createElement(core_1.Typography, { variant: "h5", style: { fontWeight: 500 } }, "Select Expertise Title")),
65
+ react_1.default.createElement(core_1.Grid, { item: true, style: { marginBottom: 12, width: '90%' } },
66
+ react_1.default.createElement(core_1.Select, { required: true, autoWidth: false, variant: "outlined", fullWidth: true, defaultValue: titleOptions, onChange: (event) => handleChangeTitle(event), value: selectedTitle !== null && selectedTitle !== void 0 ? selectedTitle : (_a = titleOptions[0]) === null || _a === void 0 ? void 0 : _a.title },
67
+ titleOptions.length > 1 && (react_1.default.createElement(core_1.MenuItem, { disabled: true, value: "" },
68
+ react_1.default.createElement("em", null, "Select title"))),
69
+ titleOptions.map((option) => (react_1.default.createElement(core_1.MenuItem, { key: option.id, value: option.title }, option.title))),
70
+ react_1.default.createElement(core_1.MenuItem, { value: "Other" },
71
+ react_1.default.createElement("em", null, "Other")))),
72
+ selectedTitle === 'Other' && react_1.default.createElement(core_1.Grid, { item: true, style: { width: '90%' } },
73
+ react_1.default.createElement(core_1.TextField, { size: "small", variant: "outlined", value: customTitle, fullWidth: true, onChange: (e) => { setCustomTitle(e.target.value); }, placeholder: "Enter custom title" })),
74
+ react_1.default.createElement(core_1.Grid, { container: true, direction: "row", justifyContent: "space-evenly", style: { marginTop: 12 }, spacing: 1 },
75
+ react_1.default.createElement(base_ui_1.Button, { label: "UPDATE PROFILE", onClick: handleUpdateExpertTitle, type: "button", isLoading: updateTitle, disabled: selectedTitle === null || (selectedTitle === 'Other' && (customTitle === null || customTitle === '')), color: "primary" }),
76
+ react_1.default.createElement(base_ui_1.Button, { label: "CANCEL", onClick: handleOnClose, type: "button", disabled: updateTitle, isLoading: updateTitle })))));
77
+ };
78
+ const NetworkSection = ({ handleScrollToBottom, preferenceTasks, isWhiteLabel, detailsSectionCompleted, infoColor, leftSideStatus, rightSideStatus, isInternal, paroTenure, getExpertVanityTitles, updateExpert, expertId, legacyFreelancerId, vanityTitle, getExpertByLegacyFreelancerIdDocument, }) => {
79
+ const [openModal, setOpenModal] = (0, react_1.useState)(false);
80
+ const [selectedTitle, setSelectedTitle] = (0, react_1.useState)(vanityTitle);
81
+ const [customTitle, setCustomTitle] = (0, react_1.useState)(null);
82
+ const [updateTitle, setUpdateTitle] = (0, react_1.useState)(false);
83
+ const handleUpdateExpertTitle = () => __awaiter(void 0, void 0, void 0, function* () {
84
+ setUpdateTitle(true);
85
+ updateExpert({
86
+ variables: {
87
+ expertId: expertId,
88
+ input: {
89
+ vanityTitle: selectedTitle === 'Other' ? customTitle : selectedTitle
90
+ }
91
+ },
92
+ refetchQueries: [{ query: getExpertByLegacyFreelancerIdDocument, variables: { legacyFreelancerId } }]
93
+ }).then(() => {
94
+ (0, ReviewsTab_1.toastNotification)({
95
+ position: 'top-center',
96
+ color: 'success',
97
+ message: 'Expertise title Updated successfully!',
98
+ icon: 'success',
99
+ });
100
+ }).catch(() => {
101
+ (0, ReviewsTab_1.toastNotification)({
102
+ position: 'top-center',
103
+ color: 'warning',
104
+ message: 'Failed to update expertise title.',
105
+ icon: 'warning'
106
+ });
107
+ }).finally(() => {
108
+ setUpdateTitle(false);
109
+ setOpenModal(false);
110
+ });
111
+ });
28
112
  return (react_1.default.createElement(core_1.Grid, { item: true, style: { width: '100%', padding: '6px 0px 6px 0px', zIndex: 1 } },
29
113
  react_1.default.createElement(core_1.Grid, { style: { paddingLeft: '10px' } },
30
114
  react_1.default.createElement("b", null, "Profile"),
@@ -32,6 +116,19 @@ const NetworkSection = ({ handleScrollToBottom, preferenceTasks, isWhiteLabel, d
32
116
  react_1.default.createElement(ProfileCompletedPercentange_1.ProfileCompletedPercentage, { preferenceTasks: preferenceTasks, isWhiteLabel: isWhiteLabel, detailsSectionCompleted: detailsSectionCompleted }))),
33
117
  react_1.default.createElement(core_1.Box, { mt: 4, mb: 2, mr: 2 },
34
118
  react_1.default.createElement(core_1.Divider, null)),
119
+ react_1.default.createElement(core_1.Box, { ml: 1, display: "flex", justifyContent: "space-between", alignItems: "center", "data-testid": "Matching-Id", style: { marginRight: '10px' } },
120
+ react_1.default.createElement(core_1.Typography, { variant: "body2" }, "Paro Tenure"),
121
+ react_1.default.createElement("b", null, paroTenure && paroTenure.length > 0 ? paroTenure : "N/A")),
122
+ react_1.default.createElement(core_1.Box, { mt: 1, mb: 1, mr: 2 },
123
+ react_1.default.createElement(core_1.Divider, null)),
124
+ vanityTitle && react_1.default.createElement(react_1.default.Fragment, null,
125
+ react_1.default.createElement(core_1.Box, { ml: 1, display: "flex", justifyContent: "space-between", alignItems: "center", "data-testid": "Matching-Id", style: { marginRight: '10px' } },
126
+ react_1.default.createElement(core_1.Typography, { variant: "body2" }, "Expertise as a "),
127
+ react_1.default.createElement("b", null, vanityTitle),
128
+ !isInternal && react_1.default.createElement(core_1.IconButton, { onClick: () => { setOpenModal(true); } },
129
+ react_1.default.createElement(icons_1.Cached, null))),
130
+ react_1.default.createElement(core_1.Box, { mt: 1, mb: 1, mr: 2 },
131
+ react_1.default.createElement(core_1.Divider, null))),
35
132
  react_1.default.createElement(core_1.Grid, { style: { marginRight: '8px', marginLeft: '2px' } },
36
133
  react_1.default.createElement(core_1.Box, { mb: 1 },
37
134
  react_1.default.createElement("b", null, "Network Availability :")),
@@ -52,6 +149,8 @@ const NetworkSection = ({ handleScrollToBottom, preferenceTasks, isWhiteLabel, d
52
149
  react_1.default.createElement("b", null, "Reason: "),
53
150
  react_1.default.createElement("ul", null,
54
151
  react_1.default.createElement("li", null, leftSideStatus),
55
- react_1.default.createElement("li", null, rightSideStatus))))));
152
+ react_1.default.createElement("li", null, rightSideStatus)))),
153
+ openModal &&
154
+ react_1.default.createElement(ExpertiseTitleModal, { openModal: openModal, updateTitle: updateTitle, titleOptions: [...getExpertVanityTitles], selectedTitle: selectedTitle, customTitle: customTitle, setCustomTitle: setCustomTitle, handleChangeTitle: (event) => { setSelectedTitle(event.target.value); }, handleOnClose: () => setOpenModal(false), handleUpdateExpertTitle: handleUpdateExpertTitle })));
56
155
  };
57
156
  exports.default = NetworkSection;
@@ -13,8 +13,6 @@ interface ProfileSectionProps {
13
13
  stateAbbreviation: string;
14
14
  email: string;
15
15
  phone: any;
16
- paroTenure: string;
17
- hourlyRate: number;
18
16
  setOpen: (open: boolean) => void;
19
17
  paroProjectsData: any;
20
18
  getUserDocument?: any;
@@ -28,6 +26,7 @@ interface ProfileSectionProps {
28
26
  getUserByEmailLazyQuery?: any;
29
27
  updateUserPassword?: any;
30
28
  verifyUserPassword?: any;
29
+ getExpertRates?: any;
31
30
  }
32
- declare const ProfileSection: ({ legacyFreelancerId, imageUrl, shouldAllowEditProfile, firstName, lastName, primaryServiceLine, editServiceLine, city, stateAbbreviation, email, phone, paroTenure, hourlyRate, setOpen, paroProjectsData, getUserDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, isInternal, getUserByEmail, updateUserEmail, updateUserMutation, getUserByEmailLazyQuery, updateUserPassword, verifyUserPassword, }: ProfileSectionProps) => JSX.Element;
31
+ declare 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, }: ProfileSectionProps) => JSX.Element;
33
32
  export default ProfileSection;