@lysaab/lysa-pep 5.0.1 → 6.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/components/PepAnswers.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./PepAnswers.scss";
|
|
3
|
-
import countries from "@lysaab/countries";
|
|
4
3
|
import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
|
|
5
4
|
import { PepType } from "../pages/PepContext";
|
|
6
5
|
import { useIntl, defineMessages, FormattedMessage } from "react-intl";
|
|
@@ -60,7 +59,6 @@ const messages = defineMessages({
|
|
|
60
59
|
},
|
|
61
60
|
});
|
|
62
61
|
export const PepAnswers = ({ answer }) => {
|
|
63
|
-
var _a;
|
|
64
62
|
const intl = useIntl();
|
|
65
63
|
if (!answer.type || answer.type === PepType.NOT_PEP) {
|
|
66
64
|
return (React.createElement("div", null,
|
|
@@ -68,8 +66,6 @@ export const PepAnswers = ({ answer }) => {
|
|
|
68
66
|
React.createElement(FormattedMessage, { id: "pep.answers.notpep" }))));
|
|
69
67
|
}
|
|
70
68
|
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
69
|
const role = getRoleAlts(intl).find((alt) => alt.value === answer.role);
|
|
74
70
|
const militaryRank = getMilitaryAlts(intl).find((alt) => alt.value === answer.militaryRank);
|
|
75
71
|
return (React.createElement("div", null,
|
|
@@ -87,9 +83,11 @@ export const PepAnswers = ({ answer }) => {
|
|
|
87
83
|
answer.ended ? (React.createElement(React.Fragment, null,
|
|
88
84
|
React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusEndedValue) }),
|
|
89
85
|
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
|
|
86
|
+
answer.country && (React.createElement(StaticInput, { label: intl.formatMessage(messages.countryLabel), value: intl.formatDisplayName(answer.country, { type: "region" }) })),
|
|
91
87
|
role && (React.createElement(StaticInput, { label: intl.formatMessage(messages.roleLabel), value: role.text })),
|
|
92
|
-
answer.ambassadorCountry && (React.createElement(StaticInput, { label: intl.formatMessage(messages.ambassadorCountryLabel), value:
|
|
88
|
+
answer.ambassadorCountry && (React.createElement(StaticInput, { label: intl.formatMessage(messages.ambassadorCountryLabel), value: intl.formatDisplayName(answer.ambassadorCountry, {
|
|
89
|
+
type: "region",
|
|
90
|
+
}) })),
|
|
93
91
|
answer.governmentCompany && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyNameLabel), value: answer.governmentCompany })),
|
|
94
92
|
answer.governmentCompanyRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyRoleLabel), value: answer.governmentCompanyRole })),
|
|
95
93
|
answer.internationalOrganisation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationNameLabel), value: answer.internationalOrganisation })),
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lysaab/lysa-pep",
|
|
3
3
|
"author": "Lysa AB",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"main": "./Exports.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@lysaab/countries": "^
|
|
7
|
+
"@lysaab/countries": "^5.0.2",
|
|
8
8
|
"@types/luxon": "^1.15.2",
|
|
9
9
|
"@types/react-datepicker": "^3.1.2",
|
|
10
10
|
"@types/react-intl": "^3.0.0",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@formatjs/cli": "^1.1.22",
|
|
16
|
-
"@lysaab/ui-2": "^
|
|
16
|
+
"@lysaab/ui-2": "^37.0.0",
|
|
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": "^37.0.0",
|
|
36
36
|
"react": "^17.0.1",
|
|
37
37
|
"react-intl": "^5.20.2",
|
|
38
38
|
"react-router-dom": "^5.2.0"
|
package/pages/PepContext.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WorldCountry } from "@lysaab/countries";
|
|
1
2
|
import React from "react";
|
|
2
3
|
export declare enum EntityType {
|
|
3
4
|
PERSON = "PERSON",
|
|
@@ -53,9 +54,9 @@ export interface PepState {
|
|
|
53
54
|
legalEntityType?: EntityType;
|
|
54
55
|
type?: PepType;
|
|
55
56
|
role?: Role;
|
|
56
|
-
country?:
|
|
57
|
+
country?: WorldCountry;
|
|
57
58
|
ended?: Date;
|
|
58
|
-
ambassadorCountry?:
|
|
59
|
+
ambassadorCountry?: WorldCountry;
|
|
59
60
|
militaryRank?: MilitaryRank;
|
|
60
61
|
governmentCompany?: string;
|
|
61
62
|
governmentCompanyRole?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useCallback, useContext, } from "react";
|
|
2
2
|
import { Form, PrimaryButton, RequiredValidator, TextInput, Select, Card, CountrySelect, } from "@lysaab/ui-2";
|
|
3
3
|
import { PepContext, Role, MilitaryRank, PepType, EntityType, } from "../PepContext";
|
|
4
|
-
import { useIntl, FormattedMessage
|
|
4
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
5
|
import { roleMessages, ambassadorMessages, governmentCompanyMessages, intCompanyMessages, militaryMessages, } from "./RoleMessages";
|
|
6
6
|
import { formatPossessive } from "../../utils/Possession";
|
|
7
7
|
export const RolePage = ({ language, next }) => {
|
|
@@ -54,9 +54,7 @@ export const RolePage = ({ language, next }) => {
|
|
|
54
54
|
: pepContext.state.relationToPEP,
|
|
55
55
|
name: pepContext.state.ownerName,
|
|
56
56
|
}), onChange: (event) => pepContext.setState({
|
|
57
|
-
ambassadorCountry: event.value
|
|
58
|
-
? event.value.toString()
|
|
59
|
-
: undefined,
|
|
57
|
+
ambassadorCountry: event.value ? event.value : undefined,
|
|
60
58
|
}), value: pepContext.state.ambassadorCountry, validators: [
|
|
61
59
|
new RequiredValidator(intl.formatMessage(ambassadorMessages.required)),
|
|
62
60
|
], language: language, placeholder: intl.formatMessage(ambassadorMessages.placeholder) })) : null,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FunctionComponent } from "react";
|
|
2
|
-
import { Language } from "@lysaab/ui-2";
|
|
2
|
+
import { Language, WorldCountry } from "@lysaab/ui-2";
|
|
3
3
|
interface Props {
|
|
4
4
|
countryName: string;
|
|
5
|
-
countryCode:
|
|
5
|
+
countryCode: WorldCountry;
|
|
6
6
|
language: Language;
|
|
7
7
|
next: () => void;
|
|
8
8
|
}
|
|
@@ -69,7 +69,7 @@ export const StatusPage = ({ countryName, countryCode, language, next, }) => {
|
|
|
69
69
|
: pepContext.state.relationToPEP,
|
|
70
70
|
pepType: pepContext.state.type,
|
|
71
71
|
}), onChange: (event) => pepContext.setState({
|
|
72
|
-
country: event.value ? event.value
|
|
72
|
+
country: event.value ? event.value : undefined,
|
|
73
73
|
}), validators: [
|
|
74
74
|
new RequiredValidator(intl.formatMessage(countrySelectionMessages.required)),
|
|
75
75
|
], value: pepContext.state.country, omitList: [countryCode], language: language, placeholder: intl.formatMessage(countrySelectionMessages.placeholder) })) : null),
|