@paro.io/expert-shared-components 1.7.4 → 1.7.5
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.
- package/lib/components/ClientReferencesSection/DeleteButton.js +11 -11
- package/lib/components/ClientReferencesSection/ParoError.js +10 -10
- package/lib/components/ClientReferencesSection/TagsSection.js +2 -2
- package/lib/components/ClientReferencesSection/styles/BrandedTypography.js +2 -2
- package/lib/components/ClientReferencesSection/styles/Buttons.js +15 -15
- package/lib/components/ClientReferencesSection/styles/Name.js +5 -5
- package/lib/components/ClientReferencesSection/styles/NullContentConditionalColor.js +4 -4
- package/lib/components/ClientReferencesSection/styles/SectionBody.js +11 -11
- package/lib/components/ClientReferencesSection/styles/SectionTitle.js +6 -6
- package/lib/components/ClientReferencesSection/styles/Tags.js +2 -2
- package/lib/components/DocumentCenter/DocumentCenter.js +1 -1
- package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
- package/lib/components/DocumentCenter/DocumentTable.js +350 -350
- package/lib/components/DocumentCenter/DocumentUploadRow.d.ts +4 -1
- package/lib/components/DocumentCenter/DocumentUploadRow.js +63 -34
- package/lib/components/DocumentCenter/ParoDocumentsTable.d.ts +1 -0
- package/lib/components/DocumentCenter/ParoDocumentsTable.js +1 -44
- package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
- package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
- package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
- package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
- package/lib/components/OrganizationChart/OrganizationChart.js +7 -7
- package/lib/components/Reviews/Pagination.js +6 -6
- package/lib/components/ReviewsTab/RatingHeader.js +6 -6
- package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
- package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
- package/lib/components/ServiceLinesTemplate/index.d.ts +2 -1
- package/lib/components/ServiceLinesTemplate/index.js +9 -5
- package/lib/components/shared/Error.d.ts +6 -6
- package/lib/components/shared/Error.js +40 -40
- package/lib/components/shared/Image.js +13 -13
- package/lib/components/shared/ProfileTextField.d.ts +18 -18
- package/lib/components/shared/ProfileTextField.js +16 -16
- package/lib/components/shared/StyledActionButtons.d.ts +7 -7
- package/lib/components/shared/StyledActionButtons.js +15 -15
- package/lib/components/shared/ToastNotification.d.ts +10 -10
- package/lib/components/shared/ToastNotification.js +63 -63
- 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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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);
|
|
@@ -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,
|
|
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, paroTenure, hourlyRate, setOpen, paroProjectsData, getUserDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, isInternal, getUserByEmail, updateUserEmail, updateUserMutation, getUserByEmailLazyQuery, updateUserPassword, verifyUserPassword, }) => {
|
|
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,8 +51,9 @@ 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
59
|
if (!isInternalProfile) {
|
|
@@ -71,8 +72,9 @@ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, ge
|
|
|
71
72
|
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
73
|
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
74
|
const expertRates = (_j = ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.data) === null || _j === void 0 ? void 0 : _j.getRatesByExpertId;
|
|
75
|
+
setCurrentFeatureStatus((_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.featureStatus);
|
|
74
76
|
setCurrentServiceRate(currentRate);
|
|
75
|
-
const isTitleExists = (
|
|
77
|
+
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
78
|
isTitleExists ? setSelectedTitle(isTitleExists) : setValue(1);
|
|
77
79
|
dispatch({
|
|
78
80
|
currentService,
|
|
@@ -124,7 +126,8 @@ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, ge
|
|
|
124
126
|
variables: {
|
|
125
127
|
expertId: expertId,
|
|
126
128
|
input: {
|
|
127
|
-
vanityTitle: selectedTitle === 'Other' ? customTitle : selectedTitle
|
|
129
|
+
vanityTitle: selectedTitle === 'Other' ? customTitle : selectedTitle,
|
|
130
|
+
featureStatus: Object.assign({}, featureStatus)
|
|
128
131
|
}
|
|
129
132
|
},
|
|
130
133
|
}).then(() => {
|
|
@@ -173,6 +176,7 @@ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, ge
|
|
|
173
176
|
}
|
|
174
177
|
finally {
|
|
175
178
|
setOpenServiceLinesTemplate && setOpenServiceLinesTemplate(false);
|
|
179
|
+
setUpdateClicked(false);
|
|
176
180
|
}
|
|
177
181
|
;
|
|
178
182
|
});
|
|
@@ -181,7 +185,7 @@ const ServiceLinesTemplate = ({ getFreelancerDataResult, createOrUpdateRates, ge
|
|
|
181
185
|
variables: {
|
|
182
186
|
expertId: expertId,
|
|
183
187
|
input: {
|
|
184
|
-
featureStatus: { "serviceLines": true }
|
|
188
|
+
featureStatus: Object.assign({ "serviceLines": true }, featureStatus)
|
|
185
189
|
}
|
|
186
190
|
},
|
|
187
191
|
}).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;
|
|
@@ -1,40 +1,40 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const core_1 = require("@material-ui/core");
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const colors_1 = __importDefault(require("../shared/constants/colors"));
|
|
10
|
-
const CopyToClipboardAlert_1 = __importDefault(require("./CopyToClipboardAlert"));
|
|
11
|
-
const ErrorBox = (0, styled_components_1.default)(core_1.Box) `
|
|
12
|
-
width: 100%;
|
|
13
|
-
padding-bottom: 100;
|
|
14
|
-
`;
|
|
15
|
-
const ParoTitle = (0, styled_components_1.default)(core_1.Box) `
|
|
16
|
-
color: ${colors_1.default.paroBlack};
|
|
17
|
-
padding: 0px 0px 18px 0px;
|
|
18
|
-
`;
|
|
19
|
-
const ParoSubtitle = styled_components_1.default.div `
|
|
20
|
-
color: ${colors_1.default.paroBlack};
|
|
21
|
-
margin-bottom: 24px;
|
|
22
|
-
font-size: 1rem;
|
|
23
|
-
`;
|
|
24
|
-
const reloadWindow = () => {
|
|
25
|
-
window.location.reload();
|
|
26
|
-
};
|
|
27
|
-
const Error = ({ handleClose }) => {
|
|
28
|
-
const handleCancel = handleClose ? handleClose : reloadWindow;
|
|
29
|
-
const handleCancelLanguage = handleClose ? 'Close' : 'Retry';
|
|
30
|
-
return (react_1.default.createElement(ErrorBox, null,
|
|
31
|
-
react_1.default.createElement(core_1.Box, { display: 'flex', alignContent: 'center', alignItems: 'center', justifyContent: 'center', flexDirection: 'column', padding: '100px 0px 36px 5px;' },
|
|
32
|
-
react_1.default.createElement(core_1.Typography, { variant: 'h6', gutterBottom: true },
|
|
33
|
-
react_1.default.createElement(ParoTitle, null, "Oops! We had a misstep.")),
|
|
34
|
-
react_1.default.createElement(core_1.Typography, { component: 'span', gutterBottom: true },
|
|
35
|
-
react_1.default.createElement(ParoSubtitle, null, "Contact support if the issue persists")),
|
|
36
|
-
react_1.default.createElement(core_1.DialogActions, null,
|
|
37
|
-
react_1.default.createElement(core_1.Button, { variant: 'outlined', onClick: handleCancel, color: 'primary' }, handleCancelLanguage),
|
|
38
|
-
react_1.default.createElement(CopyToClipboardAlert_1.default, { alertMessage: 'Email address copied to clipboard', button: core_1.Button, buttonContent: 'Copy support email', copyContent: 'people@paro.io', variant: 'contained' })))));
|
|
39
|
-
};
|
|
40
|
-
exports.default = Error;
|
|
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
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const core_1 = require("@material-ui/core");
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const colors_1 = __importDefault(require("../shared/constants/colors"));
|
|
10
|
+
const CopyToClipboardAlert_1 = __importDefault(require("./CopyToClipboardAlert"));
|
|
11
|
+
const ErrorBox = (0, styled_components_1.default)(core_1.Box) `
|
|
12
|
+
width: 100%;
|
|
13
|
+
padding-bottom: 100;
|
|
14
|
+
`;
|
|
15
|
+
const ParoTitle = (0, styled_components_1.default)(core_1.Box) `
|
|
16
|
+
color: ${colors_1.default.paroBlack};
|
|
17
|
+
padding: 0px 0px 18px 0px;
|
|
18
|
+
`;
|
|
19
|
+
const ParoSubtitle = styled_components_1.default.div `
|
|
20
|
+
color: ${colors_1.default.paroBlack};
|
|
21
|
+
margin-bottom: 24px;
|
|
22
|
+
font-size: 1rem;
|
|
23
|
+
`;
|
|
24
|
+
const reloadWindow = () => {
|
|
25
|
+
window.location.reload();
|
|
26
|
+
};
|
|
27
|
+
const Error = ({ handleClose }) => {
|
|
28
|
+
const handleCancel = handleClose ? handleClose : reloadWindow;
|
|
29
|
+
const handleCancelLanguage = handleClose ? 'Close' : 'Retry';
|
|
30
|
+
return (react_1.default.createElement(ErrorBox, null,
|
|
31
|
+
react_1.default.createElement(core_1.Box, { display: 'flex', alignContent: 'center', alignItems: 'center', justifyContent: 'center', flexDirection: 'column', padding: '100px 0px 36px 5px;' },
|
|
32
|
+
react_1.default.createElement(core_1.Typography, { variant: 'h6', gutterBottom: true },
|
|
33
|
+
react_1.default.createElement(ParoTitle, null, "Oops! We had a misstep.")),
|
|
34
|
+
react_1.default.createElement(core_1.Typography, { component: 'span', gutterBottom: true },
|
|
35
|
+
react_1.default.createElement(ParoSubtitle, null, "Contact support if the issue persists")),
|
|
36
|
+
react_1.default.createElement(core_1.DialogActions, null,
|
|
37
|
+
react_1.default.createElement(core_1.Button, { variant: 'outlined', onClick: handleCancel, color: 'primary' }, handleCancelLanguage),
|
|
38
|
+
react_1.default.createElement(CopyToClipboardAlert_1.default, { alertMessage: 'Email address copied to clipboard', button: core_1.Button, buttonContent: 'Copy support email', copyContent: 'people@paro.io', variant: 'contained' })))));
|
|
39
|
+
};
|
|
40
|
+
exports.default = Error;
|