@paro.io/expert-shared-components 1.12.60 → 1.13.0

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.
@@ -1,4 +1,4 @@
1
- declare const EscalationChat: ({ activeChatIssue, showEscalationChat, setShowEscalationChat, user, createEscalationChatMessage, documentUploadUrl, bucketName, uploadExpertClientFiles, createProjectEscalation, isExpert, }: {
1
+ declare const EscalationChat: ({ activeChatIssue, showEscalationChat, setShowEscalationChat, user, createEscalationChatMessage, documentUploadUrl, bucketName, uploadExpertClientFiles, updateProjectEscalation, isExpert, }: {
2
2
  activeChatIssue: any;
3
3
  showEscalationChat: boolean;
4
4
  setShowEscalationChat: (showEscalationChat: boolean) => void;
@@ -6,8 +6,8 @@ declare const EscalationChat: ({ activeChatIssue, showEscalationChat, setShowEsc
6
6
  createEscalationChatMessage: any;
7
7
  documentUploadUrl: string;
8
8
  bucketName: string;
9
- uploadExpertClientFiles: string;
10
- createProjectEscalation: string;
9
+ uploadExpertClientFiles: any;
10
+ updateProjectEscalation: any;
11
11
  isExpert: boolean;
12
12
  }) => JSX.Element;
13
13
  export default EscalationChat;
@@ -40,7 +40,7 @@ const DiscussionSection_1 = require("../Invoices/DiscussionSection");
40
40
  const EscalationIssueCard_1 = require("./EscalationIssueCard");
41
41
  const FileUploader_1 = require("../FileUploader");
42
42
  const EscalationRespondForm_1 = require("./EscalationRespondForm");
43
- const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalationChat, user, createEscalationChatMessage, documentUploadUrl, bucketName, uploadExpertClientFiles, createProjectEscalation, isExpert, }) => {
43
+ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalationChat, user, createEscalationChatMessage, documentUploadUrl, bucketName, uploadExpertClientFiles, updateProjectEscalation, isExpert, }) => {
44
44
  var _a, _b, _c, _d;
45
45
  const [uploadFiles, setUploadFiles] = (0, react_1.useState)(isExpert
46
46
  ? (((_a = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.expertSupportingDocuments) === null || _a === void 0 ? void 0 : _a.split(",")) || [])
@@ -64,7 +64,7 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
64
64
  }
65
65
  const uploadPromises = validFiles.map((selectedFile) => {
66
66
  return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
67
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
67
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
68
68
  try {
69
69
  const res = yield (0, FileUploader_1.fileUploader)({
70
70
  file: selectedFile,
@@ -77,13 +77,13 @@ const EscalationChat = ({ activeChatIssue, showEscalationChat, setShowEscalation
77
77
  previousFiles: isExpert ? activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.clientDocumentLinks : activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.expertDocumentlinks,
78
78
  isExpert: isExpert,
79
79
  uploadExpertClientFiles: uploadExpertClientFiles,
80
- createProjectEscalation: createProjectEscalation,
80
+ updateProjectEscalation: updateProjectEscalation,
81
81
  extraData: {
82
- clientId: isExpert ? (_b = (_a = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.client) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0 : (_d = (_c = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.client) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : 0,
83
- clientName: isExpert ? (_f = (_e = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.client) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : '' : (_g = user === null || user === void 0 ? void 0 : user.name) !== null && _g !== void 0 ? _g : '',
84
- email: isExpert ? (_k = (_j = (_h = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.client) === null || _h === void 0 ? void 0 : _h.primaryContact) === null || _j === void 0 ? void 0 : _j.email) !== null && _k !== void 0 ? _k : '' : (_m = (_l = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.freelancer) === null || _l === void 0 ? void 0 : _l.email) !== null && _m !== void 0 ? _m : '',
85
- freelancerId: isExpert ? (_o = user === null || user === void 0 ? void 0 : user.userId) !== null && _o !== void 0 ? _o : 0 : (_q = (_p = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.freelancer) === null || _p === void 0 ? void 0 : _p.id) !== null && _q !== void 0 ? _q : 0,
86
- freelancerName: isExpert ? (_r = user === null || user === void 0 ? void 0 : user.name) !== null && _r !== void 0 ? _r : '' : (_t = (_s = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.freelancer) === null || _s === void 0 ? void 0 : _s.name) !== null && _t !== void 0 ? _t : '',
82
+ clientId: (_b = (_a = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.client) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0,
83
+ clientName: (_d = (_c = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.client) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '',
84
+ email: isExpert ? (_g = (_f = (_e = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.client) === null || _e === void 0 ? void 0 : _e.primaryContact) === null || _f === void 0 ? void 0 : _f.email) !== null && _g !== void 0 ? _g : '' : (_j = (_h = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.freelancer) === null || _h === void 0 ? void 0 : _h.email) !== null && _j !== void 0 ? _j : '',
85
+ freelancerId: (_l = (_k = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.freelancer) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : 0,
86
+ freelancerName: (_o = (_m = activeChatIssue === null || activeChatIssue === void 0 ? void 0 : activeChatIssue.freelancer) === null || _m === void 0 ? void 0 : _m.name) !== null && _o !== void 0 ? _o : '',
87
87
  projectName: activeChatIssue.projectDetails.length > 0 ? activeChatIssue.projectDetails[0].projectName : '',
88
88
  }
89
89
  });
@@ -15,6 +15,7 @@ type EscalationIssueCardProps = {
15
15
  updateProjectEscalation: any;
16
16
  downloadDocumentUrl: string;
17
17
  bucketName: string;
18
+ userId: number;
18
19
  };
19
20
  declare const EscalationIssueCard: React.FC<EscalationIssueCardProps>;
20
21
  export default EscalationIssueCard;
@@ -55,8 +55,8 @@ const CustomTag = ({ label, iconLeft, onClick, customColor, }) => {
55
55
  label.toUpperCase()));
56
56
  };
57
57
  exports.CustomTag = CustomTag;
58
- const EscalationIssueCard = ({ issues, isExpert, openEscalationChat, showRespondButton = false, setSelectedIssueId, showMarkResolvedButton = false, updateProjectEscalation, downloadDocumentUrl, bucketName, }) => {
59
- var _a, _b, _c;
58
+ const EscalationIssueCard = ({ issues, isExpert, openEscalationChat, showRespondButton = false, setSelectedIssueId, showMarkResolvedButton = false, updateProjectEscalation, downloadDocumentUrl, bucketName, userId, }) => {
59
+ var _a, _b;
60
60
  const [viewResponseModal, setViewResponseModal] = (0, react_1.useState)(null);
61
61
  const [markAsResolved, setMarkAsResolved] = (0, react_1.useState)(null);
62
62
  const getResponseButtonText = (issue) => {
@@ -109,6 +109,6 @@ const EscalationIssueCard = ({ issues, isExpert, openEscalationChat, showRespond
109
109
  showMarkResolvedButton && !isExpert && (react_1.default.createElement(base_ui_1.Button, { onClick: () => { setMarkAsResolved(issue); }, label: "Mark as Resolved", color: "primary" })))));
110
110
  }),
111
111
  !!viewResponseModal && react_1.default.createElement(ViewResponseModal_1.default, { response: isExpert ? viewResponseModal.clientResponse : viewResponseModal.expertResponse, isExpert: isExpert, open: !!viewResponseModal, onClose: () => setViewResponseModal(null) }),
112
- !!markAsResolved && react_1.default.createElement(MarkResolvedModal_1.default, { escalationId: markAsResolved.escalationId, expertName: (_b = (_a = markAsResolved === null || markAsResolved === void 0 ? void 0 : markAsResolved.freelancer) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'Expert', open: !!markAsResolved, onClose: () => setMarkAsResolved(false), updateProjectEscalation: updateProjectEscalation, clientId: (_c = markAsResolved === null || markAsResolved === void 0 ? void 0 : markAsResolved.client) === null || _c === void 0 ? void 0 : _c.id })));
112
+ !!markAsResolved && react_1.default.createElement(MarkResolvedModal_1.default, { escalationId: markAsResolved.escalationId, expertName: (_b = (_a = markAsResolved === null || markAsResolved === void 0 ? void 0 : markAsResolved.freelancer) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'Expert', open: !!markAsResolved, onClose: () => setMarkAsResolved(false), updateProjectEscalation: updateProjectEscalation, userId: userId })));
113
113
  };
114
114
  exports.default = EscalationIssueCard;
@@ -9,6 +9,7 @@ interface EscalationTabProps {
9
9
  updateProjectEscalation: any;
10
10
  downloadDocumentUrl: string;
11
11
  bucketName: string;
12
+ userId: number;
12
13
  }
13
- declare const EscalationTabsContent: ({ activeTab, openEscalationChat, setSelectedIssueId, activeIssues, inProgressIssues, resolvedIssues, isExpert, updateProjectEscalation, downloadDocumentUrl, bucketName, }: EscalationTabProps) => JSX.Element;
14
+ declare const EscalationTabsContent: ({ activeTab, openEscalationChat, setSelectedIssueId, activeIssues, inProgressIssues, resolvedIssues, isExpert, updateProjectEscalation, downloadDocumentUrl, bucketName, userId, }: EscalationTabProps) => JSX.Element;
14
15
  export default EscalationTabsContent;
@@ -31,18 +31,18 @@ const EscalationIssueCard_1 = __importStar(require("./EscalationIssueCard"));
31
31
  const base_ui_1 = require("@paro.io/base-ui");
32
32
  const dayjs_1 = __importDefault(require("dayjs"));
33
33
  ;
34
- const EscalationTabsContent = ({ activeTab, openEscalationChat, setSelectedIssueId, activeIssues, inProgressIssues, resolvedIssues, isExpert, updateProjectEscalation, downloadDocumentUrl, bucketName, }) => {
34
+ const EscalationTabsContent = ({ activeTab, openEscalationChat, setSelectedIssueId, activeIssues, inProgressIssues, resolvedIssues, isExpert, updateProjectEscalation, downloadDocumentUrl, bucketName, userId, }) => {
35
35
  if (activeTab === 'action-required') {
36
36
  return (react_1.default.createElement("div", null,
37
37
  react_1.default.createElement("div", { className: "flex items-center justify-between mb-4" },
38
38
  react_1.default.createElement("h3", { className: "text-lg font-semibold text-gray-900" }, "Issues Requiring Your Response")),
39
- react_1.default.createElement(EscalationIssueCard_1.default, { issues: activeIssues, isExpert: isExpert, openEscalationChat: openEscalationChat, showRespondButton: true, setSelectedIssueId: setSelectedIssueId, updateProjectEscalation: updateProjectEscalation, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName })));
39
+ react_1.default.createElement(EscalationIssueCard_1.default, { issues: activeIssues, isExpert: isExpert, openEscalationChat: openEscalationChat, showRespondButton: true, setSelectedIssueId: setSelectedIssueId, updateProjectEscalation: updateProjectEscalation, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName, userId: userId })));
40
40
  }
41
41
  if (activeTab === 'in-progress') {
42
42
  return (react_1.default.createElement("div", null,
43
43
  react_1.default.createElement("div", { className: "flex items-center justify-between mb-4" },
44
44
  react_1.default.createElement("h3", { className: "text-lg font-semibold text-gray-900" }, "Issues In Progress")),
45
- react_1.default.createElement(EscalationIssueCard_1.default, { issues: inProgressIssues, isExpert: isExpert, openEscalationChat: openEscalationChat, showMarkResolvedButton: true, updateProjectEscalation: updateProjectEscalation, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName })));
45
+ react_1.default.createElement(EscalationIssueCard_1.default, { issues: inProgressIssues, isExpert: isExpert, openEscalationChat: openEscalationChat, showMarkResolvedButton: true, updateProjectEscalation: updateProjectEscalation, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName, userId: userId })));
46
46
  }
47
47
  if (activeTab === 'resolved') {
48
48
  return (react_1.default.createElement("div", null,
@@ -152,10 +152,10 @@ const Escalations = ({ expertsOrClients, projects, isExpert = false, escalations
152
152
  !isExpert &&
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
- 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 })),
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, userId: user.userId })),
156
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
- 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 })),
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, updateProjectEscalation: updateProjectEscalation, isExpert: isExpert })),
159
159
  showSuspensionModal &&
160
160
  react_1.default.createElement(AccountSuspensionModal_1.default, { showSuspensionModal: showSuspensionModal, onClose: () => setShowSuspensionModal(false) })),
161
161
  react_1.default.createElement(react_hot_toast_1.Toaster, { position: "top-center", toastOptions: {
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- declare const MarkResolvedModal: ({ escalationId, expertName, open, onClose, updateProjectEscalation, clientId, }: {
2
+ declare const MarkResolvedModal: ({ escalationId, expertName, open, onClose, updateProjectEscalation, userId, }: {
3
3
  escalationId: string;
4
4
  expertName: string;
5
5
  open: boolean;
6
6
  onClose: () => void;
7
7
  updateProjectEscalation: any;
8
- clientId: number;
8
+ userId: number;
9
9
  }) => React.JSX.Element;
10
10
  export default MarkResolvedModal;
@@ -37,7 +37,7 @@ const base_icons_1 = require("@paro.io/base-icons");
37
37
  const base_ui_1 = require("@paro.io/base-ui");
38
38
  const core_1 = require("@material-ui/core");
39
39
  const utils_1 = require("../shared/utils");
40
- const MarkResolvedModal = ({ escalationId, expertName, open, onClose, updateProjectEscalation, clientId, }) => {
40
+ const MarkResolvedModal = ({ escalationId, expertName, open, onClose, updateProjectEscalation, userId, }) => {
41
41
  const [resolutionText, setResolutionText] = (0, react_1.useState)(null);
42
42
  const [submitting, setSubmitting] = (0, react_1.useState)(false);
43
43
  const handleSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
@@ -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: userId,
53
53
  }
54
54
  }
55
55
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.12.60",
3
+ "version": "1.13.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {