@paro.io/expert-shared-components 1.12.57 → 1.12.59

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.
@@ -307,7 +307,11 @@ const ClientDocumentsTable = ({ legacyFreelancerId, expertFiles, setExpertClient
307
307
  const handleDownloadFile = (fileName, fileId, projectId, docSize, docType) => __awaiter(void 0, void 0, void 0, function* () {
308
308
  (0, utils_1.showToast)('success', 'Starting File Download...');
309
309
  fileId && setFileId(fileId);
310
- const bucketName = docType === 'Dispute Documents' ? `expert-client-dispute-files${!stage || stage === 'dev' ? '' : `-${stage}`}` : `expert-client-files-${stage}`;
310
+ const bucketName = docType === 'Escalation Documents'
311
+ ? `expert-client-escalation-files${!stage || stage === 'dev' ? '' : `-${stage}`}`
312
+ : docType === 'Dispute Documents'
313
+ ? `expert-client-dispute-files${!stage || stage === 'dev' ? '' : `-${stage}`}`
314
+ : `expert-client-files-${stage}`;
311
315
  if (docSize >= 5) {
312
316
  const downloadFileName = `project-${projectId}/${fileName}`;
313
317
  const downloadClient = new DownloadClient_1.default({ downloadDocumentUrl: downloadDocumentUrl, fileKey: downloadFileName, bucketName: bucketName });
@@ -335,6 +339,8 @@ const ClientDocumentsTable = ({ legacyFreelancerId, expertFiles, setExpertClient
335
339
  }
336
340
  fileId && setFileId(fileId);
337
341
  };
342
+ console.log("files here are", files);
343
+ console.log("expertFiles here are", expertFiles);
338
344
  return (react_1.default.createElement(react_1.default.Fragment, null,
339
345
  react_1.default.createElement(DocumentUploadRow_1.DocumentUploadRow, { clientAndProject: clientAndProject, setClientAndProject: setClientAndProject, clientAndProjectsList: clientAndProjectsList, docType: docType, setDocType: setDocType, paroDocuments: paroDocuments, uploadExpertClientFiles: uploadExpertClientFiles, refetchFiles: refetchFiles, legacyFreelancerId: legacyFreelancerId, freelancerName: freelancerName, freelancerEmail: freelancerEmail, isClientPortal: isClientPortal, documentUploadUrl: documentUploadUrl }),
340
346
  react_1.default.createElement(utils_1.CustomPaper, { style: { height: `${(files === null || files === void 0 ? void 0 : files.length) === 0 ? '30vh' : 'auto'}` } },
@@ -53,11 +53,13 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
53
53
  const selectedFiles = event.target.files;
54
54
  if (!selectedFiles) {
55
55
  setUploadingFile(false);
56
+ setUploadFiles([]);
56
57
  return;
57
58
  }
58
59
  const validFiles = Array.from(selectedFiles).filter(file => (0, EscalationRespondForm_1.validateFileUpload)(file));
59
60
  if (validFiles.length === 0) {
60
61
  setUploadingFile(false);
62
+ setUploadFiles([]);
61
63
  return;
62
64
  }
63
65
  const uploadPromises = validFiles.map((selectedFile) => {
@@ -68,6 +70,7 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
68
70
  file: selectedFile,
69
71
  documentName: selectedFile.name,
70
72
  escalationId: activeChatIssue.escalationId,
73
+ escalationNumber: activeChatIssue.escalationNumber,
71
74
  projectId: activeChatIssue.projectDetails.length > 0 ? activeChatIssue.projectDetails[0].projectId : '',
72
75
  documentUploadUrl: documentUploadUrl,
73
76
  bucketName: bucketName,
@@ -101,6 +104,7 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
101
104
  }
102
105
  finally {
103
106
  setUploadingFile(false);
107
+ setUploadFiles([]);
104
108
  }
105
109
  });
106
110
  const docs = [activeChatIssue.expertSupportingDocuments, activeChatIssue.clientSupportingDocuments, activeChatIssue.internalSupportingDocuments, ...uploadFiles];
@@ -1,6 +1,6 @@
1
1
  export declare const ACCEPTED_FILE_TYPES: string[];
2
2
  export declare const validateFileUpload: (file: File | null) => boolean;
3
- declare const EscalationRespondForm: ({ goBack, selectedIssue, documentUploadUrl, downloadDocumentUrl, uploadExpertClientFiles, updateProjectEscalation, bucketName, goHome, isExpert, }: {
3
+ declare const EscalationRespondForm: ({ goBack, selectedIssue, documentUploadUrl, downloadDocumentUrl, uploadExpertClientFiles, updateProjectEscalation, bucketName, goHome, isExpert, userId, }: {
4
4
  goBack: () => void;
5
5
  selectedIssue: any;
6
6
  documentUploadUrl: string;
@@ -10,5 +10,6 @@ declare const EscalationRespondForm: ({ goBack, selectedIssue, documentUploadUrl
10
10
  bucketName: string;
11
11
  goHome: () => void;
12
12
  isExpert: boolean;
13
+ userId: number;
13
14
  }) => JSX.Element;
14
15
  export default EscalationRespondForm;
@@ -75,7 +75,7 @@ const responseTypes = [
75
75
  value: "NoResponse",
76
76
  },
77
77
  ];
78
- const EscalationRespondForm = ({ goBack, selectedIssue, documentUploadUrl, downloadDocumentUrl, uploadExpertClientFiles, updateProjectEscalation, bucketName, goHome, isExpert, }) => {
78
+ const EscalationRespondForm = ({ goBack, selectedIssue, documentUploadUrl, downloadDocumentUrl, uploadExpertClientFiles, updateProjectEscalation, bucketName, goHome, isExpert, userId, }) => {
79
79
  var _a, _b;
80
80
  const [selectedType, setSelectedType] = (0, react_1.useState)(responseTypes[0].value);
81
81
  const [responseInput, setResponseInput] = (0, react_1.useState)('');
@@ -91,11 +91,13 @@ const EscalationRespondForm = ({ goBack, selectedIssue, documentUploadUrl, downl
91
91
  const selectedFiles = event.target.files;
92
92
  if (!selectedFiles) {
93
93
  setUploadingFile(false);
94
+ setUploadFiles([]);
94
95
  return;
95
96
  }
96
97
  const validFiles = Array.from(selectedFiles).filter(file => (0, exports.validateFileUpload)(file));
97
98
  if (validFiles.length === 0) {
98
99
  setUploadingFile(false);
100
+ setUploadFiles([]);
99
101
  return;
100
102
  }
101
103
  const uploadPromises = validFiles.map((selectedFile) => {
@@ -106,6 +108,7 @@ const EscalationRespondForm = ({ goBack, selectedIssue, documentUploadUrl, downl
106
108
  file: selectedFile,
107
109
  documentName: selectedFile.name,
108
110
  escalationId: selectedIssue === null || selectedIssue === void 0 ? void 0 : selectedIssue.escalationId,
111
+ escalationNumber: selectedIssue === null || selectedIssue === void 0 ? void 0 : selectedIssue.escalationNumber,
109
112
  projectId: (_b = (_a = selectedIssue === null || selectedIssue === void 0 ? void 0 : selectedIssue.projectDetails) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.projectId,
110
113
  documentUploadUrl: documentUploadUrl,
111
114
  bucketName: bucketName,
@@ -139,6 +142,7 @@ const EscalationRespondForm = ({ goBack, selectedIssue, documentUploadUrl, downl
139
142
  }
140
143
  finally {
141
144
  setUploadingFile(false);
145
+ setUploadFiles([]);
142
146
  }
143
147
  });
144
148
  const submitResponse = () => __awaiter(void 0, void 0, void 0, function* () {
@@ -150,7 +154,7 @@ const EscalationRespondForm = ({ goBack, selectedIssue, documentUploadUrl, downl
150
154
  escalationId: selectedIssue.escalationId,
151
155
  [isExpert ? 'expertResponse' : 'clientResponse']: responseInput,
152
156
  [isExpert ? 'expertSupportingDocuments' : 'clientSupportingDocuments']: uploadFiles.length > 0 ? uploadFiles.join(", ") : '',
153
- statuschangedby: isExpert ? selectedIssue.freelancer.id : selectedIssue.client.id,
157
+ statusChangedBy: userId,
154
158
  }
155
159
  }
156
160
  });
@@ -105,11 +105,13 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
105
105
  const selectedFiles = event.target.files;
106
106
  if (!selectedFiles) {
107
107
  setUploadingFile(false);
108
+ setUploadFiles([]);
108
109
  return;
109
110
  }
110
111
  const validFiles = Array.from(selectedFiles).filter(file => (0, EscalationRespondForm_1.validateFileUpload)(file));
111
112
  if (validFiles.length === 0) {
112
113
  setUploadingFile(false);
114
+ setUploadFiles([]);
113
115
  return;
114
116
  }
115
117
  const uploadPromises = validFiles.map((selectedFile) => {
@@ -152,6 +154,7 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
152
154
  }
153
155
  finally {
154
156
  setUploadingFile(false);
157
+ setUploadFiles([]);
155
158
  }
156
159
  });
157
160
  const isFormValid = () => {
@@ -153,7 +153,7 @@ const Escalations = ({ expertsOrClients, projects, isExpert = false, escalations
153
153
  react_1.default.createElement(EscalationReportBanner_1.default, { onReport: () => setSelectedIssueId(0) }),
154
154
  escalations.length > 0 ? react_1.default.createElement(EscalationTabs_1.default, { activeTab: activeEscalationTab, setActiveTab: setActiveEscalationTab, activeIssues: activeIssues.length, inProgressIssues: inProgressIssues.length, resolvedIssues: resolvedIssues.length }) : null,
155
155
  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 })),
156
- 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 })),
156
+ 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, userId: user.userId })),
157
157
  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, clientId: clientId })),
158
158
  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 })),
159
159
  showSuspensionModal &&
@@ -49,7 +49,7 @@ const MarkResolvedModal = ({ escalationId, expertName, open, onClose, updateProj
49
49
  escalationId: escalationId,
50
50
  clientResolution: resolutionText,
51
51
  status: 'Resolved',
52
- statuschangedby: clientId,
52
+ statusChangedBy: clientId,
53
53
  }
54
54
  }
55
55
  });
@@ -34,6 +34,7 @@ export declare const DOCUMENT_TYPE_CONSTANTS: {
34
34
  "Tax and Compliance Documents": string;
35
35
  "Project Specific Documents": string;
36
36
  "Dispute Documents": string;
37
+ "Escalation Documents": string;
37
38
  };
38
39
  export declare const titleMappings: Record<string, string>;
39
40
  export declare const features: string[];
@@ -272,7 +272,8 @@ exports.DOCUMENT_TYPE_CONSTANTS = {
272
272
  "Operational and Management Documents": "OPERATIONAL_AND_MANAGEMENT_DOCUMENTS",
273
273
  "Tax and Compliance Documents": "TAX_AND_COMPLIANCE_DOCUMENTS",
274
274
  "Project Specific Documents": "PROJECT_SPECIFIC_DOCUMENTS",
275
- "Dispute Documents": "DISPUTE_DOCUMENTS"
275
+ "Dispute Documents": "DISPUTE_DOCUMENTS",
276
+ "Escalation Documents": "ESCALATION_DOCUMENTS"
276
277
  };
277
278
  exports.titleMappings = {
278
279
  "CFO": "Chief Financial Officer (CFO)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.12.57",
3
+ "version": "1.12.59",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {