@paro.io/expert-shared-components 1.12.32 → 1.12.34
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 +16 -7
- package/lib/components/Invoices/DecisionSection.d.ts +1 -2
- package/lib/components/Invoices/DecisionSection.js +25 -56
- package/lib/components/Invoices/DisputeSection.d.ts +2 -1
- package/lib/components/Invoices/DisputeSection.js +3 -3
- package/lib/components/Invoices/InvoiceCard.d.ts +2 -2
- package/lib/components/Invoices/InvoiceCard.js +5 -9
- package/lib/components/Invoices/InvoiceDetails.d.ts +2 -1
- package/lib/components/Invoices/InvoiceDetails.js +3 -3
- package/lib/components/Invoices/TestDecisionSection.d.ts +1 -1
- package/lib/components/Invoices/TestDecisionSection.js +126 -126
- 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
|
@@ -42,15 +42,14 @@ const RESOLUTION_OPTIONS = [
|
|
|
42
42
|
{ value: 'DECLINED', label: 'Decline Dispute' },
|
|
43
43
|
{ value: 'PARTIAL', label: 'Partial Approval' },
|
|
44
44
|
];
|
|
45
|
-
const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, updateClientInvoiceDisputeMutation, invoiceSummary, user, getClientInvoiceSummaryByMonth,
|
|
46
|
-
var _a, _b
|
|
45
|
+
const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, updateClientInvoiceDisputeMutation, invoiceSummary, user, getClientInvoiceSummaryByMonth, }) => {
|
|
46
|
+
var _a, _b;
|
|
47
47
|
const totalDisputeHours = (_a = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _a === void 0 ? void 0 : _a.reduce((acc, project) => acc + (project === null || project === void 0 ? void 0 : project.disputeHours), 0);
|
|
48
48
|
const [resolution, setResolution] = (0, react_1.useState)('');
|
|
49
49
|
const [approvedHours, setApprovedHours] = (0, react_1.useState)(totalDisputeHours);
|
|
50
50
|
const [projectApprovedHours, setProjectApprovedHours] = (0, react_1.useState)({});
|
|
51
51
|
const [isSubmitting, setIsSubmitting] = (0, react_1.useState)(false);
|
|
52
52
|
const [showHoursModal, setShowHoursModal] = (0, react_1.useState)(false);
|
|
53
|
-
const isDisputePaid = ((_b = dispute === null || dispute === void 0 ? void 0 : dispute.invoice) === null || _b === void 0 ? void 0 : _b.clientInvoiceStatusId) === 4 || ((_c = dispute === null || dispute === void 0 ? void 0 : dispute.invoice) === null || _c === void 0 ? void 0 : _c.clientInvoiceStatusId) === 8;
|
|
54
53
|
// Initialize project approved hours when resolution changes to PARTIAL
|
|
55
54
|
const handleResolutionChange = (newResolution) => {
|
|
56
55
|
var _a;
|
|
@@ -85,6 +84,7 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
|
|
|
85
84
|
const handleApproveClick = () => {
|
|
86
85
|
if (!resolution)
|
|
87
86
|
return;
|
|
87
|
+
// Show modal for PARTIAL or APPROVED resolutions regardless of dispute type
|
|
88
88
|
if (resolution === 'PARTIAL' || resolution === 'APPROVED') {
|
|
89
89
|
setShowHoursModal(true);
|
|
90
90
|
}
|
|
@@ -100,13 +100,19 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
|
|
|
100
100
|
var _a, _b, _c;
|
|
101
101
|
setIsSubmitting(true);
|
|
102
102
|
try {
|
|
103
|
+
const resolutionType = resolution === 'APPROVED' ? 'Upheld' : 'Reduced';
|
|
104
|
+
const disputeProjectUpdates = ((_a = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _a === void 0 ? void 0 : _a.map((project) => ({
|
|
105
|
+
projectId: project.projectId,
|
|
106
|
+
resolutionMode: 'Direct',
|
|
107
|
+
resolutionType: resolution === 'DECLINED' ? 'Canceled' : resolutionType
|
|
108
|
+
}))) || [];
|
|
103
109
|
let calculatedApprovedAmount = 0;
|
|
104
|
-
const fullDisputeAmount = (
|
|
110
|
+
const fullDisputeAmount = (_b = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _b === void 0 ? void 0 : _b.reduce((acc, project) => acc + project.disputeAmount, 0);
|
|
105
111
|
if (resolution === 'APPROVED') {
|
|
106
112
|
calculatedApprovedAmount = fullDisputeAmount;
|
|
107
113
|
}
|
|
108
114
|
else {
|
|
109
|
-
(
|
|
115
|
+
(_c = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _c === void 0 ? void 0 : _c.forEach((project) => {
|
|
110
116
|
var _a, _b;
|
|
111
117
|
const approvedForProject = projectApprovedHours[project.projectId] || 0;
|
|
112
118
|
if (project.disputeType === 'Hourly') {
|
|
@@ -118,50 +124,6 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
|
|
|
118
124
|
}
|
|
119
125
|
});
|
|
120
126
|
}
|
|
121
|
-
if (submissionData) {
|
|
122
|
-
if (isDisputePaid) {
|
|
123
|
-
yield addClientCredit({
|
|
124
|
-
variables: {
|
|
125
|
-
input: {
|
|
126
|
-
clientId: submissionData.clientId,
|
|
127
|
-
amount: calculatedApprovedAmount,
|
|
128
|
-
description: `Credit from Dispute #${dispute.disputeId} - Invoice #${dispute.invoice.id}`,
|
|
129
|
-
updatedDate: new Date().toISOString()
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
yield updateInvoiceMutation({
|
|
136
|
-
variables: {
|
|
137
|
-
input: submissionData.input,
|
|
138
|
-
clientId: submissionData.clientId,
|
|
139
|
-
invoiceId: submissionData.invoiceId,
|
|
140
|
-
dateGenerated: submissionData.dateGenerated,
|
|
141
|
-
updateDescription: submissionData.updateDescription,
|
|
142
|
-
freelancerIds: submissionData.freelancerIds
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
let resolutionType;
|
|
148
|
-
if (isDisputePaid) {
|
|
149
|
-
resolutionType = 'FutureCredit';
|
|
150
|
-
}
|
|
151
|
-
else if (resolution === 'APPROVED') {
|
|
152
|
-
resolutionType = 'Upheld';
|
|
153
|
-
}
|
|
154
|
-
else if (resolution === 'PARTIAL') {
|
|
155
|
-
resolutionType = 'Reduced';
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
resolutionType = 'Canceled';
|
|
159
|
-
}
|
|
160
|
-
const disputeProjectUpdates = ((_c = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _c === void 0 ? void 0 : _c.map((project) => ({
|
|
161
|
-
projectId: project.projectId,
|
|
162
|
-
resolutionMode: 'Direct',
|
|
163
|
-
resolutionType: resolutionType
|
|
164
|
-
}))) || [];
|
|
165
127
|
const updateData = {
|
|
166
128
|
disputeId: dispute.disputeId,
|
|
167
129
|
status: "Resolved",
|
|
@@ -169,17 +131,24 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
|
|
|
169
131
|
finalDecisionOwnerId: (user === null || user === void 0 ? void 0 : user.userId) || null,
|
|
170
132
|
projectDisputes: disputeProjectUpdates
|
|
171
133
|
};
|
|
134
|
+
if (submissionData) {
|
|
135
|
+
yield updateInvoiceMutation({
|
|
136
|
+
variables: {
|
|
137
|
+
input: submissionData.input,
|
|
138
|
+
clientId: submissionData.clientId,
|
|
139
|
+
invoiceId: submissionData.invoiceId,
|
|
140
|
+
dateGenerated: submissionData.dateGenerated,
|
|
141
|
+
updateDescription: submissionData.updateDescription,
|
|
142
|
+
freelancerIds: submissionData.freelancerIds
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
172
146
|
yield onUpdateDispute({
|
|
173
147
|
variables: {
|
|
174
148
|
input: updateData,
|
|
175
149
|
},
|
|
176
150
|
});
|
|
177
|
-
|
|
178
|
-
(0, utils_1.showToast)('success', `Future credit applied: $${calculatedApprovedAmount} to Client ${dispute.client.name}'s balance`);
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
(0, utils_1.showToast)('success', 'Thank you for resolving the dispute. The invoice has been updated with the new hours.');
|
|
182
|
-
}
|
|
151
|
+
(0, utils_1.showToast)('success', 'Thank you for resolving the dispute. The invoice has been updated with the new hours.');
|
|
183
152
|
}
|
|
184
153
|
catch (error) {
|
|
185
154
|
console.error('Failed to update dispute:', error);
|
|
@@ -189,7 +158,7 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
|
|
|
189
158
|
setIsSubmitting(false);
|
|
190
159
|
}
|
|
191
160
|
});
|
|
192
|
-
const isPartialWithMultipleProjects = resolution === 'PARTIAL' && ((
|
|
161
|
+
const isPartialWithMultipleProjects = resolution === 'PARTIAL' && ((_b = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _b === void 0 ? void 0 : _b.length) > 0;
|
|
193
162
|
const isValidPartialApproval = () => {
|
|
194
163
|
if (resolution !== 'PARTIAL')
|
|
195
164
|
return true;
|
|
@@ -3,7 +3,8 @@ interface DisputeSectionProps {
|
|
|
3
3
|
documentUploadUrl: string;
|
|
4
4
|
downloadDocumentUrl: string;
|
|
5
5
|
bucketName: string;
|
|
6
|
+
isInternal: boolean;
|
|
6
7
|
updateClientInvoiceDisputeMutation: (variables: any) => Promise<any>;
|
|
7
8
|
}
|
|
8
|
-
export declare const DisputeSection: ({ dispute, documentUploadUrl, downloadDocumentUrl, bucketName, updateClientInvoiceDisputeMutation, }: DisputeSectionProps) => JSX.Element;
|
|
9
|
+
export declare const DisputeSection: ({ dispute, documentUploadUrl, downloadDocumentUrl, bucketName, isInternal, updateClientInvoiceDisputeMutation, }: DisputeSectionProps) => JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -47,7 +47,7 @@ const ACCEPTED_FILE_TYPES = [
|
|
|
47
47
|
'image/png',
|
|
48
48
|
'text/csv',
|
|
49
49
|
];
|
|
50
|
-
const DisputeSection = ({ dispute, documentUploadUrl, downloadDocumentUrl, bucketName, updateClientInvoiceDisputeMutation, }) => {
|
|
50
|
+
const DisputeSection = ({ dispute, documentUploadUrl, downloadDocumentUrl, bucketName, isInternal, updateClientInvoiceDisputeMutation, }) => {
|
|
51
51
|
var _a, _b, _c;
|
|
52
52
|
const expertFileInputRef = (0, react_1.useRef)(null);
|
|
53
53
|
const clientFileInputRef = (0, react_1.useRef)(null);
|
|
@@ -123,7 +123,7 @@ const DisputeSection = ({ dispute, documentUploadUrl, downloadDocumentUrl, bucke
|
|
|
123
123
|
}
|
|
124
124
|
} })))),
|
|
125
125
|
react_1.default.createElement("div", { className: "w-full mt-2" },
|
|
126
|
-
react_1.default.createElement(base_ui_1.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = clientFileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, size: "sm", color: "info", className: "bg-white border border-[#248384] text-[#248384]" })))))),
|
|
126
|
+
react_1.default.createElement(base_ui_1.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = clientFileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, size: "sm", color: "info", className: "bg-white border border-[#248384] text-[#248384]", disabled: isInternal })))))),
|
|
127
127
|
react_1.default.createElement("div", { className: "space-y-4" },
|
|
128
128
|
react_1.default.createElement("div", { className: "flex items-center justify-between" },
|
|
129
129
|
react_1.default.createElement("div", { className: "text-lg font-bold text-[#333333]" }, "Expert Rebuttal")),
|
|
@@ -146,6 +146,6 @@ const DisputeSection = ({ dispute, documentUploadUrl, downloadDocumentUrl, bucke
|
|
|
146
146
|
}
|
|
147
147
|
} })))),
|
|
148
148
|
react_1.default.createElement("div", { className: "w-full mt-2" },
|
|
149
|
-
react_1.default.createElement(base_ui_1.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = expertFileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, size: "sm", color: "info", className: "bg-white border border-[#248384] text-[#248384]" }))))))));
|
|
149
|
+
react_1.default.createElement(base_ui_1.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = expertFileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, size: "sm", color: "info", className: "bg-white border border-[#248384] text-[#248384]", disabled: isInternal }))))))));
|
|
150
150
|
};
|
|
151
151
|
exports.DisputeSection = DisputeSection;
|
|
@@ -13,7 +13,7 @@ interface InvoiceCardProps {
|
|
|
13
13
|
isClient?: boolean;
|
|
14
14
|
bucketName?: string;
|
|
15
15
|
reactAppUrl?: string;
|
|
16
|
-
|
|
16
|
+
isLateDisputeAllowed?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, updateInvoiceMutation, getClientInvoiceSummaryByMonth, invoiceSummary, documentUploadUrl, downloadDocumentUrl, isInternal, isClient, bucketName, reactAppUrl,
|
|
18
|
+
export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, updateInvoiceMutation, getClientInvoiceSummaryByMonth, invoiceSummary, documentUploadUrl, downloadDocumentUrl, isInternal, isClient, bucketName, reactAppUrl, isLateDisputeAllowed, }: InvoiceCardProps) => JSX.Element;
|
|
19
19
|
export {};
|
|
@@ -34,29 +34,25 @@ const DisputeSection_1 = require("./DisputeSection");
|
|
|
34
34
|
const DiscussionSection_1 = require("./DiscussionSection");
|
|
35
35
|
const DecisionSection_1 = require("./DecisionSection");
|
|
36
36
|
const ClientDisputeProjectCard_1 = require("./ClientDisputeProjectCard");
|
|
37
|
-
const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, updateInvoiceMutation, getClientInvoiceSummaryByMonth, invoiceSummary, documentUploadUrl, downloadDocumentUrl, isInternal = false, isClient = false, bucketName, reactAppUrl,
|
|
38
|
-
var _a;
|
|
39
|
-
const envUrl = reactAppUrl === null || reactAppUrl === void 0 ? void 0 : reactAppUrl.split('.')[1];
|
|
40
|
-
const rolesUrl = `https://app.${envUrl}.io/roles`;
|
|
37
|
+
const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, updateInvoiceMutation, getClientInvoiceSummaryByMonth, invoiceSummary, documentUploadUrl, downloadDocumentUrl, isInternal = false, isClient = false, bucketName, reactAppUrl, isLateDisputeAllowed = false, }) => {
|
|
41
38
|
const [currentInvoice, setCurrentInvoice] = (0, react_1.useState)(clientInvoice);
|
|
42
39
|
(0, react_1.useEffect)(() => {
|
|
43
40
|
setCurrentInvoice(clientInvoice);
|
|
44
41
|
}, [clientInvoice]);
|
|
45
42
|
const disputeId = currentInvoice === null || currentInvoice === void 0 ? void 0 : currentInvoice.disputeId;
|
|
46
|
-
const hasDisputeAdminRole = (_a = user === null || user === void 0 ? void 0 : user[rolesUrl]) === null || _a === void 0 ? void 0 : _a.includes('disputes_admin');
|
|
47
43
|
return (react_1.default.createElement(base_ui_1.Card, { className: "w-full bg-white rounded-lg shadow-sm overflow-hidden mb-4" },
|
|
48
44
|
react_1.default.createElement(core_1.Accordion, null,
|
|
49
45
|
react_1.default.createElement(core_1.AccordionSummary, { expandIcon: react_1.default.createElement(base_icons_1.IconChevronDown, null), "aria-controls": "invoice-content", id: "invoice-header" },
|
|
50
46
|
react_1.default.createElement(InvoiceHeader_1.InvoiceHeader, { invoice: currentInvoice, isInternal: isInternal, isClient: isClient })),
|
|
51
47
|
react_1.default.createElement(core_1.AccordionDetails, null,
|
|
52
48
|
react_1.default.createElement("div", { className: "p-6 space-y-6 w-full" },
|
|
53
|
-
react_1.default.createElement(InvoiceDetails_1.InvoiceDetails, { invoice: currentInvoice, isInternal: isInternal, isClient: isClient, reactAppUrl: reactAppUrl }),
|
|
49
|
+
react_1.default.createElement(InvoiceDetails_1.InvoiceDetails, { invoice: currentInvoice, isInternal: isInternal, isClient: isClient, reactAppUrl: reactAppUrl, isLateDisputeAllowed: isLateDisputeAllowed }),
|
|
54
50
|
isInternal ?
|
|
55
|
-
react_1.default.createElement(DisputeSection_1.DisputeSection, { dispute: currentInvoice, documentUploadUrl: documentUploadUrl, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName })
|
|
51
|
+
react_1.default.createElement(DisputeSection_1.DisputeSection, { dispute: currentInvoice, documentUploadUrl: documentUploadUrl, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName, isInternal: isInternal })
|
|
56
52
|
:
|
|
57
53
|
react_1.default.createElement(ClientDisputeProjectCard_1.ClientDisputeProjectCard, { clientInvoice: currentInvoice, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, documentUploadUrl: documentUploadUrl, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName }),
|
|
58
54
|
(currentInvoice === null || currentInvoice === void 0 ? void 0 : currentInvoice.chatEnabled) && disputeId && (react_1.default.createElement(DiscussionSection_1.DiscussionSection, { disputeId: disputeId, currentUser: user, messages: chatMessages, onCreateMessage: createDisputeChatMessage, isInternal: isInternal })),
|
|
59
|
-
isInternal &&
|
|
60
|
-
react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: currentInvoice, onUpdateDispute: updateClientInvoiceDisputeMutation, updateInvoiceMutation: updateInvoiceMutation, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, invoiceSummary: invoiceSummary, user: user, getClientInvoiceSummaryByMonth: getClientInvoiceSummaryByMonth
|
|
55
|
+
isInternal &&
|
|
56
|
+
react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: currentInvoice, onUpdateDispute: updateClientInvoiceDisputeMutation, updateInvoiceMutation: updateInvoiceMutation, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, invoiceSummary: invoiceSummary, user: user, getClientInvoiceSummaryByMonth: getClientInvoiceSummaryByMonth }))))));
|
|
61
57
|
};
|
|
62
58
|
exports.InvoiceCard = InvoiceCard;
|
|
@@ -3,8 +3,9 @@ interface InvoiceDetailsProps {
|
|
|
3
3
|
isInternal: boolean;
|
|
4
4
|
isClient: boolean;
|
|
5
5
|
reactAppUrl?: string;
|
|
6
|
+
isLateDisputeAllowed?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const getStatusColor: (status: string) => "success" | "primary" | "info" | "warning";
|
|
8
9
|
export declare const getStatusText: (status: string) => "" | "Resolved" | "In Progress" | "Under Review";
|
|
9
|
-
export declare const InvoiceDetails: ({ invoice, isInternal, isClient, reactAppUrl }: InvoiceDetailsProps) => JSX.Element;
|
|
10
|
+
export declare const InvoiceDetails: ({ invoice, isInternal, isClient, reactAppUrl, isLateDisputeAllowed }: InvoiceDetailsProps) => JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -34,15 +34,15 @@ const getStatusText = (status) => {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
exports.getStatusText = getStatusText;
|
|
37
|
-
const InvoiceDetails = ({ invoice, isInternal = false, isClient = false, reactAppUrl = 'https://internal.parodev.io' }) => {
|
|
37
|
+
const InvoiceDetails = ({ invoice, isInternal = false, isClient = false, reactAppUrl = 'https://internal.parodev.io', isLateDisputeAllowed = false }) => {
|
|
38
38
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
39
39
|
const clientInvoiceUrl = `${reactAppUrl}/invoices/${(_a = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _a === void 0 ? void 0 : _a.id}?month=${(_b = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _b === void 0 ? void 0 : _b.month}&companyId=${(_c = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _c === void 0 ? void 0 : _c.clientId}`;
|
|
40
40
|
const internalInvoiceUrl = `${reactAppUrl}/client/${(_d = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _d === void 0 ? void 0 : _d.clientId}/invoices/${(_e = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _e === void 0 ? void 0 : _e.id}?month=${(_f = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _f === void 0 ? void 0 : _f.month}`;
|
|
41
41
|
const today = (0, dayjs_1.default)();
|
|
42
42
|
const firstDayOfMonth = (0, dayjs_1.default)().startOf('month');
|
|
43
|
-
const disputeDaysLeft = 14 - today.diff(firstDayOfMonth, 'day');
|
|
43
|
+
const disputeDaysLeft = isLateDisputeAllowed ? 14 - today.diff(firstDayOfMonth, 'day') : 7 - today.diff(firstDayOfMonth, 'day');
|
|
44
44
|
const daysLeft = disputeDaysLeft > 0;
|
|
45
|
-
const editableDate = (0, dayjs_1.default)().date(14).format("MMM DD");
|
|
45
|
+
const editableDate = (0, dayjs_1.default)().date(isLateDisputeAllowed ? 14 : 7).format("MMM DD");
|
|
46
46
|
return (react_1.default.createElement("div", { className: "space-y-6" },
|
|
47
47
|
react_1.default.createElement("div", { className: "flex items-center space-x-4" },
|
|
48
48
|
react_1.default.createElement(base_ui_1.Tag, { color: (0, exports.getStatusColor)(invoice === null || invoice === void 0 ? void 0 : invoice.status), label: (0, exports.getStatusText)(invoice === null || invoice === void 0 ? void 0 : invoice.status), borderRadius: "full", variant: "subtle" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TestDecisionSection: () => JSX.Element;
|
|
1
|
+
export declare const TestDecisionSection: () => JSX.Element;
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.TestDecisionSection = void 0;
|
|
16
|
-
const react_1 = __importDefault(require("react"));
|
|
17
|
-
const DecisionSection_1 = require("./DecisionSection");
|
|
18
|
-
// Test data from the provided JSON
|
|
19
|
-
const testDispute = {
|
|
20
|
-
"__typename": "ClientInvoiceDispute",
|
|
21
|
-
"disputeId": 35,
|
|
22
|
-
"approvedAmount": 450,
|
|
23
|
-
"chatEnabled": true,
|
|
24
|
-
"disputeDate": "2025-05-22",
|
|
25
|
-
"disputeUpdatedDate": "2025-05-23",
|
|
26
|
-
"freelancerId": 8081,
|
|
27
|
-
"freelancer": {
|
|
28
|
-
"__typename": "User",
|
|
29
|
-
"id": 8081,
|
|
30
|
-
"email": "andpande@gmail.com",
|
|
31
|
-
"firstName": "William",
|
|
32
|
-
"lastName": "Annon"
|
|
33
|
-
},
|
|
34
|
-
"status": "Resolved",
|
|
35
|
-
"finalDecisionOwnerId": 29005,
|
|
36
|
-
"invoice": {
|
|
37
|
-
"__typename": "ClientInvoice",
|
|
38
|
-
"amount": 450,
|
|
39
|
-
"balanceDue": 450,
|
|
40
|
-
"clientId": 4433,
|
|
41
|
-
"dateGenerated": "2025-04-14",
|
|
42
|
-
"id": 175325,
|
|
43
|
-
"month": "2025-04-01"
|
|
44
|
-
},
|
|
45
|
-
"disputeProjects": [
|
|
46
|
-
{
|
|
47
|
-
"__typename": "ClientInvoiceDisputeProject",
|
|
48
|
-
"id": 37,
|
|
49
|
-
"projectId": 19158,
|
|
50
|
-
"disputeAmount": 450,
|
|
51
|
-
"disputeHours": 30,
|
|
52
|
-
"disputeType": "Hourly",
|
|
53
|
-
"disputeReasonCode": "Incorrect Hours Logged",
|
|
54
|
-
"clientExplanation": "I have a dispute over this expert for the current invoice 175325",
|
|
55
|
-
"clientDocumentLinks": "https://expert-client-dispute-files.s3.amazonaws.com/project-19158%2Ftesting.pdf,https://expert-client-dispute-files.s3.amazonaws.com/project-19158%2F_Carmelita_Resume-Graduation__1_.docx",
|
|
56
|
-
"expertDocumentLinks": "https://expert-client-dispute-files.s3.amazonaws.com/project-19158%2F0eb4b31b-b6d8-4cd1-b6ac-39b807ea4577.pdf",
|
|
57
|
-
"resolutionMode": null,
|
|
58
|
-
"resolutionType": null,
|
|
59
|
-
"project": {
|
|
60
|
-
"__typename": "Project",
|
|
61
|
-
"name": "Ongoing Ad-Hoc Support",
|
|
62
|
-
"freelancerRate": null,
|
|
63
|
-
"clientRate": null,
|
|
64
|
-
"projectHours": [
|
|
65
|
-
{
|
|
66
|
-
"__typename": "ProjectHour",
|
|
67
|
-
"id": 136605,
|
|
68
|
-
"date": "2022-02-11",
|
|
69
|
-
"description": "Ate Tacos",
|
|
70
|
-
"hours": 8
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"__typename": "ProjectHour",
|
|
74
|
-
"id": 136606,
|
|
75
|
-
"date": "2022-02-12",
|
|
76
|
-
"description": "Worked on project analysis",
|
|
77
|
-
"hours": 6
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"__typename": "ProjectHour",
|
|
81
|
-
"id": 136607,
|
|
82
|
-
"date": "2022-02-13",
|
|
83
|
-
"description": "Client meeting and documentation",
|
|
84
|
-
"hours": 4
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"__typename": "ProjectHour",
|
|
88
|
-
"id": 136608,
|
|
89
|
-
"date": "2022-02-14",
|
|
90
|
-
"description": "Code review and testing",
|
|
91
|
-
"hours": 7
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"__typename": "ProjectHour",
|
|
95
|
-
"id": 136609,
|
|
96
|
-
"date": "2022-02-15",
|
|
97
|
-
"description": "Final deliverable preparation",
|
|
98
|
-
"hours": 5
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
|
-
"lastMessageAt": "2025-05-23T10:56:53.000Z",
|
|
105
|
-
"messageCount": 5,
|
|
106
|
-
"client": {
|
|
107
|
-
"__typename": "Client",
|
|
108
|
-
"name": "Vessel Advisors"
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const testUser = {
|
|
112
|
-
userId: 29005,
|
|
113
|
-
firstName: "Test",
|
|
114
|
-
lastName: "User"
|
|
115
|
-
};
|
|
116
|
-
const TestDecisionSection = () => {
|
|
117
|
-
const mockOnUpdateDispute = (variables) => __awaiter(void 0, void 0, void 0, function* () {
|
|
118
|
-
console.log('Mock update dispute called with:', variables);
|
|
119
|
-
return Promise.resolve({ success: true });
|
|
120
|
-
});
|
|
121
|
-
const mockUpdateInvoiceMutation = {};
|
|
122
|
-
return (react_1.default.createElement("div", { className: "p-8 max-w-4xl mx-auto" },
|
|
123
|
-
react_1.default.createElement("h1", { className: "text-2xl font-bold mb-6" }, "Test Decision Section with Hours Modal"),
|
|
124
|
-
react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: testDispute, onUpdateDispute: mockOnUpdateDispute, updateInvoiceMutation: mockUpdateInvoiceMutation, user: testUser })));
|
|
125
|
-
};
|
|
126
|
-
exports.TestDecisionSection = TestDecisionSection;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.TestDecisionSection = void 0;
|
|
16
|
+
const react_1 = __importDefault(require("react"));
|
|
17
|
+
const DecisionSection_1 = require("./DecisionSection");
|
|
18
|
+
// Test data from the provided JSON
|
|
19
|
+
const testDispute = {
|
|
20
|
+
"__typename": "ClientInvoiceDispute",
|
|
21
|
+
"disputeId": 35,
|
|
22
|
+
"approvedAmount": 450,
|
|
23
|
+
"chatEnabled": true,
|
|
24
|
+
"disputeDate": "2025-05-22",
|
|
25
|
+
"disputeUpdatedDate": "2025-05-23",
|
|
26
|
+
"freelancerId": 8081,
|
|
27
|
+
"freelancer": {
|
|
28
|
+
"__typename": "User",
|
|
29
|
+
"id": 8081,
|
|
30
|
+
"email": "andpande@gmail.com",
|
|
31
|
+
"firstName": "William",
|
|
32
|
+
"lastName": "Annon"
|
|
33
|
+
},
|
|
34
|
+
"status": "Resolved",
|
|
35
|
+
"finalDecisionOwnerId": 29005,
|
|
36
|
+
"invoice": {
|
|
37
|
+
"__typename": "ClientInvoice",
|
|
38
|
+
"amount": 450,
|
|
39
|
+
"balanceDue": 450,
|
|
40
|
+
"clientId": 4433,
|
|
41
|
+
"dateGenerated": "2025-04-14",
|
|
42
|
+
"id": 175325,
|
|
43
|
+
"month": "2025-04-01"
|
|
44
|
+
},
|
|
45
|
+
"disputeProjects": [
|
|
46
|
+
{
|
|
47
|
+
"__typename": "ClientInvoiceDisputeProject",
|
|
48
|
+
"id": 37,
|
|
49
|
+
"projectId": 19158,
|
|
50
|
+
"disputeAmount": 450,
|
|
51
|
+
"disputeHours": 30,
|
|
52
|
+
"disputeType": "Hourly",
|
|
53
|
+
"disputeReasonCode": "Incorrect Hours Logged",
|
|
54
|
+
"clientExplanation": "I have a dispute over this expert for the current invoice 175325",
|
|
55
|
+
"clientDocumentLinks": "https://expert-client-dispute-files.s3.amazonaws.com/project-19158%2Ftesting.pdf,https://expert-client-dispute-files.s3.amazonaws.com/project-19158%2F_Carmelita_Resume-Graduation__1_.docx",
|
|
56
|
+
"expertDocumentLinks": "https://expert-client-dispute-files.s3.amazonaws.com/project-19158%2F0eb4b31b-b6d8-4cd1-b6ac-39b807ea4577.pdf",
|
|
57
|
+
"resolutionMode": null,
|
|
58
|
+
"resolutionType": null,
|
|
59
|
+
"project": {
|
|
60
|
+
"__typename": "Project",
|
|
61
|
+
"name": "Ongoing Ad-Hoc Support",
|
|
62
|
+
"freelancerRate": null,
|
|
63
|
+
"clientRate": null,
|
|
64
|
+
"projectHours": [
|
|
65
|
+
{
|
|
66
|
+
"__typename": "ProjectHour",
|
|
67
|
+
"id": 136605,
|
|
68
|
+
"date": "2022-02-11",
|
|
69
|
+
"description": "Ate Tacos",
|
|
70
|
+
"hours": 8
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"__typename": "ProjectHour",
|
|
74
|
+
"id": 136606,
|
|
75
|
+
"date": "2022-02-12",
|
|
76
|
+
"description": "Worked on project analysis",
|
|
77
|
+
"hours": 6
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"__typename": "ProjectHour",
|
|
81
|
+
"id": 136607,
|
|
82
|
+
"date": "2022-02-13",
|
|
83
|
+
"description": "Client meeting and documentation",
|
|
84
|
+
"hours": 4
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"__typename": "ProjectHour",
|
|
88
|
+
"id": 136608,
|
|
89
|
+
"date": "2022-02-14",
|
|
90
|
+
"description": "Code review and testing",
|
|
91
|
+
"hours": 7
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"__typename": "ProjectHour",
|
|
95
|
+
"id": 136609,
|
|
96
|
+
"date": "2022-02-15",
|
|
97
|
+
"description": "Final deliverable preparation",
|
|
98
|
+
"hours": 5
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"lastMessageAt": "2025-05-23T10:56:53.000Z",
|
|
105
|
+
"messageCount": 5,
|
|
106
|
+
"client": {
|
|
107
|
+
"__typename": "Client",
|
|
108
|
+
"name": "Vessel Advisors"
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const testUser = {
|
|
112
|
+
userId: 29005,
|
|
113
|
+
firstName: "Test",
|
|
114
|
+
lastName: "User"
|
|
115
|
+
};
|
|
116
|
+
const TestDecisionSection = () => {
|
|
117
|
+
const mockOnUpdateDispute = (variables) => __awaiter(void 0, void 0, void 0, function* () {
|
|
118
|
+
console.log('Mock update dispute called with:', variables);
|
|
119
|
+
return Promise.resolve({ success: true });
|
|
120
|
+
});
|
|
121
|
+
const mockUpdateInvoiceMutation = {};
|
|
122
|
+
return (react_1.default.createElement("div", { className: "p-8 max-w-4xl mx-auto" },
|
|
123
|
+
react_1.default.createElement("h1", { className: "text-2xl font-bold mb-6" }, "Test Decision Section with Hours Modal"),
|
|
124
|
+
react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: testDispute, onUpdateDispute: mockOnUpdateDispute, updateInvoiceMutation: mockUpdateInvoiceMutation, user: testUser })));
|
|
125
|
+
};
|
|
126
|
+
exports.TestDecisionSection = TestDecisionSection;
|
|
@@ -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 {};
|