@paro.io/expert-shared-components 1.12.28 → 1.12.30

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.
Files changed (70) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +2 -2
  3. package/lib/components/ClientReferencesSection/DeleteButton.js +11 -11
  4. package/lib/components/ClientReferencesSection/ParoError.js +10 -10
  5. package/lib/components/ClientReferencesSection/TagsSection.js +2 -2
  6. package/lib/components/ClientReferencesSection/styles/BrandedTypography.js +2 -2
  7. package/lib/components/ClientReferencesSection/styles/Buttons.js +15 -15
  8. package/lib/components/ClientReferencesSection/styles/Name.js +5 -5
  9. package/lib/components/ClientReferencesSection/styles/NullContentConditionalColor.js +4 -4
  10. package/lib/components/ClientReferencesSection/styles/SectionBody.js +11 -11
  11. package/lib/components/ClientReferencesSection/styles/SectionTitle.js +6 -6
  12. package/lib/components/ClientReferencesSection/styles/Tags.js +2 -2
  13. package/lib/components/DiscussionThread/chat.d.ts +22 -22
  14. package/lib/components/DiscussionThread/chat.js +106 -106
  15. package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
  16. package/lib/components/DocumentCenter/DocumentTable.js +350 -350
  17. package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
  18. package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
  19. package/lib/components/EarningsTracker/ActiveProjectCard.d.ts +52 -52
  20. package/lib/components/EarningsTracker/ActiveProjectCard.js +161 -161
  21. package/lib/components/EarningsTracker/CenterCardUI.d.ts +13 -13
  22. package/lib/components/EarningsTracker/CenterCardUI.js +134 -134
  23. package/lib/components/EarningsTracker/EarningsTracker.d.ts +52 -52
  24. package/lib/components/EarningsTracker/EarningsTracker.js +508 -508
  25. package/lib/components/EarningsTracker/EditDateModal.d.ts +22 -22
  26. package/lib/components/EarningsTracker/EditDateModal.js +149 -149
  27. package/lib/components/EarningsTracker/EmailModal.d.ts +14 -14
  28. package/lib/components/EarningsTracker/EmailModal.js +79 -79
  29. package/lib/components/EarningsTracker/EndProjectModal.d.ts +56 -56
  30. package/lib/components/EarningsTracker/EndProjectModal.js +221 -221
  31. package/lib/components/EarningsTracker/LeftCardUI.d.ts +18 -18
  32. package/lib/components/EarningsTracker/LeftCardUI.js +189 -189
  33. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.d.ts +52 -52
  34. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.js +358 -358
  35. package/lib/components/EarningsTracker/ProgressBar.d.ts +4 -4
  36. package/lib/components/EarningsTracker/ProgressBar.js +66 -66
  37. package/lib/components/EarningsTracker/ReviewRequestModal.d.ts +17 -17
  38. package/lib/components/EarningsTracker/ReviewRequestModal.js +135 -135
  39. package/lib/components/EarningsTracker/RightCardUI.d.ts +46 -46
  40. package/lib/components/EarningsTracker/RightCardUI.js +231 -231
  41. package/lib/components/EarningsTracker/index.d.ts +1 -1
  42. package/lib/components/EarningsTracker/index.js +5 -5
  43. package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
  44. package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
  45. package/lib/components/Invoices/DecisionSection.d.ts +2 -1
  46. package/lib/components/Invoices/DecisionSection.js +56 -25
  47. package/lib/components/Invoices/InvoiceCard.d.ts +2 -1
  48. package/lib/components/Invoices/InvoiceCard.js +7 -3
  49. package/lib/components/Invoices/InvoiceDetails.d.ts +1 -1
  50. package/lib/components/Invoices/InvoiceDetails.js +3 -3
  51. package/lib/components/Invoices/TestDecisionSection.d.ts +1 -1
  52. package/lib/components/Invoices/TestDecisionSection.js +126 -126
  53. package/lib/components/OrganizationChart/OrganizationChart.d.ts +15 -15
  54. package/lib/components/OrganizationChart/OrganizationChart.js +312 -312
  55. package/lib/components/OrganizationChart/PersonCard.js +5 -5
  56. package/lib/components/OrganizationChart/utils.js +79 -79
  57. package/lib/components/ProjectCard/ProgressBar.js +4 -4
  58. package/lib/components/ProjectCard/ReviewRequestModal.js +5 -5
  59. package/lib/components/Reviews/Pagination.js +6 -6
  60. package/lib/components/ReviewsTab/RatingHeader.js +6 -6
  61. package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
  62. package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
  63. package/lib/components/shared/Image.js +13 -13
  64. package/lib/components/shared/ProfileTextField.d.ts +18 -18
  65. package/lib/components/shared/ProfileTextField.js +16 -16
  66. package/lib/components/shared/StyledActionButtons.d.ts +7 -7
  67. package/lib/components/shared/StyledActionButtons.js +15 -15
  68. package/lib/components/shared/ToastNotification.d.ts +10 -10
  69. package/lib/components/shared/ToastNotification.js +63 -63
  70. package/package.json +61 -61
@@ -42,14 +42,15 @@ 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, addClientCredit }) => {
46
+ var _a, _b, _c;
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;
53
54
  // Initialize project approved hours when resolution changes to PARTIAL
54
55
  const handleResolutionChange = (newResolution) => {
55
56
  var _a;
@@ -84,7 +85,6 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
84
85
  const handleApproveClick = () => {
85
86
  if (!resolution)
86
87
  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,19 +100,13 @@ 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
- }))) || [];
109
103
  let calculatedApprovedAmount = 0;
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);
104
+ const fullDisputeAmount = (_a = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _a === void 0 ? void 0 : _a.reduce((acc, project) => acc + project.disputeAmount, 0);
111
105
  if (resolution === 'APPROVED') {
112
106
  calculatedApprovedAmount = fullDisputeAmount;
113
107
  }
114
108
  else {
115
- (_c = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _c === void 0 ? void 0 : _c.forEach((project) => {
109
+ (_b = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _b === void 0 ? void 0 : _b.forEach((project) => {
116
110
  var _a, _b;
117
111
  const approvedForProject = projectApprovedHours[project.projectId] || 0;
118
112
  if (project.disputeType === 'Hourly') {
@@ -124,6 +118,50 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
124
118
  }
125
119
  });
126
120
  }
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
+ }))) || [];
127
165
  const updateData = {
128
166
  disputeId: dispute.disputeId,
129
167
  status: "Resolved",
@@ -131,24 +169,17 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
131
169
  finalDecisionOwnerId: (user === null || user === void 0 ? void 0 : user.userId) || null,
132
170
  projectDisputes: disputeProjectUpdates
133
171
  };
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
- }
146
172
  yield onUpdateDispute({
147
173
  variables: {
148
174
  input: updateData,
149
175
  },
150
176
  });
151
- (0, utils_1.showToast)('success', 'Thank you for resolving the dispute. The invoice has been updated with the new hours.');
177
+ if (isDisputePaid) {
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
+ }
152
183
  }
153
184
  catch (error) {
154
185
  console.error('Failed to update dispute:', error);
@@ -158,7 +189,7 @@ const DecisionSection = ({ dispute, onUpdateDispute, updateInvoiceMutation, upda
158
189
  setIsSubmitting(false);
159
190
  }
160
191
  });
161
- const isPartialWithMultipleProjects = resolution === 'PARTIAL' && ((_b = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _b === void 0 ? void 0 : _b.length) > 0;
192
+ const isPartialWithMultipleProjects = resolution === 'PARTIAL' && ((_c = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _c === void 0 ? void 0 : _c.length) > 0;
162
193
  const isValidPartialApproval = () => {
163
194
  if (resolution !== 'PARTIAL')
164
195
  return true;
@@ -13,6 +13,7 @@ interface InvoiceCardProps {
13
13
  isClient?: boolean;
14
14
  bucketName?: string;
15
15
  reactAppUrl?: string;
16
+ addClientCredit?: any;
16
17
  }
17
- export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, updateInvoiceMutation, getClientInvoiceSummaryByMonth, invoiceSummary, documentUploadUrl, downloadDocumentUrl, isInternal, isClient, bucketName, reactAppUrl }: InvoiceCardProps) => JSX.Element;
18
+ export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, updateInvoiceMutation, getClientInvoiceSummaryByMonth, invoiceSummary, documentUploadUrl, downloadDocumentUrl, isInternal, isClient, bucketName, reactAppUrl, addClientCredit }: InvoiceCardProps) => JSX.Element;
18
19
  export {};
@@ -34,12 +34,16 @@ 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 }) => {
37
+ const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, updateInvoiceMutation, getClientInvoiceSummaryByMonth, invoiceSummary, documentUploadUrl, downloadDocumentUrl, isInternal = false, isClient = false, bucketName, reactAppUrl, addClientCredit }) => {
38
+ var _a;
39
+ const envUrl = reactAppUrl === null || reactAppUrl === void 0 ? void 0 : reactAppUrl.split('.')[1];
40
+ const rolesUrl = `https://app.${envUrl}.io/roles`;
38
41
  const [currentInvoice, setCurrentInvoice] = (0, react_1.useState)(clientInvoice);
39
42
  (0, react_1.useEffect)(() => {
40
43
  setCurrentInvoice(clientInvoice);
41
44
  }, [clientInvoice]);
42
45
  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');
43
47
  return (react_1.default.createElement(base_ui_1.Card, { className: "w-full bg-white rounded-lg shadow-sm overflow-hidden mb-4" },
44
48
  react_1.default.createElement(core_1.Accordion, null,
45
49
  react_1.default.createElement(core_1.AccordionSummary, { expandIcon: react_1.default.createElement(base_icons_1.IconChevronDown, null), "aria-controls": "invoice-content", id: "invoice-header" },
@@ -52,7 +56,7 @@ const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessag
52
56
  :
53
57
  react_1.default.createElement(ClientDisputeProjectCard_1.ClientDisputeProjectCard, { clientInvoice: currentInvoice, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, documentUploadUrl: documentUploadUrl, downloadDocumentUrl: downloadDocumentUrl, bucketName: bucketName }),
54
58
  (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 })),
55
- isInternal &&
56
- react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: currentInvoice, onUpdateDispute: updateClientInvoiceDisputeMutation, updateInvoiceMutation: updateInvoiceMutation, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, invoiceSummary: invoiceSummary, user: user, getClientInvoiceSummaryByMonth: getClientInvoiceSummaryByMonth }))))));
59
+ isInternal && hasDisputeAdminRole &&
60
+ react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: currentInvoice, onUpdateDispute: updateClientInvoiceDisputeMutation, updateInvoiceMutation: updateInvoiceMutation, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, invoiceSummary: invoiceSummary, user: user, getClientInvoiceSummaryByMonth: getClientInvoiceSummaryByMonth, addClientCredit: addClientCredit }))))));
57
61
  };
58
62
  exports.InvoiceCard = InvoiceCard;
@@ -7,5 +7,5 @@ interface InvoiceDetailsProps {
7
7
  }
8
8
  export declare const getStatusColor: (status: string) => "success" | "primary" | "info" | "warning";
9
9
  export declare const getStatusText: (status: string) => "" | "Resolved" | "In Progress" | "Under Review";
10
- export declare const InvoiceDetails: ({ invoice, isInternal, isClient, reactAppUrl, isLateDisputeAllowed }: InvoiceDetailsProps) => JSX.Element;
10
+ export declare const InvoiceDetails: ({ invoice, isInternal, isClient, reactAppUrl }: InvoiceDetailsProps) => JSX.Element;
11
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', isLateDisputeAllowed = false }) => {
37
+ const InvoiceDetails = ({ invoice, isInternal = false, isClient = false, reactAppUrl = 'https://internal.parodev.io' }) => {
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 = isLateDisputeAllowed ? 14 - today.diff(firstDayOfMonth, 'day') : 7 - today.diff(firstDayOfMonth, 'day');
43
+ const disputeDaysLeft = 14 - today.diff(firstDayOfMonth, 'day');
44
44
  const daysLeft = disputeDaysLeft > 0;
45
- const editableDate = (0, dayjs_1.default)().date(isLateDisputeAllowed ? 14 : 7).format("MMM DD");
45
+ const editableDate = (0, dayjs_1.default)().date(14).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 {};