@lysaab/lysa-pep 3.0.4 → 4.0.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/Exports.d.ts +7 -7
- package/Exports.js +7 -7
- package/components/PepAnswers.d.ts +8 -8
- package/components/PepAnswers.js +103 -137
- package/messages/src/components/PepAnswers.json +1 -1
- package/messages/src/pages/IsPep/IsPepMessages.json +1 -1
- package/messages/src/pages/IsPep/IsPepPage.json +1 -1
- package/messages/src/pages/RelationPage/RelationMessages.json +1 -1
- package/messages/src/pages/RelationPage/RelationPage.json +1 -1
- package/messages/src/pages/RolePage/RoleMessages.json +1 -1
- package/messages/src/pages/RolePage/RolePage.json +1 -1
- package/messages/src/pages/StatusPage/StatusMessages.json +1 -1
- package/messages/src/pages/StatusPage/StatusPage.json +1 -1
- package/model/PepModel.d.ts +7 -7
- package/model/PepModel.js +40 -40
- package/package.json +3 -3
- package/pages/IsPep/IsPepMessages.d.ts +20 -32
- package/pages/IsPep/IsPepMessages.js +10 -70
- package/pages/IsPep/IsPepPage.d.ts +15 -15
- package/pages/IsPep/IsPepPage.js +61 -61
- package/pages/PepContext.d.ts +80 -81
- package/pages/PepContext.js +88 -89
- package/pages/RelationPage/RelationMessages.d.ts +67 -105
- package/pages/RelationPage/RelationMessages.js +69 -287
- package/pages/RelationPage/RelationPage.d.ts +6 -6
- package/pages/RelationPage/RelationPage.js +158 -156
- package/pages/RolePage/RoleMessages.d.ts +115 -185
- package/pages/RolePage/RoleMessages.js +117 -385
- package/pages/RolePage/RolePage.d.ts +13 -11
- package/pages/RolePage/RolePage.js +222 -223
- package/pages/StatusPage/StatusMessages.d.ts +48 -72
- package/pages/StatusPage/StatusMessages.js +50 -272
- package/pages/StatusPage/StatusPage.d.ts +10 -8
- package/pages/StatusPage/StatusPage.js +104 -105
- package/utils/Possession.d.ts +1 -1
- package/utils/Possession.js +27 -27
- package/components/CountrySelect.d.ts +0 -11
- package/components/CountrySelect.js +0 -41
- package/messages/src/components/CountrySelect.json +0 -1
package/Exports.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./pages/PepContext";
|
|
2
|
-
export * from "./model/PepModel";
|
|
3
|
-
export * from "./pages/IsPep/IsPepPage";
|
|
4
|
-
export { RelationPage } from "./pages/RelationPage/RelationPage";
|
|
5
|
-
export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts } from "./pages/RolePage/RolePage";
|
|
6
|
-
export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
|
|
7
|
-
export { PepAnswers } from "./components/PepAnswers";
|
|
1
|
+
export * from "./pages/PepContext";
|
|
2
|
+
export * from "./model/PepModel";
|
|
3
|
+
export * from "./pages/IsPep/IsPepPage";
|
|
4
|
+
export { RelationPage } from "./pages/RelationPage/RelationPage";
|
|
5
|
+
export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts } from "./pages/RolePage/RolePage";
|
|
6
|
+
export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
|
|
7
|
+
export { PepAnswers } from "./components/PepAnswers";
|
package/Exports.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./pages/PepContext";
|
|
2
|
-
export * from "./model/PepModel";
|
|
3
|
-
export * from "./pages/IsPep/IsPepPage";
|
|
4
|
-
export { RelationPage } from "./pages/RelationPage/RelationPage";
|
|
5
|
-
export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts } from "./pages/RolePage/RolePage";
|
|
6
|
-
export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
|
|
7
|
-
export { PepAnswers } from "./components/PepAnswers";
|
|
1
|
+
export * from "./pages/PepContext";
|
|
2
|
+
export * from "./model/PepModel";
|
|
3
|
+
export * from "./pages/IsPep/IsPepPage";
|
|
4
|
+
export { RelationPage } from "./pages/RelationPage/RelationPage";
|
|
5
|
+
export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts } from "./pages/RolePage/RolePage";
|
|
6
|
+
export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
|
|
7
|
+
export { PepAnswers } from "./components/PepAnswers";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FunctionComponent } from "react";
|
|
2
|
-
import "./PepAnswers.scss";
|
|
3
|
-
import { PepRequest } from "../model/PepModel";
|
|
4
|
-
interface Props {
|
|
5
|
-
answer: PepRequest;
|
|
6
|
-
}
|
|
7
|
-
export declare const PepAnswers: FunctionComponent<Props>;
|
|
8
|
-
export {};
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
import "./PepAnswers.scss";
|
|
3
|
+
import { PepRequest } from "../model/PepModel";
|
|
4
|
+
interface Props {
|
|
5
|
+
answer: PepRequest;
|
|
6
|
+
}
|
|
7
|
+
export declare const PepAnswers: FunctionComponent<Props>;
|
|
8
|
+
export {};
|
package/components/PepAnswers.js
CHANGED
|
@@ -1,137 +1,103 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./PepAnswers.scss";
|
|
3
|
-
import countries from "@lysaab/countries";
|
|
4
|
-
import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
|
|
5
|
-
import { PepType } from "../pages/PepContext";
|
|
6
|
-
import { useIntl, defineMessages, FormattedMessage } from "react-intl";
|
|
7
|
-
import { messages as isPepMessages } from "../pages/IsPep/IsPepMessages";
|
|
8
|
-
import { relationMessages, businessRelationMessages, } from "../pages/RelationPage/RelationMessages";
|
|
9
|
-
const messages = defineMessages({
|
|
10
|
-
whoIsPepLabel: {
|
|
11
|
-
id: "pep.answers.who.label",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
id: "pep.answers.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
id: "pep.answers.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
id: "pep.answers.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const entityType = answer.legalEntityType;
|
|
105
|
-
const lang = intl.locale.slice(0, 2);
|
|
106
|
-
const country = (countries[lang] || countries["en"]).find((country) => country.value === answer.country);
|
|
107
|
-
const role = getRoleAlts(intl).find((alt) => alt.value === answer.role);
|
|
108
|
-
const militaryRank = getMilitaryAlts(intl).find((alt) => alt.value === answer.militaryRank);
|
|
109
|
-
return (React.createElement("div", null,
|
|
110
|
-
answer.type && (React.createElement(StaticInput, { label: intl.formatMessage(messages.whoIsPepLabel), value: intl.formatMessage(isPepMessages[answer.type], {
|
|
111
|
-
entityType,
|
|
112
|
-
name: answer.ownerName,
|
|
113
|
-
}) })),
|
|
114
|
-
answer.relationToPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.relationLabel), value: intl.formatMessage(relationMessages[answer.relationToPEP], {
|
|
115
|
-
entityType,
|
|
116
|
-
name: answer.ownerName,
|
|
117
|
-
}) })),
|
|
118
|
-
answer.businessRelation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.businessRelationLabel), value: intl.formatMessage(businessRelationMessages[answer.businessRelation], { entityType, name: answer.ownerName }) })),
|
|
119
|
-
answer.nameOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.nameOfPepLabel), value: answer.nameOfPEP })),
|
|
120
|
-
answer.birthdayOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.birthdayOfPEPLabel), value: answer.birthdayOfPEP })),
|
|
121
|
-
answer.ended ? (React.createElement(React.Fragment, null,
|
|
122
|
-
React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusEndedValue) }),
|
|
123
|
-
React.createElement(StaticInput, { label: intl.formatMessage(messages.endedLabel), value: answer.ended }))) : (React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusOngoingValue) })),
|
|
124
|
-
answer.country && (React.createElement(StaticInput, { label: intl.formatMessage(messages.countryLabel), value: country ? country.label : answer.country })),
|
|
125
|
-
role && (React.createElement(StaticInput, { label: intl.formatMessage(messages.roleLabel), value: role.text })),
|
|
126
|
-
answer.ambassadorCountry && (React.createElement(StaticInput, { label: intl.formatMessage(messages.ambassadorCountryLabel), value: ((_a = (countries[lang] || countries["en"]).find((country) => country.value === answer.ambassadorCountry)) === null || _a === void 0 ? void 0 : _a.label) || answer.ambassadorCountry })),
|
|
127
|
-
answer.governmentCompany && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyNameLabel), value: answer.governmentCompany })),
|
|
128
|
-
answer.governmentCompanyRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyRoleLabel), value: answer.governmentCompanyRole })),
|
|
129
|
-
answer.internationalOrganisation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationNameLabel), value: answer.internationalOrganisation })),
|
|
130
|
-
answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationRoleLabel), value: answer.internationalOrganisationRole })),
|
|
131
|
-
militaryRank && (React.createElement(StaticInput, { label: intl.formatMessage(messages.militaryGradeLabel), value: militaryRank.text }))));
|
|
132
|
-
};
|
|
133
|
-
const StaticInput = ({ label, value }) => {
|
|
134
|
-
return (React.createElement("div", { className: "static-input" },
|
|
135
|
-
React.createElement("div", { className: "label" }, label),
|
|
136
|
-
React.createElement("div", { className: "value" }, value)));
|
|
137
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./PepAnswers.scss";
|
|
3
|
+
import countries from "@lysaab/countries";
|
|
4
|
+
import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
|
|
5
|
+
import { PepType } from "../pages/PepContext";
|
|
6
|
+
import { useIntl, defineMessages, FormattedMessage } from "react-intl";
|
|
7
|
+
import { messages as isPepMessages } from "../pages/IsPep/IsPepMessages";
|
|
8
|
+
import { relationMessages, businessRelationMessages, } from "../pages/RelationPage/RelationMessages";
|
|
9
|
+
const messages = defineMessages({
|
|
10
|
+
whoIsPepLabel: {
|
|
11
|
+
id: "pep.answers.who.label",
|
|
12
|
+
},
|
|
13
|
+
relationLabel: {
|
|
14
|
+
id: "pep.answers.relationship.label",
|
|
15
|
+
},
|
|
16
|
+
businessRelationLabel: {
|
|
17
|
+
id: "pep.answers.businessRelationship.label",
|
|
18
|
+
},
|
|
19
|
+
nameOfPepLabel: {
|
|
20
|
+
id: "pep.answers.nameOfPep.label",
|
|
21
|
+
},
|
|
22
|
+
birthdayOfPEPLabel: {
|
|
23
|
+
id: "pep.answers.birthdayOfPEP.label",
|
|
24
|
+
},
|
|
25
|
+
statusLabel: {
|
|
26
|
+
id: "pep.answers.status.label",
|
|
27
|
+
},
|
|
28
|
+
statusEndedValue: {
|
|
29
|
+
id: "pep.answers.statusEnded.value",
|
|
30
|
+
},
|
|
31
|
+
statusOngoingValue: {
|
|
32
|
+
id: "pep.answers.statusOngoing.value",
|
|
33
|
+
},
|
|
34
|
+
endedLabel: {
|
|
35
|
+
id: "pep.answers.endedStatus.label",
|
|
36
|
+
},
|
|
37
|
+
roleLabel: {
|
|
38
|
+
id: "pep.answers.role.label",
|
|
39
|
+
},
|
|
40
|
+
countryLabel: {
|
|
41
|
+
id: "pep.answers.country.label",
|
|
42
|
+
},
|
|
43
|
+
ambassadorCountryLabel: {
|
|
44
|
+
id: "pep.answers.ambassadorCountry.label",
|
|
45
|
+
},
|
|
46
|
+
governmentCompanyNameLabel: {
|
|
47
|
+
id: "pep.answers.governmentCompanyName.label",
|
|
48
|
+
},
|
|
49
|
+
governmentCompanyRoleLabel: {
|
|
50
|
+
id: "pep.answers.governmentCompanyRole.label",
|
|
51
|
+
},
|
|
52
|
+
internationalOrganisationNameLabel: {
|
|
53
|
+
id: "pep.answers.companyName.label",
|
|
54
|
+
},
|
|
55
|
+
internationalOrganisationRoleLabel: {
|
|
56
|
+
id: "pep.answers.companyRole.label",
|
|
57
|
+
},
|
|
58
|
+
militaryGradeLabel: {
|
|
59
|
+
id: "pep.answers.militaryRank.label",
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
export const PepAnswers = ({ answer }) => {
|
|
63
|
+
var _a;
|
|
64
|
+
const intl = useIntl();
|
|
65
|
+
if (!answer.type || answer.type === PepType.NOT_PEP) {
|
|
66
|
+
return (React.createElement("div", null,
|
|
67
|
+
React.createElement("p", null,
|
|
68
|
+
React.createElement(FormattedMessage, { id: "pep.answers.notpep" }))));
|
|
69
|
+
}
|
|
70
|
+
const entityType = answer.legalEntityType;
|
|
71
|
+
const lang = intl.locale.slice(0, 2);
|
|
72
|
+
const country = (countries[lang] || countries["en"]).find((country) => country.value === answer.country);
|
|
73
|
+
const role = getRoleAlts(intl).find((alt) => alt.value === answer.role);
|
|
74
|
+
const militaryRank = getMilitaryAlts(intl).find((alt) => alt.value === answer.militaryRank);
|
|
75
|
+
return (React.createElement("div", null,
|
|
76
|
+
answer.type && (React.createElement(StaticInput, { label: intl.formatMessage(messages.whoIsPepLabel), value: intl.formatMessage(isPepMessages[answer.type], {
|
|
77
|
+
entityType,
|
|
78
|
+
name: answer.ownerName,
|
|
79
|
+
}) })),
|
|
80
|
+
answer.relationToPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.relationLabel), value: intl.formatMessage(relationMessages[answer.relationToPEP], {
|
|
81
|
+
entityType,
|
|
82
|
+
name: answer.ownerName,
|
|
83
|
+
}) })),
|
|
84
|
+
answer.businessRelation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.businessRelationLabel), value: intl.formatMessage(businessRelationMessages[answer.businessRelation], { entityType, name: answer.ownerName }) })),
|
|
85
|
+
answer.nameOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.nameOfPepLabel), value: answer.nameOfPEP })),
|
|
86
|
+
answer.birthdayOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.birthdayOfPEPLabel), value: answer.birthdayOfPEP })),
|
|
87
|
+
answer.ended ? (React.createElement(React.Fragment, null,
|
|
88
|
+
React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusEndedValue) }),
|
|
89
|
+
React.createElement(StaticInput, { label: intl.formatMessage(messages.endedLabel), value: answer.ended }))) : (React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusOngoingValue) })),
|
|
90
|
+
answer.country && (React.createElement(StaticInput, { label: intl.formatMessage(messages.countryLabel), value: country ? country.label : answer.country })),
|
|
91
|
+
role && (React.createElement(StaticInput, { label: intl.formatMessage(messages.roleLabel), value: role.text })),
|
|
92
|
+
answer.ambassadorCountry && (React.createElement(StaticInput, { label: intl.formatMessage(messages.ambassadorCountryLabel), value: ((_a = (countries[lang] || countries["en"]).find((country) => country.value === answer.ambassadorCountry)) === null || _a === void 0 ? void 0 : _a.label) || answer.ambassadorCountry })),
|
|
93
|
+
answer.governmentCompany && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyNameLabel), value: answer.governmentCompany })),
|
|
94
|
+
answer.governmentCompanyRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyRoleLabel), value: answer.governmentCompanyRole })),
|
|
95
|
+
answer.internationalOrganisation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationNameLabel), value: answer.internationalOrganisation })),
|
|
96
|
+
answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationRoleLabel), value: answer.internationalOrganisationRole })),
|
|
97
|
+
militaryRank && (React.createElement(StaticInput, { label: intl.formatMessage(messages.militaryGradeLabel), value: militaryRank.text }))));
|
|
98
|
+
};
|
|
99
|
+
const StaticInput = ({ label, value }) => {
|
|
100
|
+
return (React.createElement("div", { className: "static-input" },
|
|
101
|
+
React.createElement("div", { className: "label" }, label),
|
|
102
|
+
React.createElement("div", { className: "value" }, value)));
|
|
103
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.answers.who.label"
|
|
1
|
+
[{"id":"pep.answers.who.label"},{"id":"pep.answers.relationship.label"},{"id":"pep.answers.businessRelationship.label"},{"id":"pep.answers.nameOfPep.label"},{"id":"pep.answers.birthdayOfPEP.label"},{"id":"pep.answers.status.label"},{"id":"pep.answers.statusEnded.value"},{"id":"pep.answers.statusOngoing.value"},{"id":"pep.answers.endedStatus.label"},{"id":"pep.answers.role.label"},{"id":"pep.answers.country.label"},{"id":"pep.answers.ambassadorCountry.label"},{"id":"pep.answers.governmentCompanyName.label"},{"id":"pep.answers.governmentCompanyRole.label"},{"id":"pep.answers.companyName.label"},{"id":"pep.answers.companyRole.label"},{"id":"pep.answers.militaryRank.label"},{"id":"pep.answers.notpep"}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.ispep.header"
|
|
1
|
+
[{"id":"pep.ispep.header"},{"id":"pep.ispep.required"},{"id":"pep.ispep.NOT_PEP"},{"id":"pep.ispep.ME"},{"id":"pep.ispep.RELATIVE"},{"id":"pep.ispep.COLLEAGUE"}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.ispep.next"
|
|
1
|
+
[{"id":"pep.ispep.next"}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.relation.relationship.header"
|
|
1
|
+
[{"id":"pep.relation.relationship.header"},{"id":"pep.relation.relation.required"},{"id":"pep.relation.relation.MARRIED_PARTNER"},{"id":"pep.relation.relation.COLIVING_PARTNER"},{"id":"pep.relation.relation.CHILD"},{"id":"pep.relation.relation.PARENT"},{"id":"pep.relation.relation.CHILD_MARRIED_PARTNER"},{"id":"pep.relation.relation.CHILD_COLIVING_PARTNER"},{"id":"pep.relation.businessrelation.header"},{"id":"pep.relation.businessrelation.required"},{"id":"pep.relation.businessrelation.alt.CO_OWNERSHIP"},{"id":"pep.relation.businessrelation.alt.CLOSE_CONNECTION"},{"id":"pep.relation.businessrelation.alt.COMPANY_FOR_PEP"},{"id":"pep.relation.relative.name.header"},{"id":"pep.relation.relative.name.required"},{"id":"pep.relation.birthday.header"},{"id":"pep.relation.birthday.required"},{"id":"pep.relation.colleague.name.header"},{"id":"pep.relation.colleague.name.required"}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.relation.next"
|
|
1
|
+
[{"id":"pep.relation.next"}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.role.roles.header","description":"Header","defaultMessage":"{ \n entityType, select,\n PERSON {\n { \n pepType, select, \n ME { \n State your role\n }\n RELATIVE { \n {\n relation, select,\n MARRIED_PARTNER { \n State the role of your spouse\n }\n COLIVING_PARTNER { \n State the role of your partner\n }\n CHILD { \n State the role of your parent\n }\n PARENT { \n State the role of your child\n }\n CHILD_MARRIED_PARTNER { \n State the role of the parent of your spouce\n }\n CHILD_COLIVING_PARTNER { \n State the role of the parent of your partner\n }\n other {}\n }\n }\n COLLEAGUE { \n {\n relation, select,\n CO_OWNERSHIP { \n State the role of the person in a politically exposed position that you have a relationship with\n }\n CLOSE_CONNECTION { \n State the role of the person in a politically exposed position that you have a relationship with\n }\n COMPANY_FOR_PEP { \n State the role of the person in a politically exposed position that you have a relationship with\n }\n other {}\n }\n }\n other {}\n }\n }\n CORPORATION {\n { \n pepType, select, \n ME { \n State the role of {name}\n }\n RELATIVE { \n {\n relation, select,\n MARRIED_PARTNER { \n State the role of the spouse of {name}\n }\n COLIVING_PARTNER { \n State the role of the partner of {name}\n }\n CHILD { \n State the role of the parent of {name}\n }\n PARENT { \n State the role of the child of {name}\n }\n CHILD_MARRIED_PARTNER { \n State the role of the parent of the spouse of {name}\n }\n CHILD_COLIVING_PARTNER { \n State the role of the parent of the partner of {name}\n }\n other {}\n }\n }\n COLLEAGUE { \n {\n relation, select,\n CO_OWNERSHIP { \n State the role of the person in a politically exposed position that {name} has a relationship with\n }\n CLOSE_CONNECTION { \n State the role of the person in a politically exposed position that {name} has a relationship with\n }\n COMPANY_FOR_PEP { \n State the role of the person in a politically exposed position that {name} has a relationship with\n }\n other {}\n }\n }\n other {}\n }\n }\n other {}\n }"},{"id":"pep.role.roles.placeholder","description":"Role placeholder","defaultMessage":"Choose a role"},{"id":"pep.role.roles.required","description":"Required validation error","defaultMessage":"You need to choose a role"},{"id":"pep.role.roles.alt.HEAD_OF_GOVERNMENT","description":"Head of government alt","defaultMessage":"Head of state"},{"id":"pep.role.roles.alt.MINISTER","description":"Minister alt","defaultMessage":"Minister or Deputy Minister"},{"id":"pep.role.roles.alt.PARLIMENT_MEMBER","description":"Parlament alt","defaultMessage":"Member of the parliament"},{"id":"pep.role.roles.alt.CENTRAL_BANK_MEMBER","description":"Central bank member alt","defaultMessage":"Member of the Board of the Central Bank"},{"id":"pep.role.roles.alt.BOARD_MEMBER_POLITICAL_PARTY","description":"Political party board member alt","defaultMessage":"Member of the Board in a political party in the parliament"},{"id":"pep.role.roles.alt.JUDGE_SUPREME_COURT","description":"Supreme court judge alt","defaultMessage":"Supreme Court judge"},{"id":"pep.role.roles.alt.JUDGE_OTHER_HIGH_COURT","description":"High court judge alt","defaultMessage":"Judge in a constitutional court of law or other high-level judicial body whose decisions only exceptionally can be appealed"},{"id":"pep.role.roles.alt.REVISION_INSTITUTE","description":"Revision institute worker alt","defaultMessage":"Senior official at a governmental audit authority"},{"id":"pep.role.roles.alt.AMBASSADOR","description":"Ambassador alt","defaultMessage":"Ambassador or head of mission"},{"id":"pep.role.roles.alt.MILITARY_OFFICER","description":"Military officer alt","defaultMessage":"Senior ranking officer in the armed forces"},{"id":"pep.role.roles.alt.GOVERNMENT_COMPANY","description":"Government company leader alt","defaultMessage":"Person part of a state-owned company's administrative-, managerial- or control bopdy"},{"id":"pep.role.roles.alt.EU_HIGH_RANKING_POSITION","description":"High ranking EU position alt","defaultMessage":"Member of the European Parliament"},{"id":"pep.role.roles.alt.HIGH_RANKING_POSITION_INTERNALTIONAL_CORP","description":"High ranking position in an international organisation alt","defaultMessage":"Senior management in an international organisation"},{"id":"pep.role.military.name.header","description":"International company name header","defaultMessage":"{ \n entityType, select,\n PERSON {\n { \n pepType, select, \n ME { \n State your rank\n }\n RELATIVE { \n {\n relation, select,\n MARRIED_PARTNER { \n State the rank of your spouce\n }\n COLIVING_PARTNER { \n State the rank of your partner\n }\n CHILD { \n State the rank of your parent\n }\n PARENT { \n State the rank of your child\n }\n CHILD_MARRIED_PARTNER { \n State the rank of your spouce's parent\n }\n CHILD_COLIVING_PARTNER { \n State the rank of your partner's parent\n }\n other {}\n }\n }\n COLLEAGUE { \n {\n relation, select,\n CO_OWNERSHIP { \n State the rank of the person that you have a relationship with that is controlling the company and is in a politically exposed position\n }\n CLOSE_CONNECTION { \n State the rank of the person that you have or have had a close relationship with \n }\n COMPANY_FOR_PEP { \n What rank does the person have\n }\n other {}\n }\n }\n other {}\n }\n }\n CORPORATION {\n { \n pepType, select, \n ME { \n State the rank of {name}\n }\n RELATIVE { \n {\n relation, select,\n MARRIED_PARTNER { \n State the rank of the spouse of {name}\n }\n COLIVING_PARTNER { \n State the rank of the partner of {name}\n }\n CHILD { \n State the rank of the parent of {name}\n }\n PARENT { \n State the rank of the child of {name}\n }\n CHILD_MARRIED_PARTNER { \n State the rank of the parent of the spouse of {name}\n }\n CHILD_COLIVING_PARTNER { \n State the rank of the parent of the partner of {name}\n }\n other {}\n }\n }\n COLLEAGUE { \n {\n relation, select,\n CO_OWNERSHIP { \n State the rank of the person in a politically exposed position that {name} has a relationship with\n }\n CLOSE_CONNECTION { \n State the rank of the person in a politically exposed position that {name} has a relationship with\n }\n COMPANY_FOR_PEP { \n What rank does the person have\n }\n other {}\n }\n }\n other {}\n }\n }\n other {}\n }"},{"id":"pep.role.military.header","description":"Header","defaultMessage":"Choose a role"},{"id":"pep.role.military.required","description":"Required validation error","defaultMessage":"You need to choose a role"},{"id":"pep.role.military.alt.GENERAL","description":"General alt","defaultMessage":"General"},{"id":"pep.role.military.alt.LIEUTENANT_GENERAL","description":"Lieutenant general alt","defaultMessage":"Lieutenant general"},{"id":"pep.role.military.alt.MAJOR_GENERAL","description":"Major general alt","defaultMessage":"Major general"},{"id":"pep.role.military.alt.ADMIRAL","description":"Admiral alt","defaultMessage":"Admiral"},{"id":"pep.role.military.alt.VICE_ADMIRAL","description":"Vice admiral alt","defaultMessage":"Vice admiral"},{"id":"pep.role.military.alt.REAR_ADMIRAL","description":"Rear admiral alt","defaultMessage":"Conter admiral"},{"id":"pep.role.ambassador.header","description":"Ambassador header","defaultMessage":"State the country"},{"id":"pep.role.ambassador.required","description":"Ambassador required error","defaultMessage":"You need to choose a country"},{"id":"pep.role.governmentCompany.name.header","description":"Government company name header","defaultMessage":"State the name of the company"},{"id":"pep.role.governmentCompany.name.required","description":"Government company name required error","defaultMessage":"You need to state a name"},{"id":"pep.role.governmentCompany.role.header","description":"Government company role header","defaultMessage":"State role"},{"id":"pep.role.governmentCompany.role.required","description":"Government company role required error","defaultMessage":"You need to state a role"},{"id":"pep.role.intCompany.name.header","description":"International company name header","defaultMessage":"State the organization's name"},{"id":"pep.role.intCompany.name.required","description":"International company name required error","defaultMessage":"You need to state a name"},{"id":"pep.role.intCompany.role.header","description":"International company role header","defaultMessage":"State role"},{"id":"pep.role.intCompany.role.required","description":"International company role required error","defaultMessage":"You need to state a role"}]
|
|
1
|
+
[{"id":"pep.role.roles.header"},{"id":"pep.role.roles.placeholder"},{"id":"pep.role.roles.required"},{"id":"pep.role.roles.alt.HEAD_OF_GOVERNMENT"},{"id":"pep.role.roles.alt.MINISTER"},{"id":"pep.role.roles.alt.PARLIMENT_MEMBER"},{"id":"pep.role.roles.alt.CENTRAL_BANK_MEMBER"},{"id":"pep.role.roles.alt.BOARD_MEMBER_POLITICAL_PARTY"},{"id":"pep.role.roles.alt.JUDGE_SUPREME_COURT"},{"id":"pep.role.roles.alt.JUDGE_OTHER_HIGH_COURT"},{"id":"pep.role.roles.alt.REVISION_INSTITUTE"},{"id":"pep.role.roles.alt.AMBASSADOR"},{"id":"pep.role.roles.alt.MILITARY_OFFICER"},{"id":"pep.role.roles.alt.GOVERNMENT_COMPANY"},{"id":"pep.role.roles.alt.EU_HIGH_RANKING_POSITION"},{"id":"pep.role.roles.alt.HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"},{"id":"pep.role.military.name.header"},{"id":"pep.role.military.header"},{"id":"pep.role.military.required"},{"id":"pep.role.military.alt.GENERAL"},{"id":"pep.role.military.alt.LIEUTENANT_GENERAL"},{"id":"pep.role.military.alt.MAJOR_GENERAL"},{"id":"pep.role.military.alt.ADMIRAL"},{"id":"pep.role.military.alt.VICE_ADMIRAL"},{"id":"pep.role.military.alt.REAR_ADMIRAL"},{"id":"pep.role.ambassador.header"},{"id":"pep.role.ambassador.required"},{"id":"pep.role.governmentCompany.name.header"},{"id":"pep.role.governmentCompany.name.required"},{"id":"pep.role.governmentCompany.role.header"},{"id":"pep.role.governmentCompany.role.required"},{"id":"pep.role.intCompany.name.header"},{"id":"pep.role.intCompany.name.required"},{"id":"pep.role.intCompany.role.header"},{"id":"pep.role.intCompany.role.required"}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.role.next"
|
|
1
|
+
[{"id":"pep.role.next"}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.status.isongoing.header"
|
|
1
|
+
[{"id":"pep.status.isongoing.header"},{"id":"pep.status.isongoing.required"},{"id":"pep.status.ended.header"},{"id":"pep.status.ended.required"},{"id":"pep.status.localcountry.header"},{"id":"pep.status.localcountry.required"},{"id":"pep.status.countryselecton.header"},{"id":"pep.status.countryselecton.required"},{"id":"pep.status.localcountryalt.local"},{"id":"pep.status.othercountryalt.other"},{"id":"pep.status.state.ONGOING"},{"id":"pep.status.state.ENDED"}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"pep.status.next"
|
|
1
|
+
[{"id":"pep.status.next"}]
|
package/model/PepModel.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PepState } from "../pages/PepContext";
|
|
2
|
-
export interface PepRequest extends Omit<PepState, "isLocalCountry" | "isOngoing" | "ended" | "birthdayOfPEP"> {
|
|
3
|
-
ended?: string;
|
|
4
|
-
birthdayOfPEP?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function stateToRequest(pepState: PepState): PepRequest;
|
|
7
|
-
export declare function requestToState({ ended, birthdayOfPEP, ...serverData }: PepRequest, countryCode: string): PepState;
|
|
1
|
+
import { PepState } from "../pages/PepContext";
|
|
2
|
+
export interface PepRequest extends Omit<PepState, "isLocalCountry" | "isOngoing" | "ended" | "birthdayOfPEP"> {
|
|
3
|
+
ended?: string;
|
|
4
|
+
birthdayOfPEP?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function stateToRequest(pepState: PepState): PepRequest;
|
|
7
|
+
export declare function requestToState({ ended, birthdayOfPEP, ...serverData }: PepRequest, countryCode: string): PepState;
|
package/model/PepModel.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { PepType, EntityType, PepStatus } from "../pages/PepContext";
|
|
13
|
-
import { DateTime } from "luxon";
|
|
14
|
-
export function stateToRequest(pepState) {
|
|
15
|
-
const state = Object.assign({}, pepState);
|
|
16
|
-
delete state.isLocalCountry;
|
|
17
|
-
delete state.isOngoing;
|
|
18
|
-
delete state.ownerName;
|
|
19
|
-
if (state.legalEntityType === EntityType.PERSON) {
|
|
20
|
-
delete state.tin;
|
|
21
|
-
}
|
|
22
|
-
return Object.assign(Object.assign({}, state), { country: state.type === PepType.NOT_PEP ? undefined : state.country, ended: state.ended
|
|
23
|
-
? DateTime.fromJSDate(state.ended).toFormat("yyyy-MM")
|
|
24
|
-
: undefined, birthdayOfPEP: state.birthdayOfPEP
|
|
25
|
-
? DateTime.fromJSDate(state.birthdayOfPEP).toFormat("yyyy-MM-dd")
|
|
26
|
-
: undefined });
|
|
27
|
-
}
|
|
28
|
-
export function requestToState(_a, countryCode) {
|
|
29
|
-
var { ended, birthdayOfPEP } = _a, serverData = __rest(_a, ["ended", "birthdayOfPEP"]);
|
|
30
|
-
const state = Object.assign({}, serverData);
|
|
31
|
-
if (ended) {
|
|
32
|
-
state.ended = DateTime.fromFormat(ended, "yyyy-MM").toJSDate();
|
|
33
|
-
}
|
|
34
|
-
if (birthdayOfPEP) {
|
|
35
|
-
state.birthdayOfPEP = DateTime.fromFormat(birthdayOfPEP, "yyyy-MM-dd").toJSDate();
|
|
36
|
-
}
|
|
37
|
-
state.isLocalCountry = state.country === countryCode ? "local" : "other";
|
|
38
|
-
state.isOngoing = state.ended ? PepStatus.ENDED : PepStatus.ONGOING;
|
|
39
|
-
return state;
|
|
40
|
-
}
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { PepType, EntityType, PepStatus } from "../pages/PepContext";
|
|
13
|
+
import { DateTime } from "luxon";
|
|
14
|
+
export function stateToRequest(pepState) {
|
|
15
|
+
const state = Object.assign({}, pepState);
|
|
16
|
+
delete state.isLocalCountry;
|
|
17
|
+
delete state.isOngoing;
|
|
18
|
+
delete state.ownerName;
|
|
19
|
+
if (state.legalEntityType === EntityType.PERSON) {
|
|
20
|
+
delete state.tin;
|
|
21
|
+
}
|
|
22
|
+
return Object.assign(Object.assign({}, state), { country: state.type === PepType.NOT_PEP ? undefined : state.country, ended: state.ended
|
|
23
|
+
? DateTime.fromJSDate(state.ended).toFormat("yyyy-MM")
|
|
24
|
+
: undefined, birthdayOfPEP: state.birthdayOfPEP
|
|
25
|
+
? DateTime.fromJSDate(state.birthdayOfPEP).toFormat("yyyy-MM-dd")
|
|
26
|
+
: undefined });
|
|
27
|
+
}
|
|
28
|
+
export function requestToState(_a, countryCode) {
|
|
29
|
+
var { ended, birthdayOfPEP } = _a, serverData = __rest(_a, ["ended", "birthdayOfPEP"]);
|
|
30
|
+
const state = Object.assign({}, serverData);
|
|
31
|
+
if (ended) {
|
|
32
|
+
state.ended = DateTime.fromFormat(ended, "yyyy-MM").toJSDate();
|
|
33
|
+
}
|
|
34
|
+
if (birthdayOfPEP) {
|
|
35
|
+
state.birthdayOfPEP = DateTime.fromFormat(birthdayOfPEP, "yyyy-MM-dd").toJSDate();
|
|
36
|
+
}
|
|
37
|
+
state.isLocalCountry = state.country === countryCode ? "local" : "other";
|
|
38
|
+
state.isOngoing = state.ended ? PepStatus.ENDED : PepStatus.ONGOING;
|
|
39
|
+
return state;
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lysaab/lysa-pep",
|
|
3
3
|
"author": "Lysa AB",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"main": "./Exports.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@lysaab/countries": "^3.1.1",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@formatjs/cli": "^1.1.22",
|
|
16
|
-
"@lysaab/ui-2": "^
|
|
16
|
+
"@lysaab/ui-2": "^33.2.2",
|
|
17
17
|
"@types/jest": "24.0.20",
|
|
18
18
|
"@types/luxon": "^1.15.2",
|
|
19
19
|
"@types/node": "12.11.7",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typescript": "^4.3.4"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@lysaab/ui-2": "^
|
|
35
|
+
"@lysaab/ui-2": "^33.2.1",
|
|
36
36
|
"react": "^17.0.1",
|
|
37
37
|
"react-intl": "^5.20.2",
|
|
38
38
|
"react-router-dom": "^5.2.0"
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
export declare const messages: {
|
|
2
|
-
header: {
|
|
3
|
-
id: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
id: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
RELATIVE: {
|
|
23
|
-
id: string;
|
|
24
|
-
description: string;
|
|
25
|
-
defaultMessage: string;
|
|
26
|
-
};
|
|
27
|
-
COLLEAGUE: {
|
|
28
|
-
id: string;
|
|
29
|
-
description: string;
|
|
30
|
-
defaultMessage: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
header: {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
required: {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
NOT_PEP: {
|
|
9
|
+
id: string;
|
|
10
|
+
};
|
|
11
|
+
ME: {
|
|
12
|
+
id: string;
|
|
13
|
+
};
|
|
14
|
+
RELATIVE: {
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
COLLEAGUE: {
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
};
|