@paro.io/expert-shared-components 1.12.44 → 1.12.45
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.
|
@@ -60,7 +60,7 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
|
|
|
60
60
|
return new Promise((resolve, reject) => {
|
|
61
61
|
const reader = new FileReader();
|
|
62
62
|
reader.onloadend = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
var _a;
|
|
63
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
64
64
|
try {
|
|
65
65
|
const res = yield (0, FileUploader_1.fileUploader)({
|
|
66
66
|
file: selectedFile,
|
|
@@ -73,11 +73,11 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
|
|
|
73
73
|
uploadExpertClientFiles: uploadExpertClientFiles,
|
|
74
74
|
createProjectEscalation: createProjectEscalation,
|
|
75
75
|
extraData: {
|
|
76
|
-
clientId: activeChatIssue.client.id,
|
|
77
|
-
clientName: activeChatIssue.client.name,
|
|
78
|
-
email: isExpert ?
|
|
79
|
-
freelancerId: activeChatIssue.freelancer.id,
|
|
80
|
-
freelancerName: (
|
|
76
|
+
clientId: (_a = activeChatIssue.client.id) !== null && _a !== void 0 ? _a : 0,
|
|
77
|
+
clientName: (_b = activeChatIssue.client.name) !== null && _b !== void 0 ? _b : '',
|
|
78
|
+
email: isExpert ? (_e = (_d = (_c = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.client) === null || _c === void 0 ? void 0 : _c.primaryContact) === null || _d === void 0 ? void 0 : _d.email) !== null && _e !== void 0 ? _e : '' : (_f = user === null || user === void 0 ? void 0 : user.email) !== null && _f !== void 0 ? _f : '',
|
|
79
|
+
freelancerId: (_g = activeChatIssue.freelancer.id) !== null && _g !== void 0 ? _g : 0,
|
|
80
|
+
freelancerName: (_h = activeChatIssue.freelancer.name) !== null && _h !== void 0 ? _h : '',
|
|
81
81
|
projectName: activeChatIssue.projectDetails.length > 0 ? activeChatIssue.projectDetails[0].projectName : '',
|
|
82
82
|
}
|
|
83
83
|
});
|
|
@@ -86,7 +86,7 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
catch (error) {
|
|
89
|
-
|
|
89
|
+
console.error("faile upload failed", error);
|
|
90
90
|
}
|
|
91
91
|
finally {
|
|
92
92
|
resolve();
|
|
@@ -8,6 +8,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const base_ui_1 = require("@paro.io/base-ui");
|
|
9
9
|
const ClientDisputeProjectCard_1 = require("../Invoices/ClientDisputeProjectCard");
|
|
10
10
|
const base_icons_1 = require("@paro.io/base-icons");
|
|
11
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
11
12
|
const getBackgroundColor = (type) => {
|
|
12
13
|
switch (type) {
|
|
13
14
|
case 'Critical':
|
|
@@ -39,10 +40,11 @@ const EscalationIssueCard = ({ issues, isExpert, openEscalationChat, showRespond
|
|
|
39
40
|
: '';
|
|
40
41
|
const docs = [issue.expertSupportingDocuments, issue.clientSupportingDocuments, issue.internalSupportingDocuments];
|
|
41
42
|
const processedDocs = docs
|
|
42
|
-
.filter(doc => doc !== null && doc !== undefined && doc !== '')
|
|
43
|
+
.filter(doc => doc !== null && doc !== undefined && doc !== '' && doc !== "NULL")
|
|
43
44
|
.flatMap(doc => doc.split(','))
|
|
44
45
|
.map(doc => doc.trim())
|
|
45
|
-
.filter(doc => doc !== '');
|
|
46
|
+
.filter(doc => doc !== '' || doc !== "NULL");
|
|
47
|
+
console.log({ processedDocs, docs });
|
|
46
48
|
return (react_1.default.createElement("div", { key: issue.id, className: "border border-gray-200 rounded-lg bg-white p-4" },
|
|
47
49
|
react_1.default.createElement("div", { className: "flex items-center justify-between mb-3" },
|
|
48
50
|
react_1.default.createElement("div", { className: "flex-1 ml-2" },
|
|
@@ -61,7 +63,7 @@ const EscalationIssueCard = ({ issues, isExpert, openEscalationChat, showRespond
|
|
|
61
63
|
react_1.default.createElement("span", { className: "font-bold" }, issue.submittedByUser.firstName + " " + issue.submittedByUser.lastName),
|
|
62
64
|
issue.createdAt && react_1.default.createElement(react_1.default.Fragment, null,
|
|
63
65
|
" \u2022 Submitted on: ",
|
|
64
|
-
react_1.default.createElement("span", { className: "font-bold" }, issue.createdAt)))),
|
|
66
|
+
react_1.default.createElement("span", { className: "font-bold" }, (0, dayjs_1.default)(issue.createdAt).format("MM-DD-YYYY"))))),
|
|
65
67
|
react_1.default.createElement("div", { className: "text-sm text-gray-600 mb-3" }, issue.outcome),
|
|
66
68
|
processedDocs && processedDocs.length > 0 && (react_1.default.createElement("div", { className: "flex flex-wrap gap-2" },
|
|
67
69
|
react_1.default.createElement("span", { className: "text-sm font-bold text-gray-500 items-center" }, "Supporting Documents: "),
|
|
@@ -38,6 +38,7 @@ const base_icons_1 = require("@paro.io/base-icons");
|
|
|
38
38
|
const base_ui_1 = require("@paro.io/base-ui");
|
|
39
39
|
const FileUploader_1 = require("../FileUploader");
|
|
40
40
|
const EscalationIssueCard_1 = require("./EscalationIssueCard");
|
|
41
|
+
const utils_1 = require("../shared/utils");
|
|
41
42
|
exports.ACCEPTED_FILE_TYPES = [
|
|
42
43
|
'application/pdf',
|
|
43
44
|
'application/msword',
|
|
@@ -122,7 +123,7 @@ const EscalationRespondForm = ({ goBack, selectedIssue, documentUploadUrl, downl
|
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
catch (error) {
|
|
125
|
-
|
|
126
|
+
console.error("Failed to upload file", error);
|
|
126
127
|
}
|
|
127
128
|
finally {
|
|
128
129
|
resolve();
|
|
@@ -155,9 +156,11 @@ const EscalationRespondForm = ({ goBack, selectedIssue, documentUploadUrl, downl
|
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
});
|
|
159
|
+
(0, utils_1.showToast)("success", "Response submitted!");
|
|
158
160
|
}
|
|
159
161
|
catch (error) {
|
|
160
162
|
console.error("Failed to send response!", error);
|
|
163
|
+
(0, utils_1.showToast)("warning", "Failed to update response!");
|
|
161
164
|
}
|
|
162
165
|
finally {
|
|
163
166
|
setSubmitting(false);
|
|
@@ -113,7 +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
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
117
117
|
try {
|
|
118
118
|
const res = yield (0, FileUploader_1.fileUploader)({
|
|
119
119
|
file: selectedFile,
|
|
@@ -126,11 +126,11 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
|
|
|
126
126
|
uploadExpertClientFiles: uploadExpertClientFiles,
|
|
127
127
|
createProjectEscalation: createProjectEscalation,
|
|
128
128
|
extraData: {
|
|
129
|
-
clientId: isExpert ? selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id : user === null || user === void 0 ? void 0 : user.userId,
|
|
130
|
-
clientName: isExpert ? selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name : user === null || user === void 0 ? void 0 : user.name,
|
|
131
|
-
email: isExpert ? (
|
|
132
|
-
freelancerId: isExpert ? user === null || user === void 0 ? void 0 : user.userId : selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id,
|
|
133
|
-
freelancerName: isExpert ? user === null || user === void 0 ? void 0 : user.name : selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name,
|
|
129
|
+
clientId: isExpert ? (_a = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id) !== null && _a !== void 0 ? _a : 0 : (_b = user === null || user === void 0 ? void 0 : user.userId) !== null && _b !== void 0 ? _b : 0,
|
|
130
|
+
clientName: isExpert ? (_c = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name) !== null && _c !== void 0 ? _c : '' : (_d = user === null || user === void 0 ? void 0 : user.name) !== null && _d !== void 0 ? _d : '',
|
|
131
|
+
email: isExpert ? (_f = (_e = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.primaryContact) === null || _e === void 0 ? void 0 : _e.email) !== null && _f !== void 0 ? _f : '' : (_g = user === null || user === void 0 ? void 0 : user.email) !== null && _g !== void 0 ? _g : '',
|
|
132
|
+
freelancerId: isExpert ? (_h = user === null || user === void 0 ? void 0 : user.userId) !== null && _h !== void 0 ? _h : 0 : (_j = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id) !== null && _j !== void 0 ? _j : 0,
|
|
133
|
+
freelancerName: isExpert ? (_k = user === null || user === void 0 ? void 0 : user.name) !== null && _k !== void 0 ? _k : '' : (_l = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name) !== null && _l !== void 0 ? _l : '',
|
|
134
134
|
projectName: selectedProjects.length > 0 ? selectedProjects[0].name : '',
|
|
135
135
|
}
|
|
136
136
|
});
|
|
@@ -197,9 +197,11 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
|
|
|
197
197
|
input: formData
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
|
+
(0, utils_1.showToast)("success", "Escalation created successfully!");
|
|
200
201
|
}
|
|
201
202
|
catch (error) {
|
|
202
203
|
console.error("Failed to create an escalation!", error);
|
|
204
|
+
(0, utils_1.showToast)("warning", "Failed to create escalation!");
|
|
203
205
|
}
|
|
204
206
|
finally {
|
|
205
207
|
setSubmitting(false);
|