@lysaab/lysa-pep 1.0.4-0 → 1.0.6-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/{lib/Exports.d.ts → Exports.d.ts} +7 -7
- package/{lib/Exports.js → Exports.js} +7 -7
- package/{lib/components → components}/CountrySelect.d.ts +15 -15
- package/{lib/components → components}/CountrySelect.js +30 -30
- package/{lib/components → components}/PepAnswers.d.ts +8 -8
- package/{lib/components → components}/PepAnswers.js +131 -131
- package/{lib/components → components}/PepAnswers.scss +7 -7
- package/messages/src/components/CountrySelect.json +1 -0
- package/messages/src/components/PepAnswers.json +1 -0
- package/messages/src/pages/IsPep/IsPepMessages.json +1 -0
- package/messages/src/pages/IsPep/IsPepPage.json +1 -0
- package/messages/src/pages/RelationPage/RelationMessages.json +1 -0
- package/messages/src/pages/RelationPage/RelationPage.json +1 -0
- package/messages/src/pages/RolePage/RoleMessages.json +1 -0
- package/messages/src/pages/RolePage/RolePage.json +1 -0
- package/messages/src/pages/StatusPage/StatusMessages.json +1 -0
- package/messages/src/pages/StatusPage/StatusPage.json +1 -0
- package/{lib/model → model}/Countries.d.ts +4 -4
- package/{lib/model → model}/Countries.js +1002 -1002
- package/model/PepModel.d.ts +7 -0
- package/{lib/model → model}/PepModel.js +40 -40
- package/{lib/model → model}/PepTexts.d.ts +380 -322
- package/{lib/model → model}/PepTexts.js +552 -467
- package/package.json +71 -57
- package/{lib/pages → pages}/IsPep/IsPepMessages.d.ts +32 -32
- package/{lib/pages → pages}/IsPep/IsPepMessages.js +66 -66
- package/{lib/pages → pages}/IsPep/IsPepPage.d.ts +14 -14
- package/{lib/pages → pages}/IsPep/IsPepPage.js +60 -60
- package/{lib/pages → pages}/PepContext.d.ts +80 -80
- package/{lib/pages → pages}/PepContext.js +88 -88
- package/pages/PepIsPepPage.d.ts +15 -0
- package/{lib/pages → pages}/PepIsPepPage.js +59 -57
- package/{lib/pages → pages}/PepRelationPage.d.ts +6 -6
- package/{lib/pages → pages}/PepRelationPage.js +79 -83
- package/{lib/pages → pages}/PepRolePage.d.ts +10 -9
- package/{lib/pages → pages}/PepRolePage.js +127 -127
- package/{lib/pages → pages}/PepStatusPage.d.ts +6 -6
- package/pages/PepStatusPage.js +58 -0
- package/{lib/pages → pages}/RelationPage/RelationMessages.d.ts +105 -105
- package/{lib/pages → pages}/RelationPage/RelationMessages.js +283 -283
- package/{lib/pages → pages}/RelationPage/RelationPage.d.ts +6 -6
- package/{lib/pages → pages}/RelationPage/RelationPage.js +154 -154
- package/{lib/pages → pages}/RolePage/RoleMessages.d.ts +185 -185
- package/{lib/pages → pages}/RolePage/RoleMessages.js +385 -385
- package/{lib/pages → pages}/RolePage/RolePage.d.ts +11 -11
- package/{lib/pages → pages}/RolePage/RolePage.js +223 -223
- package/{lib/pages → pages}/StatusPage/StatusMessages.d.ts +72 -72
- package/{lib/pages → pages}/StatusPage/StatusMessages.js +266 -266
- package/{lib/pages → pages}/StatusPage/StatusPage.d.ts +8 -6
- package/{lib/pages → pages}/StatusPage/StatusPage.js +103 -98
- package/{lib/utils → utils}/Possession.d.ts +1 -1
- package/{lib/utils → utils}/Possession.js +18 -18
- package/.vscode/settings.json +0 -4
- package/lib/model/PepModel.d.ts +0 -7
- package/lib/pages/PepIsPepPage.d.ts +0 -6
- package/lib/pages/PepStatusPage.js +0 -57
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -2
- package/src/App.css +0 -3
- package/src/App.test.tsx +0 -9
- package/src/App.tsx +0 -25
- package/src/Exports.ts +0 -12
- package/src/components/CountrySelect.tsx +0 -47
- package/src/components/PepAnswers.scss +0 -7
- package/src/components/PepAnswers.tsx +0 -252
- package/src/demo/Done.tsx +0 -16
- package/src/demo/Pep.tsx +0 -112
- package/src/index.css +0 -13
- package/src/index.tsx +0 -12
- package/src/logo.svg +0 -1
- package/src/model/Countries.ts +0 -1002
- package/src/model/PepModel.ts +0 -52
- package/src/pages/IsPep/IsPepMessages.ts +0 -67
- package/src/pages/IsPep/IsPepPage.tsx +0 -118
- package/src/pages/PepContext.tsx +0 -144
- package/src/pages/RelationPage/RelationMessages.ts +0 -288
- package/src/pages/RelationPage/RelationPage.tsx +0 -304
- package/src/pages/RolePage/RoleMessages.ts +0 -393
- package/src/pages/RolePage/RolePage.tsx +0 -361
- package/src/pages/StatusPage/StatusMessages.ts +0 -272
- package/src/pages/StatusPage/StatusPage.tsx +0 -213
- package/src/react-app-env.d.ts +0 -1
- package/src/serviceWorker.ts +0 -143
- package/src/utils/Possession.ts +0 -21
- package/tsconfig.json +0 -25
- package/tsconfig_build.json +0 -19
package/package.json
CHANGED
|
@@ -1,57 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lysaab/lysa-pep",
|
|
3
|
-
"author": "Lysa AB",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"main": "./
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@types/luxon": "^1.15.2",
|
|
8
|
-
"@types/react-intl": "^3.0.0",
|
|
9
|
-
"luxon": "^1.21.1",
|
|
10
|
-
"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@
|
|
14
|
-
"@
|
|
15
|
-
"@types/
|
|
16
|
-
"@types/
|
|
17
|
-
"@types/
|
|
18
|
-
"@types/react
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"react
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@lysaab/lysa-pep",
|
|
3
|
+
"author": "Lysa AB",
|
|
4
|
+
"version": "1.0.6-0",
|
|
5
|
+
"main": "./Exports.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@types/luxon": "^1.15.2",
|
|
8
|
+
"@types/react-intl": "^3.0.0",
|
|
9
|
+
"luxon": "^1.21.1",
|
|
10
|
+
"node-sass": "^4.14.1"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@formatjs/cli": "^1.1.22",
|
|
14
|
+
"@lysaab/ui-2": "^20.13.0",
|
|
15
|
+
"@types/jest": "24.0.20",
|
|
16
|
+
"@types/luxon": "^1.15.2",
|
|
17
|
+
"@types/node": "12.11.7",
|
|
18
|
+
"@types/react": "^16.9.23",
|
|
19
|
+
"@types/react-dom": "^16.9.5",
|
|
20
|
+
"copyfiles": "^2.3.0",
|
|
21
|
+
"eslint-plugin-formatjs": "^2.3.13",
|
|
22
|
+
"luxon": "^1.21.1",
|
|
23
|
+
"react": "^16.13.1",
|
|
24
|
+
"react-dom": "^16.13.0",
|
|
25
|
+
"react-router-dom": "^5.2.0",
|
|
26
|
+
"react-intl": "^4.5.12",
|
|
27
|
+
"react-intl-translations-manager": "^5.0.3",
|
|
28
|
+
"react-scripts": "^3.4.0",
|
|
29
|
+
"typescript": "^3.7.2"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@lysaab/ui-2": "^20.13.0",
|
|
33
|
+
"react": "^16.13.1",
|
|
34
|
+
"react-intl": "^4.5.12",
|
|
35
|
+
"react-router-dom": "^5.2.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"start": "react-scripts start",
|
|
39
|
+
"build": "react-scripts build",
|
|
40
|
+
"test": "react-scripts test",
|
|
41
|
+
"eject": "react-scripts eject",
|
|
42
|
+
"build:lib": "tsc -p ./tsconfig_build.json && npm run copyscss",
|
|
43
|
+
"translations:extract": "formatjs extract --messages-dir ./build/messages \"./src/**/*.tsx\" \"./src/**/*.ts\"",
|
|
44
|
+
"translations:manage": "node ./translationRunner.js",
|
|
45
|
+
"translations": "npm run translations:extract && npm run translations:manage",
|
|
46
|
+
"copyscss": "copyfiles -u 1 \"src/components/**/*.scss\" lib/",
|
|
47
|
+
"copymessages": "copyfiles -u 1 \"build/messages/**/*.json\" lib/",
|
|
48
|
+
"copypkgfiles": "cp README.md ./lib/ && cp package.json ./lib/",
|
|
49
|
+
"postversioning": "npm run translations:extract && npm run copymessages && npm run copypkgfiles && cd lib && npm publish",
|
|
50
|
+
"release:patch": "npm run build:lib && npm version patch && npm run postversioning",
|
|
51
|
+
"release:minor": "npm run build:lib && npm version minor && npm run postversioning",
|
|
52
|
+
"release:major": "npm run build:lib && npm version major && npm run postversioning",
|
|
53
|
+
"release:premajor": "npm run build:lib && npm version premajor && npm run postversioning",
|
|
54
|
+
"release:prepatch": "npm run build:lib && npm version prepatch && npm run postversioning"
|
|
55
|
+
},
|
|
56
|
+
"eslintConfig": {
|
|
57
|
+
"extends": "react-app"
|
|
58
|
+
},
|
|
59
|
+
"browserslist": {
|
|
60
|
+
"production": [
|
|
61
|
+
">0.2%",
|
|
62
|
+
"not dead",
|
|
63
|
+
"not op_mini all"
|
|
64
|
+
],
|
|
65
|
+
"development": [
|
|
66
|
+
"last 1 chrome version",
|
|
67
|
+
"last 1 firefox version",
|
|
68
|
+
"last 1 safari version"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export declare const messages: {
|
|
2
|
-
header: {
|
|
3
|
-
id: string;
|
|
4
|
-
description: string;
|
|
5
|
-
defaultMessage: string;
|
|
6
|
-
};
|
|
7
|
-
required: {
|
|
8
|
-
id: string;
|
|
9
|
-
description: string;
|
|
10
|
-
defaultMessage: string;
|
|
11
|
-
};
|
|
12
|
-
NOT_PEP: {
|
|
13
|
-
id: string;
|
|
14
|
-
description: string;
|
|
15
|
-
defaultMessage: string;
|
|
16
|
-
};
|
|
17
|
-
ME: {
|
|
18
|
-
id: string;
|
|
19
|
-
description: string;
|
|
20
|
-
defaultMessage: string;
|
|
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
|
+
description: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
required: {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
NOT_PEP: {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
};
|
|
17
|
+
ME: {
|
|
18
|
+
id: string;
|
|
19
|
+
description: string;
|
|
20
|
+
defaultMessage: string;
|
|
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,66 +1,66 @@
|
|
|
1
|
-
import { defineMessages } from "react-intl";
|
|
2
|
-
import { PepType } from "../PepContext";
|
|
3
|
-
export const messages = defineMessages({
|
|
4
|
-
header: {
|
|
5
|
-
id: "pep.ispep.header",
|
|
6
|
-
description: "Not pep",
|
|
7
|
-
defaultMessage: `{
|
|
8
|
-
entityType, select,
|
|
9
|
-
PERSON {
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
CORPORATION {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}`,
|
|
16
|
-
},
|
|
17
|
-
required: {
|
|
18
|
-
id: "pep.ispep.required",
|
|
19
|
-
description: "
|
|
20
|
-
defaultMessage: "
|
|
21
|
-
},
|
|
22
|
-
[PepType.NOT_PEP]: {
|
|
23
|
-
id: "pep.ispep.NOT_PEP",
|
|
24
|
-
description: "Not pep",
|
|
25
|
-
defaultMessage: "
|
|
26
|
-
},
|
|
27
|
-
[PepType.ME]: {
|
|
28
|
-
id: "pep.ispep.ME",
|
|
29
|
-
description: "The person is pep",
|
|
30
|
-
defaultMessage: `{
|
|
31
|
-
entityType, select,
|
|
32
|
-
PERSON {
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
CORPORATION {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}`,
|
|
39
|
-
},
|
|
40
|
-
[PepType.RELATIVE]: {
|
|
41
|
-
id: "pep.ispep.RELATIVE",
|
|
42
|
-
description: "
|
|
43
|
-
defaultMessage: `{
|
|
44
|
-
entityType, select,
|
|
45
|
-
PERSON {
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
CORPORATION {
|
|
49
|
-
{name}
|
|
50
|
-
}
|
|
51
|
-
}`,
|
|
52
|
-
},
|
|
53
|
-
[PepType.COLLEAGUE]: {
|
|
54
|
-
id: "pep.ispep.COLLEAGUE",
|
|
55
|
-
description: "The person has a colleague that is
|
|
56
|
-
defaultMessage: `{
|
|
57
|
-
entityType, select,
|
|
58
|
-
PERSON {
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
CORPORATION {
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
}`,
|
|
65
|
-
},
|
|
66
|
-
});
|
|
1
|
+
import { defineMessages } from "react-intl";
|
|
2
|
+
import { PepType } from "../PepContext";
|
|
3
|
+
export const messages = defineMessages({
|
|
4
|
+
header: {
|
|
5
|
+
id: "pep.ispep.header",
|
|
6
|
+
description: "Not pep",
|
|
7
|
+
defaultMessage: `{
|
|
8
|
+
entityType, select,
|
|
9
|
+
PERSON {
|
|
10
|
+
Are you or is a peer close to you a politically exposed person? (PEP)
|
|
11
|
+
}
|
|
12
|
+
CORPORATION {
|
|
13
|
+
Is {name} or a person close to {name} a politically exposed person? (PEP)
|
|
14
|
+
}
|
|
15
|
+
}`,
|
|
16
|
+
},
|
|
17
|
+
required: {
|
|
18
|
+
id: "pep.ispep.required",
|
|
19
|
+
description: "Required validator text",
|
|
20
|
+
defaultMessage: "You need to choose an alternative",
|
|
21
|
+
},
|
|
22
|
+
[PepType.NOT_PEP]: {
|
|
23
|
+
id: "pep.ispep.NOT_PEP",
|
|
24
|
+
description: "Not pep",
|
|
25
|
+
defaultMessage: "No",
|
|
26
|
+
},
|
|
27
|
+
[PepType.ME]: {
|
|
28
|
+
id: "pep.ispep.ME",
|
|
29
|
+
description: "The person is pep",
|
|
30
|
+
defaultMessage: `{
|
|
31
|
+
entityType, select,
|
|
32
|
+
PERSON {
|
|
33
|
+
I have a role which makes me a PEP
|
|
34
|
+
}
|
|
35
|
+
CORPORATION {
|
|
36
|
+
{name} is PEP because of its role
|
|
37
|
+
}
|
|
38
|
+
}`,
|
|
39
|
+
},
|
|
40
|
+
[PepType.RELATIVE]: {
|
|
41
|
+
id: "pep.ispep.RELATIVE",
|
|
42
|
+
description: "I have a relationship with a person that is a PEP",
|
|
43
|
+
defaultMessage: `{
|
|
44
|
+
entityType, select,
|
|
45
|
+
PERSON {
|
|
46
|
+
I have a relationship with a person that is a PEP
|
|
47
|
+
}
|
|
48
|
+
CORPORATION {
|
|
49
|
+
{name} is a coworker to, or has a business relationship with a PEP
|
|
50
|
+
}
|
|
51
|
+
}`,
|
|
52
|
+
},
|
|
53
|
+
[PepType.COLLEAGUE]: {
|
|
54
|
+
id: "pep.ispep.COLLEAGUE",
|
|
55
|
+
description: "The person has a colleague that is a PEP",
|
|
56
|
+
defaultMessage: `{
|
|
57
|
+
entityType, select,
|
|
58
|
+
PERSON {
|
|
59
|
+
I work for, or have a business relationship with, a PEP
|
|
60
|
+
}
|
|
61
|
+
CORPORATION {
|
|
62
|
+
{name} is a PEP because its role
|
|
63
|
+
}
|
|
64
|
+
}`,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { FunctionComponent } from "react";
|
|
2
|
-
import { PepType, EntityType } from "../PepContext";
|
|
3
|
-
export interface ExternalIsPepState {
|
|
4
|
-
ownerName: string;
|
|
5
|
-
entityType: EntityType;
|
|
6
|
-
type?: PepType;
|
|
7
|
-
onChange: (type: PepType) => void;
|
|
8
|
-
}
|
|
9
|
-
interface Props {
|
|
10
|
-
next?: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const IsPepRadioGroup: FunctionComponent<ExternalIsPepState>;
|
|
13
|
-
export declare const IsPepPage: FunctionComponent<Props>;
|
|
14
|
-
export {};
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
import { PepType, EntityType } from "../PepContext";
|
|
3
|
+
export interface ExternalIsPepState {
|
|
4
|
+
ownerName: string;
|
|
5
|
+
entityType: EntityType;
|
|
6
|
+
type?: PepType;
|
|
7
|
+
onChange: (type: PepType) => void;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
next?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const IsPepRadioGroup: FunctionComponent<ExternalIsPepState>;
|
|
13
|
+
export declare const IsPepPage: FunctionComponent<Props>;
|
|
14
|
+
export {};
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import React, { useRef, useCallback, useContext, } from "react";
|
|
2
|
-
import { Form, RadioGroup, RequiredValidator, PrimaryButton, Card, } from "@lysaab/ui-2";
|
|
3
|
-
import { PepType, PepContext, EntityType } from "../PepContext";
|
|
4
|
-
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
|
-
import { messages } from "./IsPepMessages";
|
|
6
|
-
export const IsPepRadioGroup = ({ ownerName, entityType, type, onChange, }) => {
|
|
7
|
-
const intl = useIntl();
|
|
8
|
-
const IsPepAlternatives = [
|
|
9
|
-
{
|
|
10
|
-
text: intl.formatMessage(messages[PepType.NOT_PEP], {
|
|
11
|
-
entityType,
|
|
12
|
-
name: ownerName,
|
|
13
|
-
}),
|
|
14
|
-
value: PepType.NOT_PEP,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
text: intl.formatMessage(messages[PepType.ME], {
|
|
18
|
-
entityType,
|
|
19
|
-
name: ownerName,
|
|
20
|
-
}),
|
|
21
|
-
value: PepType.ME,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
text: intl.formatMessage(messages[PepType.RELATIVE], {
|
|
25
|
-
entityType,
|
|
26
|
-
name: ownerName,
|
|
27
|
-
}),
|
|
28
|
-
value: PepType.RELATIVE,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
text: intl.formatMessage(messages[PepType.COLLEAGUE], {
|
|
32
|
-
entityType,
|
|
33
|
-
name: ownerName,
|
|
34
|
-
}),
|
|
35
|
-
value: PepType.COLLEAGUE,
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
return (React.createElement(RadioGroup, { alternatives: IsPepAlternatives, onChange: (alt) => onChange(alt.value), value: IsPepAlternatives.find((alt) => alt.value === type), header: intl.formatMessage(messages.header, {
|
|
39
|
-
entityType,
|
|
40
|
-
name: ownerName,
|
|
41
|
-
}), validators: [
|
|
42
|
-
new RequiredValidator(intl.formatMessage(messages.required)),
|
|
43
|
-
], "data-test-id": "pep-ispep" }));
|
|
44
|
-
};
|
|
45
|
-
export const IsPepPage = ({ next }) => {
|
|
46
|
-
const pepContext = useContext(PepContext);
|
|
47
|
-
const formRef = useRef();
|
|
48
|
-
const nextPage = useCallback(() => {
|
|
49
|
-
if (formRef.current && formRef.current.isValid && next) {
|
|
50
|
-
next();
|
|
51
|
-
}
|
|
52
|
-
}, [formRef, next]);
|
|
53
|
-
return (React.createElement(Form, { onSubmit: nextPage, lysaFormRef: formRef },
|
|
54
|
-
React.createElement(Card, null,
|
|
55
|
-
React.createElement(IsPepRadioGroup, { entityType: pepContext.state.legalEntityType || EntityType.PERSON, ownerName: pepContext.state.ownerName || "", type: pepContext.state.type, onChange: (type) => {
|
|
56
|
-
pepContext.setState({ type });
|
|
57
|
-
} })),
|
|
58
|
-
React.createElement(PrimaryButton, { block: true, type: "submit" },
|
|
59
|
-
React.createElement(FormattedMessage, { id: "pep.ispep.next", description: "Next button", defaultMessage: "
|
|
60
|
-
};
|
|
1
|
+
import React, { useRef, useCallback, useContext, } from "react";
|
|
2
|
+
import { Form, RadioGroup, RequiredValidator, PrimaryButton, Card, } from "@lysaab/ui-2";
|
|
3
|
+
import { PepType, PepContext, EntityType } from "../PepContext";
|
|
4
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
|
+
import { messages } from "./IsPepMessages";
|
|
6
|
+
export const IsPepRadioGroup = ({ ownerName, entityType, type, onChange, }) => {
|
|
7
|
+
const intl = useIntl();
|
|
8
|
+
const IsPepAlternatives = [
|
|
9
|
+
{
|
|
10
|
+
text: intl.formatMessage(messages[PepType.NOT_PEP], {
|
|
11
|
+
entityType,
|
|
12
|
+
name: ownerName,
|
|
13
|
+
}),
|
|
14
|
+
value: PepType.NOT_PEP,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
text: intl.formatMessage(messages[PepType.ME], {
|
|
18
|
+
entityType,
|
|
19
|
+
name: ownerName,
|
|
20
|
+
}),
|
|
21
|
+
value: PepType.ME,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
text: intl.formatMessage(messages[PepType.RELATIVE], {
|
|
25
|
+
entityType,
|
|
26
|
+
name: ownerName,
|
|
27
|
+
}),
|
|
28
|
+
value: PepType.RELATIVE,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
text: intl.formatMessage(messages[PepType.COLLEAGUE], {
|
|
32
|
+
entityType,
|
|
33
|
+
name: ownerName,
|
|
34
|
+
}),
|
|
35
|
+
value: PepType.COLLEAGUE,
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
return (React.createElement(RadioGroup, { alternatives: IsPepAlternatives, onChange: (alt) => onChange(alt.value), value: IsPepAlternatives.find((alt) => alt.value === type), header: intl.formatMessage(messages.header, {
|
|
39
|
+
entityType,
|
|
40
|
+
name: ownerName,
|
|
41
|
+
}), validators: [
|
|
42
|
+
new RequiredValidator(intl.formatMessage(messages.required)),
|
|
43
|
+
], "data-test-id": "pep-ispep" }));
|
|
44
|
+
};
|
|
45
|
+
export const IsPepPage = ({ next }) => {
|
|
46
|
+
const pepContext = useContext(PepContext);
|
|
47
|
+
const formRef = useRef();
|
|
48
|
+
const nextPage = useCallback(() => {
|
|
49
|
+
if (formRef.current && formRef.current.isValid && next) {
|
|
50
|
+
next();
|
|
51
|
+
}
|
|
52
|
+
}, [formRef, next]);
|
|
53
|
+
return (React.createElement(Form, { onSubmit: nextPage, lysaFormRef: formRef },
|
|
54
|
+
React.createElement(Card, null,
|
|
55
|
+
React.createElement(IsPepRadioGroup, { entityType: pepContext.state.legalEntityType || EntityType.PERSON, ownerName: pepContext.state.ownerName || "", type: pepContext.state.type, onChange: (type) => {
|
|
56
|
+
pepContext.setState({ type });
|
|
57
|
+
} })),
|
|
58
|
+
React.createElement(PrimaryButton, { block: true, type: "submit" },
|
|
59
|
+
React.createElement(FormattedMessage, { id: "pep.ispep.next", description: "Next button", defaultMessage: "Next" }))));
|
|
60
|
+
};
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export declare enum EntityType {
|
|
3
|
-
PERSON = "PERSON",
|
|
4
|
-
CORPORATION = "CORPORATION"
|
|
5
|
-
}
|
|
6
|
-
export declare enum PepType {
|
|
7
|
-
NOT_PEP = "NOT_PEP",
|
|
8
|
-
ME = "ME",
|
|
9
|
-
RELATIVE = "RELATIVE",
|
|
10
|
-
COLLEAGUE = "COLLEAGUE"
|
|
11
|
-
}
|
|
12
|
-
export declare enum PepStatus {
|
|
13
|
-
ONGOING = "ONGOING",
|
|
14
|
-
ENDED = "ENDED"
|
|
15
|
-
}
|
|
16
|
-
export declare enum Role {
|
|
17
|
-
HEAD_OF_GOVERNMENT = "HEAD_OF_GOVERNMENT",
|
|
18
|
-
MINISTER = "MINISTER",
|
|
19
|
-
PARLIMENT_MEMBER = "PARLIMENT_MEMBER",
|
|
20
|
-
CENTRAL_BANK_MEMBER = "CENTRAL_BANK_MEMBER",
|
|
21
|
-
BOARD_MEMBER_POLITICAL_PARTY = "BOARD_MEMBER_POLITICAL_PARTY",
|
|
22
|
-
JUDGE_SUPREME_COURT = "JUDGE_SUPREME_COURT",
|
|
23
|
-
JUDGE_OTHER_HIGH_COURT = "JUDGE_OTHER_HIGH_COURT",
|
|
24
|
-
REVISION_INSTITUTE = "REVISION_INSTITUTE",
|
|
25
|
-
AMBASSADOR = "AMBASSADOR",
|
|
26
|
-
MILITARY_OFFICER = "MILITARY_OFFICER",
|
|
27
|
-
GOVERNMENT_COMPANY = "GOVERNMENT_COMPANY",
|
|
28
|
-
EU_HIGH_RANKING_POSITION = "EU_HIGH_RANKING_POSITION",
|
|
29
|
-
HIGH_RANKING_POSITION_INTERNALTIONAL_CORP = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"
|
|
30
|
-
}
|
|
31
|
-
export declare enum Relation {
|
|
32
|
-
MARRIED_PARTNER = "MARRIED_PARTNER",
|
|
33
|
-
COLIVING_PARTNER = "COLIVING_PARTNER",
|
|
34
|
-
CHILD = "CHILD",
|
|
35
|
-
PARENT = "PARENT",
|
|
36
|
-
CHILD_MARRIED_PARTNER = "CHILD_MARRIED_PARTNER",
|
|
37
|
-
CHILD_COLIVING_PARTNER = "CHILD_COLIVING_PARTNER"
|
|
38
|
-
}
|
|
39
|
-
export declare enum BusinessRelation {
|
|
40
|
-
CO_OWNERSHIP = "CO_OWNERSHIP",
|
|
41
|
-
CLOSE_CONNECTION = "CLOSE_CONNECTION",
|
|
42
|
-
COMPANY_FOR_PEP = "COMPANY_FOR_PEP"
|
|
43
|
-
}
|
|
44
|
-
export declare enum MilitaryRank {
|
|
45
|
-
GENERAL = "GENERAL",
|
|
46
|
-
LIEUTENANT_GENERAL = "LIEUTENANT_GENERAL",
|
|
47
|
-
MAJOR_GENERAL = "MAJOR_GENERAL",
|
|
48
|
-
ADMIRAL = "ADMIRAL",
|
|
49
|
-
VICE_ADMIRAL = "VICE_ADMIRAL",
|
|
50
|
-
REAR_ADMIRAL = "REAR_ADMIRAL"
|
|
51
|
-
}
|
|
52
|
-
export interface PepState {
|
|
53
|
-
legalEntityType?: EntityType;
|
|
54
|
-
type?: PepType;
|
|
55
|
-
role?: Role;
|
|
56
|
-
country?: string;
|
|
57
|
-
ended?: Date;
|
|
58
|
-
ambassadorCountry?: string;
|
|
59
|
-
militaryRank?: MilitaryRank;
|
|
60
|
-
governmentCompany?: string;
|
|
61
|
-
governmentCompanyRole?: string;
|
|
62
|
-
internationalOrganisation?: string;
|
|
63
|
-
internationalOrganisationRole?: string;
|
|
64
|
-
relationToPEP?: Relation;
|
|
65
|
-
nameOfPEP?: string;
|
|
66
|
-
birthdayOfPEP?: Date;
|
|
67
|
-
tin?: string;
|
|
68
|
-
businessRelation?: BusinessRelation;
|
|
69
|
-
isOngoing?: PepStatus;
|
|
70
|
-
|
|
71
|
-
ownerName?: string;
|
|
72
|
-
}
|
|
73
|
-
export declare const EMPTY_PEP_STATE: PepState;
|
|
74
|
-
export interface PepContextProps {
|
|
75
|
-
state: PepState;
|
|
76
|
-
setState: (newState: Partial<PepState>) => void;
|
|
77
|
-
}
|
|
78
|
-
export declare const PepContext: React.Context<PepContextProps>;
|
|
79
|
-
export declare const withPep: <P extends object>(Component: React.ComponentType<P>) => React.FC<Pick<P, Exclude<keyof P, "state" | "setState">>>;
|
|
80
|
-
export declare const PepContextProvider: React.FC;
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare enum EntityType {
|
|
3
|
+
PERSON = "PERSON",
|
|
4
|
+
CORPORATION = "CORPORATION"
|
|
5
|
+
}
|
|
6
|
+
export declare enum PepType {
|
|
7
|
+
NOT_PEP = "NOT_PEP",
|
|
8
|
+
ME = "ME",
|
|
9
|
+
RELATIVE = "RELATIVE",
|
|
10
|
+
COLLEAGUE = "COLLEAGUE"
|
|
11
|
+
}
|
|
12
|
+
export declare enum PepStatus {
|
|
13
|
+
ONGOING = "ONGOING",
|
|
14
|
+
ENDED = "ENDED"
|
|
15
|
+
}
|
|
16
|
+
export declare enum Role {
|
|
17
|
+
HEAD_OF_GOVERNMENT = "HEAD_OF_GOVERNMENT",
|
|
18
|
+
MINISTER = "MINISTER",
|
|
19
|
+
PARLIMENT_MEMBER = "PARLIMENT_MEMBER",
|
|
20
|
+
CENTRAL_BANK_MEMBER = "CENTRAL_BANK_MEMBER",
|
|
21
|
+
BOARD_MEMBER_POLITICAL_PARTY = "BOARD_MEMBER_POLITICAL_PARTY",
|
|
22
|
+
JUDGE_SUPREME_COURT = "JUDGE_SUPREME_COURT",
|
|
23
|
+
JUDGE_OTHER_HIGH_COURT = "JUDGE_OTHER_HIGH_COURT",
|
|
24
|
+
REVISION_INSTITUTE = "REVISION_INSTITUTE",
|
|
25
|
+
AMBASSADOR = "AMBASSADOR",
|
|
26
|
+
MILITARY_OFFICER = "MILITARY_OFFICER",
|
|
27
|
+
GOVERNMENT_COMPANY = "GOVERNMENT_COMPANY",
|
|
28
|
+
EU_HIGH_RANKING_POSITION = "EU_HIGH_RANKING_POSITION",
|
|
29
|
+
HIGH_RANKING_POSITION_INTERNALTIONAL_CORP = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"
|
|
30
|
+
}
|
|
31
|
+
export declare enum Relation {
|
|
32
|
+
MARRIED_PARTNER = "MARRIED_PARTNER",
|
|
33
|
+
COLIVING_PARTNER = "COLIVING_PARTNER",
|
|
34
|
+
CHILD = "CHILD",
|
|
35
|
+
PARENT = "PARENT",
|
|
36
|
+
CHILD_MARRIED_PARTNER = "CHILD_MARRIED_PARTNER",
|
|
37
|
+
CHILD_COLIVING_PARTNER = "CHILD_COLIVING_PARTNER"
|
|
38
|
+
}
|
|
39
|
+
export declare enum BusinessRelation {
|
|
40
|
+
CO_OWNERSHIP = "CO_OWNERSHIP",
|
|
41
|
+
CLOSE_CONNECTION = "CLOSE_CONNECTION",
|
|
42
|
+
COMPANY_FOR_PEP = "COMPANY_FOR_PEP"
|
|
43
|
+
}
|
|
44
|
+
export declare enum MilitaryRank {
|
|
45
|
+
GENERAL = "GENERAL",
|
|
46
|
+
LIEUTENANT_GENERAL = "LIEUTENANT_GENERAL",
|
|
47
|
+
MAJOR_GENERAL = "MAJOR_GENERAL",
|
|
48
|
+
ADMIRAL = "ADMIRAL",
|
|
49
|
+
VICE_ADMIRAL = "VICE_ADMIRAL",
|
|
50
|
+
REAR_ADMIRAL = "REAR_ADMIRAL"
|
|
51
|
+
}
|
|
52
|
+
export interface PepState {
|
|
53
|
+
legalEntityType?: EntityType;
|
|
54
|
+
type?: PepType;
|
|
55
|
+
role?: Role;
|
|
56
|
+
country?: string;
|
|
57
|
+
ended?: Date;
|
|
58
|
+
ambassadorCountry?: string;
|
|
59
|
+
militaryRank?: MilitaryRank;
|
|
60
|
+
governmentCompany?: string;
|
|
61
|
+
governmentCompanyRole?: string;
|
|
62
|
+
internationalOrganisation?: string;
|
|
63
|
+
internationalOrganisationRole?: string;
|
|
64
|
+
relationToPEP?: Relation;
|
|
65
|
+
nameOfPEP?: string;
|
|
66
|
+
birthdayOfPEP?: Date;
|
|
67
|
+
tin?: string;
|
|
68
|
+
businessRelation?: BusinessRelation;
|
|
69
|
+
isOngoing?: PepStatus;
|
|
70
|
+
isLocalCountry?: string;
|
|
71
|
+
ownerName?: string;
|
|
72
|
+
}
|
|
73
|
+
export declare const EMPTY_PEP_STATE: PepState;
|
|
74
|
+
export interface PepContextProps {
|
|
75
|
+
state: PepState;
|
|
76
|
+
setState: (newState: Partial<PepState>) => void;
|
|
77
|
+
}
|
|
78
|
+
export declare const PepContext: React.Context<PepContextProps>;
|
|
79
|
+
export declare const withPep: <P extends object>(Component: React.ComponentType<P>) => React.FC<Pick<P, Exclude<keyof P, "state" | "setState">>>;
|
|
80
|
+
export declare const PepContextProvider: React.FC;
|