@adyen/kyc-components 2.17.1 → 2.18.0
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/dist/es/adyen-kyc-components.es.js +196 -28
- package/dist/types/components/TaskList/component/TaskItemStatus.d.ts +1 -1
- package/dist/types/components/TaskList/component/TaskListItem.d.ts +1 -1
- package/dist/types/components/TaskList/types.d.ts +2 -0
- package/dist/types/components/TrustMembers/component/RootTrusteeTaskItem.d.ts +2 -1
- package/dist/types/components/TrustMembers/types.d.ts +1 -1
- package/dist/types/components/TrustRoleAndEntityType/convertExistingTrustMember.d.ts +2 -1
- package/dist/types/components/TrustRoleAndEntityType/getAvailableRoles.d.ts +2 -0
- package/dist/types/components/TrustRoleAndEntityType/types.d.ts +1 -0
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/core/Context/ExperimentContext/types.d.ts +2 -1
- package/dist/types/language/config.d.ts +1 -0
- package/dist/types/utils/decision-maker-roles.d.ts +1 -1
- package/dist/types/utils/entity-status-util.d.ts +2 -2
- package/dist/types/utils/mapping/trustMembers/getTrustMembers.d.ts +1 -0
- package/dist/types/utils/trust-util.d.ts +1 -1
- package/dist/types/utils/trustMembers/handlers/addOrUpdateAssociatedTrustMember.d.ts +6 -1
- package/package.json +1 -1
|
@@ -276,6 +276,7 @@ const signed = "Signed";
|
|
|
276
276
|
const invalidRole = "Please select a role";
|
|
277
277
|
const unableToVerifyTheIdNumber = "Unable to verify the Id number for the given country";
|
|
278
278
|
const download = "Download";
|
|
279
|
+
const downloadACopy = "Download a copy";
|
|
279
280
|
const accountHolder = "Account holder";
|
|
280
281
|
const accountHolderDescriptionCompany = "The bank account holder has to have the same name as your company.";
|
|
281
282
|
const accountHolderDescriptionIndividual = "This should be you, since the bank account has to be in your name";
|
|
@@ -1378,6 +1379,7 @@ const defaultTrans = {
|
|
|
1378
1379
|
invalidRole,
|
|
1379
1380
|
unableToVerifyTheIdNumber,
|
|
1380
1381
|
download,
|
|
1382
|
+
downloadACopy,
|
|
1381
1383
|
accountHolder,
|
|
1382
1384
|
accountHolderDescriptionCompany,
|
|
1383
1385
|
accountHolderDescriptionIndividual,
|
|
@@ -17160,6 +17162,7 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
|
17160
17162
|
ExperimentNames2["OnlyAllowAlphanumericBankAccountNumbers"] = "OnlyAllowAlphanumericBankAccountNumbers";
|
|
17161
17163
|
ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
|
|
17162
17164
|
ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
|
|
17165
|
+
ExperimentNames2["AllowMoreRolesForMainRootTrustee"] = "AllowMoreRolesForMainRootTrustee";
|
|
17163
17166
|
return ExperimentNames2;
|
|
17164
17167
|
})(ExperimentNames || {});
|
|
17165
17168
|
const stripNonAlphanumeric = (value) => value.replaceAll(/[^0-9a-zA-Z]/g, "");
|
|
@@ -21704,7 +21707,7 @@ const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations,
|
|
|
21704
21707
|
};
|
|
21705
21708
|
const mapRootLegalEntityToTrustMember = (rootLegalEntity) => ({
|
|
21706
21709
|
trustMemberType: "rootTrustee",
|
|
21707
|
-
roles: [
|
|
21710
|
+
roles: [],
|
|
21708
21711
|
legalEntityType: rootLegalEntity.type,
|
|
21709
21712
|
legalEntityId: rootLegalEntity.id,
|
|
21710
21713
|
name: getLegalEntityNameBasedOnType(rootLegalEntity)
|
|
@@ -21722,6 +21725,23 @@ const getTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => {
|
|
|
21722
21725
|
var _a;
|
|
21723
21726
|
return [mapRootLegalEntityToTrustMember(rootLegalEntity), ...mapEntityAssociationsToTrustMembers(trustLE.id, trustLE.entityAssociations ?? [], exemptSettlorLE), ...mapUndefinedBeneficiaryInfoToTrustMembers(((_a = trustLE.trust) == null ? void 0 : _a.undefinedBeneficiaryInfo) ?? [])];
|
|
21724
21727
|
};
|
|
21728
|
+
const combineRootLegalEntityWithEntityAssociations = (rootLegalEntity, entityAssociations) => {
|
|
21729
|
+
const roles = entityAssociations.map((entityAssociation) => entityAssociation.type).filter((role2) => role2 === TrustMemberTypes.SETTLOR || role2 === TrustMemberTypes.PROTECTOR);
|
|
21730
|
+
return {
|
|
21731
|
+
trustMemberType: "rootTrustee",
|
|
21732
|
+
roles: [...roles, TrustMemberTypes.TRUSTEE],
|
|
21733
|
+
legalEntityType: rootLegalEntity.type,
|
|
21734
|
+
legalEntityId: rootLegalEntity.id,
|
|
21735
|
+
name: getLegalEntityNameBasedOnType(rootLegalEntity)
|
|
21736
|
+
};
|
|
21737
|
+
};
|
|
21738
|
+
const getRootTrusteeTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => {
|
|
21739
|
+
var _a;
|
|
21740
|
+
const entityAssociations = trustLE.entityAssociations ?? [];
|
|
21741
|
+
const rootLegalEntityAssociations = entityAssociations.filter((a) => a.legalEntityId === rootLegalEntity.id);
|
|
21742
|
+
const nonRootLegalEntityAssociations = entityAssociations.filter((a) => a.legalEntityId !== rootLegalEntity.id);
|
|
21743
|
+
return [combineRootLegalEntityWithEntityAssociations(rootLegalEntity, rootLegalEntityAssociations), ...mapEntityAssociationsToTrustMembers(trustLE.id, nonRootLegalEntityAssociations ?? [], exemptSettlorLE), ...mapUndefinedBeneficiaryInfoToTrustMembers(((_a = trustLE.trust) == null ? void 0 : _a.undefinedBeneficiaryInfo) ?? [])];
|
|
21744
|
+
};
|
|
21725
21745
|
const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
21726
21746
|
var _a, _b;
|
|
21727
21747
|
if (trustMember.legalEntityId === isNewEntity) {
|
|
@@ -21752,6 +21772,22 @@ const addOrUpdateAssociatedTrustMember = async ({
|
|
|
21752
21772
|
};
|
|
21753
21773
|
await handleUpdateLegalEntity(patchLE, trust2.id);
|
|
21754
21774
|
};
|
|
21775
|
+
const updateRootTrusteeTrustMember = async ({
|
|
21776
|
+
trustMember,
|
|
21777
|
+
trust: trust2,
|
|
21778
|
+
handleUpdateLegalEntity
|
|
21779
|
+
}) => {
|
|
21780
|
+
const otherAssociations = getOwnEntityAssociations(trust2).filter((existingAssociation) => existingAssociation.legalEntityId !== trustMember.legalEntityId);
|
|
21781
|
+
const updatedAssociations = mapRootTrustMemberToEntityAssociations(trustMember);
|
|
21782
|
+
const patchLE = {
|
|
21783
|
+
entityAssociations: [...otherAssociations, ...updatedAssociations]
|
|
21784
|
+
};
|
|
21785
|
+
await handleUpdateLegalEntity(patchLE, trust2.id);
|
|
21786
|
+
};
|
|
21787
|
+
const mapRootTrustMemberToEntityAssociations = (trustMember) => trustMember.roles.filter((r) => r !== "secondaryTrustee").map((role2) => ({
|
|
21788
|
+
legalEntityId: trustMember.legalEntityId,
|
|
21789
|
+
type: role2
|
|
21790
|
+
}));
|
|
21755
21791
|
const addOrUpdateUndefinedBeneficiary = async ({
|
|
21756
21792
|
newOrUpdated,
|
|
21757
21793
|
trust: trust2,
|
|
@@ -22455,6 +22491,7 @@ const Status = ({
|
|
|
22455
22491
|
};
|
|
22456
22492
|
const TaskItemStatus = ({
|
|
22457
22493
|
status,
|
|
22494
|
+
statusLabel,
|
|
22458
22495
|
downloadHandler
|
|
22459
22496
|
}) => {
|
|
22460
22497
|
const {
|
|
@@ -22472,64 +22509,64 @@ const TaskItemStatus = ({
|
|
|
22472
22509
|
tabIndex: 0,
|
|
22473
22510
|
icon: "download",
|
|
22474
22511
|
onClick: handleDownloadClick,
|
|
22475
|
-
children: [i18n.get("download"), " "]
|
|
22512
|
+
children: [statusLabel || i18n.get("download"), " "]
|
|
22476
22513
|
});
|
|
22477
22514
|
case TaskStatus.FINISHED:
|
|
22478
22515
|
return jsx(Status, {
|
|
22479
22516
|
className: "adl-status--finished",
|
|
22480
22517
|
iconStatusClass: "adl-status__icon--finished",
|
|
22481
22518
|
icon: "check",
|
|
22482
|
-
text: i18n.get("verified")
|
|
22519
|
+
text: statusLabel || i18n.get("verified")
|
|
22483
22520
|
});
|
|
22484
22521
|
case TaskStatus.SIGNED:
|
|
22485
22522
|
return jsx(Status, {
|
|
22486
22523
|
className: "adl-status--finished",
|
|
22487
22524
|
iconStatusClass: "adl-status__icon--finished",
|
|
22488
22525
|
icon: "check",
|
|
22489
|
-
text: i18n.get("signed")
|
|
22526
|
+
text: statusLabel || i18n.get("signed")
|
|
22490
22527
|
});
|
|
22491
22528
|
case TaskStatus.ERROR:
|
|
22492
22529
|
return jsx(Status, {
|
|
22493
22530
|
className: "adl-status--error",
|
|
22494
22531
|
iconStatusClass: "adl-status__icon--error",
|
|
22495
22532
|
icon: "info-circle",
|
|
22496
|
-
text: i18n.get("unsuccessful")
|
|
22533
|
+
text: statusLabel || i18n.get("unsuccessful")
|
|
22497
22534
|
});
|
|
22498
22535
|
case TaskStatus.PROCESSING:
|
|
22499
22536
|
return jsx(Status, {
|
|
22500
22537
|
className: "",
|
|
22501
22538
|
iconStatusClass: "",
|
|
22502
22539
|
icon: "loading",
|
|
22503
|
-
text: i18n.get("inReview")
|
|
22540
|
+
text: statusLabel || i18n.get("inReview")
|
|
22504
22541
|
});
|
|
22505
22542
|
case TaskStatus.SIGN:
|
|
22506
22543
|
return jsx("span", {
|
|
22507
22544
|
className: "adl-task-status-sign",
|
|
22508
|
-
children: i18n.get("sign")
|
|
22545
|
+
children: statusLabel || i18n.get("sign")
|
|
22509
22546
|
});
|
|
22510
22547
|
case TaskStatus.SUBMIT:
|
|
22511
22548
|
return jsx("span", {
|
|
22512
22549
|
className: "adl-task-status-submit",
|
|
22513
|
-
children: i18n.get("submit")
|
|
22550
|
+
children: statusLabel || i18n.get("submit")
|
|
22514
22551
|
});
|
|
22515
22552
|
case TaskStatus.REMOVING:
|
|
22516
22553
|
return jsx(Status, {
|
|
22517
22554
|
className: "",
|
|
22518
22555
|
iconStatusClass: "",
|
|
22519
22556
|
icon: "loading",
|
|
22520
|
-
text: i18n.get("removing")
|
|
22557
|
+
text: statusLabel || i18n.get("removing")
|
|
22521
22558
|
});
|
|
22522
22559
|
case "review":
|
|
22523
22560
|
return jsx("span", {
|
|
22524
22561
|
className: "adl-task-status-details-required",
|
|
22525
|
-
children: i18n.get("verify")
|
|
22562
|
+
children: statusLabel || i18n.get("verify")
|
|
22526
22563
|
});
|
|
22527
22564
|
case TaskStatus.DETAILS_REQUIRED:
|
|
22528
22565
|
case TaskStatus.EMPTY:
|
|
22529
22566
|
default:
|
|
22530
22567
|
return jsx("span", {
|
|
22531
22568
|
className: "adl-task-status-details-required",
|
|
22532
|
-
children: i18n.get("add")
|
|
22569
|
+
children: statusLabel || i18n.get("add")
|
|
22533
22570
|
});
|
|
22534
22571
|
}
|
|
22535
22572
|
};
|
|
@@ -23451,6 +23488,7 @@ const TaskListItem = ({
|
|
|
23451
23488
|
tagline,
|
|
23452
23489
|
icon,
|
|
23453
23490
|
status,
|
|
23491
|
+
statusLabel,
|
|
23454
23492
|
onNavigateToTask,
|
|
23455
23493
|
disabled = false,
|
|
23456
23494
|
problems,
|
|
@@ -23511,6 +23549,7 @@ const TaskListItem = ({
|
|
|
23511
23549
|
className: "adyen-task-item__status",
|
|
23512
23550
|
children: [jsx(TaskItemStatus, {
|
|
23513
23551
|
status: isStatusRemoving ? TaskStatus.REMOVING : status,
|
|
23552
|
+
statusLabel,
|
|
23514
23553
|
downloadHandler
|
|
23515
23554
|
}), typeof removeEntity === "function" && typeof handleIsRemoveDisabled === "function" ? jsx("div", {
|
|
23516
23555
|
className: "adyen-task-item__remove",
|
|
@@ -23775,6 +23814,7 @@ function TaskListComponent({
|
|
|
23775
23814
|
icon: "pci",
|
|
23776
23815
|
title: i18n.get("pciDssQuestionnaire"),
|
|
23777
23816
|
status: canDownloadPci ? TaskStatus.DOWNLOAD : TaskStatus.SIGN,
|
|
23817
|
+
statusLabel: canDownloadPci && i18n.get("downloadACopy"),
|
|
23778
23818
|
downloadHandler: onPciDownload,
|
|
23779
23819
|
disabled: isPciTaskDisabled,
|
|
23780
23820
|
info: isPciTaskDisabled && !canDownloadPci ? i18n.get("requiresDecisionMakers") : null
|
|
@@ -23942,12 +23982,33 @@ const RegularTrustMemberTaskItem = ({
|
|
|
23942
23982
|
};
|
|
23943
23983
|
const RootTrusteeTaskItem = ({
|
|
23944
23984
|
rootTrustee,
|
|
23945
|
-
taskStatus
|
|
23946
|
-
|
|
23947
|
-
|
|
23948
|
-
|
|
23949
|
-
|
|
23950
|
-
}
|
|
23985
|
+
taskStatus,
|
|
23986
|
+
onEdit
|
|
23987
|
+
}) => {
|
|
23988
|
+
const {
|
|
23989
|
+
i18n
|
|
23990
|
+
} = useI18nContext();
|
|
23991
|
+
const actions = [{
|
|
23992
|
+
icon: "edit",
|
|
23993
|
+
onSelect: onEdit,
|
|
23994
|
+
label: i18n.get("editEntityDetails"),
|
|
23995
|
+
title: i18n.get("editTrustMember", {
|
|
23996
|
+
values: {
|
|
23997
|
+
trustMember: rootTrustee.name
|
|
23998
|
+
}
|
|
23999
|
+
})
|
|
24000
|
+
}];
|
|
24001
|
+
const {
|
|
24002
|
+
isExperimentEnabled
|
|
24003
|
+
} = useExperimentsContext();
|
|
24004
|
+
const isAllowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
24005
|
+
return jsx(EntityAssociation, {
|
|
24006
|
+
types: isExperimentEnabled("AllowMoreRolesForMainRootTrustee") ? rootTrustee.roles : [TrustMemberTypes.TRUSTEE],
|
|
24007
|
+
name: rootTrustee.name,
|
|
24008
|
+
status: taskStatus,
|
|
24009
|
+
actions: isAllowMoreRolesForMainRootTrustee ? actions : void 0
|
|
24010
|
+
});
|
|
24011
|
+
};
|
|
23951
24012
|
const UndefinedBeneficiaryTaskItem = ({
|
|
23952
24013
|
undefinedBeneficiary: undefinedBeneficiary2,
|
|
23953
24014
|
onEdit,
|
|
@@ -23998,6 +24059,10 @@ const TrustMembersOverview = ({
|
|
|
23998
24059
|
const trustMembersWithOneOfGivenRoles = (roleTypes) => trustMembers2.filter(({
|
|
23999
24060
|
roles
|
|
24000
24061
|
}) => roleTypes.some((label) => roles.includes(label)));
|
|
24062
|
+
const {
|
|
24063
|
+
isExperimentEnabled
|
|
24064
|
+
} = useExperimentsContext();
|
|
24065
|
+
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
24001
24066
|
return jsx(DropinLayout, {
|
|
24002
24067
|
content: jsxs("div", {
|
|
24003
24068
|
className: "adl-trust-members adl-u-width-full",
|
|
@@ -24038,15 +24103,17 @@ const TrustMembersOverview = ({
|
|
|
24038
24103
|
case "rootTrustee":
|
|
24039
24104
|
return jsx(RootTrusteeTaskItem, {
|
|
24040
24105
|
rootTrustee: trustMember,
|
|
24041
|
-
taskStatus: getTrustMemberTaskStatus(trustMember)
|
|
24042
|
-
|
|
24106
|
+
taskStatus: getTrustMemberTaskStatus(trustMember),
|
|
24107
|
+
onEdit: allowMoreRolesForMainRootTrustee ? () => navigateToEditTrustMember(trustMember) : () => {
|
|
24108
|
+
}
|
|
24109
|
+
}, trustMember.legalEntityId);
|
|
24043
24110
|
case "regular":
|
|
24044
24111
|
return jsx(RegularTrustMemberTaskItem, {
|
|
24045
24112
|
trustMember,
|
|
24046
24113
|
taskStatus: getTrustMemberTaskStatus(trustMember),
|
|
24047
24114
|
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
24048
24115
|
onDelete: () => deleteTrustMember(trustMember)
|
|
24049
|
-
});
|
|
24116
|
+
}, trustMember.legalEntityId);
|
|
24050
24117
|
case "company":
|
|
24051
24118
|
return jsx(CompanyTrustMemberTaskItem, {
|
|
24052
24119
|
companyTrustMember: trustMember,
|
|
@@ -24055,20 +24122,20 @@ const TrustMembersOverview = ({
|
|
|
24055
24122
|
onDelete: () => deleteTrustMember(trustMember),
|
|
24056
24123
|
onEditOwner: () => navigateToEditTrustMemberOwner(trustMember.ownerId, trustMember.legalEntityId),
|
|
24057
24124
|
onAddOwner: () => navigateToEditTrustMemberOwner("", trustMember.legalEntityId)
|
|
24058
|
-
});
|
|
24125
|
+
}, trustMember.legalEntityId);
|
|
24059
24126
|
case "exemptSettlor":
|
|
24060
24127
|
return jsx(ExemptSettlorTaskItem, {
|
|
24061
24128
|
exemptSettlor: trustMember,
|
|
24062
24129
|
taskStatus: getTrustMemberTaskStatus(trustMember),
|
|
24063
24130
|
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
24064
24131
|
onDelete: () => deleteTrustMember(trustMember)
|
|
24065
|
-
});
|
|
24132
|
+
}, trustMember.legalEntityId);
|
|
24066
24133
|
case "undefinedBeneficiary":
|
|
24067
24134
|
return jsx(UndefinedBeneficiaryTaskItem, {
|
|
24068
24135
|
undefinedBeneficiary: trustMember,
|
|
24069
24136
|
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
24070
24137
|
onDelete: () => deleteTrustMember(trustMember)
|
|
24071
|
-
});
|
|
24138
|
+
}, trustMember.reference);
|
|
24072
24139
|
}
|
|
24073
24140
|
})
|
|
24074
24141
|
}), jsx(Button, {
|
|
@@ -25575,6 +25642,7 @@ const convertExistingTrustMember = (trustMember) => {
|
|
|
25575
25642
|
};
|
|
25576
25643
|
case "rootTrustee":
|
|
25577
25644
|
return {
|
|
25645
|
+
trustMemberType: trustMember.trustMemberType,
|
|
25578
25646
|
entityType: trustMember.legalEntityType,
|
|
25579
25647
|
role: trustMember.roles,
|
|
25580
25648
|
settlorExemptionReason: ["noneOfTheAbove"]
|
|
@@ -25591,6 +25659,12 @@ const convertExistingTrustMember = (trustMember) => {
|
|
|
25591
25659
|
};
|
|
25592
25660
|
}
|
|
25593
25661
|
};
|
|
25662
|
+
const convertRootTrusteeTrustMember = (trustMember) => ({
|
|
25663
|
+
trustMemberType: trustMember.trustMemberType,
|
|
25664
|
+
entityType: trustMember.legalEntityType,
|
|
25665
|
+
role: trustMember.roles,
|
|
25666
|
+
settlorExemptionReason: ["noneOfTheAbove"]
|
|
25667
|
+
});
|
|
25594
25668
|
const allowedCrossoverRolesMatrix = {
|
|
25595
25669
|
settlor: ["secondaryTrustee", "protector"],
|
|
25596
25670
|
secondaryTrustee: ["settlor", "protector", "definedBeneficiary"],
|
|
@@ -25598,6 +25672,67 @@ const allowedCrossoverRolesMatrix = {
|
|
|
25598
25672
|
definedBeneficiary: ["secondaryTrustee", "protector"],
|
|
25599
25673
|
undefinedBeneficiary: []
|
|
25600
25674
|
};
|
|
25675
|
+
const allowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType = {
|
|
25676
|
+
rootTrustee: {
|
|
25677
|
+
[LegalEntityType.INDIVIDUAL]: {
|
|
25678
|
+
settlor: ["secondaryTrustee", "protector"],
|
|
25679
|
+
secondaryTrustee: ["settlor", "protector", "definedBeneficiary"],
|
|
25680
|
+
protector: ["settlor", "secondaryTrustee", "definedBeneficiary"],
|
|
25681
|
+
definedBeneficiary: ["secondaryTrustee", "protector"],
|
|
25682
|
+
undefinedBeneficiary: []
|
|
25683
|
+
},
|
|
25684
|
+
[LegalEntityType.ORGANIZATION]: {
|
|
25685
|
+
settlor: ["secondaryTrustee", "protector"],
|
|
25686
|
+
secondaryTrustee: ["settlor", "protector"],
|
|
25687
|
+
protector: ["settlor", "secondaryTrustee"],
|
|
25688
|
+
definedBeneficiary: [],
|
|
25689
|
+
undefinedBeneficiary: []
|
|
25690
|
+
}
|
|
25691
|
+
}
|
|
25692
|
+
};
|
|
25693
|
+
const getAllowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType = (trustMember) => {
|
|
25694
|
+
const {
|
|
25695
|
+
trustMemberType
|
|
25696
|
+
} = trustMember;
|
|
25697
|
+
if (trustMemberType === "undefinedBeneficiary") {
|
|
25698
|
+
return allowedCrossoverRolesMatrix;
|
|
25699
|
+
}
|
|
25700
|
+
const crossoverRolesByTrustMember = allowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType[trustMemberType];
|
|
25701
|
+
if (!crossoverRolesByTrustMember) {
|
|
25702
|
+
return allowedCrossoverRolesMatrix;
|
|
25703
|
+
}
|
|
25704
|
+
const crossoverRoles = crossoverRolesByTrustMember[trustMember.legalEntityType];
|
|
25705
|
+
if (!crossoverRoles) {
|
|
25706
|
+
return allowedCrossoverRolesMatrix;
|
|
25707
|
+
}
|
|
25708
|
+
return crossoverRoles;
|
|
25709
|
+
};
|
|
25710
|
+
const availablesRolesByTrustMemberTypeAndLegalEntityType = {
|
|
25711
|
+
rootTrustee: {
|
|
25712
|
+
[LegalEntityType.INDIVIDUAL]: ["settlor", "protector", "definedBeneficiary"],
|
|
25713
|
+
[LegalEntityType.ORGANIZATION]: ["settlor", "protector"]
|
|
25714
|
+
}
|
|
25715
|
+
};
|
|
25716
|
+
const getAvailableRolesByTrustMemberTypeAndLegalEntityType = (currentRoles, trustMember) => {
|
|
25717
|
+
if (!(currentRoles == null ? void 0 : currentRoles.length)) {
|
|
25718
|
+
const {
|
|
25719
|
+
trustMemberType,
|
|
25720
|
+
legalEntityType
|
|
25721
|
+
} = trustMember;
|
|
25722
|
+
const availableRolesByTrustMemberType = availablesRolesByTrustMemberTypeAndLegalEntityType[trustMemberType];
|
|
25723
|
+
if (!availableRolesByTrustMemberType) {
|
|
25724
|
+
return Object.values(TrustMemberTypes);
|
|
25725
|
+
}
|
|
25726
|
+
const availableRoles = availableRolesByTrustMemberType[legalEntityType];
|
|
25727
|
+
if (!availableRoles) {
|
|
25728
|
+
return Object.values(TrustMemberTypes);
|
|
25729
|
+
}
|
|
25730
|
+
return availableRoles;
|
|
25731
|
+
}
|
|
25732
|
+
const crossoverRolesMatrix = trustMember ? getAllowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType(trustMember) : allowedCrossoverRolesMatrix;
|
|
25733
|
+
const roles = currentRoles.map((role2) => [role2, ...crossoverRolesMatrix[role2]]).reduce((existingAllowed, allowedForRole) => existingAllowed.filter((role2) => allowedForRole.includes(role2)));
|
|
25734
|
+
return roles.filter((r) => r !== "secondaryTrustee");
|
|
25735
|
+
};
|
|
25601
25736
|
const getAvailableRoles = (currentRoles) => {
|
|
25602
25737
|
if (!(currentRoles == null ? void 0 : currentRoles.length))
|
|
25603
25738
|
return Object.values(TrustMemberTypes);
|
|
@@ -25660,6 +25795,15 @@ const leTypeCardDetails = {
|
|
|
25660
25795
|
description: "businessEntityDescription"
|
|
25661
25796
|
}
|
|
25662
25797
|
};
|
|
25798
|
+
const convertExistingTrustMemberToDefaultData = (trustMember, allowMoreRolesForMainRootTrusteeEnabled) => {
|
|
25799
|
+
if (!trustMember) {
|
|
25800
|
+
return {};
|
|
25801
|
+
}
|
|
25802
|
+
if (allowMoreRolesForMainRootTrusteeEnabled && trustMember.trustMemberType === "rootTrustee") {
|
|
25803
|
+
return convertRootTrusteeTrustMember(trustMember);
|
|
25804
|
+
}
|
|
25805
|
+
return convertExistingTrustMember(trustMember);
|
|
25806
|
+
};
|
|
25663
25807
|
const TrustRoleAndEntityType = (props) => {
|
|
25664
25808
|
const {
|
|
25665
25809
|
existingTrustMember,
|
|
@@ -25670,7 +25814,11 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25670
25814
|
const {
|
|
25671
25815
|
i18n
|
|
25672
25816
|
} = useI18nContext();
|
|
25673
|
-
const
|
|
25817
|
+
const {
|
|
25818
|
+
isExperimentEnabled
|
|
25819
|
+
} = useExperimentsContext();
|
|
25820
|
+
const allowMoreRolesForMainRootTrusteeEnabled = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
25821
|
+
const defaultData = convertExistingTrustMemberToDefaultData(existingTrustMember, allowMoreRolesForMainRootTrusteeEnabled);
|
|
25674
25822
|
const formUtils = formUtilities(props, i18n);
|
|
25675
25823
|
const decideFields = (data2) => {
|
|
25676
25824
|
var _a, _b;
|
|
@@ -25684,7 +25832,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25684
25832
|
if (couldBeExemptSettlor(data2)) {
|
|
25685
25833
|
return isExemptSettlor(data2) ? ["role", "entityType", "settlorExemptionReason", "firstName", "lastName"] : ["role", "entityType", "settlorExemptionReason"];
|
|
25686
25834
|
}
|
|
25687
|
-
return ["role", "entityType"];
|
|
25835
|
+
return allowMoreRolesForMainRootTrusteeEnabled ? ["role", "entityType", "trustMemberType"] : ["role", "entityType"];
|
|
25688
25836
|
}
|
|
25689
25837
|
return ["role"];
|
|
25690
25838
|
};
|
|
@@ -25706,7 +25854,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25706
25854
|
defaultData,
|
|
25707
25855
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
25708
25856
|
});
|
|
25709
|
-
const availableRoles = getAvailableRoles(data.role);
|
|
25857
|
+
const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && (existingTrustMember == null ? void 0 : existingTrustMember.trustMemberType) === "rootTrustee" ? getAvailableRolesByTrustMemberTypeAndLegalEntityType(data.role, existingTrustMember) : getAvailableRoles(data.role);
|
|
25710
25858
|
useEffect(() => {
|
|
25711
25859
|
(async () => {
|
|
25712
25860
|
var _a;
|
|
@@ -25852,7 +26000,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
25852
26000
|
name: i18n.get(reason)
|
|
25853
26001
|
})
|
|
25854
26002
|
})
|
|
25855
|
-
}),
|
|
26003
|
+
}), data.trustMemberType !== "rootTrustee" && (schema.includes("firstName") || schema.includes("lastName")) ? jsx(Name, {
|
|
25856
26004
|
...nameProps,
|
|
25857
26005
|
data: {
|
|
25858
26006
|
firstName: defaultData.firstName,
|
|
@@ -25932,6 +26080,7 @@ const decideForms = (trustMember) => {
|
|
|
25932
26080
|
case "exemptSettlor":
|
|
25933
26081
|
return exemptSettlorForms;
|
|
25934
26082
|
case "rootTrustee":
|
|
26083
|
+
return exemptSettlorForms;
|
|
25935
26084
|
case "regular":
|
|
25936
26085
|
case "company":
|
|
25937
26086
|
return regularForms;
|
|
@@ -25940,6 +26089,15 @@ const decideForms = (trustMember) => {
|
|
|
25940
26089
|
const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettlorWithExemptionReasonEnabled2 = false) => {
|
|
25941
26090
|
var _a;
|
|
25942
26091
|
const existingId = existingTrustMember ? existingTrustMember.trustMemberType === "undefinedBeneficiary" ? existingTrustMember.reference : existingTrustMember.legalEntityId : void 0;
|
|
26092
|
+
if (data.trustMemberType === "rootTrustee") {
|
|
26093
|
+
return {
|
|
26094
|
+
trustMemberType: "rootTrustee",
|
|
26095
|
+
roles: data.role ?? [],
|
|
26096
|
+
legalEntityType: data.entityType ?? LegalEntityType.ORGANIZATION,
|
|
26097
|
+
legalEntityId: "",
|
|
26098
|
+
name: data.firstName ?? ""
|
|
26099
|
+
};
|
|
26100
|
+
}
|
|
25943
26101
|
if ((_a = data.role) == null ? void 0 : _a.length) {
|
|
25944
26102
|
if (isExemptSettlor(data)) {
|
|
25945
26103
|
if (isOrganizationSettlorWithExemptionReasonEnabled2 && data.entityType === LegalEntityType.ORGANIZATION) {
|
|
@@ -27586,6 +27744,7 @@ function DropinComposerComponent({
|
|
|
27586
27744
|
const reviewRequired = (legalEntity == null ? void 0 : legalEntity.id) && ((_d = (_c = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _c[legalEntity.id]) == null ? void 0 : _d.isReviewRequired);
|
|
27587
27745
|
const additionalSalesChannels = useSalesChannelsSettings();
|
|
27588
27746
|
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), trust2 == null ? void 0 : trust2.trust.countryOfGoverningLaw);
|
|
27747
|
+
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
27589
27748
|
const getLegalEntityProblems = (le) => {
|
|
27590
27749
|
var _a2;
|
|
27591
27750
|
if (le == null ? void 0 : le.id) {
|
|
@@ -27812,6 +27971,15 @@ function DropinComposerComponent({
|
|
|
27812
27971
|
});
|
|
27813
27972
|
break;
|
|
27814
27973
|
case "rootTrustee":
|
|
27974
|
+
if (allowMoreRolesForMainRootTrustee && existing) {
|
|
27975
|
+
existing.roles = updated.roles;
|
|
27976
|
+
await updateRootTrusteeTrustMember({
|
|
27977
|
+
trustMember: existing,
|
|
27978
|
+
trust: trust2,
|
|
27979
|
+
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
27980
|
+
});
|
|
27981
|
+
}
|
|
27982
|
+
break;
|
|
27815
27983
|
default:
|
|
27816
27984
|
logger$5.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
|
|
27817
27985
|
}
|
|
@@ -28327,7 +28495,7 @@ function DropinComposerComponent({
|
|
|
28327
28495
|
});
|
|
28328
28496
|
case TaskTypes.TRUST_MEMBER_OVERVIEW:
|
|
28329
28497
|
return jsx(TrustMembersOverview, {
|
|
28330
|
-
trustMembers: getTrustMembers(trust2, legalEntity, exemptSettlor),
|
|
28498
|
+
trustMembers: allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust2, legalEntity, exemptSettlor) : getTrustMembers(trust2, legalEntity, exemptSettlor),
|
|
28331
28499
|
getTrustMemberTaskStatus: (member) => getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntity, member.trustMemberType === "undefinedBeneficiary" ? void 0 : [member.legalEntityId]),
|
|
28332
28500
|
navigateBackToTaskList: navigateBack,
|
|
28333
28501
|
navigateToEditTrustMember: onNavigateToTrustMemberRoleAndType,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { JSX } from 'preact';
|
|
2
2
|
import { TaskStatusProps } from '../types';
|
|
3
|
-
declare const TaskItemStatus: ({ status, downloadHandler }: TaskStatusProps) => JSX.Element;
|
|
3
|
+
declare const TaskItemStatus: ({ status, statusLabel, downloadHandler }: TaskStatusProps) => JSX.Element;
|
|
4
4
|
export default TaskItemStatus;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../TaskListItem.scss';
|
|
2
2
|
import { TaskListItemProps } from '../types';
|
|
3
|
-
declare const TaskListItem: ({ title, tagline, icon, status, onNavigateToTask, disabled, problems, downloadHandler, info, loading, showErrorAlerts, showWarningAlert, warningMessage, removeEntity, isRemoveDisabled, handleIsRemoveDisabled, }: TaskListItemProps) => import("preact").JSX.Element;
|
|
3
|
+
declare const TaskListItem: ({ title, tagline, icon, status, statusLabel, onNavigateToTask, disabled, problems, downloadHandler, info, loading, showErrorAlerts, showWarningAlert, warningMessage, removeEntity, isRemoveDisabled, handleIsRemoveDisabled, }: TaskListItemProps) => import("preact").JSX.Element;
|
|
4
4
|
export default TaskListItem;
|
|
@@ -46,6 +46,7 @@ export declare enum TaskStatus {
|
|
|
46
46
|
}
|
|
47
47
|
export interface TaskStatusProps {
|
|
48
48
|
status: TaskStatus | 'review';
|
|
49
|
+
statusLabel?: string;
|
|
49
50
|
downloadHandler?(): void;
|
|
50
51
|
}
|
|
51
52
|
export interface TaskListComponentProps {
|
|
@@ -67,6 +68,7 @@ export interface TaskListGroupProps {
|
|
|
67
68
|
export interface TaskListItemProps extends TaskStatusProps {
|
|
68
69
|
icon: string;
|
|
69
70
|
title: string;
|
|
71
|
+
statusLabel?: string;
|
|
70
72
|
tagline?: string;
|
|
71
73
|
disabled?: boolean;
|
|
72
74
|
problems?: EntityProblems;
|
|
@@ -3,6 +3,7 @@ import { RootTrustee } from '../types';
|
|
|
3
3
|
interface RootTrusteeTaskItemProps {
|
|
4
4
|
rootTrustee: RootTrustee;
|
|
5
5
|
taskStatus: TaskStatus;
|
|
6
|
+
onEdit: () => void;
|
|
6
7
|
}
|
|
7
|
-
export declare const RootTrusteeTaskItem: ({ rootTrustee, taskStatus }: RootTrusteeTaskItemProps) => import("preact").JSX.Element;
|
|
8
|
+
export declare const RootTrusteeTaskItem: ({ rootTrustee, taskStatus, onEdit, }: RootTrusteeTaskItemProps) => import("preact").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -8,7 +8,7 @@ import { SettlorExemptionReason, TrustMemberLegalEntityType } from '../TrustRole
|
|
|
8
8
|
*/
|
|
9
9
|
export interface RootTrustee {
|
|
10
10
|
trustMemberType: 'rootTrustee';
|
|
11
|
-
roles: [
|
|
11
|
+
roles: TrustMemberType[];
|
|
12
12
|
legalEntityType: TrustMemberLegalEntityType;
|
|
13
13
|
legalEntityId: string;
|
|
14
14
|
name: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { TrustMember } from '../TrustMembers/types';
|
|
1
|
+
import { RootTrustee, TrustMember } from '../TrustMembers/types';
|
|
2
2
|
import { TrustRoleAndEntityTypeSchema } from './types';
|
|
3
3
|
export declare const convertExistingTrustMember: (trustMember: TrustMember) => TrustRoleAndEntityTypeSchema;
|
|
4
|
+
export declare const convertRootTrusteeTrustMember: (trustMember: RootTrustee) => TrustRoleAndEntityTypeSchema;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { TrustMemberType } from '../../core/models/api/trust-member-type';
|
|
2
|
+
import { RootTrustee } from '../TrustMembers/types';
|
|
3
|
+
export declare const getAvailableRolesByTrustMemberTypeAndLegalEntityType: (currentRoles: TrustMemberType[] | undefined, trustMember: RootTrustee) => readonly TrustMemberType[];
|
|
2
4
|
export declare const getAvailableRoles: (currentRoles: TrustMemberType[] | undefined) => readonly TrustMemberType[];
|
|
@@ -20,6 +20,7 @@ export interface TrustRoleAndEntityTypeSchema extends NameSchema {
|
|
|
20
20
|
companyDetails?: CompanyNameAndCountrySchema;
|
|
21
21
|
country?: CountryCode;
|
|
22
22
|
legalCompanyName?: string;
|
|
23
|
+
trustMemberType?: string;
|
|
23
24
|
}
|
|
24
25
|
export interface TrustRoleAndEntityTypeProps extends BaseInnerFormProps<TrustRoleAndEntityTypeSchema> {
|
|
25
26
|
existingTrustMember?: TrustMember;
|