@paro.io/expert-shared-components 1.11.3 → 1.11.4
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/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/DecisionSection.d.ts +7 -0
- package/lib/components/Invoices/DecisionSection.js +95 -0
- package/lib/components/Invoices/DiscussionSection.d.ts +19 -0
- package/lib/components/Invoices/DiscussionSection.js +163 -0
- package/lib/components/Invoices/DisputeProjectCard.d.ts +20 -0
- package/lib/components/Invoices/DisputeProjectCard.js +79 -0
- package/lib/components/Invoices/DisputeSection.d.ts +7 -0
- package/lib/components/Invoices/DisputeSection.js +94 -0
- package/lib/components/Invoices/InvoiceCard.d.ts +2 -1
- package/lib/components/Invoices/InvoiceCard.js +16 -254
- package/lib/components/Invoices/InvoiceDetails.d.ts +5 -0
- package/lib/components/Invoices/InvoiceDetails.js +34 -0
- package/lib/components/Invoices/InvoiceHeader.d.ts +5 -0
- package/lib/components/Invoices/InvoiceHeader.js +29 -0
- 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/package.json +61 -61
|
@@ -1,263 +1,25 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
4
|
};
|
|
37
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
6
|
exports.InvoiceCard = void 0;
|
|
39
|
-
const react_1 =
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
40
8
|
const base_ui_1 = require("@paro.io/base-ui");
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
border: "1px solid",
|
|
57
|
-
borderColor: "#E2E8F0",
|
|
58
|
-
},
|
|
59
|
-
visuallyHidden: {
|
|
60
|
-
border: 0,
|
|
61
|
-
clip: "rect(0 0 0 0)",
|
|
62
|
-
height: 1,
|
|
63
|
-
margin: -1,
|
|
64
|
-
overflow: "hidden",
|
|
65
|
-
padding: 0,
|
|
66
|
-
position: "absolute",
|
|
67
|
-
top: 20,
|
|
68
|
-
width: 1,
|
|
69
|
-
},
|
|
70
|
-
tableCell: {
|
|
71
|
-
width: "auto",
|
|
72
|
-
},
|
|
73
|
-
collapse: {
|
|
74
|
-
backgroundColor: "#FFFFFF",
|
|
75
|
-
width: "100%",
|
|
76
|
-
borderRadius: 6,
|
|
77
|
-
marginLeft: 12,
|
|
78
|
-
marginTop: 12,
|
|
79
|
-
},
|
|
80
|
-
tableHead: {
|
|
81
|
-
backgroundColor: "#F1F5F9",
|
|
82
|
-
borderRadius: 6,
|
|
83
|
-
width: "100%",
|
|
84
|
-
},
|
|
85
|
-
}));
|
|
86
|
-
const headCells = [
|
|
87
|
-
{ id: 'project', label: 'Project' },
|
|
88
|
-
{ id: 'projectType', label: 'Project Type' },
|
|
89
|
-
{ id: 'hours', label: 'Hours' },
|
|
90
|
-
{ id: 'amount', label: 'Amount' },
|
|
91
|
-
{ id: 'reason', label: 'Reason' },
|
|
92
|
-
];
|
|
93
|
-
const ACCEPTED_FILE_TYPES = [
|
|
94
|
-
'application/pdf',
|
|
95
|
-
'application/msword',
|
|
96
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
97
|
-
'image/jpeg',
|
|
98
|
-
'image/png',
|
|
99
|
-
'text/csv',
|
|
100
|
-
];
|
|
101
|
-
const validateFileUpload = (file) => {
|
|
102
|
-
if (!file) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
if (!ACCEPTED_FILE_TYPES.includes(file.type)) {
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
return true;
|
|
109
|
-
};
|
|
110
|
-
const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceMutation }) => {
|
|
111
|
-
var _a, _b, _c, _d, _e, _f;
|
|
112
|
-
const [expandRow, setExpandRow] = (0, react_1.useState)(null);
|
|
113
|
-
const classes = useStyles();
|
|
114
|
-
const [projects, setProjects] = (0, react_1.useState)(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects);
|
|
115
|
-
const [editingRowId, setEditingRowId] = (0, react_1.useState)(null);
|
|
116
|
-
const [editedExplanation, setEditedExplanation] = (0, react_1.useState)('');
|
|
117
|
-
const [updatedDispute, setUpdateDispute] = (0, react_1.useState)(false);
|
|
118
|
-
const [updatingDispute, setUpdatingDispute] = (0, react_1.useState)(false);
|
|
119
|
-
(0, react_1.useEffect)(() => {
|
|
120
|
-
if (JSON.stringify(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) !== JSON.stringify(projects)) {
|
|
121
|
-
setUpdateDispute(true);
|
|
122
|
-
}
|
|
123
|
-
}, [projects]);
|
|
124
|
-
const fileInputRef = (0, react_1.useRef)(null);
|
|
125
|
-
const handleChange = (e, field) => {
|
|
126
|
-
const updatedProject = field === "clientDocumentLinks" ? projects.map((project) => {
|
|
127
|
-
if (project.projectId === expandRow) {
|
|
128
|
-
return Object.assign(Object.assign({}, project), { clientDocumentLinks: [...project.clientDocumentLinks, ...e.filter((name) => !project.clientDocumentLinks.includes(name))] });
|
|
129
|
-
}
|
|
130
|
-
return project;
|
|
131
|
-
}) : projects.map((project) => {
|
|
132
|
-
return Object.assign(Object.assign({}, project), { [field]: e.target.value });
|
|
133
|
-
});
|
|
134
|
-
//upload files mutation
|
|
135
|
-
setProjects(updatedProject);
|
|
136
|
-
};
|
|
137
|
-
const handleUpload = (event) => {
|
|
138
|
-
const selectedFiles = event.target.files;
|
|
139
|
-
if (!selectedFiles)
|
|
140
|
-
return;
|
|
141
|
-
const validFiles = Array.from(selectedFiles)
|
|
142
|
-
.filter(file => validateFileUpload(file))
|
|
143
|
-
.map(file => file.name);
|
|
144
|
-
if (validFiles.length === 0)
|
|
145
|
-
return;
|
|
146
|
-
handleChange(validFiles, "clientDocumentLinks");
|
|
147
|
-
if (fileInputRef.current) {
|
|
148
|
-
fileInputRef.current.value = '';
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
const handleEditExplanation = (projectId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
152
|
-
setProjects((prev) => prev.map((p) => p.projectId === projectId
|
|
153
|
-
? Object.assign(Object.assign({}, p), { clientExplanation: editedExplanation }) : p));
|
|
154
|
-
setEditingRowId(null);
|
|
155
|
-
});
|
|
156
|
-
const handleSubmitDispute = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
157
|
-
setUpdatingDispute(true);
|
|
158
|
-
try {
|
|
159
|
-
yield updateClientInvoiceMutation({
|
|
160
|
-
variables: {
|
|
161
|
-
input: {
|
|
162
|
-
disputeId: projects[0].id,
|
|
163
|
-
projectDisputes: projects.map((project) => ({
|
|
164
|
-
projectId: project.projectId,
|
|
165
|
-
disputeReasonCode: project.disputeReasonCode,
|
|
166
|
-
disputeType: project.disputeType,
|
|
167
|
-
disputeHours: project.disputeHours,
|
|
168
|
-
disputeAmount: project.disputeAmount,
|
|
169
|
-
clientExplanation: project.clientExplanation,
|
|
170
|
-
clientDocumentLinks: project.clientDocumentLinks,
|
|
171
|
-
})),
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}).then(() => {
|
|
175
|
-
(0, utils_1.showToast)('success', 'Dispute updation successfull!');
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
catch (error) {
|
|
179
|
-
console.error("Failed to update dispute", error);
|
|
180
|
-
(0, utils_1.showToast)('warning', 'Failed to update dispute');
|
|
181
|
-
}
|
|
182
|
-
finally {
|
|
183
|
-
setUpdatingDispute(false);
|
|
184
|
-
setUpdateDispute(false);
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
return (react_1.default.createElement(base_ui_1.Card, { className: `mx-1 my-4 md:mx-8 flex md:flex items-center justify-between rounded flex-col` },
|
|
188
|
-
react_1.default.createElement("div", { key: (_a = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.invoice) === null || _a === void 0 ? void 0 : _a.id, className: "bg-[#0F172A] text-white mb-1 p-4 relative top-0 left-0 w-full rounded flex flex-row justify-between" },
|
|
189
|
-
react_1.default.createElement("b", null,
|
|
190
|
-
"Dispute Invoice #", (_b = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.invoice) === null || _b === void 0 ? void 0 :
|
|
191
|
-
_b.id),
|
|
192
|
-
react_1.default.createElement("p", null,
|
|
193
|
-
"Dispute Date: ", clientInvoice === null || clientInvoice === void 0 ? void 0 :
|
|
194
|
-
clientInvoice.disputeDate),
|
|
195
|
-
react_1.default.createElement("p", null,
|
|
196
|
-
"Invoice Date: ", (_c = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.invoice) === null || _c === void 0 ? void 0 :
|
|
197
|
-
_c.dateGenerated),
|
|
198
|
-
react_1.default.createElement("p", null,
|
|
199
|
-
"Expert Name: ",
|
|
200
|
-
((_d = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.freelancer) === null || _d === void 0 ? void 0 : _d.firstName) + " " + ((_e = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.freelancer) === null || _e === void 0 ? void 0 : _e.lastName))),
|
|
201
|
-
react_1.default.createElement("div", { className: "w-[95%] m-2" },
|
|
202
|
-
react_1.default.createElement("div", { className: "flex flex-row justify-start items-center gap-4 mr-auto mb-2" },
|
|
203
|
-
react_1.default.createElement("div", null,
|
|
204
|
-
(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.status) === 'InProgress' &&
|
|
205
|
-
react_1.default.createElement(base_ui_1.Tag, { color: "warning", label: "In Progress", variant: "subtle" }),
|
|
206
|
-
(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.status) === 'Resolved' &&
|
|
207
|
-
react_1.default.createElement(base_ui_1.Tag, { color: "success", label: "Resolved", variant: "subtle" }),
|
|
208
|
-
(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.status) === 'UnderReview' &&
|
|
209
|
-
react_1.default.createElement(base_ui_1.Tag, { color: "info", label: "Under Review", variant: "subtle" })),
|
|
210
|
-
react_1.default.createElement("div", { className: "flex items-center" },
|
|
211
|
-
"Last updated: ",
|
|
212
|
-
(0, dayjs_1.default)(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeUpdatedDate).format("YYYY-MM-DD"))),
|
|
213
|
-
react_1.default.createElement(core_1.Table, { className: classes.table, "aria-labelledby": "tableTitle", size: 'medium', "aria-label": "enhanced table" },
|
|
214
|
-
react_1.default.createElement(core_1.TableHead, { className: classes.tableHead },
|
|
215
|
-
react_1.default.createElement(core_1.TableRow, null,
|
|
216
|
-
headCells.map((headcell) => {
|
|
217
|
-
return react_1.default.createElement(core_1.TableCell, { key: headcell.id, className: classes.tableCell }, headcell.label);
|
|
218
|
-
}),
|
|
219
|
-
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell }))), projects === null || projects === void 0 ? void 0 :
|
|
220
|
-
projects.map((row) => {
|
|
221
|
-
var _a;
|
|
222
|
-
return (react_1.default.createElement(react_1.default.Fragment, { key: row.projectId },
|
|
223
|
-
react_1.default.createElement(core_1.TableRow, null,
|
|
224
|
-
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, ((_a = row.project) === null || _a === void 0 ? void 0 : _a.name) || "N/A"),
|
|
225
|
-
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.disputeType),
|
|
226
|
-
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.disputeHours),
|
|
227
|
-
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.disputeAmount),
|
|
228
|
-
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.disputeReasonCode),
|
|
229
|
-
react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell },
|
|
230
|
-
react_1.default.createElement(core_1.IconButton, { onClick: () => setExpandRow(expandRow === row.projectId ? null : row.projectId) }, expandRow === row.projectId ? react_1.default.createElement(base_icons_1.IconChevronUp, null) : react_1.default.createElement(base_icons_1.IconChevronDown, null)))),
|
|
231
|
-
expandRow === row.projectId && (react_1.default.createElement(core_1.TableRow, { key: `expanded-${row.projectId}` },
|
|
232
|
-
react_1.default.createElement(core_1.TableCell, { colSpan: headCells.length + 1, style: { paddingBottom: 0, paddingTop: 0 } },
|
|
233
|
-
react_1.default.createElement(core_1.Collapse, { in: true, timeout: "auto", unmountOnExit: true },
|
|
234
|
-
react_1.default.createElement(react_1.default.Fragment, null,
|
|
235
|
-
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" },
|
|
236
|
-
react_1.default.createElement("b", { className: "mb-2 flex flex-row justify-start items-center" },
|
|
237
|
-
"Explanation:",
|
|
238
|
-
editingRowId === row.projectId ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
239
|
-
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" }),
|
|
240
|
-
react_1.default.createElement(base_ui_2.Button, { label: "Save", size: "md", color: "success", className: "ml-2 mt-1", onClick: () => { handleEditExplanation(row.projectId); } }))) : (react_1.default.createElement(base_ui_2.Button, { label: "Edit", iconLeft: react_1.default.createElement(base_icons_1.IconPencil, { size: "sm" }), onClick: () => {
|
|
241
|
-
setEditedExplanation(row.clientExplanation);
|
|
242
|
-
setEditingRowId(row.projectId);
|
|
243
|
-
}, size: "sm", color: "info", className: "ml-6" }))),
|
|
244
|
-
react_1.default.createElement("p", null, row.clientExplanation),
|
|
245
|
-
react_1.default.createElement("b", { className: "flex flex-row flex-wrap justify-start items-center mt-2" },
|
|
246
|
-
"Supporting Documents:",
|
|
247
|
-
react_1.default.createElement("input", { id: "upload-file", type: "file", multiple: true, accept: ".pdf,.doc,.docx,.jpeg,.png,.gif,.csv", style: { display: 'none' }, ref: fileInputRef, onChange: handleUpload }),
|
|
248
|
-
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" }),
|
|
249
|
-
(Array.isArray(row.clientDocumentLinks)
|
|
250
|
-
? row.clientDocumentLinks
|
|
251
|
-
: []).map((f, index) => (react_1.default.createElement("div", { key: index, className: "mx-2" },
|
|
252
|
-
react_1.default.createElement(base_ui_1.Tag, { variant: "subtle", color: "success", label: f, iconRight: react_1.default.createElement(base_icons_1.IconXCircle, null), onClick: () => {
|
|
253
|
-
const updatedProjects = projects.map((p) => p.projectId === row.projectId
|
|
254
|
-
? Object.assign(Object.assign({}, p), { clientDocumentLinks: p.clientDocumentLinks.filter((file) => file !== f) }) : p);
|
|
255
|
-
setProjects(updatedProjects);
|
|
256
|
-
} })))))))))))));
|
|
257
|
-
})),
|
|
258
|
-
updatedDispute && react_1.default.createElement("div", { className: "flex justify-end ml-auto mt-2" },
|
|
259
|
-
react_1.default.createElement(base_ui_2.Button, { label: "Update Dispute", color: "primary", isLoading: updatingDispute, onClick: () => handleSubmitDispute() })),
|
|
260
|
-
(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.chatEnabled) && react_1.default.createElement("div", { className: "flex flex-row w-full my-2 justify-start" },
|
|
261
|
-
react_1.default.createElement(DiscussionThread_1.DiscussionThread, { disputeId: (_f = projects[0]) === null || _f === void 0 ? void 0 : _f.id, currentUser: user, initialThreads: chatMessages, createDisputeChatMessage: createDisputeChatMessage })))));
|
|
9
|
+
const InvoiceHeader_1 = require("./InvoiceHeader");
|
|
10
|
+
const InvoiceDetails_1 = require("./InvoiceDetails");
|
|
11
|
+
const DisputeSection_1 = require("./DisputeSection");
|
|
12
|
+
const DiscussionSection_1 = require("./DiscussionSection");
|
|
13
|
+
const DecisionSection_1 = require("./DecisionSection");
|
|
14
|
+
const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceMutation, refetchInvoiceDisputes, }) => {
|
|
15
|
+
var _a, _b, _c;
|
|
16
|
+
return (react_1.default.createElement(base_ui_1.Card, { className: "w-full bg-white rounded-lg shadow-sm overflow-hidden" },
|
|
17
|
+
react_1.default.createElement(InvoiceHeader_1.InvoiceHeader, { invoice: clientInvoice }),
|
|
18
|
+
react_1.default.createElement("div", { className: "p-6 space-y-6" },
|
|
19
|
+
react_1.default.createElement(InvoiceDetails_1.InvoiceDetails, { invoice: clientInvoice }),
|
|
20
|
+
react_1.default.createElement(DisputeSection_1.DisputeSection, { dispute: clientInvoice, onUpdateDispute: updateClientInvoiceMutation, onRefetch: refetchInvoiceDisputes }),
|
|
21
|
+
(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 })),
|
|
22
|
+
((_c = user === null || user === void 0 ? void 0 : user.app_metadata) === null || _c === void 0 ? void 0 : _c.userTypeId) === 2 &&
|
|
23
|
+
react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: clientInvoice, onUpdateDispute: updateClientInvoiceMutation, onRefetch: refetchInvoiceDisputes }))));
|
|
262
24
|
};
|
|
263
25
|
exports.InvoiceCard = InvoiceCard;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InvoiceDetails = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const base_ui_1 = require("@paro.io/base-ui");
|
|
9
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
10
|
+
const DisputeProjectCard_1 = require("./DisputeProjectCard");
|
|
11
|
+
const InvoiceDetails = ({ invoice }) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const getStatusColor = (status) => {
|
|
14
|
+
switch (status) {
|
|
15
|
+
case 'InProgress':
|
|
16
|
+
return 'warning';
|
|
17
|
+
case 'UnderReview':
|
|
18
|
+
return 'info';
|
|
19
|
+
case 'Resolved':
|
|
20
|
+
return 'success';
|
|
21
|
+
default:
|
|
22
|
+
return 'default';
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return (react_1.default.createElement("div", { className: "space-y-6" },
|
|
26
|
+
react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
27
|
+
react_1.default.createElement(base_ui_1.Tag, { label: invoice === null || invoice === void 0 ? void 0 : invoice.status, variant: "subtle", color: getStatusColor(invoice === null || invoice === void 0 ? void 0 : invoice.status) }),
|
|
28
|
+
react_1.default.createElement("span", { className: "text-xs text-[#666666]" },
|
|
29
|
+
"Last updated: ",
|
|
30
|
+
(0, dayjs_1.default)(invoice === null || invoice === void 0 ? void 0 : invoice.disputeUpdatedDate).format('YYYY-MM-DD'))),
|
|
31
|
+
((_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" },
|
|
32
|
+
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 }))))))));
|
|
33
|
+
};
|
|
34
|
+
exports.InvoiceDetails = InvoiceDetails;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InvoiceHeader = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
|
+
const InvoiceHeader = ({ invoice }) => {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
return (react_1.default.createElement("div", { className: "bg-[#0F172A] text-white px-6 py-4 rounded-t-lg flex items-center justify-between font-arial" },
|
|
12
|
+
react_1.default.createElement("div", { className: "flex items-center space-x-8" },
|
|
13
|
+
react_1.default.createElement("div", null,
|
|
14
|
+
react_1.default.createElement("span", { className: "text-sm font-bold" }, "Dispute Invoice #"),
|
|
15
|
+
react_1.default.createElement("span", { className: "ml-2" }, (_a = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _a === void 0 ? void 0 : _a.id)),
|
|
16
|
+
react_1.default.createElement("div", null,
|
|
17
|
+
react_1.default.createElement("span", { className: "text-sm font-bold" }, "Dispute Date: "),
|
|
18
|
+
react_1.default.createElement("span", { className: "ml-2" }, (0, dayjs_1.default)(invoice === null || invoice === void 0 ? void 0 : invoice.disputeDate).format('MMM D, YYYY'))),
|
|
19
|
+
react_1.default.createElement("div", null,
|
|
20
|
+
react_1.default.createElement("span", { className: "text-sm font-bold" }, "Invoice Date: "),
|
|
21
|
+
react_1.default.createElement("span", { className: "ml-2" }, (0, dayjs_1.default)((_b = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _b === void 0 ? void 0 : _b.dateGenerated).format('MMM D, YYYY')))),
|
|
22
|
+
react_1.default.createElement("div", null,
|
|
23
|
+
react_1.default.createElement("span", { className: "text-sm font-bold" }, "Expert Name: "),
|
|
24
|
+
react_1.default.createElement("span", { className: "ml-2" }, (_c = invoice === null || invoice === void 0 ? void 0 : invoice.freelancer) === null || _c === void 0 ? void 0 :
|
|
25
|
+
_c.firstName,
|
|
26
|
+
" ", (_d = invoice === null || invoice === void 0 ? void 0 : invoice.freelancer) === null || _d === void 0 ? void 0 :
|
|
27
|
+
_d.lastName))));
|
|
28
|
+
};
|
|
29
|
+
exports.InvoiceHeader = InvoiceHeader;
|
|
@@ -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 {};
|