@dyedurham/search-and-file-widget 2.1.7 → 2.1.9
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/dnd-filing-shell.js +39 -15
- package/package.json +1 -1
package/dnd-filing-shell.js
CHANGED
|
@@ -84312,12 +84312,12 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
84312
84312
|
const entityDetails = deltaData.entityDetails;
|
|
84313
84313
|
const isNamed2 = entityDetails?.corporationNameType === BCNameType.Named;
|
|
84314
84314
|
const nameTranslations = entityDetails?.usesNameTranslation ? (entityDetails.nameTranslations ?? []).filter(Boolean) : [];
|
|
84315
|
-
const
|
|
84316
|
-
const
|
|
84317
|
-
const regMailing = pickAddress(
|
|
84318
|
-
const regDelivery = pickAddress(
|
|
84319
|
-
const recMailing = pickAddress(
|
|
84320
|
-
const recDelivery = pickAddress(
|
|
84315
|
+
const registeredOfficeAddresses = collectSharedAddresses(affiliations, AddressTitle2.REGISTERED_OFFICE);
|
|
84316
|
+
const recordsOfficeAddresses = collectSharedAddresses(affiliations, AddressTitle2.RECORDS_OFFICE);
|
|
84317
|
+
const regMailing = pickAddress(registeredOfficeAddresses, "Mailing");
|
|
84318
|
+
const regDelivery = pickAddress(registeredOfficeAddresses, "Delivery");
|
|
84319
|
+
const recMailing = pickAddress(recordsOfficeAddresses, "Mailing");
|
|
84320
|
+
const recDelivery = pickAddress(recordsOfficeAddresses, "Delivery");
|
|
84321
84321
|
const regMailingBC = mapAddress(regMailing);
|
|
84322
84322
|
const regDeliveryBC = regDelivery ? mapAddress(regDelivery) : void 0;
|
|
84323
84323
|
const recMailingBC = recMailing ? mapAddress(recMailing) : void 0;
|
|
@@ -84358,6 +84358,26 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
84358
84358
|
};
|
|
84359
84359
|
return pruneUndefined(request);
|
|
84360
84360
|
}
|
|
84361
|
+
function findBCOfficeAddressIssues(task) {
|
|
84362
|
+
const affiliations = task.entity.affiliations ?? [];
|
|
84363
|
+
const issues = [];
|
|
84364
|
+
const offices = [
|
|
84365
|
+
{ name: "Registered Office", title: AddressTitle2.REGISTERED_OFFICE, required: true },
|
|
84366
|
+
{ name: "Records Office", title: AddressTitle2.RECORDS_OFFICE, required: false }
|
|
84367
|
+
];
|
|
84368
|
+
for (const { name, title, required } of offices) {
|
|
84369
|
+
const addresses = collectSharedAddresses(affiliations, title);
|
|
84370
|
+
if (!addresses.length && !required) {
|
|
84371
|
+
continue;
|
|
84372
|
+
}
|
|
84373
|
+
for (const type of ["Mailing", "Delivery"]) {
|
|
84374
|
+
if (!pickAddress(addresses, type)) {
|
|
84375
|
+
issues.push(`The ${name} has no ${type} address.`);
|
|
84376
|
+
}
|
|
84377
|
+
}
|
|
84378
|
+
}
|
|
84379
|
+
return issues;
|
|
84380
|
+
}
|
|
84361
84381
|
function findBCRequestIssues(request) {
|
|
84362
84382
|
const issues = [];
|
|
84363
84383
|
const email = request.companyEmail?.trim() ?? "";
|
|
@@ -84366,9 +84386,6 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
84366
84386
|
} else if (email.length > 150) {
|
|
84367
84387
|
issues.push("Company Email must be 150 characters or fewer.");
|
|
84368
84388
|
}
|
|
84369
|
-
if (!request.registeredOfficeMailingAddress?.streetAddress?.trim()) {
|
|
84370
|
-
issues.push("The Registered Office has no Mailing address.");
|
|
84371
|
-
}
|
|
84372
84389
|
for (const director of request.directors ?? []) {
|
|
84373
84390
|
if (!director.mailingAddress?.streetAddress?.trim()) {
|
|
84374
84391
|
issues.push(`Director ${`${director.firstName} ${director.lastName}`.trim()} has no Mailing address.`);
|
|
@@ -84473,6 +84490,9 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
84473
84490
|
function findSharedAddressAffiliation(affiliations, staticTitle) {
|
|
84474
84491
|
return affiliations.find((a) => a.role?.role_name === AddressRole2.SHARED_ADDRESS && a.role?.static_title === staticTitle && isActiveAffiliation(a));
|
|
84475
84492
|
}
|
|
84493
|
+
function collectSharedAddresses(affiliations, staticTitle) {
|
|
84494
|
+
return affiliations.filter((a) => a.role?.role_name === AddressRole2.SHARED_ADDRESS && a.role?.static_title === staticTitle && isActiveAffiliation(a)).flatMap((a) => a.addresses ?? []);
|
|
84495
|
+
}
|
|
84476
84496
|
function pickAddress(addresses, locationType, fallbackToFirst = false) {
|
|
84477
84497
|
const match = addresses?.find((a) => (a.computed_location_type ?? a.location_type)?.toLowerCase() === locationType.toLowerCase());
|
|
84478
84498
|
return match ?? (fallbackToFirst ? addresses?.[0] : void 0);
|
|
@@ -84609,7 +84629,8 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
84609
84629
|
const affiliations = task.entity.affiliations ?? [];
|
|
84610
84630
|
const delta = task.deltaData;
|
|
84611
84631
|
const registeredOffice = findSharedAddressAffiliation(affiliations, AddressTitle2.REGISTERED_OFFICE);
|
|
84612
|
-
const
|
|
84632
|
+
const registeredOfficeAddresses = collectSharedAddresses(affiliations, AddressTitle2.REGISTERED_OFFICE);
|
|
84633
|
+
const recordsOfficeAddresses = collectSharedAddresses(affiliations, AddressTitle2.RECORDS_OFFICE);
|
|
84613
84634
|
const companyEmail = task.entity.emailOptions?.[0]?.value ?? registeredOffice?.addresses?.[0]?.communications?.find((c) => c.type === "Business Email")?.value ?? task.entity.communications?.find((c) => c.type === "Business Email")?.value ?? // Email only: the entity may carry its Business Email on another address (e.g. Head
|
|
84614
84635
|
// Office) when no Registered Office shared address exists.
|
|
84615
84636
|
task.entity.addresses?.flatMap((a) => a.communications ?? []).find((c) => c.type === "Business Email")?.value ?? "";
|
|
@@ -84618,19 +84639,19 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
84618
84639
|
config2[BCFormationFormGroups.CorporationDetails] = this.generateCorporationDetailsFormGroup(task, delta?.entityDetails, companyEmail);
|
|
84619
84640
|
config2[BCFormationFormGroups.RegisteredOfficeAddress] = new FormGroup({
|
|
84620
84641
|
[BCFormationFormControls.MailingAddress]: new FormControl({
|
|
84621
|
-
value: this.formatFullAddress(this.pickAddress(
|
|
84642
|
+
value: this.formatFullAddress(this.pickAddress(registeredOfficeAddresses, "Mailing", true)),
|
|
84622
84643
|
disabled: true
|
|
84623
84644
|
}),
|
|
84624
84645
|
[BCFormationFormControls.DeliveryAddress]: new FormControl({
|
|
84625
|
-
value: this.formatFullAddress(this.pickAddress(
|
|
84646
|
+
value: this.formatFullAddress(this.pickAddress(registeredOfficeAddresses, "Delivery", true)),
|
|
84626
84647
|
disabled: true
|
|
84627
84648
|
}),
|
|
84628
84649
|
[BCFormationFormControls.RecordsOfficeMailingAddress]: new FormControl({
|
|
84629
|
-
value: this.formatFullAddress(this.pickAddress(
|
|
84650
|
+
value: this.formatFullAddress(this.pickAddress(recordsOfficeAddresses, "Mailing", true)),
|
|
84630
84651
|
disabled: true
|
|
84631
84652
|
}),
|
|
84632
84653
|
[BCFormationFormControls.RecordsOfficeDeliveryAddress]: new FormControl({
|
|
84633
|
-
value: this.formatFullAddress(this.pickAddress(
|
|
84654
|
+
value: this.formatFullAddress(this.pickAddress(recordsOfficeAddresses, "Delivery", true)),
|
|
84634
84655
|
disabled: true
|
|
84635
84656
|
})
|
|
84636
84657
|
});
|
|
@@ -96574,7 +96595,10 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
|
|
|
96574
96595
|
const signature = this._signature();
|
|
96575
96596
|
if (signature) {
|
|
96576
96597
|
const requestBody = buildBCFormationValidateRequest(signature.task, deltaData);
|
|
96577
|
-
const issues =
|
|
96598
|
+
const issues = [
|
|
96599
|
+
...findBCOfficeAddressIssues(signature.task),
|
|
96600
|
+
...findBCRequestIssues(requestBody)
|
|
96601
|
+
];
|
|
96578
96602
|
if (issues.length) {
|
|
96579
96603
|
this.errors.set(issues);
|
|
96580
96604
|
return;
|