@paro.io/expert-shared-components 1.11.8 → 1.12.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.
- package/LICENSE +21 -21
- package/README.md +2 -2
- package/lib/components/ClientReferencesSection/DeleteButton.js +11 -11
- package/lib/components/ClientReferencesSection/ParoError.js +10 -10
- package/lib/components/ClientReferencesSection/TagsSection.js +2 -2
- package/lib/components/ClientReferencesSection/styles/BrandedTypography.js +2 -2
- package/lib/components/ClientReferencesSection/styles/Buttons.js +15 -15
- package/lib/components/ClientReferencesSection/styles/Name.js +5 -5
- package/lib/components/ClientReferencesSection/styles/NullContentConditionalColor.js +4 -4
- package/lib/components/ClientReferencesSection/styles/SectionBody.js +11 -11
- package/lib/components/ClientReferencesSection/styles/SectionTitle.js +6 -6
- package/lib/components/ClientReferencesSection/styles/Tags.js +2 -2
- package/lib/components/DiscussionThread/chat.d.ts +22 -22
- package/lib/components/DiscussionThread/chat.js +106 -106
- package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
- package/lib/components/DocumentCenter/DocumentTable.js +350 -350
- package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
- package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
- package/lib/components/EarningsTracker/ActiveProjectCard.d.ts +52 -52
- package/lib/components/EarningsTracker/ActiveProjectCard.js +161 -161
- package/lib/components/EarningsTracker/CenterCardUI.d.ts +13 -13
- package/lib/components/EarningsTracker/CenterCardUI.js +134 -134
- package/lib/components/EarningsTracker/EarningsTracker.d.ts +52 -52
- package/lib/components/EarningsTracker/EarningsTracker.js +508 -508
- package/lib/components/EarningsTracker/EditDateModal.d.ts +22 -22
- package/lib/components/EarningsTracker/EditDateModal.js +149 -149
- package/lib/components/EarningsTracker/EmailModal.d.ts +14 -14
- package/lib/components/EarningsTracker/EmailModal.js +79 -79
- package/lib/components/EarningsTracker/EndProjectModal.d.ts +56 -56
- package/lib/components/EarningsTracker/EndProjectModal.js +221 -221
- package/lib/components/EarningsTracker/LeftCardUI.d.ts +18 -18
- package/lib/components/EarningsTracker/LeftCardUI.js +189 -189
- package/lib/components/EarningsTracker/LogTimeModalAuthenticated.d.ts +52 -52
- package/lib/components/EarningsTracker/LogTimeModalAuthenticated.js +358 -358
- package/lib/components/EarningsTracker/ProgressBar.d.ts +4 -4
- package/lib/components/EarningsTracker/ProgressBar.js +66 -66
- package/lib/components/EarningsTracker/ReviewRequestModal.d.ts +17 -17
- package/lib/components/EarningsTracker/ReviewRequestModal.js +135 -135
- package/lib/components/EarningsTracker/RightCardUI.d.ts +46 -46
- package/lib/components/EarningsTracker/RightCardUI.js +231 -231
- package/lib/components/EarningsTracker/index.d.ts +1 -1
- package/lib/components/EarningsTracker/index.js +5 -5
- package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
- package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
- package/lib/components/Invoices/ClientDisputeProjectCard.d.ts +9 -0
- package/lib/components/Invoices/ClientDisputeProjectCard.js +292 -0
- package/lib/components/Invoices/DiscussionSection.js +2 -2
- package/lib/components/Invoices/InvoiceCard.d.ts +3 -1
- package/lib/components/Invoices/InvoiceCard.js +8 -4
- package/lib/components/Invoices/InvoiceDetails.d.ts +2 -1
- package/lib/components/Invoices/InvoiceDetails.js +2 -2
- package/lib/components/OrganizationChart/OrganizationChart.d.ts +15 -15
- package/lib/components/OrganizationChart/OrganizationChart.js +312 -312
- package/lib/components/OrganizationChart/PersonCard.js +5 -5
- package/lib/components/OrganizationChart/utils.js +79 -79
- package/lib/components/ProjectCard/ProgressBar.js +4 -4
- package/lib/components/ProjectCard/ReviewRequestModal.js +5 -5
- package/lib/components/Reviews/Pagination.js +6 -6
- package/lib/components/ReviewsTab/RatingHeader.js +6 -6
- package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
- package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
- package/lib/components/shared/Image.js +13 -13
- package/lib/components/shared/ProfileTextField.d.ts +18 -18
- package/lib/components/shared/ProfileTextField.js +16 -16
- package/lib/components/shared/StyledActionButtons.d.ts +7 -7
- package/lib/components/shared/StyledActionButtons.js +15 -15
- package/lib/components/shared/ToastNotification.d.ts +10 -10
- package/lib/components/shared/ToastNotification.js +63 -63
- package/lib/components/shared/UploadClient.js +15 -0
- package/package.json +61 -61
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
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
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.ClientDisputeProjectCard = void 0;
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const base_ui_1 = require("@paro.io/base-ui");
|
|
41
|
+
const base_ui_2 = require("@paro.io/base-ui");
|
|
42
|
+
const core_1 = require("@material-ui/core");
|
|
43
|
+
const base_icons_1 = require("@paro.io/base-icons");
|
|
44
|
+
const FileUploader_1 = require("../FileUploader");
|
|
45
|
+
const DownloadClient_1 = __importDefault(require("../shared/DownloadClient"));
|
|
46
|
+
const useStyles = (0, core_1.makeStyles)((theme) => ({
|
|
47
|
+
root: {
|
|
48
|
+
width: "100%",
|
|
49
|
+
},
|
|
50
|
+
paper: {
|
|
51
|
+
width: "100%",
|
|
52
|
+
},
|
|
53
|
+
table: {
|
|
54
|
+
minWidth: '95%',
|
|
55
|
+
border: "1px solid",
|
|
56
|
+
borderColor: "#E2E8F0",
|
|
57
|
+
},
|
|
58
|
+
visuallyHidden: {
|
|
59
|
+
border: 0,
|
|
60
|
+
clip: "rect(0 0 0 0)",
|
|
61
|
+
height: 1,
|
|
62
|
+
margin: -1,
|
|
63
|
+
overflow: "hidden",
|
|
64
|
+
padding: 0,
|
|
65
|
+
position: "absolute",
|
|
66
|
+
top: 20,
|
|
67
|
+
width: 1,
|
|
68
|
+
},
|
|
69
|
+
tableCell: {
|
|
70
|
+
width: "auto",
|
|
71
|
+
},
|
|
72
|
+
collapse: {
|
|
73
|
+
backgroundColor: "#FFFFFF",
|
|
74
|
+
width: "100%",
|
|
75
|
+
borderRadius: 6,
|
|
76
|
+
marginLeft: 12,
|
|
77
|
+
marginTop: 12,
|
|
78
|
+
},
|
|
79
|
+
tableHead: {
|
|
80
|
+
backgroundColor: "#F1F5F9",
|
|
81
|
+
borderRadius: 6,
|
|
82
|
+
width: "100%",
|
|
83
|
+
},
|
|
84
|
+
}));
|
|
85
|
+
const headCells = [
|
|
86
|
+
{ id: 'project', label: 'Project' },
|
|
87
|
+
{ id: 'projectType', label: 'Project Type' },
|
|
88
|
+
{ id: 'hours', label: 'Hours' },
|
|
89
|
+
{ id: 'amount', label: 'Amount' },
|
|
90
|
+
{ id: 'reason', label: 'Reason' },
|
|
91
|
+
];
|
|
92
|
+
const ACCEPTED_FILE_TYPES = [
|
|
93
|
+
'application/pdf',
|
|
94
|
+
'application/msword',
|
|
95
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
96
|
+
'image/jpeg',
|
|
97
|
+
'image/png',
|
|
98
|
+
'text/csv',
|
|
99
|
+
];
|
|
100
|
+
const ClientDisputeProjectCard = ({ clientInvoice, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, refetchInvoiceDisputes, }) => {
|
|
101
|
+
const [expandRow, setExpandRow] = (0, react_1.useState)(null);
|
|
102
|
+
const classes = useStyles();
|
|
103
|
+
const [projects, setProjects] = (0, react_1.useState)(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects);
|
|
104
|
+
const [editingRowId, setEditingRowId] = (0, react_1.useState)(null);
|
|
105
|
+
const [editedExplanation, setEditedExplanation] = (0, react_1.useState)('');
|
|
106
|
+
const [updatedDispute, setUpdateDispute] = (0, react_1.useState)(false);
|
|
107
|
+
const [updatingDispute, setUpdatingDispute] = (0, react_1.useState)(false);
|
|
108
|
+
const [uploadingFile, setUploadingFile] = (0, react_1.useState)(false);
|
|
109
|
+
const fileInputRef = (0, react_1.useRef)(null);
|
|
110
|
+
const handleDownloadPdf = ({ fileData, downloadFilename, streamData }) => {
|
|
111
|
+
var _a, _b;
|
|
112
|
+
let byteArray = streamData ? fileData : new Uint8Array();
|
|
113
|
+
if (!streamData) {
|
|
114
|
+
const byteCharacters = atob((_b = (_a = fileData === null || fileData === void 0 ? void 0 : fileData.data) === null || _a === void 0 ? void 0 : _a.getFile) === null || _b === void 0 ? void 0 : _b.data);
|
|
115
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
116
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
117
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
118
|
+
}
|
|
119
|
+
byteArray = new Uint8Array(byteNumbers);
|
|
120
|
+
}
|
|
121
|
+
const blob = new Blob([byteArray], { type: 'application/pdf' });
|
|
122
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
123
|
+
const newTab = window.open(blobUrl, '_blank');
|
|
124
|
+
const downloadLink = document.createElement('a');
|
|
125
|
+
downloadLink.href = blobUrl;
|
|
126
|
+
downloadLink.download = downloadFilename;
|
|
127
|
+
document.body.appendChild(downloadLink);
|
|
128
|
+
downloadLink.click();
|
|
129
|
+
document.body.removeChild(downloadLink);
|
|
130
|
+
URL.revokeObjectURL(blobUrl);
|
|
131
|
+
if (newTab) {
|
|
132
|
+
newTab.focus();
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const handleDownloadDocument = (projectId, fileName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
|
+
const downloadFileName = `project-${projectId}/${fileName}`;
|
|
137
|
+
const downloadClient = new DownloadClient_1.default({ downloadDocumentUrl: downloadDocumentUrl, fileKey: downloadFileName });
|
|
138
|
+
const downloadData = yield downloadClient.downloadDocument();
|
|
139
|
+
handleDownloadPdf({ fileData: downloadData, downloadFilename: fileName, streamData: true });
|
|
140
|
+
});
|
|
141
|
+
(0, react_1.useEffect)(() => {
|
|
142
|
+
if (JSON.stringify(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) !== JSON.stringify(projects)) {
|
|
143
|
+
setUpdateDispute(true);
|
|
144
|
+
}
|
|
145
|
+
}, [projects]);
|
|
146
|
+
const validateFileUpload = (file) => {
|
|
147
|
+
return ACCEPTED_FILE_TYPES.includes(file.type);
|
|
148
|
+
};
|
|
149
|
+
const handleEditExplanation = (projectId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
150
|
+
setProjects((prev) => prev.map((p) => p.projectId === projectId
|
|
151
|
+
? Object.assign(Object.assign({}, p), { clientExplanation: editedExplanation }) : p));
|
|
152
|
+
setEditingRowId(null);
|
|
153
|
+
});
|
|
154
|
+
const handleChange = (e, field) => {
|
|
155
|
+
const updatedProject = projects.map((project) => {
|
|
156
|
+
return Object.assign(Object.assign({}, project), { [field]: e.target.value });
|
|
157
|
+
});
|
|
158
|
+
setProjects(updatedProject);
|
|
159
|
+
};
|
|
160
|
+
const handleUpload = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
161
|
+
setUploadingFile(true);
|
|
162
|
+
const selectedFiles = event.target.files;
|
|
163
|
+
if (!selectedFiles)
|
|
164
|
+
return;
|
|
165
|
+
const validFileNames = Array.from(selectedFiles)
|
|
166
|
+
.filter(file => validateFileUpload(file))
|
|
167
|
+
.map(file => file.name);
|
|
168
|
+
if (validFileNames.length === 0)
|
|
169
|
+
return;
|
|
170
|
+
if (validFileNames && validFileNames.length > 0) {
|
|
171
|
+
const uploadPromises = Array.from(selectedFiles).map((selectedFile) => {
|
|
172
|
+
return new Promise((resolve, reject) => {
|
|
173
|
+
const reader = new FileReader();
|
|
174
|
+
reader.onloadend = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
175
|
+
var _a, _b, _c, _d, _e;
|
|
176
|
+
try {
|
|
177
|
+
yield (0, FileUploader_1.fileUploader)({
|
|
178
|
+
file: selectedFile,
|
|
179
|
+
documentName: selectedFile.name,
|
|
180
|
+
disputeId: clientInvoice.disputeId,
|
|
181
|
+
projectId: Number((_b = (_a = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.projectId),
|
|
182
|
+
documentUploadUrl: documentUploadUrl,
|
|
183
|
+
updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation,
|
|
184
|
+
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 : [],
|
|
185
|
+
isExpert: false,
|
|
186
|
+
}).then(() => {
|
|
187
|
+
refetchInvoiceDisputes();
|
|
188
|
+
});
|
|
189
|
+
resolve();
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
reject(error);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
reader.readAsDataURL(selectedFile);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
try {
|
|
199
|
+
yield Promise.all(uploadPromises);
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
console.error('Error uploading files:', error);
|
|
203
|
+
}
|
|
204
|
+
finally {
|
|
205
|
+
setUploadingFile(false);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (fileInputRef.current) {
|
|
209
|
+
fileInputRef.current.value = ''; // Reset the file input
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
const handleSubmitDispute = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
213
|
+
setUpdatingDispute(true);
|
|
214
|
+
try {
|
|
215
|
+
yield updateClientInvoiceDisputeMutation({
|
|
216
|
+
variables: {
|
|
217
|
+
input: {
|
|
218
|
+
disputeId: clientInvoice.disputeId,
|
|
219
|
+
projectDisputes: projects.map((project) => ({
|
|
220
|
+
projectId: project.projectId,
|
|
221
|
+
disputeReasonCode: project.disputeReasonCode,
|
|
222
|
+
disputeType: project.disputeType,
|
|
223
|
+
disputeHours: project.disputeHours,
|
|
224
|
+
disputeAmount: project.disputeAmount,
|
|
225
|
+
clientExplanation: project.clientExplanation,
|
|
226
|
+
clientDocumentLinks: project.clientDocumentLinks,
|
|
227
|
+
})),
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}).then(() => {
|
|
231
|
+
refetchInvoiceDisputes();
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
catch (error) {
|
|
235
|
+
console.error("Failed to update dispute", error);
|
|
236
|
+
}
|
|
237
|
+
finally {
|
|
238
|
+
setUpdatingDispute(false);
|
|
239
|
+
setUpdateDispute(false);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
return (react_1.default.createElement("div", null,
|
|
243
|
+
react_1.default.createElement(core_1.Table, { className: classes.table, "aria-labelledby": "tableTitle", size: 'medium', "aria-label": "enhanced table" },
|
|
244
|
+
react_1.default.createElement(core_1.TableHead, { className: classes.tableHead },
|
|
245
|
+
react_1.default.createElement(core_1.TableRow, null,
|
|
246
|
+
headCells.map((headcell) => {
|
|
247
|
+
return react_1.default.createElement(core_1.TableCell, { key: headcell.id, className: classes.tableCell }, headcell.label);
|
|
248
|
+
}),
|
|
249
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell }))), projects === null || projects === void 0 ? void 0 :
|
|
250
|
+
projects.map((row) => {
|
|
251
|
+
var _a, _b;
|
|
252
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: row === null || row === void 0 ? void 0 : row.projectId },
|
|
253
|
+
react_1.default.createElement(core_1.TableRow, null,
|
|
254
|
+
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, ((_a = row === null || row === void 0 ? void 0 : row.project) === null || _a === void 0 ? void 0 : _a.name) || "N/A"),
|
|
255
|
+
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row === null || row === void 0 ? void 0 : row.disputeType),
|
|
256
|
+
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row === null || row === void 0 ? void 0 : row.disputeHours),
|
|
257
|
+
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row === null || row === void 0 ? void 0 : row.disputeAmount),
|
|
258
|
+
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row === null || row === void 0 ? void 0 : row.disputeReasonCode),
|
|
259
|
+
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell },
|
|
260
|
+
react_1.default.createElement(core_1.IconButton, { onClick: () => setExpandRow(expandRow === (row === null || row === void 0 ? void 0 : row.projectId) ? null : row === null || row === void 0 ? void 0 : row.projectId) }, expandRow === (row === null || row === void 0 ? void 0 : row.projectId) ? react_1.default.createElement(base_icons_1.IconChevronUp, null) : react_1.default.createElement(base_icons_1.IconChevronDown, null)))),
|
|
261
|
+
expandRow === (row === null || row === void 0 ? void 0 : row.projectId) && (react_1.default.createElement(core_1.TableRow, { key: `expanded-${row === null || row === void 0 ? void 0 : row.projectId}` },
|
|
262
|
+
react_1.default.createElement(core_1.TableCell, { colSpan: headCells.length + 1, style: { paddingBottom: 0, paddingTop: 0 } },
|
|
263
|
+
react_1.default.createElement(core_1.Collapse, { in: true, timeout: "auto", unmountOnExit: true },
|
|
264
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
265
|
+
react_1.default.createElement(base_ui_1.Card, { className: "bg-[#F8F9FA] m-2 flex items-start justify-between rounded flex-col w-full p-6" },
|
|
266
|
+
react_1.default.createElement("b", { className: "mb-2 flex flex-row justify-start items-center" },
|
|
267
|
+
"Explanation:",
|
|
268
|
+
editingRowId === (row === null || row === void 0 ? void 0 : row.projectId) ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
269
|
+
react_1.default.createElement(base_ui_2.Input, { label: "", type: "text", className: "w-96 mx-4 overflow-ellipsis", value: editedExplanation, onChange: (e) => setEditedExplanation(e.target.value), placeholder: "Please provide an explanation", isInvalid: !editedExplanation, isInvalidText: "Please provide an explanation" }),
|
|
270
|
+
react_1.default.createElement(base_ui_2.Button, { label: "Save", size: "md", color: "success", className: "ml-1 mt-1", onClick: () => { handleEditExplanation(row === null || row === void 0 ? void 0 : row.projectId); } }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
271
|
+
react_1.default.createElement("span", { className: "font-normal mx-1" }, row === null || row === void 0 ? void 0 : row.clientExplanation),
|
|
272
|
+
react_1.default.createElement(core_1.Tooltip, { title: "Edit explanation", placement: "top", arrow: true },
|
|
273
|
+
react_1.default.createElement(core_1.IconButton, { onClick: () => {
|
|
274
|
+
setEditedExplanation(row === null || row === void 0 ? void 0 : row.clientExplanation);
|
|
275
|
+
setEditingRowId(row === null || row === void 0 ? void 0 : row.projectId);
|
|
276
|
+
} },
|
|
277
|
+
react_1.default.createElement(base_icons_1.IconPencil, { size: "sm" })))))),
|
|
278
|
+
react_1.default.createElement("b", { className: "flex flex-row flex-wrap justify-start items-center mt-2" },
|
|
279
|
+
"Supporting Documents:",
|
|
280
|
+
react_1.default.createElement("input", { id: "upload-file", type: "file", multiple: false, accept: ".pdf,.doc,.docx,.jpeg,.png,.gif,.csv", style: { display: 'none' }, ref: fileInputRef, onChange: handleUpload }),
|
|
281
|
+
react_1.default.createElement(base_ui_2.Button, { label: "Add File", 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(); }, size: "sm", color: "info", className: "mx-2", isLoading: uploadingFile }),
|
|
282
|
+
((row === null || row === void 0 ? void 0 : row.clientDocumentLinks)
|
|
283
|
+
? (typeof (row === null || row === void 0 ? void 0 : row.clientDocumentLinks) === 'string' ? (_b = row === null || row === void 0 ? void 0 : row.clientDocumentLinks) === null || _b === void 0 ? void 0 : _b.split(',') : [...row === null || row === void 0 ? void 0 : row.clientDocumentLinks])
|
|
284
|
+
: []).map((f, index) => (react_1.default.createElement("div", { key: index, className: "m-1" },
|
|
285
|
+
react_1.default.createElement(base_ui_1.Tag, { variant: "subtle", color: "success", label: f.split('%2F')[1], iconRight: react_1.default.createElement(base_icons_1.IconXCircle, null), onClick: () => {
|
|
286
|
+
handleDownloadDocument(row === null || row === void 0 ? void 0 : row.projectId, f.split('%2F')[1]);
|
|
287
|
+
} })))))))))))));
|
|
288
|
+
})),
|
|
289
|
+
updatedDispute && react_1.default.createElement("div", { className: "flex justify-end ml-auto mt-2" },
|
|
290
|
+
react_1.default.createElement(base_ui_2.Button, { label: "Update Dispute", color: "primary", isLoading: updatingDispute, onClick: () => handleSubmitDispute() }))));
|
|
291
|
+
};
|
|
292
|
+
exports.ClientDisputeProjectCard = ClientDisputeProjectCard;
|
|
@@ -122,7 +122,7 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
|
|
|
122
122
|
react_1.default.createElement("div", { className: "flex items-center justify-between" },
|
|
123
123
|
react_1.default.createElement("div", { className: "text-lg font-bold text-[#333333]" }, "Discussion Thread")),
|
|
124
124
|
react_1.default.createElement("div", { className: "rounded" },
|
|
125
|
-
react_1.default.createElement("div", { className: "space-y-6" }, messages.map((message) => (react_1.default.createElement("div", { key: message.id, className: `flex ${getMessageAlignment(message.sender.userTypeId)}` },
|
|
125
|
+
messages.length ? react_1.default.createElement("div", { className: "flex-1 max-h-[40vh] overflow-y-auto border rounded-md p-2 space-y-6" }, messages.map((message) => (react_1.default.createElement("div", { key: message.id, className: `flex ${getMessageAlignment(message.sender.userTypeId)}` },
|
|
126
126
|
react_1.default.createElement("div", { className: `flex space-x-4 ${getMessageOrder(message.sender.userTypeId)} ${getMessageAlignment(message.sender.userTypeId)}` },
|
|
127
127
|
react_1.default.createElement("div", { style: {
|
|
128
128
|
backgroundColor: getSenderBackgroundColor(message.sender.userTypeId),
|
|
@@ -137,7 +137,7 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
|
|
|
137
137
|
message.sender.lastName),
|
|
138
138
|
react_1.default.createElement("span", { className: "text-xs text-[#666666]" }, (0, dayjs_1.default)(message.createdAt).format('MMM D, YYYY • h:mm A'))),
|
|
139
139
|
react_1.default.createElement("div", { style: { backgroundColor: getSenderBackgroundColor(message.sender.userTypeId) }, className: "mt-1 p-3 rounded-lg" },
|
|
140
|
-
react_1.default.createElement("p", { className: `text-sm ${getHeaderAlignment(message.sender.userTypeId)}`, style: { color: getSenderTextColor(message.sender.userTypeId) } }, message.messageText)))))))),
|
|
140
|
+
react_1.default.createElement("p", { className: `text-sm ${getHeaderAlignment(message.sender.userTypeId)}`, style: { color: getSenderTextColor(message.sender.userTypeId) } }, message.messageText)))))))) : react_1.default.createElement(react_1.default.Fragment, null),
|
|
141
141
|
react_1.default.createElement("div", { ref: threadsEndRef }),
|
|
142
142
|
react_1.default.createElement("div", { className: "space-y-4 p-6 space-y-6 rounded mt-4", style: { backgroundColor: '#F5F7F9' } },
|
|
143
143
|
react_1.default.createElement("div", null,
|
|
@@ -5,7 +5,9 @@ interface InvoiceCardProps {
|
|
|
5
5
|
chatMessages: any[];
|
|
6
6
|
updateClientInvoiceDisputeMutation: any;
|
|
7
7
|
documentUploadUrl: string;
|
|
8
|
+
downloadDocumentUrl: string;
|
|
8
9
|
isInternal?: boolean;
|
|
10
|
+
refetchInvoiceDisputes: any;
|
|
9
11
|
}
|
|
10
|
-
export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, isInternal }: InvoiceCardProps) => JSX.Element;
|
|
12
|
+
export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, isInternal, refetchInvoiceDisputes, }: InvoiceCardProps) => JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -11,13 +11,17 @@ const InvoiceDetails_1 = require("./InvoiceDetails");
|
|
|
11
11
|
const DisputeSection_1 = require("./DisputeSection");
|
|
12
12
|
const DiscussionSection_1 = require("./DiscussionSection");
|
|
13
13
|
const DecisionSection_1 = require("./DecisionSection");
|
|
14
|
-
const
|
|
14
|
+
const ClientDisputeProjectCard_1 = require("./ClientDisputeProjectCard");
|
|
15
|
+
const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, isInternal = false, refetchInvoiceDisputes, }) => {
|
|
15
16
|
var _a, _b;
|
|
16
|
-
return (react_1.default.createElement(base_ui_1.Card, { className: "w-full bg-white rounded-lg shadow-sm overflow-hidden" },
|
|
17
|
+
return (react_1.default.createElement(base_ui_1.Card, { className: "w-full bg-white rounded-lg shadow-sm overflow-hidden mb-4" },
|
|
17
18
|
react_1.default.createElement(InvoiceHeader_1.InvoiceHeader, { invoice: clientInvoice }),
|
|
18
19
|
react_1.default.createElement("div", { className: "p-6 space-y-6" },
|
|
19
|
-
react_1.default.createElement(InvoiceDetails_1.InvoiceDetails, { invoice: clientInvoice }),
|
|
20
|
-
|
|
20
|
+
react_1.default.createElement(InvoiceDetails_1.InvoiceDetails, { invoice: clientInvoice, isInternal: isInternal }),
|
|
21
|
+
isInternal ?
|
|
22
|
+
react_1.default.createElement(DisputeSection_1.DisputeSection, { dispute: clientInvoice, documentUploadUrl: documentUploadUrl, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation })
|
|
23
|
+
:
|
|
24
|
+
react_1.default.createElement(ClientDisputeProjectCard_1.ClientDisputeProjectCard, { clientInvoice: clientInvoice, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, documentUploadUrl: documentUploadUrl, downloadDocumentUrl: downloadDocumentUrl, refetchInvoiceDisputes: refetchInvoiceDisputes }),
|
|
21
25
|
(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.chatEnabled) && (react_1.default.createElement(DiscussionSection_1.DiscussionSection, { disputeId: (_b = (_a = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id, currentUser: user, messages: chatMessages, onCreateMessage: createDisputeChatMessage, isInternal: isInternal })),
|
|
22
26
|
isInternal &&
|
|
23
27
|
react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: clientInvoice, onUpdateDispute: updateClientInvoiceDisputeMutation }))));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface InvoiceDetailsProps {
|
|
2
2
|
invoice: any;
|
|
3
|
+
isInternal: boolean;
|
|
3
4
|
}
|
|
4
|
-
export declare const InvoiceDetails: ({ invoice }: InvoiceDetailsProps) => JSX.Element;
|
|
5
|
+
export declare const InvoiceDetails: ({ invoice, isInternal }: InvoiceDetailsProps) => JSX.Element;
|
|
5
6
|
export {};
|
|
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
9
|
const DisputeProjectCard_1 = require("./DisputeProjectCard");
|
|
10
10
|
const core_1 = require("@material-ui/core");
|
|
11
|
-
const InvoiceDetails = ({ invoice }) => {
|
|
11
|
+
const InvoiceDetails = ({ invoice, isInternal = false }) => {
|
|
12
12
|
var _a;
|
|
13
13
|
const getStatusColor = (status) => {
|
|
14
14
|
switch (status) {
|
|
@@ -30,7 +30,7 @@ const InvoiceDetails = ({ invoice }) => {
|
|
|
30
30
|
react_1.default.createElement("span", { className: "text-xs text-[#666666]" },
|
|
31
31
|
"Last updated: ",
|
|
32
32
|
(0, dayjs_1.default)(invoice === null || invoice === void 0 ? void 0 : invoice.disputeUpdatedDate).format('MMM D, YYYY'))),
|
|
33
|
-
((_a = invoice === null || invoice === void 0 ? void 0 : invoice.disputeProjects) === null || _a === void 0 ? void 0 : _a.length) > 0 && (react_1.default.createElement("div", { className: "space-y-4" },
|
|
33
|
+
isInternal && ((_a = invoice === null || invoice === void 0 ? void 0 : invoice.disputeProjects) === null || _a === void 0 ? void 0 : _a.length) > 0 && (react_1.default.createElement("div", { className: "space-y-4" },
|
|
34
34
|
react_1.default.createElement("div", { className: "grid grid-cols-1 gap-4" }, invoice.disputeProjects.map((project) => (react_1.default.createElement(DisputeProjectCard_1.DisputeProjectCard, { key: project.id, project: project, client: invoice === null || invoice === void 0 ? void 0 : invoice.client, disputeDate: invoice === null || invoice === void 0 ? void 0 : invoice.disputeDate, disputeUpdatedDate: invoice === null || invoice === void 0 ? void 0 : invoice.disputeUpdatedDate }))))))));
|
|
35
35
|
};
|
|
36
36
|
exports.InvoiceDetails = InvoiceDetails;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
interface OrgChartProps {
|
|
2
|
-
openModal: boolean;
|
|
3
|
-
setOpenModal: (openModal: boolean) => void;
|
|
4
|
-
expertFirms: any;
|
|
5
|
-
firstName: string;
|
|
6
|
-
lastName: string;
|
|
7
|
-
imageUrl?: string;
|
|
8
|
-
primaryServiceLine: string;
|
|
9
|
-
city: string;
|
|
10
|
-
stateAbbreviation: string;
|
|
11
|
-
paroTenure?: string;
|
|
12
|
-
isPublicProfile?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const OrganizationChart: ({ openModal, setOpenModal, expertFirms, firstName, lastName, imageUrl, primaryServiceLine, city, stateAbbreviation, paroTenure, isPublicProfile }: OrgChartProps) => JSX.Element;
|
|
15
|
-
export {};
|
|
1
|
+
interface OrgChartProps {
|
|
2
|
+
openModal: boolean;
|
|
3
|
+
setOpenModal: (openModal: boolean) => void;
|
|
4
|
+
expertFirms: any;
|
|
5
|
+
firstName: string;
|
|
6
|
+
lastName: string;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
primaryServiceLine: string;
|
|
9
|
+
city: string;
|
|
10
|
+
stateAbbreviation: string;
|
|
11
|
+
paroTenure?: string;
|
|
12
|
+
isPublicProfile?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const OrganizationChart: ({ openModal, setOpenModal, expertFirms, firstName, lastName, imageUrl, primaryServiceLine, city, stateAbbreviation, paroTenure, isPublicProfile }: OrgChartProps) => JSX.Element;
|
|
15
|
+
export {};
|