@paro.io/expert-shared-components 1.12.1 → 1.12.3

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.
@@ -5,7 +5,7 @@ interface UploadFileParams {
5
5
  projectId: number;
6
6
  documentUploadUrl: string;
7
7
  updateClientInvoiceDisputeMutation: any;
8
- previousFiles: string[];
8
+ previousFiles: string | string[];
9
9
  isExpert: boolean;
10
10
  }
11
11
  export declare const fileUploader: ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, disputeId, previousFiles, isExpert, }: UploadFileParams) => Promise<boolean>;
@@ -16,6 +16,7 @@ exports.fileUploader = void 0;
16
16
  const UploadClient_1 = __importDefault(require("../shared/UploadClient"));
17
17
  const utils_1 = require("../shared/utils");
18
18
  const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, disputeId, previousFiles, isExpert, }) {
19
+ const documentLinks = previousFiles ? (typeof previousFiles === 'string' ? previousFiles.split(',') : [...previousFiles]) : [];
19
20
  try {
20
21
  (0, utils_1.showToast)('success', 'Starting Document Upload');
21
22
  const uploadClient = new UploadClient_1.default({
@@ -28,10 +29,7 @@ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file,
28
29
  yield uploadClient.triggerMultipartUpload().then((res) => {
29
30
  const resParsed = JSON.parse(res);
30
31
  const documentLink = resParsed === null || resParsed === void 0 ? void 0 : resParsed.Location;
31
- const documentLinks = [documentLink];
32
- if (previousFiles) {
33
- documentLinks.push(...previousFiles);
34
- }
32
+ documentLinks.push(documentLink); // Add the new file to the documentLinks array
35
33
  updateClientInvoiceDisputeMutation({
36
34
  variables: {
37
35
  input: {
@@ -3,7 +3,6 @@ interface ClientDisputeProjectCardProps {
3
3
  updateClientInvoiceDisputeMutation: any;
4
4
  documentUploadUrl: string;
5
5
  downloadDocumentUrl: string;
6
- refetchInvoiceDisputes: any;
7
6
  }
8
- export declare const ClientDisputeProjectCard: ({ clientInvoice, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, refetchInvoiceDisputes, }: ClientDisputeProjectCardProps) => JSX.Element;
7
+ export declare const ClientDisputeProjectCard: ({ clientInvoice, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, }: ClientDisputeProjectCardProps) => JSX.Element;
9
8
  export {};
@@ -97,7 +97,7 @@ const ACCEPTED_FILE_TYPES = [
97
97
  'image/png',
98
98
  'text/csv',
99
99
  ];
100
- const ClientDisputeProjectCard = ({ clientInvoice, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, refetchInvoiceDisputes, }) => {
100
+ const ClientDisputeProjectCard = ({ clientInvoice, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, }) => {
101
101
  const [expandRow, setExpandRow] = (0, react_1.useState)(null);
102
102
  const classes = useStyles();
103
103
  const [projects, setProjects] = (0, react_1.useState)(clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects);
@@ -183,8 +183,6 @@ const ClientDisputeProjectCard = ({ clientInvoice, updateClientInvoiceDisputeMut
183
183
  updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation,
184
184
  previousFiles: (_e = (_d = (_c = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.clientDocumentLinks) !== null && _e !== void 0 ? _e : [],
185
185
  isExpert: false,
186
- }).then(() => {
187
- refetchInvoiceDisputes();
188
186
  });
189
187
  resolve();
190
188
  }
@@ -227,8 +225,6 @@ const ClientDisputeProjectCard = ({ clientInvoice, updateClientInvoiceDisputeMut
227
225
  })),
228
226
  }
229
227
  }
230
- }).then(() => {
231
- refetchInvoiceDisputes();
232
228
  });
233
229
  }
234
230
  catch (error) {
@@ -7,7 +7,6 @@ interface InvoiceCardProps {
7
7
  documentUploadUrl: string;
8
8
  downloadDocumentUrl: string;
9
9
  isInternal?: boolean;
10
- refetchInvoiceDisputes: any;
11
10
  }
12
- export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, isInternal, refetchInvoiceDisputes, }: InvoiceCardProps) => JSX.Element;
11
+ export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, isInternal, }: InvoiceCardProps) => JSX.Element;
13
12
  export {};
@@ -12,7 +12,7 @@ const DisputeSection_1 = require("./DisputeSection");
12
12
  const DiscussionSection_1 = require("./DiscussionSection");
13
13
  const DecisionSection_1 = require("./DecisionSection");
14
14
  const ClientDisputeProjectCard_1 = require("./ClientDisputeProjectCard");
15
- const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, isInternal = false, refetchInvoiceDisputes, }) => {
15
+ const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, downloadDocumentUrl, isInternal = false, }) => {
16
16
  var _a, _b;
17
17
  return (react_1.default.createElement(base_ui_1.Card, { className: "w-full bg-white rounded-lg shadow-sm overflow-hidden mb-4" },
18
18
  react_1.default.createElement(InvoiceHeader_1.InvoiceHeader, { invoice: clientInvoice }),
@@ -21,7 +21,7 @@ const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessag
21
21
  isInternal ?
22
22
  react_1.default.createElement(DisputeSection_1.DisputeSection, { dispute: clientInvoice, documentUploadUrl: documentUploadUrl, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation })
23
23
  :
24
- react_1.default.createElement(ClientDisputeProjectCard_1.ClientDisputeProjectCard, { clientInvoice: clientInvoice, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, documentUploadUrl: documentUploadUrl, downloadDocumentUrl: downloadDocumentUrl, refetchInvoiceDisputes: refetchInvoiceDisputes }),
24
+ react_1.default.createElement(ClientDisputeProjectCard_1.ClientDisputeProjectCard, { clientInvoice: clientInvoice, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation, documentUploadUrl: documentUploadUrl, downloadDocumentUrl: downloadDocumentUrl }),
25
25
  (clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.chatEnabled) && (react_1.default.createElement(DiscussionSection_1.DiscussionSection, { disputeId: (_b = (_a = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id, currentUser: user, messages: chatMessages, onCreateMessage: createDisputeChatMessage, isInternal: isInternal })),
26
26
  isInternal &&
27
27
  react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: clientInvoice, onUpdateDispute: updateClientInvoiceDisputeMutation }))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.12.1",
3
+ "version": "1.12.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {