@paro.io/expert-shared-components 1.12.43 → 1.12.44
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.
|
@@ -113,6 +113,7 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
|
|
|
113
113
|
return new Promise((resolve, reject) => {
|
|
114
114
|
const reader = new FileReader();
|
|
115
115
|
reader.onloadend = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
116
|
+
var _a;
|
|
116
117
|
try {
|
|
117
118
|
const res = yield (0, FileUploader_1.fileUploader)({
|
|
118
119
|
file: selectedFile,
|
|
@@ -127,7 +128,7 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
|
|
|
127
128
|
extraData: {
|
|
128
129
|
clientId: isExpert ? selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id : user === null || user === void 0 ? void 0 : user.userId,
|
|
129
130
|
clientName: isExpert ? selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name : user === null || user === void 0 ? void 0 : user.name,
|
|
130
|
-
email: isExpert ?
|
|
131
|
+
email: isExpert ? (_a = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.primaryContact) === null || _a === void 0 ? void 0 : _a.email : user === null || user === void 0 ? void 0 : user.email,
|
|
131
132
|
freelancerId: isExpert ? user === null || user === void 0 ? void 0 : user.userId : selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id,
|
|
132
133
|
freelancerName: isExpert ? user === null || user === void 0 ? void 0 : user.name : selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name,
|
|
133
134
|
projectName: selectedProjects.length > 0 ? selectedProjects[0].name : '',
|
|
@@ -44,10 +44,22 @@ const Escalations = ({ expertsOrClients, projects, isExpert = false, escalations
|
|
|
44
44
|
const [selectedProject, setSelectedProject] = (0, react_1.useState)(null);
|
|
45
45
|
const [selectedIssueId, setSelectedIssueId] = (0, react_1.useState)(null); // using selectedIssueId 0 for new escalation submission
|
|
46
46
|
const [showEscalationChat, setShowEscalationChat] = (0, react_1.useState)(false);
|
|
47
|
-
const [activeChatIssue, setActiveChatIssue] = (0, react_1.useState)(null);
|
|
47
|
+
const [activeChatIssue, setActiveChatIssue] = (0, react_1.useState)(null);
|
|
48
48
|
const [activeEscalationTab, setActiveEscalationTab] = (0, react_1.useState)('action-required');
|
|
49
49
|
const [showSuspensionModal, setShowSuspensionModal] = (0, react_1.useState)(false);
|
|
50
|
-
const activeIssues = escalations.filter(issue => {
|
|
50
|
+
const activeIssues = escalations.filter(issue => {
|
|
51
|
+
var _a;
|
|
52
|
+
const userTypeId = (_a = issue === null || issue === void 0 ? void 0 : issue.submittedByUser) === null || _a === void 0 ? void 0 : _a.userTypeId;
|
|
53
|
+
const internalEscalationTo = issue === null || issue === void 0 ? void 0 : issue.internalEscalationTo;
|
|
54
|
+
const status = issue === null || issue === void 0 ? void 0 : issue.status;
|
|
55
|
+
// Determine if this issue should be shown to the current user
|
|
56
|
+
const isRelevantEscalation = (isExpert
|
|
57
|
+
? (internalEscalationTo === 'expert' || internalEscalationTo === 'both')
|
|
58
|
+
: (internalEscalationTo === 'client' || internalEscalationTo === 'both'));
|
|
59
|
+
return ((userTypeId !== user.userTypeId ||
|
|
60
|
+
(userTypeId === 2 && isRelevantEscalation)) &&
|
|
61
|
+
status === 'InProgress');
|
|
62
|
+
});
|
|
51
63
|
const inProgressIssues = escalations.filter(issue => { var _a; return ((_a = issue === null || issue === void 0 ? void 0 : issue.submittedByUser) === null || _a === void 0 ? void 0 : _a.userTypeId) === user.userTypeId && (issue === null || issue === void 0 ? void 0 : issue.status) === 'InProgress'; });
|
|
52
64
|
const resolvedIssues = escalations.filter(issue => (issue === null || issue === void 0 ? void 0 : issue.status) === 'Resolved');
|
|
53
65
|
const goBack = () => {
|
|
@@ -16,26 +16,6 @@ exports.fileUploader = void 0;
|
|
|
16
16
|
const UploadClient_1 = __importDefault(require("../shared/UploadClient"));
|
|
17
17
|
const utils_1 = require("../shared/utils");
|
|
18
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, }) {
|
|
19
|
-
console.log("input params here in file uploader is ", {
|
|
20
|
-
file,
|
|
21
|
-
disputeId,
|
|
22
|
-
escalationId,
|
|
23
|
-
projectId,
|
|
24
|
-
documentUploadUrl,
|
|
25
|
-
bucketName,
|
|
26
|
-
updateClientInvoiceDisputeMutation,
|
|
27
|
-
updateProjectEscalation,
|
|
28
|
-
uploadExpertClientFiles,
|
|
29
|
-
createProjectEscalation,
|
|
30
|
-
previousFiles,
|
|
31
|
-
isExpert,
|
|
32
|
-
extraData,
|
|
33
|
-
});
|
|
34
|
-
// Add these debug logs
|
|
35
|
-
console.log("escalationId exists?", !!escalationId);
|
|
36
|
-
console.log("escalationId value:", escalationId);
|
|
37
|
-
console.log("updateProjectEscalation exists?", !!updateProjectEscalation);
|
|
38
|
-
console.log("typeof updateProjectEscalation:", typeof updateProjectEscalation);
|
|
39
19
|
const documentLinks = previousFiles ? (typeof previousFiles === 'string' ? previousFiles.split(',') : [...previousFiles]) : [];
|
|
40
20
|
try {
|
|
41
21
|
(0, utils_1.showToast)('success', 'Starting Document Upload');
|
|
@@ -51,7 +31,6 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
51
31
|
const resParsed = JSON.parse(res);
|
|
52
32
|
const documentLink = resParsed === null || resParsed === void 0 ? void 0 : resParsed.Location;
|
|
53
33
|
documentLinks.push(documentLink); // Add the new file to the documentLinks array
|
|
54
|
-
console.log("document links are ", documentLinks);
|
|
55
34
|
const promises = [];
|
|
56
35
|
if (disputeId) {
|
|
57
36
|
promises.push(updateClientInvoiceDisputeMutation({
|
|
@@ -69,11 +48,7 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
69
48
|
},
|
|
70
49
|
}));
|
|
71
50
|
}
|
|
72
|
-
console.log("Escalation id is ", escalationId);
|
|
73
|
-
console.log("About to check escalationId condition");
|
|
74
51
|
if (escalationNumber) {
|
|
75
|
-
console.log("escalationId condition is TRUE - adding updateProjectEscalation to promises");
|
|
76
|
-
console.log("updateProjectEscalation function:", updateProjectEscalation);
|
|
77
52
|
const escalationPromise = updateProjectEscalation({
|
|
78
53
|
variables: {
|
|
79
54
|
input: Object.assign({ escalationId }, (isExpert ? {
|
|
@@ -83,16 +58,12 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
83
58
|
}))
|
|
84
59
|
},
|
|
85
60
|
});
|
|
86
|
-
console.log("Created escalation promise:", escalationPromise);
|
|
87
61
|
promises.push(escalationPromise);
|
|
88
|
-
console.log("Added escalation promise to promises array");
|
|
89
62
|
}
|
|
90
63
|
else {
|
|
91
64
|
console.log("escalationId condition is FALSE");
|
|
92
65
|
}
|
|
93
|
-
console.log("promises are ", promises.length, promises);
|
|
94
66
|
if (uploadExpertClientFiles && extraData) {
|
|
95
|
-
console.log("extra data is ", extraData);
|
|
96
67
|
promises.push(uploadExpertClientFiles({
|
|
97
68
|
variables: {
|
|
98
69
|
input: {
|
|
@@ -33,7 +33,6 @@ class UploadClient {
|
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
try {
|
|
35
35
|
const fileName = this.generateS3Key(this.state.projectId, this.state.escalationId, this.state.fileName);
|
|
36
|
-
console.log('File Name', fileName);
|
|
37
36
|
this.state = Object.assign(Object.assign({}, this.state), { fileName: fileName });
|
|
38
37
|
const params = {
|
|
39
38
|
fileName: this.state.fileName,
|
|
@@ -123,7 +122,6 @@ class UploadClient {
|
|
|
123
122
|
throw new Error('Failed to complete multipart upload');
|
|
124
123
|
}
|
|
125
124
|
const { responseData } = yield response.json();
|
|
126
|
-
console.log('Upload Complete', responseData);
|
|
127
125
|
return `${JSON.stringify(responseData)}`;
|
|
128
126
|
}
|
|
129
127
|
catch (error) {
|