@lysaab/lysa-pep 1.0.0-1 → 1.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/lib/Exports.d.ts +8 -7
- package/lib/Exports.js +8 -7
- package/lib/components/CountrySelect.d.ts +22 -15
- package/lib/components/CountrySelect.js +21 -30
- package/lib/components/PepAnswers.d.ts +8 -8
- package/lib/components/PepAnswers.js +39 -131
- package/lib/components/PepAnswers.scss +7 -7
- package/lib/model/Countries.d.ts +4 -4
- package/lib/model/Countries.js +1002 -1002
- package/lib/model/PepModel.d.ts +7 -7
- package/lib/model/PepModel.js +40 -40
- package/lib/model/PepTexts.d.ts +380 -322
- package/lib/model/PepTexts.js +552 -467
- package/lib/pages/PepContext.d.ts +80 -80
- package/lib/pages/PepContext.js +88 -88
- package/lib/pages/PepIsPepPage.d.ts +15 -6
- package/lib/pages/PepIsPepPage.js +59 -57
- package/lib/pages/PepRelationPage.d.ts +6 -6
- package/lib/pages/PepRelationPage.js +79 -83
- package/lib/pages/PepRolePage.d.ts +10 -9
- package/lib/pages/PepRolePage.js +127 -127
- package/lib/pages/PepStatusPage.d.ts +6 -6
- package/lib/pages/PepStatusPage.js +58 -57
- package/package.json +53 -56
- package/src/Exports.ts +13 -12
- package/src/components/CountrySelect.tsx +43 -47
- package/src/components/PepAnswers.scss +7 -7
- package/src/components/PepAnswers.tsx +120 -252
- package/src/demo/Done.tsx +20 -16
- package/src/demo/Pep.tsx +106 -112
- package/src/model/PepModel.ts +52 -52
- package/src/model/PepTexts.ts +607 -0
- package/src/pages/PepContext.tsx +144 -144
- package/src/pages/PepIsPepPage.tsx +107 -0
- package/src/pages/PepRelationPage.tsx +188 -0
- package/src/pages/PepRolePage.tsx +272 -0
- package/src/pages/PepStatusPage.tsx +157 -0
- package/.vscode/settings.json +0 -4
- package/lib/pages/IsPep/IsPepMessages.d.ts +0 -32
- package/lib/pages/IsPep/IsPepMessages.js +0 -74
- package/lib/pages/IsPep/IsPepPage.d.ts +0 -14
- package/lib/pages/IsPep/IsPepPage.js +0 -39
- package/lib/pages/RelationPage/RelationMessages.d.ts +0 -105
- package/lib/pages/RelationPage/RelationMessages.js +0 -282
- package/lib/pages/RelationPage/RelationPage.d.ts +0 -6
- package/lib/pages/RelationPage/RelationPage.js +0 -142
- package/lib/pages/RolePage/RoleMessages.d.ts +0 -185
- package/lib/pages/RolePage/RoleMessages.js +0 -381
- package/lib/pages/RolePage/RolePage.d.ts +0 -11
- package/lib/pages/RolePage/RolePage.js +0 -214
- package/lib/pages/StatusPage/StatusMessages.d.ts +0 -72
- package/lib/pages/StatusPage/StatusMessages.js +0 -74
- package/lib/pages/StatusPage/StatusPage.d.ts +0 -6
- package/lib/pages/StatusPage/StatusPage.js +0 -75
- package/src/pages/IsPep/IsPepMessages.ts +0 -75
- package/src/pages/IsPep/IsPepPage.tsx +0 -94
- package/src/pages/RelationPage/RelationMessages.ts +0 -287
- package/src/pages/RelationPage/RelationPage.tsx +0 -269
- package/src/pages/RolePage/RoleMessages.ts +0 -389
- package/src/pages/RolePage/RolePage.tsx +0 -342
- package/src/pages/StatusPage/StatusMessages.ts +0 -80
- package/src/pages/StatusPage/StatusPage.tsx +0 -172
package/package.json
CHANGED
|
@@ -1,56 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lysaab/lysa-pep",
|
|
3
|
-
"author": "Lysa AB",
|
|
4
|
-
"version": "1.0.0
|
|
5
|
-
"main": "./lib/Exports.js",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@types/luxon": "^1.15.2",
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"@
|
|
14
|
-
"@types/
|
|
15
|
-
"@types/
|
|
16
|
-
"@types/
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"react": "^
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"release:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@lysaab/lysa-pep",
|
|
3
|
+
"author": "Lysa AB",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"main": "./lib/Exports.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@types/luxon": "^1.15.2",
|
|
8
|
+
"luxon": "^1.21.1"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@lysaab/ui-2": "^18.0.0",
|
|
12
|
+
"@types/jest": "24.0.20",
|
|
13
|
+
"@types/luxon": "^1.15.2",
|
|
14
|
+
"@types/node": "12.11.7",
|
|
15
|
+
"@types/react": "16.9.11",
|
|
16
|
+
"@types/react-dom": "16.9.3",
|
|
17
|
+
"copyfiles": "^2.1.1",
|
|
18
|
+
"luxon": "^1.21.1",
|
|
19
|
+
"react": "^16.11.0",
|
|
20
|
+
"react-dom": "^16.11.0",
|
|
21
|
+
"react-scripts": "^3.4.1",
|
|
22
|
+
"typescript": "^3.7.2"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@lysaab/ui-2": "^18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"start": "react-scripts start",
|
|
29
|
+
"build": "react-scripts build",
|
|
30
|
+
"test": "react-scripts test",
|
|
31
|
+
"eject": "react-scripts eject",
|
|
32
|
+
"build:lib": "tsc -p ./tsconfig_build.json ",
|
|
33
|
+
"copyscss": "copyfiles -u 1 \"src/components/**/*.scss\" lib/",
|
|
34
|
+
"release:patch": "npm run build:lib && npm run copyscss && npm version patch && npm publish",
|
|
35
|
+
"release:minor": "npm run build:lib && npm run copyscss && npm version minor && npm publish",
|
|
36
|
+
"release:major": "npm run build:lib && npm run copyscss && npm version major && npm publish"
|
|
37
|
+
},
|
|
38
|
+
"eslintConfig": {
|
|
39
|
+
"extends": "react-app"
|
|
40
|
+
},
|
|
41
|
+
"browserslist": {
|
|
42
|
+
"production": [
|
|
43
|
+
">0.2%",
|
|
44
|
+
"not dead",
|
|
45
|
+
"not op_mini all"
|
|
46
|
+
],
|
|
47
|
+
"development": [
|
|
48
|
+
"last 1 chrome version",
|
|
49
|
+
"last 1 firefox version",
|
|
50
|
+
"last 1 safari version"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
package/src/Exports.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export * from "./pages/PepContext";
|
|
2
|
-
export * from "./model/PepModel";
|
|
3
|
-
export * from "./
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
export * from "./pages/PepContext";
|
|
2
|
+
export * from "./model/PepModel";
|
|
3
|
+
export * from "./model/PepTexts";
|
|
4
|
+
export * from "./pages/PepIsPepPage";
|
|
5
|
+
export { PepRelationPage } from "./pages/PepRelationPage";
|
|
6
|
+
export {
|
|
7
|
+
PepRolePage,
|
|
8
|
+
militaryAlternatives,
|
|
9
|
+
roleAlternatives
|
|
10
|
+
} from "./pages/PepRolePage";
|
|
11
|
+
export { PepStatusPage } from "./pages/PepStatusPage";
|
|
12
|
+
|
|
13
|
+
export { PepAnswers } from "./components/PepAnswers";
|
|
@@ -1,47 +1,43 @@
|
|
|
1
|
-
import React, { useState, FunctionComponent } from "react";
|
|
2
|
-
import { Alternative, Select } from "@lysaab/ui-2";
|
|
3
|
-
import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
|
|
4
|
-
import { countries } from "../model/Countries";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
1
|
+
import React, { useState, FunctionComponent } from "react";
|
|
2
|
+
import { Alternative, Select } from "@lysaab/ui-2";
|
|
3
|
+
import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
|
|
4
|
+
import { countries } from "../model/Countries";
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
lysa: { contentPath: string };
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface Country {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface Props extends ValidationProps {
|
|
18
|
+
value?: string;
|
|
19
|
+
onChange?(value: Alternative<string>): void;
|
|
20
|
+
label: string;
|
|
21
|
+
removeSweden?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const CountrySelect: FunctionComponent<Props> = ({
|
|
25
|
+
value,
|
|
26
|
+
removeSweden = false,
|
|
27
|
+
...props
|
|
28
|
+
}) => {
|
|
29
|
+
const [countryAlternatives] = useState(
|
|
30
|
+
countries
|
|
31
|
+
.filter(country => !(removeSweden && country.value === "SE"))
|
|
32
|
+
.map(country => ({ text: country.label, value: country.value }))
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Select
|
|
37
|
+
alternatives={countryAlternatives}
|
|
38
|
+
placeholder={"Välj ett land"}
|
|
39
|
+
value={countryAlternatives.find(country => country.value === value)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.static-input {
|
|
2
|
-
margin-bottom: 8px;
|
|
3
|
-
|
|
4
|
-
.label {
|
|
5
|
-
font-weight: bold;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
.static-input {
|
|
2
|
+
margin-bottom: 8px;
|
|
3
|
+
|
|
4
|
+
.label {
|
|
5
|
+
font-weight: bold;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,252 +1,120 @@
|
|
|
1
|
-
import React, { FunctionComponent } from "react";
|
|
2
|
-
import "./PepAnswers.scss";
|
|
3
|
-
import { PepRequest } from "../model/PepModel";
|
|
4
|
-
import { countries } from "../model/Countries";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const country = countries.find(country => country.value === answer.country);
|
|
123
|
-
const role = getRoleAlts(intl).find(alt => alt.value === answer.role);
|
|
124
|
-
const militaryRank = getMilitaryAlts(intl).find(
|
|
125
|
-
alt => alt.value === answer.militaryRank
|
|
126
|
-
);
|
|
127
|
-
return (
|
|
128
|
-
<div>
|
|
129
|
-
{answer.type && (
|
|
130
|
-
<StaticInput
|
|
131
|
-
label={intl.formatMessage(messages.whoIsPepLabel)}
|
|
132
|
-
value={intl.formatMessage(isPepMessages[answer.type], {
|
|
133
|
-
entityType: EntityType.PERSON
|
|
134
|
-
})}
|
|
135
|
-
/>
|
|
136
|
-
)}
|
|
137
|
-
{answer.relationToPEP && (
|
|
138
|
-
<StaticInput
|
|
139
|
-
label={intl.formatMessage(messages.relationLabel)}
|
|
140
|
-
value={intl.formatMessage(relationMessages[answer.relationToPEP])}
|
|
141
|
-
/>
|
|
142
|
-
)}
|
|
143
|
-
{answer.businessRelation && (
|
|
144
|
-
<StaticInput
|
|
145
|
-
label={intl.formatMessage(messages.businessRelationLabel)}
|
|
146
|
-
value={intl.formatMessage(
|
|
147
|
-
businessRelationMessages[answer.businessRelation]
|
|
148
|
-
)}
|
|
149
|
-
/>
|
|
150
|
-
)}
|
|
151
|
-
{answer.nameOfPEP && (
|
|
152
|
-
<StaticInput
|
|
153
|
-
label={intl.formatMessage(messages.nameOfPepLabel)}
|
|
154
|
-
value={answer.nameOfPEP}
|
|
155
|
-
/>
|
|
156
|
-
)}
|
|
157
|
-
{answer.birthdayOfPEP && (
|
|
158
|
-
<StaticInput
|
|
159
|
-
label={intl.formatMessage(messages.birthdayOfPEPLabel)}
|
|
160
|
-
value={answer.birthdayOfPEP}
|
|
161
|
-
/>
|
|
162
|
-
)}
|
|
163
|
-
{answer.ended ? (
|
|
164
|
-
<React.Fragment>
|
|
165
|
-
<StaticInput
|
|
166
|
-
label={intl.formatMessage(messages.statusLabel)}
|
|
167
|
-
value={intl.formatMessage(messages.statusEndedValue)}
|
|
168
|
-
/>
|
|
169
|
-
<StaticInput
|
|
170
|
-
label={intl.formatMessage(messages.endedLabel)}
|
|
171
|
-
value={answer.ended}
|
|
172
|
-
/>
|
|
173
|
-
</React.Fragment>
|
|
174
|
-
) : (
|
|
175
|
-
<StaticInput
|
|
176
|
-
label={intl.formatMessage(messages.statusLabel)}
|
|
177
|
-
value={intl.formatMessage(messages.statusOngoingValue)}
|
|
178
|
-
/>
|
|
179
|
-
)}
|
|
180
|
-
{answer.country && (
|
|
181
|
-
<StaticInput
|
|
182
|
-
label={intl.formatMessage(messages.countryLabel)}
|
|
183
|
-
value={country ? country.label : answer.country}
|
|
184
|
-
/>
|
|
185
|
-
)}
|
|
186
|
-
{role && (
|
|
187
|
-
<StaticInput
|
|
188
|
-
label={intl.formatMessage(messages.roleLabel)}
|
|
189
|
-
value={role.text}
|
|
190
|
-
/>
|
|
191
|
-
)}
|
|
192
|
-
{answer.ambassadorCountry && (
|
|
193
|
-
<StaticInput
|
|
194
|
-
label={intl.formatMessage(messages.ambassadorCountryLabel)}
|
|
195
|
-
value={
|
|
196
|
-
countries.find(
|
|
197
|
-
country => country.value === answer.ambassadorCountry
|
|
198
|
-
)?.label || answer.ambassadorCountry
|
|
199
|
-
}
|
|
200
|
-
/>
|
|
201
|
-
)}
|
|
202
|
-
{answer.governmentCompany && (
|
|
203
|
-
<StaticInput
|
|
204
|
-
label={intl.formatMessage(messages.governmentCompanyNameLabel)}
|
|
205
|
-
value={answer.governmentCompany}
|
|
206
|
-
/>
|
|
207
|
-
)}
|
|
208
|
-
{answer.governmentCompanyRole && (
|
|
209
|
-
<StaticInput
|
|
210
|
-
label={intl.formatMessage(messages.governmentCompanyRoleLabel)}
|
|
211
|
-
value={answer.governmentCompanyRole}
|
|
212
|
-
/>
|
|
213
|
-
)}
|
|
214
|
-
{answer.internationalOrganisation && (
|
|
215
|
-
<StaticInput
|
|
216
|
-
label={intl.formatMessage(
|
|
217
|
-
messages.internationalOrganisationNameLabel
|
|
218
|
-
)}
|
|
219
|
-
value={answer.internationalOrganisation}
|
|
220
|
-
/>
|
|
221
|
-
)}
|
|
222
|
-
{answer.internationalOrganisationRole && (
|
|
223
|
-
<StaticInput
|
|
224
|
-
label={intl.formatMessage(
|
|
225
|
-
messages.internationalOrganisationRoleLabel
|
|
226
|
-
)}
|
|
227
|
-
value={answer.internationalOrganisationRole}
|
|
228
|
-
/>
|
|
229
|
-
)}
|
|
230
|
-
{militaryRank && (
|
|
231
|
-
<StaticInput
|
|
232
|
-
label={intl.formatMessage(messages.militaryGradeLabel)}
|
|
233
|
-
value={militaryRank.value}
|
|
234
|
-
/>
|
|
235
|
-
)}
|
|
236
|
-
</div>
|
|
237
|
-
);
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
interface StaticInputProps {
|
|
241
|
-
label: string;
|
|
242
|
-
value: string | React.ReactNode;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const StaticInput: FunctionComponent<StaticInputProps> = ({ label, value }) => {
|
|
246
|
-
return (
|
|
247
|
-
<div className="static-input">
|
|
248
|
-
<div className="label">{label}</div>
|
|
249
|
-
<div className="value">{value}</div>
|
|
250
|
-
</div>
|
|
251
|
-
);
|
|
252
|
-
};
|
|
1
|
+
import React, { FunctionComponent } from "react";
|
|
2
|
+
import "./PepAnswers.scss";
|
|
3
|
+
import { PepRequest } from "../model/PepModel";
|
|
4
|
+
import { countries } from "../model/Countries";
|
|
5
|
+
import { LABELS } from "../model/PepTexts";
|
|
6
|
+
import { roleAlternatives, militaryAlternatives } from "../pages/PepRolePage";
|
|
7
|
+
import { EntityType, PepType } from "../pages/PepContext";
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
answer: PepRequest;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const PepAnswers: FunctionComponent<Props> = ({ answer }) => {
|
|
14
|
+
if (!answer.type || answer.type === PepType.NOT_PEP) {
|
|
15
|
+
return <div><p>Personen är inte PEP</p></div>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const entityType = answer.legalEntityType || EntityType.PERSON;
|
|
19
|
+
const labels = LABELS(answer.ownerName);
|
|
20
|
+
const country = countries.find(country => country.value === answer.country);
|
|
21
|
+
const role = roleAlternatives.find(alt => alt.value === answer.role);
|
|
22
|
+
const militaryRank = militaryAlternatives.find(
|
|
23
|
+
alt => alt.value === answer.militaryRank
|
|
24
|
+
);
|
|
25
|
+
return (
|
|
26
|
+
<div>
|
|
27
|
+
{answer.type && (
|
|
28
|
+
<StaticInput
|
|
29
|
+
label="Vem är pep"
|
|
30
|
+
value={labels[entityType].GENERIC.IS_PEP[answer.type]}
|
|
31
|
+
/>
|
|
32
|
+
)}
|
|
33
|
+
{answer.relationToPEP && (
|
|
34
|
+
<StaticInput
|
|
35
|
+
label="Relation"
|
|
36
|
+
value={
|
|
37
|
+
labels[entityType][PepType.RELATIVE].RELATION[
|
|
38
|
+
answer.relationToPEP
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
{answer.businessRelation && (
|
|
44
|
+
<StaticInput
|
|
45
|
+
label="Relation"
|
|
46
|
+
value={
|
|
47
|
+
labels[entityType][PepType.COLLEAGUE].BUSINESS_RELATION[
|
|
48
|
+
answer.businessRelation
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
53
|
+
{answer.nameOfPEP && (
|
|
54
|
+
<StaticInput label="Namn på personen" value={answer.nameOfPEP} />
|
|
55
|
+
)}
|
|
56
|
+
{answer.birthdayOfPEP && (
|
|
57
|
+
<StaticInput
|
|
58
|
+
label="Födelsedag för personen"
|
|
59
|
+
value={answer.birthdayOfPEP}
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
{answer.ended ? (
|
|
63
|
+
<React.Fragment>
|
|
64
|
+
<StaticInput label="Status" value="Avslutad" />
|
|
65
|
+
<StaticInput label="Avslutades" value={answer.ended} />
|
|
66
|
+
</React.Fragment>
|
|
67
|
+
) : (
|
|
68
|
+
<StaticInput label="Status" value="Pågående" />
|
|
69
|
+
)}
|
|
70
|
+
{answer.country && (
|
|
71
|
+
<StaticInput
|
|
72
|
+
label="Land"
|
|
73
|
+
value={country ? country.label : answer.country}
|
|
74
|
+
/>
|
|
75
|
+
)}
|
|
76
|
+
{role && <StaticInput label="Roll" value={role.text} />}
|
|
77
|
+
{answer.ambassadorCountry && (
|
|
78
|
+
<StaticInput label="Ambassadörsland" value={answer.ambassadorCountry} />
|
|
79
|
+
)}
|
|
80
|
+
{answer.governmentCompany && (
|
|
81
|
+
<StaticInput label="Företagets namn" value={answer.governmentCompany} />
|
|
82
|
+
)}
|
|
83
|
+
{answer.governmentCompanyRole && (
|
|
84
|
+
<StaticInput
|
|
85
|
+
label="Roll på företaget"
|
|
86
|
+
value={answer.governmentCompanyRole}
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
{answer.internationalOrganisation && (
|
|
90
|
+
<StaticInput
|
|
91
|
+
label="Organisationens namn"
|
|
92
|
+
value={answer.internationalOrganisation}
|
|
93
|
+
/>
|
|
94
|
+
)}
|
|
95
|
+
{answer.internationalOrganisationRole && (
|
|
96
|
+
<StaticInput
|
|
97
|
+
label="Roll i organisationen"
|
|
98
|
+
value={answer.internationalOrganisationRole}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
{militaryRank && (
|
|
102
|
+
<StaticInput label="Militär grad" value={militaryRank.text} />
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
interface StaticInputProps {
|
|
109
|
+
label: string;
|
|
110
|
+
value: string | React.ReactNode;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const StaticInput: FunctionComponent<StaticInputProps> = ({ label, value }) => {
|
|
114
|
+
return (
|
|
115
|
+
<div className="static-input">
|
|
116
|
+
<div className="label">{label}</div>
|
|
117
|
+
<div className="value">{value}</div>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
};
|
package/src/demo/Done.tsx
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import { PepContext } from "../pages/PepContext";
|
|
3
|
-
import { stateToRequest } from "../model/PepModel";
|
|
4
|
-
import { PepAnswers } from "../components/PepAnswers";
|
|
5
|
-
|
|
6
|
-
export function Done() {
|
|
7
|
-
const pepContext = useContext(PepContext);
|
|
8
|
-
return (
|
|
9
|
-
<div>
|
|
10
|
-
<h2>Taco hej!</h2>
|
|
11
|
-
<p>Leverpastej!</p>
|
|
12
|
-
<PepAnswers
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { PepContext } from "../pages/PepContext";
|
|
3
|
+
import { stateToRequest } from "../model/PepModel";
|
|
4
|
+
import { PepAnswers } from "../components/PepAnswers";
|
|
5
|
+
|
|
6
|
+
export function Done() {
|
|
7
|
+
const pepContext = useContext(PepContext);
|
|
8
|
+
return (
|
|
9
|
+
<div>
|
|
10
|
+
<h2>Taco hej!</h2>
|
|
11
|
+
<p>Leverpastej!</p>
|
|
12
|
+
<PepAnswers
|
|
13
|
+
answer={{
|
|
14
|
+
...stateToRequest(pepContext.state),
|
|
15
|
+
ownerName: pepContext.state.ownerName,
|
|
16
|
+
}}
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
}
|