@paro.io/expert-shared-components 1.12.47 → 1.12.49

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.
@@ -41,7 +41,7 @@ const EscalationIssueCard_1 = require("./EscalationIssueCard");
41
41
  const FileUploader_1 = require("../FileUploader");
42
42
  const EscalationRespondForm_1 = require("./EscalationRespondForm");
43
43
  const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalationChat, user, createEscalationChatMessage, documentUploadUrl, bucketName, uploadExpertClientFiles, createProjectEscalation, isExpert, }) => {
44
- var _a;
44
+ var _a, _b;
45
45
  const [uploadFiles, setUploadFiles] = (0, react_1.useState)([]);
46
46
  const [uploadingFile, setUploadingFile] = (0, react_1.useState)(false);
47
47
  const fileInputRef = (0, react_1.useRef)(null);
@@ -109,10 +109,13 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
109
109
  });
110
110
  const docs = [activeChatIssue.expertSupportingDocuments, activeChatIssue.clientSupportingDocuments, activeChatIssue.internalSupportingDocuments, ...uploadFiles];
111
111
  const processedDocs = docs
112
- .filter(doc => doc !== null && doc !== undefined && doc !== '')
112
+ .filter(doc => doc !== null && doc !== undefined && doc !== '' && doc !== "NULL")
113
113
  .flatMap(doc => doc.split(','))
114
114
  .map(doc => doc.trim())
115
- .filter(doc => doc !== '');
115
+ .filter(doc => doc !== '' || doc !== "NULL");
116
+ const project = activeChatIssue.projectDetails && Array.isArray(activeChatIssue.projectDetails) && activeChatIssue.projectDetails.length > 0
117
+ ? `${(_a = activeChatIssue.projectDetails[0]) === null || _a === void 0 ? void 0 : _a.projectName}${activeChatIssue.projectDetails.length > 1 ? ` +${activeChatIssue.projectDetails.length - 1} more` : ''} `
118
+ : '';
116
119
  return (react_1.default.createElement(core_1.Dialog, { open: showEscalationChat, onClose: () => setShowEscalationChat(false), maxWidth: 'sm' },
117
120
  react_1.default.createElement(core_1.DialogTitle, null,
118
121
  react_1.default.createElement("div", { className: "text-black mb-1 p-2 pl-4 absolute top-0 left-0 w-full flex flex-row justify-between items-center z-50" },
@@ -123,15 +126,15 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
123
126
  activeChatIssue.escalationNumber),
124
127
  react_1.default.createElement(EscalationIssueCard_1.CustomTag, { label: activeChatIssue.status })),
125
128
  react_1.default.createElement("p", { className: "text-xs" },
126
- activeChatIssue.probelm,
127
- " - ",
128
- activeChatIssue.project)),
129
+ activeChatIssue.problem,
130
+ " \u2022 ",
131
+ project)),
129
132
  react_1.default.createElement("div", { className: "flex items-center space-x-4" },
130
133
  react_1.default.createElement(core_1.IconButton, { onClick: () => setShowEscalationChat(false) },
131
134
  react_1.default.createElement(base_icons_1.IconX, null))))),
132
135
  react_1.default.createElement(core_1.DialogContent, null,
133
136
  react_1.default.createElement("div", { className: "bg-white rounded-lg w-full overflow-hidden flex flex-col p-2 mt-12" },
134
- react_1.default.createElement(DiscussionSection_1.DiscussionSection, { escalationNumber: activeChatIssue.escalationNumber, currentUser: user, messages: (_a = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.chatMessages) !== null && _a !== void 0 ? _a : [], onCreateMessage: createEscalationChatMessage, isInternal: false }),
137
+ react_1.default.createElement(DiscussionSection_1.DiscussionSection, { escalationNumber: activeChatIssue.escalationNumber, currentUser: user, messages: (_b = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.chatMessages) !== null && _b !== void 0 ? _b : [], onCreateMessage: createEscalationChatMessage, isInternal: false }),
135
138
  processedDocs && processedDocs.length > 0 && (react_1.default.createElement("div", { className: "flex flex-wrap gap-2" },
136
139
  react_1.default.createElement("span", { className: "text-sm font-bold text-gray-500 items-center" }, "Supporting Documents: "),
137
140
  processedDocs.map((d, idx) => (react_1.default.createElement(EscalationIssueCard_1.CustomTag, { key: idx, label: d.split('%2F')[1] }))))),
@@ -75,8 +75,8 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
75
75
  (0, react_1.useEffect)(() => {
76
76
  if (expertsOrClients && expertsOrClients.length > 0) {
77
77
  const options = expertsOrClients.map((user) => ({
78
- label: isExpert ? user.name : user.freelancerName,
79
- value: { id: isExpert ? user.id : user.freelancerId, name: isExpert ? user.name : user.freelancerName },
78
+ label: user.name,
79
+ value: { id: user.id, name: user.name },
80
80
  }));
81
81
  setExpertOptions(options);
82
82
  }
@@ -114,7 +114,7 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
114
114
  return new Promise((resolve, reject) => {
115
115
  const reader = new FileReader();
116
116
  reader.onloadend = () => __awaiter(void 0, void 0, void 0, function* () {
117
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
117
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
118
118
  try {
119
119
  const res = yield (0, FileUploader_1.fileUploader)({
120
120
  file: selectedFile,
@@ -127,11 +127,11 @@ const EscalationSubmitForm = ({ goBack, goHome, expertsOrClients, projects, docu
127
127
  uploadExpertClientFiles: uploadExpertClientFiles,
128
128
  createProjectEscalation: createProjectEscalation,
129
129
  extraData: {
130
- 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,
131
- 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 : '',
132
- 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 : '',
133
- 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,
134
- 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 : '',
130
+ clientId: isExpert ? (_a = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id) !== null && _a !== void 0 ? _a : 0 : clientId,
131
+ clientName: isExpert ? (_b = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name) !== null && _b !== void 0 ? _b : '' : (_c = user === null || user === void 0 ? void 0 : user.name) !== null && _c !== void 0 ? _c : '',
132
+ email: isExpert ? (_e = (_d = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.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 : '',
133
+ freelancerId: isExpert ? (_g = user === null || user === void 0 ? void 0 : user.userId) !== null && _g !== void 0 ? _g : 0 : (_h = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id) !== null && _h !== void 0 ? _h : 0,
134
+ freelancerName: isExpert ? (_j = user === null || user === void 0 ? void 0 : user.name) !== null && _j !== void 0 ? _j : '' : (_k = selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.name) !== null && _k !== void 0 ? _k : '',
135
135
  projectName: selectedProjects.length > 0 ? selectedProjects[0].name : '',
136
136
  }
137
137
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.12.47",
3
+ "version": "1.12.49",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {