@paro.io/expert-shared-components 1.14.42 → 1.14.43

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.
@@ -188,6 +188,22 @@ const MultiFileUploadSection = ({ paroDocuments, clientAndProjectsList, uploadEx
188
188
  }, [selectedExpert, clientOptions, isClientPortal]);
189
189
  const hasMultipleProjects = selectedExpertProjects.length > 1;
190
190
  const hasSingleProject = selectedExpertProjects.length === 1;
191
+ // Filtered project options for the selected expert/client
192
+ const filteredProjectOptions = react_1.default.useMemo(() => {
193
+ if (!selectedExpert)
194
+ return [];
195
+ return clientOptions.filter((opt) => {
196
+ var _a, _b;
197
+ const isMatch = isClientPortal
198
+ ? ((_a = opt.freelancer) === null || _a === void 0 ? void 0 : _a.id) === selectedExpert.id
199
+ : ((_b = opt.client) === null || _b === void 0 ? void 0 : _b.id) === selectedExpert.id;
200
+ const projectStatus = opt.status || opt.projectStatus;
201
+ const excludedStatuses = ["complete", "completed", "doa", "churned"];
202
+ const isValidProject = projectStatus &&
203
+ !excludedStatuses.includes(projectStatus.toLowerCase());
204
+ return isMatch && isValidProject;
205
+ });
206
+ }, [selectedExpert, clientOptions, isClientPortal]);
191
207
  // Check if all files have projects assigned (for multi-project experts/clients)
192
208
  const allFilesHaveProjects = react_1.default.useMemo(() => {
193
209
  if (!hasMultipleProjects)
@@ -538,27 +554,7 @@ const MultiFileUploadSection = ({ paroDocuments, clientAndProjectsList, uploadEx
538
554
  });
539
555
  return;
540
556
  }
541
- const filteredOptions = selectedExpert
542
- ? clientOptions.filter((opt) => {
543
- var _a, _b;
544
- const isMatch = isClientPortal
545
- ? ((_a = opt.freelancer) === null || _a === void 0 ? void 0 : _a.id) ===
546
- selectedExpert.id
547
- : ((_b = opt.client) === null || _b === void 0 ? void 0 : _b.id) ===
548
- selectedExpert.id;
549
- const projectStatus = opt.status || opt.projectStatus;
550
- const excludedStatuses = [
551
- "complete",
552
- "completed",
553
- "doa",
554
- "churned",
555
- ];
556
- const isValidProject = projectStatus &&
557
- !excludedStatuses.includes(projectStatus.toLowerCase());
558
- return isMatch && isValidProject;
559
- })
560
- : clientOptions;
561
- const selected = filteredOptions.find((opt) => opt.value === e.target.value);
557
+ const selected = filteredProjectOptions.find((opt) => opt.value === e.target.value);
562
558
  updateItem(item.id, {
563
559
  clientAndProject: selected,
564
560
  });
@@ -568,36 +564,7 @@ const MultiFileUploadSection = ({ paroDocuments, clientAndProjectsList, uploadEx
568
564
  value: "",
569
565
  label: "Which project?",
570
566
  },
571
- ...(selectedExpert
572
- ? clientOptions.filter((opt) => {
573
- var _a, _b;
574
- const isMatch = isClientPortal
575
- ? ((_a = opt.freelancer) === null || _a === void 0 ? void 0 : _a.id) ===
576
- selectedExpert.id
577
- : ((_b = opt.client) === null || _b === void 0 ? void 0 : _b.id) ===
578
- selectedExpert.id;
579
- const projectStatus = opt.status || opt.projectStatus;
580
- const excludedStatuses = [
581
- "complete",
582
- "completed",
583
- "doa",
584
- "churned",
585
- ];
586
- const isValidProject = projectStatus &&
587
- !excludedStatuses.includes(projectStatus.toLowerCase());
588
- return isMatch && isValidProject;
589
- })
590
- : clientOptions.filter((opt) => {
591
- const projectStatus = opt.status || opt.projectStatus;
592
- const excludedStatuses = [
593
- "complete",
594
- "completed",
595
- "doa",
596
- "churned",
597
- ];
598
- return (projectStatus &&
599
- !excludedStatuses.includes(projectStatus.toLowerCase()));
600
- })),
567
+ ...filteredProjectOptions,
601
568
  ], disabled: item.status === "uploading" ||
602
569
  item.status === "success" ||
603
570
  !selectedExpert, required: false }))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.14.42",
3
+ "version": "1.14.43",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {