@paro.io/expert-shared-components 1.12.41 → 1.12.43
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/Escalations/EscalationChat.d.ts +8 -1
- package/lib/components/Escalations/EscalationChat.js +80 -23
- package/lib/components/Escalations/EscalationIssueCard.d.ts +7 -3
- package/lib/components/Escalations/EscalationIssueCard.js +38 -20
- package/lib/components/Escalations/EscalationRespondForm.d.ts +9 -1
- package/lib/components/Escalations/EscalationRespondForm.js +128 -20
- package/lib/components/Escalations/EscalationSubmitForm.d.ts +7 -2
- package/lib/components/Escalations/EscalationSubmitForm.js +138 -39
- package/lib/components/Escalations/EscalationTabsContent.d.ts +5 -8
- package/lib/components/Escalations/EscalationTabsContent.js +4 -9
- package/lib/components/Escalations/Escalations.d.ts +11 -5
- package/lib/components/Escalations/Escalations.js +8 -5
- package/lib/components/FileUploader/index.d.ts +9 -5
- package/lib/components/FileUploader/index.js +55 -9
- package/lib/components/Invoices/ClientDisputeProjectCard.d.ts +1 -1
- package/lib/components/Invoices/ClientDisputeProjectCard.js +3 -3
- package/lib/components/Invoices/DiscussionSection.d.ts +2 -2
- package/lib/components/Invoices/DiscussionSection.js +2 -2
- package/lib/components/Invoices/DisputeSection.js +1 -1
- package/lib/components/shared/UploadClient.d.ts +2 -1
- package/lib/components/shared/UploadClient.js +7 -4
- package/lib/components/shared/utils.d.ts +1 -0
- package/lib/components/shared/utils.js +6 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/package.json +8 -2
|
@@ -22,6 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
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
|
+
});
|
|
33
|
+
};
|
|
25
34
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
36
|
};
|
|
@@ -32,6 +41,9 @@ const base_ui_1 = require("@paro.io/base-ui");
|
|
|
32
41
|
const core_1 = require("@material-ui/core");
|
|
33
42
|
const LogTimeModalAuthenticated_1 = require("../ProjectCard/LogTimeModalAuthenticated");
|
|
34
43
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
44
|
+
const EscalationRespondForm_1 = require("./EscalationRespondForm");
|
|
45
|
+
const FileUploader_1 = require("../FileUploader");
|
|
46
|
+
const utils_1 = require("../shared/utils");
|
|
35
47
|
const issueTypeOptions = [
|
|
36
48
|
{ value: 'CommunicationIssues', label: 'Communication Issues' },
|
|
37
49
|
{ value: 'Professionalism', label: 'Professionalism' },
|
|
@@ -41,80 +53,158 @@ const issueTypeOptions = [
|
|
|
41
53
|
{ value: 'ScopeCreep', label: 'Scope Creep/Unauthorized Requests' },
|
|
42
54
|
{ value: 'Other', label: 'Other' },
|
|
43
55
|
];
|
|
44
|
-
const EscalationSubmitForm = ({ goBack, goHome,
|
|
56
|
+
const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, documentUploadUrl, bucketName, uploadExpertClientFiles, createProjectEscalation, isExpert = false, user }) => {
|
|
57
|
+
var _a;
|
|
45
58
|
const [isChecked, setIsChecked] = (0, react_1.useState)(false);
|
|
46
59
|
const [problemInput, setProblemInput] = (0, react_1.useState)('');
|
|
47
60
|
const [outcomeInput, setOutcomeInput] = (0, react_1.useState)('');
|
|
48
61
|
const [uploadFiles, setUploadFiles] = (0, react_1.useState)([]);
|
|
49
62
|
const [uploadingFile, setUploadingFile] = (0, react_1.useState)(false);
|
|
50
63
|
const [expertOptions, setExpertOptions] = (0, react_1.useState)([]);
|
|
51
|
-
const [
|
|
64
|
+
const [selectedUser, setSelectedUser] = (0, react_1.useState)(null);
|
|
52
65
|
const [projectOptions, setProjectOptions] = (0, react_1.useState)([]);
|
|
53
66
|
const [selectedProjects, setSelectedProjects] = (0, react_1.useState)([]);
|
|
54
67
|
const [issueType, setIssueType] = (0, react_1.useState)('');
|
|
55
68
|
const [severity, setSeverity] = (0, react_1.useState)('');
|
|
56
|
-
const [
|
|
69
|
+
const [issueStartDate, setIssueStartDate] = (0, react_1.useState)(undefined);
|
|
57
70
|
const [isDateInvalid, setIsDateInvalid] = (0, react_1.useState)(false);
|
|
71
|
+
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
58
72
|
const fileInputRef = (0, react_1.useRef)(null);
|
|
73
|
+
const escalationId = (0, utils_1.generateUUID)();
|
|
59
74
|
(0, react_1.useEffect)(() => {
|
|
60
|
-
if (
|
|
61
|
-
const options =
|
|
62
|
-
label:
|
|
63
|
-
value:
|
|
75
|
+
if (expertsOrClients && expertsOrClients.length > 0) {
|
|
76
|
+
const options = expertsOrClients.map((user) => ({
|
|
77
|
+
label: user.name,
|
|
78
|
+
value: { id: user.id, name: user.name },
|
|
64
79
|
}));
|
|
65
80
|
setExpertOptions(options);
|
|
66
81
|
}
|
|
67
|
-
}, [
|
|
82
|
+
}, [expertsOrClients]);
|
|
68
83
|
(0, react_1.useEffect)(() => {
|
|
69
84
|
if (projects && projects.length > 0) {
|
|
70
85
|
const options = projects
|
|
71
86
|
.filter((p) => {
|
|
72
87
|
if (isExpert) {
|
|
73
|
-
return p.client.id === Number(
|
|
88
|
+
return p.client.id === Number(selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id);
|
|
74
89
|
}
|
|
75
90
|
else {
|
|
76
|
-
return p.freelancer.id === Number(
|
|
91
|
+
return p.freelancer.id === Number(selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id);
|
|
77
92
|
}
|
|
78
93
|
})
|
|
79
94
|
.map((p) => ({
|
|
80
|
-
label:
|
|
81
|
-
value:
|
|
95
|
+
label: p.name,
|
|
96
|
+
value: p,
|
|
82
97
|
}));
|
|
83
98
|
setProjectOptions(options);
|
|
84
99
|
}
|
|
85
|
-
}, [projects,
|
|
86
|
-
const handleFileUpload = (event) => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
}, [projects, selectedUser]);
|
|
101
|
+
const handleFileUpload = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
+
const selectedFiles = event.target.files;
|
|
103
|
+
if (!selectedFiles)
|
|
104
|
+
return;
|
|
105
|
+
setUploadingFile(true);
|
|
106
|
+
const validFileNames = Array.from(selectedFiles)
|
|
107
|
+
.filter(file => (0, EscalationRespondForm_1.validateFileUpload)(file))
|
|
108
|
+
.map(file => file.name);
|
|
109
|
+
if (validFileNames.length === 0)
|
|
110
|
+
return;
|
|
111
|
+
if (validFileNames && validFileNames.length > 0) {
|
|
112
|
+
const uploadPromises = Array.from(selectedFiles).map((selectedFile) => {
|
|
113
|
+
return new Promise((resolve, reject) => {
|
|
114
|
+
const reader = new FileReader();
|
|
115
|
+
reader.onloadend = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
116
|
+
try {
|
|
117
|
+
const res = yield (0, FileUploader_1.fileUploader)({
|
|
118
|
+
file: selectedFile,
|
|
119
|
+
documentName: selectedFile.name,
|
|
120
|
+
escalationId: escalationId,
|
|
121
|
+
projectId: selectedProjects.length > 0 ? selectedProjects[0].id : '',
|
|
122
|
+
documentUploadUrl: documentUploadUrl,
|
|
123
|
+
bucketName: bucketName,
|
|
124
|
+
isExpert: false,
|
|
125
|
+
uploadExpertClientFiles: uploadExpertClientFiles,
|
|
126
|
+
createProjectEscalation: createProjectEscalation,
|
|
127
|
+
extraData: {
|
|
128
|
+
clientId: isExpert ? selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id : user === null || user === void 0 ? void 0 : user.userId,
|
|
129
|
+
clientName: isExpert ? selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name : user === null || user === void 0 ? void 0 : user.name,
|
|
130
|
+
email: isExpert ? "client@gmail.com" : user === null || user === void 0 ? void 0 : user.email,
|
|
131
|
+
freelancerId: isExpert ? user === null || user === void 0 ? void 0 : user.userId : selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id,
|
|
132
|
+
freelancerName: isExpert ? user === null || user === void 0 ? void 0 : user.name : selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name,
|
|
133
|
+
projectName: selectedProjects.length > 0 ? selectedProjects[0].name : '',
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
if (res) {
|
|
137
|
+
setUploadFiles(prev => [...prev, ...res]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
reject(error);
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
resolve();
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
reader.readAsDataURL(selectedFile);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
try {
|
|
151
|
+
const res = yield Promise.all(uploadPromises);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
console.error('Error uploading files:', error);
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
setUploadingFile(false);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
;
|
|
161
|
+
});
|
|
90
162
|
const isFormValid = () => {
|
|
91
163
|
const requiredProjectSelection = isExpert || (!isExpert && selectedProjects.length > 0);
|
|
92
|
-
return (
|
|
164
|
+
return (selectedUser !== null &&
|
|
93
165
|
issueType !== '' &&
|
|
94
166
|
severity !== '' &&
|
|
95
167
|
problemInput.trim() !== '' &&
|
|
96
168
|
outcomeInput.trim() !== '' &&
|
|
97
169
|
isChecked &&
|
|
98
|
-
|
|
170
|
+
issueStartDate !== undefined &&
|
|
99
171
|
requiredProjectSelection);
|
|
100
172
|
};
|
|
101
|
-
const handleSubmit = () => {
|
|
173
|
+
const handleSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
174
|
+
var _a;
|
|
102
175
|
if (!isFormValid())
|
|
103
176
|
return;
|
|
177
|
+
setSubmitting(true);
|
|
104
178
|
const formData = {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
179
|
+
escalationId: escalationId,
|
|
180
|
+
freelancerId: user.userId,
|
|
181
|
+
clientId: (_a = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id) !== null && _a !== void 0 ? _a : 0,
|
|
182
|
+
projectDetails: selectedProjects.map((p) => { return { projectId: p.id, projectName: p.name }; }),
|
|
183
|
+
issueStartDate: issueStartDate,
|
|
184
|
+
escalationType: issueType,
|
|
185
|
+
severityLevel: severity,
|
|
110
186
|
problem: problemInput,
|
|
111
|
-
|
|
112
|
-
|
|
187
|
+
outcome: outcomeInput,
|
|
188
|
+
submittedByUserId: user.userId,
|
|
189
|
+
status: 'InProgress',
|
|
190
|
+
[isExpert ? 'expertSupportingDocuments' : 'clientSupportingDocuments']: uploadFiles.join(", "),
|
|
191
|
+
statusChangedBy: user.userId,
|
|
113
192
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
193
|
+
try {
|
|
194
|
+
yield createProjectEscalation({
|
|
195
|
+
variables: {
|
|
196
|
+
input: formData
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
console.error("Failed to create an escalation!", error);
|
|
202
|
+
}
|
|
203
|
+
finally {
|
|
204
|
+
setSubmitting(false);
|
|
205
|
+
goHome();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
118
208
|
const validateDate = (date) => {
|
|
119
209
|
const minDate = LogTimeModalAuthenticated_1.constants.MIN_DATE;
|
|
120
210
|
const maxDate = new Date();
|
|
@@ -146,10 +236,19 @@ const EscalationSubmitForm = ({ goBack, goHome, experts, projects, isExpert = fa
|
|
|
146
236
|
react_1.default.createElement("div", { className: "p-4 space-y-4" },
|
|
147
237
|
react_1.default.createElement("div", null,
|
|
148
238
|
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700 mb-1" }, `Which ${isExpert ? 'client' : 'expert'} are you experiencing the issue with?`),
|
|
149
|
-
react_1.default.createElement(core_1.Select, { fullWidth: true, value:
|
|
239
|
+
react_1.default.createElement(core_1.Select, { fullWidth: true, value: (_a = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name) !== null && _a !== void 0 ? _a : '', onChange: e => {
|
|
240
|
+
const selectedName = e.target.value;
|
|
241
|
+
if (selectedName === '') {
|
|
242
|
+
setSelectedUser(null);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
const selectedOption = expertOptions.find(opt => opt.value.name === selectedName);
|
|
246
|
+
setSelectedUser(selectedOption ? selectedOption.value : null);
|
|
247
|
+
}
|
|
248
|
+
}, displayEmpty: true, variant: "outlined", placeholder: `Select a ${isExpert ? 'Client' : 'Expert'}` },
|
|
150
249
|
react_1.default.createElement(core_1.MenuItem, { disabled: true, value: "" },
|
|
151
250
|
react_1.default.createElement("em", null, `Select a ${isExpert ? 'Client' : 'Expert'}`)),
|
|
152
|
-
expertOptions.map(option => (react_1.default.createElement(core_1.MenuItem, { key: option.value, value: option.value }, option.label))))),
|
|
251
|
+
expertOptions.map(option => (react_1.default.createElement(core_1.MenuItem, { key: option.value.id, value: option.value.name }, option.label))))),
|
|
153
252
|
react_1.default.createElement("div", null,
|
|
154
253
|
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700 mb-1" }, "Which Project(s)?"),
|
|
155
254
|
react_1.default.createElement(core_1.Select, { multiple: true, fullWidth: true, value: selectedProjects, onChange: (e) => {
|
|
@@ -166,7 +265,7 @@ const EscalationSubmitForm = ({ goBack, goHome, experts, projects, isExpert = fa
|
|
|
166
265
|
}, placeholder: `Select a Project(s)` },
|
|
167
266
|
react_1.default.createElement(core_1.MenuItem, { disabled: true, value: "" },
|
|
168
267
|
react_1.default.createElement("em", null, "Select a Project(s)...")),
|
|
169
|
-
projectOptions.map(option => (react_1.default.createElement(core_1.MenuItem, { key: option.value, value: option.value }, option.label))))),
|
|
268
|
+
projectOptions.map(option => (react_1.default.createElement(core_1.MenuItem, { key: option.value.id, value: option.value }, option.label))))),
|
|
170
269
|
react_1.default.createElement("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4" },
|
|
171
270
|
react_1.default.createElement("div", null,
|
|
172
271
|
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700 mb-1" }, "Issue Type"),
|
|
@@ -194,7 +293,7 @@ const EscalationSubmitForm = ({ goBack, goHome, experts, projects, isExpert = fa
|
|
|
194
293
|
react_1.default.createElement(core_1.MenuItem, { value: "Low" }, "Low")))),
|
|
195
294
|
react_1.default.createElement("div", null,
|
|
196
295
|
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700 mb-1" }, "When did this issue start?"),
|
|
197
|
-
react_1.default.createElement(LogTimeModalAuthenticated_1.SelectDate, { timeLogDate:
|
|
296
|
+
react_1.default.createElement(LogTimeModalAuthenticated_1.SelectDate, { timeLogDate: issueStartDate, setTimeLogDate: setIssueStartDate, isInvalid: false, setIsDateInvalid: setIsDateInvalid, validateDate: validateDate, maxDate: (0, dayjs_1.default)(new Date()).format("MM-DD-YYYY") })),
|
|
198
297
|
react_1.default.createElement("div", null,
|
|
199
298
|
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700 mb-1" }, "What's the problem?"),
|
|
200
299
|
react_1.default.createElement(base_ui_1.Input, { type: "text", value: problemInput, placeholder: "Describe the issue...", onChange: (e) => setProblemInput(e.target.value) })),
|
|
@@ -206,12 +305,12 @@ const EscalationSubmitForm = ({ goBack, goHome, experts, projects, isExpert = fa
|
|
|
206
305
|
react_1.default.createElement("div", { className: "border border-dashed border-gray-300 rounded-md p-6 text-center" },
|
|
207
306
|
react_1.default.createElement("p", { className: "text-sm text-gray-600 mb-2" }, "Upload screenshots, emails, or documents"),
|
|
208
307
|
react_1.default.createElement("input", { ref: fileInputRef, type: "file", multiple: true, accept: ".pdf,.doc,.docx,.jpeg,.png,.gif,.csv", hidden: true, onChange: handleFileUpload }),
|
|
209
|
-
react_1.default.createElement(base_ui_1.Button, { label: "Attach Files", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, color: "info", isLoading: uploadingFile, size: "sm" }),
|
|
210
|
-
uploadFiles.length > 0 && (react_1.default.createElement("ul", { className: "mt-2 text-sm text-gray-600 list-disc list-inside" }, uploadFiles.map(f => react_1.default.createElement("li", { key: f.name }, f.
|
|
308
|
+
react_1.default.createElement(base_ui_1.Button, { label: "Attach Files", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, color: "info", isLoading: uploadingFile, disabled: selectedUser === null, size: "sm" }),
|
|
309
|
+
uploadFiles.length > 0 && (react_1.default.createElement("ul", { className: "mt-2 text-sm text-gray-600 list-disc list-inside" }, uploadFiles.map(f => react_1.default.createElement("li", { key: f.name }, f.split('%2F')[1])))))),
|
|
211
310
|
react_1.default.createElement("div", { className: "bg-[#EFF6FF] p-3 rounded" },
|
|
212
311
|
react_1.default.createElement(base_ui_1.Checkbox, { id: "checkbox-1", label: `I understand this will notify my ${isExpert ? 'client' : 'expert'} and the Paro support team`, name: "acknowledge", isChecked: isChecked, onChange: () => setIsChecked(prev => !prev) })),
|
|
213
312
|
react_1.default.createElement("div", { className: "flex justify-end space-x-3 pt-4" },
|
|
214
|
-
react_1.default.createElement(base_ui_1.Button, { label: "Cancel", onClick: goBack }),
|
|
215
|
-
react_1.default.createElement(base_ui_1.Button, { label: "Submit issue", onClick: handleSubmit, color: "primary", disabled: !isFormValid() }))))));
|
|
313
|
+
react_1.default.createElement(base_ui_1.Button, { label: "Cancel", onClick: goBack, disabled: submitting || uploadingFile }),
|
|
314
|
+
react_1.default.createElement(base_ui_1.Button, { label: "Submit issue", onClick: handleSubmit, color: "primary", isLoading: submitting, disabled: !isFormValid() || uploadingFile }))))));
|
|
216
315
|
};
|
|
217
316
|
exports.default = EscalationSubmitForm;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
export type EscalationChatDetails = {
|
|
2
|
-
title: string;
|
|
3
|
-
project: string;
|
|
4
|
-
id: string;
|
|
5
|
-
status: string;
|
|
6
|
-
};
|
|
7
1
|
interface EscalationTabProps {
|
|
8
2
|
activeTab: string;
|
|
9
|
-
openEscalationChat: (
|
|
3
|
+
openEscalationChat: (issue: any) => void;
|
|
10
4
|
setSelectedIssueId: (issue: number) => void;
|
|
11
5
|
activeIssues: any[];
|
|
12
6
|
inProgressIssues: any[];
|
|
13
7
|
resolvedIssues: any[];
|
|
14
8
|
isExpert: boolean;
|
|
9
|
+
updateProjectEscalation: any;
|
|
10
|
+
downloadDocumentUrl: string;
|
|
11
|
+
bucketName: string;
|
|
15
12
|
}
|
|
16
|
-
declare const EscalationTabsContent: ({ activeTab, openEscalationChat, setSelectedIssueId, activeIssues, inProgressIssues, resolvedIssues, isExpert, }: EscalationTabProps) => JSX.Element;
|
|
13
|
+
declare const EscalationTabsContent: ({ activeTab, openEscalationChat, setSelectedIssueId, activeIssues, inProgressIssues, resolvedIssues, isExpert, updateProjectEscalation, downloadDocumentUrl, bucketName, }: EscalationTabProps) => JSX.Element;
|
|
17
14
|
export default EscalationTabsContent;
|
|
@@ -30,18 +30,18 @@ const react_1 = __importDefault(require("react"));
|
|
|
30
30
|
const EscalationIssueCard_1 = __importStar(require("./EscalationIssueCard"));
|
|
31
31
|
const base_ui_1 = require("@paro.io/base-ui");
|
|
32
32
|
;
|
|
33
|
-
const EscalationTabsContent = ({ activeTab, openEscalationChat, setSelectedIssueId, activeIssues, inProgressIssues, resolvedIssues, isExpert, }) => {
|
|
33
|
+
const EscalationTabsContent = ({ activeTab, openEscalationChat, setSelectedIssueId, activeIssues, inProgressIssues, resolvedIssues, isExpert, updateProjectEscalation, downloadDocumentUrl, bucketName, }) => {
|
|
34
34
|
if (activeTab === 'action-required') {
|
|
35
35
|
return (react_1.default.createElement("div", null,
|
|
36
36
|
react_1.default.createElement("div", { className: "flex items-center justify-between mb-4" },
|
|
37
37
|
react_1.default.createElement("h3", { className: "text-lg font-semibold text-gray-900" }, "Issues Requiring Your Response")),
|
|
38
|
-
react_1.default.createElement(EscalationIssueCard_1.default, { issues: activeIssues, isExpert: isExpert, openEscalationChat: openEscalationChat, showRespondButton: true, setSelectedIssueId: setSelectedIssueId })));
|
|
38
|
+
react_1.default.createElement(EscalationIssueCard_1.default, { issues: activeIssues, isExpert: isExpert, openEscalationChat: openEscalationChat, showRespondButton: true, setSelectedIssueId: setSelectedIssueId, updateProjectEscalation: updateProjectEscalation, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName })));
|
|
39
39
|
}
|
|
40
40
|
if (activeTab === 'in-progress') {
|
|
41
41
|
return (react_1.default.createElement("div", null,
|
|
42
42
|
react_1.default.createElement("div", { className: "flex items-center justify-between mb-4" },
|
|
43
43
|
react_1.default.createElement("h3", { className: "text-lg font-semibold text-gray-900" }, "Issues In Progress")),
|
|
44
|
-
react_1.default.createElement(EscalationIssueCard_1.default, { issues: inProgressIssues, isExpert: isExpert, openEscalationChat: openEscalationChat, showMarkResolvedButton: true })));
|
|
44
|
+
react_1.default.createElement(EscalationIssueCard_1.default, { issues: inProgressIssues, isExpert: isExpert, openEscalationChat: openEscalationChat, showMarkResolvedButton: true, updateProjectEscalation: updateProjectEscalation, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName })));
|
|
45
45
|
}
|
|
46
46
|
if (activeTab === 'resolved') {
|
|
47
47
|
return (react_1.default.createElement("div", null,
|
|
@@ -77,12 +77,7 @@ const EscalationTabsContent = ({ activeTab, openEscalationChat, setSelectedIssue
|
|
|
77
77
|
react_1.default.createElement("span", { className: "text-xs text-gray-500" },
|
|
78
78
|
"Resolved By ",
|
|
79
79
|
issue.resolvedBy)))),
|
|
80
|
-
react_1.default.createElement(base_ui_1.Button, { onClick: () => openEscalationChat(
|
|
81
|
-
title: issue.chatTitle,
|
|
82
|
-
project: issue.projectName,
|
|
83
|
-
id: issue.id,
|
|
84
|
-
status: issue.chatStatus
|
|
85
|
-
}), label: "Chat", color: "primary" }))));
|
|
80
|
+
react_1.default.createElement(base_ui_1.Button, { onClick: () => openEscalationChat(issue), label: "Chat", color: "primary" }))));
|
|
86
81
|
}))
|
|
87
82
|
:
|
|
88
83
|
react_1.default.createElement("div", null, "No resolved issues.")));
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
interface EscalationsProps {
|
|
2
|
-
|
|
2
|
+
expertsOrClients: any[];
|
|
3
3
|
projects: any[];
|
|
4
4
|
isExpert: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
escalations: any[];
|
|
6
|
+
documentUploadUrl: string;
|
|
7
|
+
downloadDocumentUrl: string;
|
|
8
|
+
uploadExpertClientFiles?: any;
|
|
9
|
+
createProjectEscalation: any;
|
|
10
|
+
updateProjectEscalation: any;
|
|
11
|
+
createEscalationChatMessage: any;
|
|
12
|
+
bucketName: string;
|
|
13
|
+
user: any;
|
|
8
14
|
}
|
|
9
|
-
export declare const Escalations: ({
|
|
15
|
+
export declare const Escalations: ({ expertsOrClients, projects, isExpert, escalations, documentUploadUrl, downloadDocumentUrl, uploadExpertClientFiles, createProjectEscalation, updateProjectEscalation, createEscalationChatMessage, bucketName, user, }: EscalationsProps) => JSX.Element;
|
|
10
16
|
export {};
|
|
@@ -39,7 +39,7 @@ const AccountSuspensionBanner_1 = __importDefault(require("./AccountSuspensionBa
|
|
|
39
39
|
const AccountSuspensionModal_1 = __importDefault(require("./AccountSuspensionModal"));
|
|
40
40
|
const base_icons_1 = require("@paro.io/base-icons");
|
|
41
41
|
const EscalationIssueCard_1 = require("./EscalationIssueCard");
|
|
42
|
-
const Escalations = ({
|
|
42
|
+
const Escalations = ({ expertsOrClients, projects, isExpert = false, escalations, documentUploadUrl, downloadDocumentUrl, uploadExpertClientFiles, createProjectEscalation, updateProjectEscalation, createEscalationChatMessage, bucketName, user, }) => {
|
|
43
43
|
const [activeSection, setActiveSection] = (0, react_1.useState)('support');
|
|
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
|
|
@@ -47,6 +47,9 @@ const Escalations = ({ experts, projects, isExpert = false, activeIssues, inProg
|
|
|
47
47
|
const [activeChatIssue, setActiveChatIssue] = (0, react_1.useState)(null); // update required
|
|
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 => { 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'; });
|
|
51
|
+
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
|
+
const resolvedIssues = escalations.filter(issue => (issue === null || issue === void 0 ? void 0 : issue.status) === 'Resolved');
|
|
50
53
|
const goBack = () => {
|
|
51
54
|
if (selectedIssueId !== null) {
|
|
52
55
|
setSelectedIssueId(null);
|
|
@@ -136,10 +139,10 @@ const Escalations = ({ experts, projects, isExpert = false, activeIssues, inProg
|
|
|
136
139
|
!isExpert &&
|
|
137
140
|
react_1.default.createElement(EscalationReportBanner_1.default, { onReport: () => setSelectedIssueId(0) }),
|
|
138
141
|
react_1.default.createElement(EscalationTabs_1.default, { activeTab: activeEscalationTab, setActiveTab: setActiveEscalationTab, activeIssues: activeIssues.length, inProgressIssues: inProgressIssues.length, resolvedIssues: resolvedIssues.length }),
|
|
139
|
-
react_1.default.createElement(EscalationTabsContent_1.default, { activeTab: activeEscalationTab, openEscalationChat: openEscalationChat, setSelectedIssueId: setSelectedIssueId, activeIssues: activeIssues, inProgressIssues: inProgressIssues, resolvedIssues: resolvedIssues, isExpert: isExpert })),
|
|
140
|
-
activeSection === 'support' && activeIssues.filter((issue) => issue.
|
|
141
|
-
activeSection === 'support' && selectedIssueId === 0 && (react_1.default.createElement(EscalationSubmitForm_1.default, { goBack: goBack, goHome: goHome,
|
|
142
|
-
showEscalationChat && activeChatIssue && (react_1.default.createElement(EscalationChat_1.default, { activeChatIssue: activeChatIssue, showEscalationChat: showEscalationChat, setShowEscalationChat: setShowEscalationChat })),
|
|
142
|
+
react_1.default.createElement(EscalationTabsContent_1.default, { activeTab: activeEscalationTab, openEscalationChat: openEscalationChat, setSelectedIssueId: setSelectedIssueId, activeIssues: activeIssues, inProgressIssues: inProgressIssues, resolvedIssues: resolvedIssues, updateProjectEscalation: updateProjectEscalation, isExpert: isExpert, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName })),
|
|
143
|
+
activeSection === 'support' && activeIssues.filter((issue) => issue.escalationNumber === selectedIssueId).length > 0 && (react_1.default.createElement(EscalationRespondForm_1.default, { goBack: goBack, selectedIssue: activeIssues.find((issue) => issue.escalationNumber === selectedIssueId), documentUploadUrl: documentUploadUrl, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName, uploadExpertClientFiles: uploadExpertClientFiles, updateProjectEscalation: updateProjectEscalation, goHome: goHome, isExpert: isExpert })),
|
|
144
|
+
activeSection === 'support' && selectedIssueId === 0 && (react_1.default.createElement(EscalationSubmitForm_1.default, { goBack: goBack, goHome: goHome, expertsOrClients: expertsOrClients, projects: projects, documentUploadUrl: documentUploadUrl, bucketName: bucketName, uploadExpertClientFiles: uploadExpertClientFiles, createProjectEscalation: createProjectEscalation, isExpert: isExpert, user: user })),
|
|
145
|
+
showEscalationChat && activeChatIssue && (react_1.default.createElement(EscalationChat_1.default, { activeChatIssue: activeChatIssue, showEscalationChat: showEscalationChat, setShowEscalationChat: setShowEscalationChat, user: user, createEscalationChatMessage: createEscalationChatMessage, documentUploadUrl: documentUploadUrl, bucketName: bucketName, uploadExpertClientFiles: uploadExpertClientFiles, createProjectEscalation: createProjectEscalation, isExpert: isExpert })),
|
|
143
146
|
showSuspensionModal &&
|
|
144
147
|
react_1.default.createElement(AccountSuspensionModal_1.default, { showSuspensionModal: showSuspensionModal, onClose: () => setShowSuspensionModal(false) }))));
|
|
145
148
|
};
|
|
@@ -2,14 +2,18 @@ interface UploadFileParams {
|
|
|
2
2
|
file: File;
|
|
3
3
|
documentName: string;
|
|
4
4
|
disputeId?: number;
|
|
5
|
-
|
|
5
|
+
escalationId?: string;
|
|
6
|
+
escalationNumber?: string;
|
|
7
|
+
projectId?: number;
|
|
6
8
|
documentUploadUrl: string;
|
|
7
9
|
bucketName: string;
|
|
8
|
-
updateClientInvoiceDisputeMutation
|
|
10
|
+
updateClientInvoiceDisputeMutation?: any;
|
|
11
|
+
updateProjectEscalation?: any;
|
|
9
12
|
uploadExpertClientFiles?: any;
|
|
10
|
-
|
|
13
|
+
createProjectEscalation?: any;
|
|
14
|
+
previousFiles?: string | string[];
|
|
11
15
|
isExpert: boolean;
|
|
12
|
-
|
|
16
|
+
extraData?: {
|
|
13
17
|
clientId: number;
|
|
14
18
|
clientName: string;
|
|
15
19
|
email: string;
|
|
@@ -18,5 +22,5 @@ interface UploadFileParams {
|
|
|
18
22
|
projectName: string;
|
|
19
23
|
};
|
|
20
24
|
}
|
|
21
|
-
export declare const fileUploader: ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, uploadExpertClientFiles, bucketName, disputeId, previousFiles, isExpert,
|
|
25
|
+
export declare const fileUploader: ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, updateProjectEscalation, uploadExpertClientFiles, createProjectEscalation, bucketName, disputeId, escalationId, escalationNumber, previousFiles, isExpert, extraData, }: UploadFileParams) => Promise<any>;
|
|
22
26
|
export {};
|
|
@@ -15,7 +15,27 @@ 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, uploadExpertClientFiles, bucketName, disputeId, previousFiles, isExpert,
|
|
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);
|
|
19
39
|
const documentLinks = previousFiles ? (typeof previousFiles === 'string' ? previousFiles.split(',') : [...previousFiles]) : [];
|
|
20
40
|
try {
|
|
21
41
|
(0, utils_1.showToast)('success', 'Starting Document Upload');
|
|
@@ -23,6 +43,7 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
23
43
|
fileSelected: file,
|
|
24
44
|
fileName: file.name,
|
|
25
45
|
projectId,
|
|
46
|
+
escalationId,
|
|
26
47
|
documentUploadUrl,
|
|
27
48
|
bucketName: bucketName,
|
|
28
49
|
});
|
|
@@ -30,6 +51,7 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
30
51
|
const resParsed = JSON.parse(res);
|
|
31
52
|
const documentLink = resParsed === null || resParsed === void 0 ? void 0 : resParsed.Location;
|
|
32
53
|
documentLinks.push(documentLink); // Add the new file to the documentLinks array
|
|
54
|
+
console.log("document links are ", documentLinks);
|
|
33
55
|
const promises = [];
|
|
34
56
|
if (disputeId) {
|
|
35
57
|
promises.push(updateClientInvoiceDisputeMutation({
|
|
@@ -47,20 +69,43 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
47
69
|
},
|
|
48
70
|
}));
|
|
49
71
|
}
|
|
50
|
-
|
|
72
|
+
console.log("Escalation id is ", escalationId);
|
|
73
|
+
console.log("About to check escalationId condition");
|
|
74
|
+
if (escalationNumber) {
|
|
75
|
+
console.log("escalationId condition is TRUE - adding updateProjectEscalation to promises");
|
|
76
|
+
console.log("updateProjectEscalation function:", updateProjectEscalation);
|
|
77
|
+
const escalationPromise = updateProjectEscalation({
|
|
78
|
+
variables: {
|
|
79
|
+
input: Object.assign({ escalationId }, (isExpert ? {
|
|
80
|
+
expertSupportingDocuments: documentLinks.join(',')
|
|
81
|
+
} : {
|
|
82
|
+
clientSupportingDocuments: documentLinks.join(',')
|
|
83
|
+
}))
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
console.log("Created escalation promise:", escalationPromise);
|
|
87
|
+
promises.push(escalationPromise);
|
|
88
|
+
console.log("Added escalation promise to promises array");
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.log("escalationId condition is FALSE");
|
|
92
|
+
}
|
|
93
|
+
console.log("promises are ", promises.length, promises);
|
|
94
|
+
if (uploadExpertClientFiles && extraData) {
|
|
95
|
+
console.log("extra data is ", extraData);
|
|
51
96
|
promises.push(uploadExpertClientFiles({
|
|
52
97
|
variables: {
|
|
53
98
|
input: {
|
|
54
|
-
clientId:
|
|
55
|
-
clientName:
|
|
56
|
-
email:
|
|
99
|
+
clientId: extraData.clientId,
|
|
100
|
+
clientName: extraData.clientName,
|
|
101
|
+
email: extraData.email,
|
|
57
102
|
fileName: file.name,
|
|
58
103
|
fileSize: file.size,
|
|
59
|
-
fileType: 'DISPUTE_DOCUMENTS',
|
|
60
|
-
freelancerId:
|
|
61
|
-
freelancerName:
|
|
104
|
+
fileType: disputeId ? 'DISPUTE_DOCUMENTS' : 'ESCALATION_DOCUMENTS',
|
|
105
|
+
freelancerId: extraData.freelancerId,
|
|
106
|
+
freelancerName: extraData.freelancerName,
|
|
62
107
|
projectId: projectId,
|
|
63
|
-
projectName:
|
|
108
|
+
projectName: extraData.projectName,
|
|
64
109
|
uploadedBy: isExpert ? 'FREELANCER' : 'CLIENT',
|
|
65
110
|
data: "",
|
|
66
111
|
},
|
|
@@ -78,6 +123,7 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
|
|
|
78
123
|
return documentLinks;
|
|
79
124
|
}
|
|
80
125
|
catch (error) {
|
|
126
|
+
console.error("Error in fileUploader:", error);
|
|
81
127
|
(0, utils_1.showToast)('warning', 'Error uploading file. Please try again.');
|
|
82
128
|
return false;
|
|
83
129
|
}
|
|
@@ -6,6 +6,6 @@ interface ClientDisputeProjectCardProps {
|
|
|
6
6
|
bucketName?: string;
|
|
7
7
|
uploadExpertClientFiles?: any;
|
|
8
8
|
}
|
|
9
|
-
export declare const handleDownloadDocument: (projectId: number, fileName: string, downloadDocumentUrl: string, bucketName: string | undefined) => Promise<void>;
|
|
9
|
+
export declare const handleDownloadDocument: (projectId: number, fileName: string, downloadDocumentUrl: string, bucketName: string | undefined, escalationId?: string | undefined) => Promise<void>;
|
|
10
10
|
export declare const ClientDisputeProjectCard: ({ clientInvoice, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, bucketName, uploadExpertClientFiles }: ClientDisputeProjectCardProps) => JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -131,11 +131,11 @@ const handleFileDownload = ({ fileData, downloadFilename, streamData, fileType =
|
|
|
131
131
|
document.body.removeChild(downloadLink);
|
|
132
132
|
URL.revokeObjectURL(blobUrl);
|
|
133
133
|
};
|
|
134
|
-
const handleDownloadDocument = (projectId, fileName, downloadDocumentUrl, bucketName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
134
|
+
const handleDownloadDocument = (projectId, fileName, downloadDocumentUrl, bucketName, escalationId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
135
135
|
var _a;
|
|
136
136
|
// Decode the filename from URL encoding if needed
|
|
137
137
|
const decodedFileName = decodeURIComponent(fileName);
|
|
138
|
-
const downloadFileName = `project-${projectId}/${decodedFileName}`;
|
|
138
|
+
const downloadFileName = escalationId ? `escalation-${escalationId}/${decodedFileName}` : `project-${projectId}/${decodedFileName}`;
|
|
139
139
|
const downloadData = yield (0, FileDownloader_1.fileDownloader)({ downloadDocumentUrl: downloadDocumentUrl, fileKey: downloadFileName, bucketName: bucketName });
|
|
140
140
|
handleFileDownload({
|
|
141
141
|
fileData: downloadData,
|
|
@@ -205,7 +205,7 @@ const ClientDisputeProjectCard = ({ clientInvoice, updateClientInvoiceDisputeMut
|
|
|
205
205
|
previousFiles: (_e = (_d = (_c = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.clientDocumentLinks) !== null && _e !== void 0 ? _e : [],
|
|
206
206
|
isExpert: false,
|
|
207
207
|
uploadExpertClientFiles: uploadExpertClientFiles,
|
|
208
|
-
|
|
208
|
+
extraData: {
|
|
209
209
|
clientId: (_f = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.invoice) === null || _f === void 0 ? void 0 : _f.clientId,
|
|
210
210
|
clientName: (_g = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.client) === null || _g === void 0 ? void 0 : _g.name,
|
|
211
211
|
email: (_h = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.freelancer) === null || _h === void 0 ? void 0 : _h.email,
|
|
@@ -12,11 +12,11 @@ interface Message {
|
|
|
12
12
|
}
|
|
13
13
|
interface DiscussionSectionProps {
|
|
14
14
|
disputeId?: string;
|
|
15
|
-
|
|
15
|
+
escalationNumber?: number;
|
|
16
16
|
currentUser: any;
|
|
17
17
|
messages: Message[];
|
|
18
18
|
onCreateMessage: (variables: any) => Promise<any>;
|
|
19
19
|
isInternal?: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare const DiscussionSection: ({ disputeId,
|
|
21
|
+
export declare const DiscussionSection: ({ disputeId, escalationNumber, currentUser, messages, onCreateMessage, isInternal, }: DiscussionSectionProps) => JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -40,7 +40,7 @@ const react_1 = __importStar(require("react"));
|
|
|
40
40
|
const base_ui_1 = require("@paro.io/base-ui");
|
|
41
41
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
42
42
|
const base_icons_1 = require("@paro.io/base-icons");
|
|
43
|
-
const DiscussionSection = ({ disputeId,
|
|
43
|
+
const DiscussionSection = ({ disputeId, escalationNumber, currentUser, messages, onCreateMessage, isInternal = false, }) => {
|
|
44
44
|
const [newMessage, setNewMessage] = (0, react_1.useState)('');
|
|
45
45
|
const [visibility, setVisibility] = (0, react_1.useState)('ALL');
|
|
46
46
|
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
@@ -55,7 +55,7 @@ const DiscussionSection = ({ disputeId, escalationId, currentUser, messages, onC
|
|
|
55
55
|
return;
|
|
56
56
|
try {
|
|
57
57
|
setIsLoading(true);
|
|
58
|
-
const inputData = Object.assign({ messageText: newMessage, visibility, senderId: currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId }, (disputeId ? { disputeId } : {
|
|
58
|
+
const inputData = Object.assign({ messageText: newMessage, visibility, senderId: currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId }, (disputeId ? { disputeId } : { escalationNumber }));
|
|
59
59
|
yield onCreateMessage({
|
|
60
60
|
variables: {
|
|
61
61
|
input: inputData,
|
|
@@ -86,7 +86,7 @@ const DisputeSection = ({ dispute, documentUploadUrl, downloadDocumentUrl, bucke
|
|
|
86
86
|
disputeId: dispute === null || dispute === void 0 ? void 0 : dispute.disputeId,
|
|
87
87
|
previousFiles: isExpert ? expertDocumentLinks : clientDocumentLinks,
|
|
88
88
|
isExpert: isExpert,
|
|
89
|
-
|
|
89
|
+
extraData: {
|
|
90
90
|
clientId: (_c = dispute === null || dispute === void 0 ? void 0 : dispute.invoice) === null || _c === void 0 ? void 0 : _c.clientId,
|
|
91
91
|
clientName: (_d = dispute === null || dispute === void 0 ? void 0 : dispute.client) === null || _d === void 0 ? void 0 : _d.name,
|
|
92
92
|
email: (_e = dispute === null || dispute === void 0 ? void 0 : dispute.freelancer) === null || _e === void 0 ? void 0 : _e.email,
|
|
@@ -6,9 +6,10 @@ export default class UploadClient {
|
|
|
6
6
|
documentUploadUrl: string;
|
|
7
7
|
projectId: number;
|
|
8
8
|
bucketName: string;
|
|
9
|
+
escalationId: string;
|
|
9
10
|
};
|
|
10
11
|
constructor(props: any);
|
|
11
|
-
generateS3Key(projectId: number, fileName: string): string;
|
|
12
|
+
generateS3Key(projectId: number, escalationId: string, fileName: string): string;
|
|
12
13
|
triggerMultipartUpload(): Promise<string | undefined>;
|
|
13
14
|
uploadMultiPartFile(): Promise<string | undefined>;
|
|
14
15
|
completeUpload(partsArray: any): Promise<string | undefined>;
|