@dyedurham/search-and-file-widget 2.0.22 → 2.0.23

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.
@@ -58124,6 +58124,24 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
58124
58124
  return isPerson && isSignificantControl;
58125
58125
  });
58126
58126
  }
58127
+ function normalizeSupportingDocuments(value) {
58128
+ if (!Array.isArray(value)) {
58129
+ return [];
58130
+ }
58131
+ return value.flatMap((d) => {
58132
+ if (typeof d === "string" && d) {
58133
+ return [{ documentId: d, name: d, extension: "pdf" }];
58134
+ }
58135
+ if (d && (typeof d.documentId === "string" || typeof d.documentId === "number")) {
58136
+ const documentId = String(d.documentId);
58137
+ return [{ documentId, name: typeof d.name === "string" && d.name ? d.name : documentId, extension: d.extension }];
58138
+ }
58139
+ return [];
58140
+ });
58141
+ }
58142
+ function normalizeDocumentIds(value) {
58143
+ return Array.isArray(value) ? value.filter((id) => typeof id === "string" && !!id) : [];
58144
+ }
58127
58145
  function getPersonName(person) {
58128
58146
  const firstName = person._profile.firstName || "";
58129
58147
  const lastName = person._profile.lastName || "";
@@ -86789,7 +86807,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
86789
86807
  umSubmit = output();
86790
86808
  dialog = inject(MatDialog);
86791
86809
  deltaState = inject(DeltaStateService);
86792
- documents = computed(() => this.task()?.supportingDocuments ?? []);
86810
+ documents = computed(() => normalizeSupportingDocuments(this.task()?.supportingDocuments));
86793
86811
  // Holds ECoreSupportingDocument.documentId values
86794
86812
  selectedDocuments = signal([]);
86795
86813
  deltaForm = signal(new FormGroup({}));
@@ -86821,8 +86839,8 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
86821
86839
  form.disable();
86822
86840
  form.addControl(FederalFormationFormGroups.Signatory, new FormGroup({ [FederalFormationFormControl.Signatory]: new FormControl("", Validators.required) }));
86823
86841
  this.previewForm.set(form);
86824
- const availableIds = new Set((task.supportingDocuments ?? []).map((d) => d.documentId));
86825
- this.selectedDocuments.set((deltaData.corporateName?.supportingDocuments ?? []).filter((id) => availableIds.has(id)));
86842
+ const availableIds = new Set(normalizeSupportingDocuments(task.supportingDocuments).map((d) => d.documentId));
86843
+ this.selectedDocuments.set(normalizeDocumentIds(deltaData.corporateName?.supportingDocuments).filter((id) => availableIds.has(id)));
86826
86844
  if (untracked2(this.activeStep) === Step.Validate) {
86827
86845
  this.nextStep.emit();
86828
86846
  }
@@ -87033,7 +87051,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
87033
87051
  }], () => [], null);
87034
87052
  })();
87035
87053
  (() => {
87036
- (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(FederalComponent, { className: "FederalComponent", filePath: "src/app/components/federal/federal.component.ts", lineNumber: 42 });
87054
+ (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(FederalComponent, { className: "FederalComponent", filePath: "src/app/components/federal/federal.component.ts", lineNumber: 48 });
87037
87055
  })();
87038
87056
  }
87039
87057
  });
@@ -87113,8 +87131,8 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
87113
87131
  if (!serviceOrderId) {
87114
87132
  throw new Error("Missing serviceOrderId.");
87115
87133
  }
87116
- const available = new Map((signature.task.supportingDocuments ?? []).map((d) => [d.documentId, d]));
87117
- const documents = documentIds.map((id) => available.get(id)).filter((d) => !!d);
87134
+ const available = new Map(normalizeSupportingDocuments(signature.task.supportingDocuments).map((d) => [d.documentId, d]));
87135
+ const documents = normalizeDocumentIds(documentIds).map((id) => available.get(id)).filter((d) => !!d);
87118
87136
  if (!documents.length) {
87119
87137
  return;
87120
87138
  }
@@ -89163,7 +89181,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
89163
89181
  if (signature) {
89164
89182
  const serviceOrderId = this.task()?.deltaData.serviceOrderId;
89165
89183
  if (serviceOrderId) {
89166
- const documentIds = this.task()?.deltaData?.corporateName?.supportingDocuments ?? [];
89184
+ const documentIds = normalizeDocumentIds(this.task()?.deltaData?.corporateName?.supportingDocuments);
89167
89185
  if (documentIds.length && !this.getDocumentBytes()) {
89168
89186
  throw new Error("Missing getDocumentBytes (required input from Athennian to upload supporting documents).");
89169
89187
  }
@@ -89559,7 +89577,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
89559
89577
  }], () => [], null);
89560
89578
  })();
89561
89579
  (() => {
89562
- (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(FilingComponent, { className: "FilingComponent", filePath: "src/app/components/filing/filing.component.ts", lineNumber: 73 });
89580
+ (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(FilingComponent, { className: "FilingComponent", filePath: "src/app/components/filing/filing.component.ts", lineNumber: 74 });
89563
89581
  })();
89564
89582
  }
89565
89583
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyedurham/search-and-file-widget",
3
- "version": "2.0.22",
3
+ "version": "2.0.23",
4
4
  "description": "",
5
5
  "main": "dnd-filing-shell.js",
6
6
  "scripts": {