@paro.io/expert-shared-components 1.14.37 → 1.14.39
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/ExpertProfileHeader/ExpertStatusCalculator.js +6 -5
- package/lib/components/FileUploader/index.d.ts +15 -1
- package/lib/components/FileUploader/index.js +14 -3
- package/lib/components/shared/UploadClient.d.ts +3 -2
- package/lib/components/shared/UploadClient.js +8 -3
- package/package.json +1 -1
|
@@ -40,11 +40,12 @@ const ExpertStatusCalculator = (statusData, setLeftSideStatus, setRightSideStatu
|
|
|
40
40
|
setLeftSideStatus('This Expert has been churned from the Network and cannot take on new projects.');
|
|
41
41
|
setRightSideStatus(`! Churned ${formattedDate}, see notes.`);
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
43
|
+
// Should not be mark Not available due to inactivity
|
|
44
|
+
// else if (isDespiseExpert(earningsData, expertMetricsData?.getExpertMetrics.lastPitchDate, statusData?.lastLoginDate, applicationStatus)) {
|
|
45
|
+
// setLeftSideStatus('This Expert is inactive and cannot take on new projects until they log in, submit a pitch, or log time.')
|
|
46
|
+
// setRightSideStatus('! Inactive, Expert must log in, submit a pitch, or log time into the Platform to become active or respond to matches')
|
|
47
|
+
// setInfoColor({leftSideStatus: false, rightSideStatus: false, Matching: false, FaF: false, JobBoard: false})
|
|
48
|
+
// }
|
|
48
49
|
// else if (statusData.isInactive) {
|
|
49
50
|
// setLeftSideStatus('This Expert is inactive and cannot take on new projects until they log in.')
|
|
50
51
|
// setRightSideStatus('! Inactive, Expert must log into the Platform to become active.')
|
|
@@ -13,6 +13,20 @@ interface UploadFileParams {
|
|
|
13
13
|
createProjectEscalation?: any;
|
|
14
14
|
previousFiles?: string | string[];
|
|
15
15
|
isExpert: boolean;
|
|
16
|
+
taskId?: string;
|
|
17
|
+
createOrUpdatePiTaskMutation?: any;
|
|
18
|
+
taskInput?: {
|
|
19
|
+
attachments?: string[];
|
|
20
|
+
budgetHours?: number;
|
|
21
|
+
columnId?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
endDate?: string;
|
|
24
|
+
firmEmployeeId?: number;
|
|
25
|
+
name: string;
|
|
26
|
+
phase?: string;
|
|
27
|
+
priority?: string;
|
|
28
|
+
userId: number;
|
|
29
|
+
};
|
|
16
30
|
extraData?: {
|
|
17
31
|
clientId: number;
|
|
18
32
|
clientName: string;
|
|
@@ -22,5 +36,5 @@ interface UploadFileParams {
|
|
|
22
36
|
projectName: string;
|
|
23
37
|
};
|
|
24
38
|
}
|
|
25
|
-
export declare const fileUploader: ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, updateProjectEscalation, uploadExpertClientFiles, createProjectEscalation, bucketName, disputeId, escalationId, escalationNumber, previousFiles, isExpert, extraData, }: UploadFileParams) => Promise<any>;
|
|
39
|
+
export declare const fileUploader: ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, updateProjectEscalation, uploadExpertClientFiles, createProjectEscalation, bucketName, disputeId, escalationId, escalationNumber, previousFiles, isExpert, extraData, taskId, createOrUpdatePiTaskMutation, taskInput, }: UploadFileParams) => Promise<any>;
|
|
26
40
|
export {};
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.fileUploader = void 0;
|
|
16
16
|
const UploadClient_1 = __importDefault(require("../shared/UploadClient"));
|
|
17
17
|
const utils_1 = require("../shared/utils");
|
|
18
|
-
const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, updateProjectEscalation, uploadExpertClientFiles, createProjectEscalation, bucketName, disputeId, escalationId, escalationNumber, previousFiles, isExpert, extraData, }) {
|
|
18
|
+
const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, updateProjectEscalation, uploadExpertClientFiles, createProjectEscalation, bucketName, disputeId, escalationId, escalationNumber, previousFiles, isExpert, extraData, taskId, createOrUpdatePiTaskMutation, taskInput, }) {
|
|
19
19
|
const documentLinks = previousFiles ? (typeof previousFiles === 'string' ? previousFiles.split(',') : [...previousFiles]) : [];
|
|
20
20
|
try {
|
|
21
21
|
(0, utils_1.showToast)('success', 'Starting Document Upload');
|
|
@@ -26,6 +26,7 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
26
26
|
escalationId,
|
|
27
27
|
documentUploadUrl,
|
|
28
28
|
bucketName: bucketName,
|
|
29
|
+
taskId
|
|
29
30
|
});
|
|
30
31
|
yield uploadClient.triggerMultipartUpload().then((res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
32
|
const resParsed = JSON.parse(res);
|
|
@@ -63,7 +64,17 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
63
64
|
else {
|
|
64
65
|
console.log("escalationId condition is FALSE");
|
|
65
66
|
}
|
|
67
|
+
if (taskId && createOrUpdatePiTaskMutation) {
|
|
68
|
+
const taskPromise = createOrUpdatePiTaskMutation({
|
|
69
|
+
variables: {
|
|
70
|
+
taskId,
|
|
71
|
+
data: Object.assign(Object.assign({}, taskInput), { attachments: documentLinks.join(',') }),
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
promises.push(taskPromise);
|
|
75
|
+
}
|
|
66
76
|
if (uploadExpertClientFiles && extraData) {
|
|
77
|
+
const fileType = disputeId ? 'DISPUTE_DOCUMENTS' : taskId ? 'PROJECT_TASK_DOCUMENTS' : 'ESCALATION_DOCUMENTS';
|
|
67
78
|
promises.push(uploadExpertClientFiles({
|
|
68
79
|
variables: {
|
|
69
80
|
input: {
|
|
@@ -72,12 +83,12 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
72
83
|
email: extraData.email,
|
|
73
84
|
fileName: file.name,
|
|
74
85
|
fileSize: file.size,
|
|
75
|
-
fileType:
|
|
86
|
+
fileType: fileType,
|
|
76
87
|
freelancerId: extraData.freelancerId,
|
|
77
88
|
freelancerName: extraData.freelancerName,
|
|
78
89
|
projectId: projectId,
|
|
79
90
|
projectName: extraData.projectName,
|
|
80
|
-
uploadedBy: isExpert ? 'FREELANCER' : 'CLIENT',
|
|
91
|
+
uploadedBy: taskId && !isExpert ? 'INTERNAL' : isExpert ? 'FREELANCER' : 'CLIENT',
|
|
81
92
|
data: "",
|
|
82
93
|
},
|
|
83
94
|
}
|
|
@@ -6,10 +6,11 @@ export default class UploadClient {
|
|
|
6
6
|
documentUploadUrl: string;
|
|
7
7
|
projectId: number;
|
|
8
8
|
bucketName: string;
|
|
9
|
-
escalationId
|
|
9
|
+
escalationId?: string;
|
|
10
|
+
taskId?: string;
|
|
10
11
|
};
|
|
11
12
|
constructor(props: any);
|
|
12
|
-
generateS3Key(projectId: number, escalationId: string, fileName: string): string;
|
|
13
|
+
generateS3Key(projectId: number, escalationId: string, fileName: string, taskId: string): string;
|
|
13
14
|
triggerMultipartUpload(): Promise<string | undefined>;
|
|
14
15
|
uploadMultiPartFile(): Promise<string | undefined>;
|
|
15
16
|
completeUpload(partsArray: any): Promise<string | undefined>;
|
|
@@ -19,11 +19,15 @@ class UploadClient {
|
|
|
19
19
|
projectId: props.projectId,
|
|
20
20
|
bucketName: props.bucketName,
|
|
21
21
|
escalationId: props.escalationId,
|
|
22
|
+
taskId: props.taskId,
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
generateS3Key(projectId, escalationId, fileName) {
|
|
25
|
+
generateS3Key(projectId, escalationId, fileName, taskId) {
|
|
25
26
|
const sanitizedFileName = fileName.replace(/[^a-zA-Z0-9.-]/g, '_');
|
|
26
|
-
if (
|
|
27
|
+
if (!!taskId) {
|
|
28
|
+
return `project-task-${taskId}/${sanitizedFileName}`;
|
|
29
|
+
}
|
|
30
|
+
if (!!escalationId) {
|
|
27
31
|
return `escalation-${escalationId}/${sanitizedFileName}`;
|
|
28
32
|
}
|
|
29
33
|
return `project-${projectId}/${sanitizedFileName}`;
|
|
@@ -31,8 +35,9 @@ class UploadClient {
|
|
|
31
35
|
;
|
|
32
36
|
triggerMultipartUpload() {
|
|
33
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
var _a, _b;
|
|
34
39
|
try {
|
|
35
|
-
const fileName = this.generateS3Key(this.state.projectId, this.state.escalationId, this.state.fileName);
|
|
40
|
+
const fileName = this.generateS3Key(this.state.projectId, (_a = this.state.escalationId) !== null && _a !== void 0 ? _a : '', this.state.fileName, (_b = this.state.taskId) !== null && _b !== void 0 ? _b : '');
|
|
36
41
|
this.state = Object.assign(Object.assign({}, this.state), { fileName: fileName });
|
|
37
42
|
const params = {
|
|
38
43
|
fileName: this.state.fileName,
|