@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
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
FunctionComponent,
|
|
3
|
+
useRef,
|
|
4
|
+
useCallback,
|
|
5
|
+
useContext,
|
|
6
|
+
} from "react";
|
|
7
|
+
import { Alternative } from "@lysaab/ui-2/components/input/InputAPI";
|
|
8
|
+
import {
|
|
9
|
+
LysaFormRef,
|
|
10
|
+
Form,
|
|
11
|
+
PrimaryButton,
|
|
12
|
+
RequiredValidator,
|
|
13
|
+
TextInput,
|
|
14
|
+
Select,
|
|
15
|
+
} from "@lysaab/ui-2";
|
|
16
|
+
import {
|
|
17
|
+
PepContext,
|
|
18
|
+
Role,
|
|
19
|
+
MilitaryRank,
|
|
20
|
+
EntityType,
|
|
21
|
+
PepType,
|
|
22
|
+
} from "./PepContext";
|
|
23
|
+
import { CountrySelect } from "../components/CountrySelect";
|
|
24
|
+
import {
|
|
25
|
+
getGovernmentCompanyNameLabel,
|
|
26
|
+
getGovernmentCompanyRoleLabel,
|
|
27
|
+
getHighRankingPositionIntCorpNameLabel,
|
|
28
|
+
getHighRankingPositionIntCorpRoleLabel,
|
|
29
|
+
getMilitaryRankLabel,
|
|
30
|
+
getRoleLabel,
|
|
31
|
+
getAmbassadorLabel,
|
|
32
|
+
} from "../model/PepTexts";
|
|
33
|
+
|
|
34
|
+
interface Props {
|
|
35
|
+
next: () => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const roleAlternatives: Alternative<Role>[] = [
|
|
39
|
+
{ text: "Stats eller regeringschef", value: Role.HEAD_OF_GOVERNMENT },
|
|
40
|
+
{ text: "Minister eller Vice/Biträdande minister", value: Role.MINISTER },
|
|
41
|
+
{ text: "Ledamot i parlament eller riksdag", value: Role.PARLIMENT_MEMBER },
|
|
42
|
+
{
|
|
43
|
+
text: "Ledamot i centralbanks styrande organ",
|
|
44
|
+
value: Role.CENTRAL_BANK_MEMBER,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
text: "Ledamot för styrelsen i politiskt parti representerade i riksdagen",
|
|
48
|
+
value: Role.BOARD_MEMBER_POLITICAL_PARTY,
|
|
49
|
+
},
|
|
50
|
+
{ text: "Domare i högsta domstolen", value: Role.JUDGE_SUPREME_COURT },
|
|
51
|
+
{
|
|
52
|
+
text:
|
|
53
|
+
"Domare i konstitutionell domstol eller annat rättsligt organ på hög nivå vars beslut endast undantagsvis kan överklagas",
|
|
54
|
+
value: Role.JUDGE_OTHER_HIGH_COURT,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
text: "Högre tjänsteman vid revisionsmyndighet",
|
|
58
|
+
value: Role.REVISION_INSTITUTE,
|
|
59
|
+
},
|
|
60
|
+
{ text: "Ambassadör eller bestickningschef", value: Role.AMBASSADOR },
|
|
61
|
+
{ text: "Högre officer i försvarsmakt", value: Role.MILITARY_OFFICER },
|
|
62
|
+
{
|
|
63
|
+
text:
|
|
64
|
+
"Person som ingår i statsägt företags förvaltnings-, lednings eller kontrollorgan",
|
|
65
|
+
value: Role.GOVERNMENT_COMPANY,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
text: "EU-parlamentariker",
|
|
69
|
+
value: Role.EU_HIGH_RANKING_POSITION,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
text: "Befattning på hög nivå i en internationell organisation",
|
|
73
|
+
value: Role.HIGH_RANKING_POSITION_INTERNALTIONAL_CORP,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
export const militaryAlternatives: Alternative<MilitaryRank>[] = [
|
|
78
|
+
{
|
|
79
|
+
text: "General",
|
|
80
|
+
value: MilitaryRank.GENERAL,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
text: "Generallöjtnant",
|
|
84
|
+
value: MilitaryRank.LIEUTENANT_GENERAL,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
text: "Generalmajor",
|
|
88
|
+
value: MilitaryRank.MAJOR_GENERAL,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
text: "Amiral",
|
|
92
|
+
value: MilitaryRank.ADMIRAL,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
text: "Viceamiral",
|
|
96
|
+
value: MilitaryRank.VICE_ADMIRAL,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
text: "Konteramiral",
|
|
100
|
+
value: MilitaryRank.REAR_ADMIRAL,
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
export const PepRolePage: FunctionComponent<Props> = ({ next }) => {
|
|
105
|
+
const pepContext = useContext(PepContext);
|
|
106
|
+
const formRef = useRef<LysaFormRef>();
|
|
107
|
+
const entityType = pepContext.state.legalEntityType || EntityType.PERSON;
|
|
108
|
+
const type = pepContext.state.type;
|
|
109
|
+
|
|
110
|
+
const nextPage = useCallback(() => {
|
|
111
|
+
if (formRef.current && formRef.current.isValid) {
|
|
112
|
+
next();
|
|
113
|
+
}
|
|
114
|
+
}, [formRef, next]);
|
|
115
|
+
|
|
116
|
+
const resetRoleFields = useCallback(() => {
|
|
117
|
+
pepContext.setState({
|
|
118
|
+
ambassadorCountry: undefined,
|
|
119
|
+
governmentCompany: undefined,
|
|
120
|
+
governmentCompanyRole: undefined,
|
|
121
|
+
internationalOrganisation: undefined,
|
|
122
|
+
internationalOrganisationRole: undefined,
|
|
123
|
+
militaryRank: undefined,
|
|
124
|
+
});
|
|
125
|
+
}, [pepContext]);
|
|
126
|
+
|
|
127
|
+
if (!type || type === PepType.NOT_PEP) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<Form onSubmit={() => nextPage()} lysaFormRef={formRef}>
|
|
133
|
+
<Select
|
|
134
|
+
label={getRoleLabel(
|
|
135
|
+
entityType,
|
|
136
|
+
type,
|
|
137
|
+
pepContext.state.relationToPEP,
|
|
138
|
+
pepContext.state.businessRelation,
|
|
139
|
+
pepContext.state.ownerName
|
|
140
|
+
)}
|
|
141
|
+
placeholder="Välj en roll"
|
|
142
|
+
alternatives={roleAlternatives}
|
|
143
|
+
value={roleAlternatives.find(
|
|
144
|
+
alt => alt.value === pepContext.state.role
|
|
145
|
+
)}
|
|
146
|
+
onChange={event => {
|
|
147
|
+
pepContext.setState({ role: event.value as Role });
|
|
148
|
+
resetRoleFields();
|
|
149
|
+
}}
|
|
150
|
+
validators={[new RequiredValidator("Du måste välja roll")]}
|
|
151
|
+
/>
|
|
152
|
+
|
|
153
|
+
{pepContext.state.role && pepContext.state.role === Role.AMBASSADOR ? (
|
|
154
|
+
<CountrySelect
|
|
155
|
+
label={getAmbassadorLabel(
|
|
156
|
+
entityType,
|
|
157
|
+
type,
|
|
158
|
+
pepContext.state.relationToPEP,
|
|
159
|
+
pepContext.state.businessRelation,
|
|
160
|
+
pepContext.state.ownerName
|
|
161
|
+
)}
|
|
162
|
+
onChange={event =>
|
|
163
|
+
pepContext.setState({
|
|
164
|
+
ambassadorCountry: event.value
|
|
165
|
+
? event.value.toString()
|
|
166
|
+
: undefined,
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
value={pepContext.state.ambassadorCountry}
|
|
170
|
+
validators={[new RequiredValidator("Du måste välja land")]}
|
|
171
|
+
/>
|
|
172
|
+
) : null}
|
|
173
|
+
|
|
174
|
+
{pepContext.state.role &&
|
|
175
|
+
pepContext.state.role === Role.GOVERNMENT_COMPANY ? (
|
|
176
|
+
<React.Fragment>
|
|
177
|
+
<TextInput
|
|
178
|
+
label={getGovernmentCompanyNameLabel(
|
|
179
|
+
entityType,
|
|
180
|
+
type,
|
|
181
|
+
pepContext.state.relationToPEP,
|
|
182
|
+
pepContext.state.businessRelation,
|
|
183
|
+
pepContext.state.ownerName
|
|
184
|
+
)}
|
|
185
|
+
value={pepContext.state.governmentCompany || ""}
|
|
186
|
+
onChange={value => {
|
|
187
|
+
pepContext.setState({ governmentCompany: value });
|
|
188
|
+
}}
|
|
189
|
+
validators={[new RequiredValidator("Du måste ange ett namn")]}
|
|
190
|
+
/>
|
|
191
|
+
<TextInput
|
|
192
|
+
label={getGovernmentCompanyRoleLabel(
|
|
193
|
+
entityType,
|
|
194
|
+
type,
|
|
195
|
+
pepContext.state.relationToPEP,
|
|
196
|
+
pepContext.state.businessRelation,
|
|
197
|
+
pepContext.state.ownerName
|
|
198
|
+
)}
|
|
199
|
+
value={pepContext.state.governmentCompanyRole || ""}
|
|
200
|
+
onChange={value => {
|
|
201
|
+
pepContext.setState({
|
|
202
|
+
governmentCompanyRole: value,
|
|
203
|
+
});
|
|
204
|
+
}}
|
|
205
|
+
validators={[new RequiredValidator("Du måste ange roll")]}
|
|
206
|
+
/>
|
|
207
|
+
</React.Fragment>
|
|
208
|
+
) : null}
|
|
209
|
+
|
|
210
|
+
{pepContext.state.role &&
|
|
211
|
+
pepContext.state.role ===
|
|
212
|
+
Role.HIGH_RANKING_POSITION_INTERNALTIONAL_CORP ? (
|
|
213
|
+
<React.Fragment>
|
|
214
|
+
<TextInput
|
|
215
|
+
label={getHighRankingPositionIntCorpNameLabel(
|
|
216
|
+
entityType,
|
|
217
|
+
type,
|
|
218
|
+
pepContext.state.relationToPEP,
|
|
219
|
+
pepContext.state.businessRelation,
|
|
220
|
+
pepContext.state.ownerName
|
|
221
|
+
)}
|
|
222
|
+
value={pepContext.state.internationalOrganisation || ""}
|
|
223
|
+
onChange={value => {
|
|
224
|
+
pepContext.setState({ internationalOrganisation: value });
|
|
225
|
+
}}
|
|
226
|
+
validators={[new RequiredValidator("Du måste ange ett namn")]}
|
|
227
|
+
/>
|
|
228
|
+
<TextInput
|
|
229
|
+
label={getHighRankingPositionIntCorpRoleLabel(
|
|
230
|
+
entityType,
|
|
231
|
+
type,
|
|
232
|
+
pepContext.state.relationToPEP,
|
|
233
|
+
pepContext.state.businessRelation,
|
|
234
|
+
pepContext.state.ownerName
|
|
235
|
+
)}
|
|
236
|
+
value={pepContext.state.internationalOrganisationRole || ""}
|
|
237
|
+
onChange={value => {
|
|
238
|
+
pepContext.setState({
|
|
239
|
+
internationalOrganisationRole: value,
|
|
240
|
+
});
|
|
241
|
+
}}
|
|
242
|
+
validators={[new RequiredValidator("Du måste ange roll")]}
|
|
243
|
+
/>
|
|
244
|
+
</React.Fragment>
|
|
245
|
+
) : null}
|
|
246
|
+
|
|
247
|
+
{pepContext.state.role &&
|
|
248
|
+
pepContext.state.role === Role.MILITARY_OFFICER ? (
|
|
249
|
+
<Select
|
|
250
|
+
label={getMilitaryRankLabel(
|
|
251
|
+
entityType,
|
|
252
|
+
type,
|
|
253
|
+
pepContext.state.relationToPEP,
|
|
254
|
+
pepContext.state.businessRelation,
|
|
255
|
+
pepContext.state.ownerName
|
|
256
|
+
)}
|
|
257
|
+
placeholder="Välj grad"
|
|
258
|
+
alternatives={militaryAlternatives}
|
|
259
|
+
value={militaryAlternatives.find(
|
|
260
|
+
alt => alt.value === pepContext.state.militaryRank
|
|
261
|
+
)}
|
|
262
|
+
onChange={event => {
|
|
263
|
+
pepContext.setState({ militaryRank: event.value as MilitaryRank });
|
|
264
|
+
}}
|
|
265
|
+
validators={[new RequiredValidator("Du måste ange en grad")]}
|
|
266
|
+
/>
|
|
267
|
+
) : null}
|
|
268
|
+
|
|
269
|
+
<PrimaryButton type="submit">Nästa</PrimaryButton>
|
|
270
|
+
</Form>
|
|
271
|
+
);
|
|
272
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
FunctionComponent,
|
|
3
|
+
useRef,
|
|
4
|
+
useCallback,
|
|
5
|
+
useContext,
|
|
6
|
+
} from "react";
|
|
7
|
+
import {
|
|
8
|
+
Form,
|
|
9
|
+
RadioGroup,
|
|
10
|
+
RequiredValidator,
|
|
11
|
+
PrimaryButton,
|
|
12
|
+
LysaFormRef,
|
|
13
|
+
Datepicker,
|
|
14
|
+
} from "@lysaab/ui-2";
|
|
15
|
+
import { Alternative } from "@lysaab/ui-2/components/input/InputAPI";
|
|
16
|
+
import { PepContext, PepStatus, EntityType, PepType } from "./PepContext";
|
|
17
|
+
import { CountrySelect } from "../components/CountrySelect";
|
|
18
|
+
import {
|
|
19
|
+
LABELS,
|
|
20
|
+
getStatusOngoingHeader,
|
|
21
|
+
getStatusCountryHeader,
|
|
22
|
+
} from "../model/PepTexts";
|
|
23
|
+
|
|
24
|
+
const stateAlternatives: Alternative<PepStatus>[] = [
|
|
25
|
+
{
|
|
26
|
+
text: "Pågående",
|
|
27
|
+
value: PepStatus.ONGOING,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
text: "Avslutad",
|
|
31
|
+
value: PepStatus.ENDED,
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const isSwedenAlternatives: Alternative<string>[] = [
|
|
36
|
+
{ text: "Sverige", value: "sweden" },
|
|
37
|
+
{ text: "Annat", value: "other" },
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
interface Props {
|
|
41
|
+
next: () => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const PepStatusPage: FunctionComponent<Props> = ({ next }) => {
|
|
45
|
+
const pepContext = useContext(PepContext);
|
|
46
|
+
const formRef = useRef<LysaFormRef>();
|
|
47
|
+
|
|
48
|
+
const nextPage = useCallback(() => {
|
|
49
|
+
if (formRef.current && formRef.current.isValid) {
|
|
50
|
+
next();
|
|
51
|
+
}
|
|
52
|
+
}, [formRef, next]);
|
|
53
|
+
|
|
54
|
+
const updateIsSweden = useCallback(
|
|
55
|
+
(alternative: Alternative<string>) => {
|
|
56
|
+
pepContext.setState({ isSweden: alternative.value });
|
|
57
|
+
|
|
58
|
+
if (alternative.value === "other") {
|
|
59
|
+
pepContext.setState({ country: undefined });
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
[pepContext]
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const updateIsOngoing = useCallback(
|
|
66
|
+
(alternative: Alternative<PepStatus>) => {
|
|
67
|
+
pepContext.setState({ isOngoing: alternative.value });
|
|
68
|
+
|
|
69
|
+
if (alternative.value === PepStatus.ONGOING) {
|
|
70
|
+
pepContext.setState({ ended: undefined });
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
[pepContext]
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const labels = LABELS(pepContext.state.ownerName);
|
|
77
|
+
const entityType = pepContext.state.legalEntityType || EntityType.PERSON;
|
|
78
|
+
const type = pepContext.state.type;
|
|
79
|
+
|
|
80
|
+
if (!type || type === PepType.NOT_PEP) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div>
|
|
86
|
+
<Form
|
|
87
|
+
lysaFormRef={formRef}
|
|
88
|
+
onSubmit={() => {
|
|
89
|
+
nextPage();
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<RadioGroup
|
|
93
|
+
alternatives={stateAlternatives}
|
|
94
|
+
header={getStatusOngoingHeader(
|
|
95
|
+
entityType,
|
|
96
|
+
type,
|
|
97
|
+
pepContext.state.relationToPEP,
|
|
98
|
+
pepContext.state.businessRelation,
|
|
99
|
+
pepContext.state.ownerName
|
|
100
|
+
)}
|
|
101
|
+
onChange={updateIsOngoing}
|
|
102
|
+
value={stateAlternatives.find(
|
|
103
|
+
(alt) => alt.value === pepContext.state.isOngoing
|
|
104
|
+
)}
|
|
105
|
+
validators={[new RequiredValidator("Du måste välja ett alternativ")]}
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
{pepContext.state.isOngoing &&
|
|
109
|
+
pepContext.state.isOngoing === PepStatus.ENDED ? (
|
|
110
|
+
<Datepicker
|
|
111
|
+
label="När avslutades uppdraget?"
|
|
112
|
+
selected={pepContext.state.ended}
|
|
113
|
+
onChange={(event) =>
|
|
114
|
+
pepContext.setState({ ended: event || undefined })
|
|
115
|
+
}
|
|
116
|
+
validators={[new RequiredValidator("Du måste ange datum")]}
|
|
117
|
+
showMonthYearPicker
|
|
118
|
+
dateFormat="yyyy-MM"
|
|
119
|
+
maxDate={new Date()}
|
|
120
|
+
/>
|
|
121
|
+
) : null}
|
|
122
|
+
|
|
123
|
+
<RadioGroup
|
|
124
|
+
alternatives={isSwedenAlternatives}
|
|
125
|
+
header={getStatusCountryHeader(
|
|
126
|
+
entityType,
|
|
127
|
+
type,
|
|
128
|
+
pepContext.state.relationToPEP,
|
|
129
|
+
pepContext.state.businessRelation,
|
|
130
|
+
pepContext.state.ownerName
|
|
131
|
+
)}
|
|
132
|
+
onChange={updateIsSweden}
|
|
133
|
+
value={isSwedenAlternatives.find(
|
|
134
|
+
(alt) => alt.value === pepContext.state.isSweden
|
|
135
|
+
)}
|
|
136
|
+
validators={[new RequiredValidator("Du måste välja ett alternativ")]}
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
{pepContext.state.isSweden && pepContext.state.isSweden === "other" ? (
|
|
140
|
+
<CountrySelect
|
|
141
|
+
label="Välj i vilket land befattningen är"
|
|
142
|
+
onChange={(event) =>
|
|
143
|
+
pepContext.setState({
|
|
144
|
+
country: event.value ? event.value.toString() : undefined,
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
validators={[new RequiredValidator("Du måste välja land")]}
|
|
148
|
+
value={pepContext.state.country}
|
|
149
|
+
removeSweden={true}
|
|
150
|
+
/>
|
|
151
|
+
) : null}
|
|
152
|
+
|
|
153
|
+
<PrimaryButton type="submit">Nästa</PrimaryButton>
|
|
154
|
+
</Form>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
};
|
package/.vscode/settings.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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,74 +0,0 @@
|
|
|
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
|
-
Är du eller en närstående till dig en person i politisk utsatt ställning? (PEP)
|
|
11
|
-
}
|
|
12
|
-
CORPORATION {
|
|
13
|
-
Är {name} eller en närstående till {name} en person i politisk utsatt ställning? (PEP)
|
|
14
|
-
}
|
|
15
|
-
}`
|
|
16
|
-
},
|
|
17
|
-
required: {
|
|
18
|
-
id: 'pep.ispep.header',
|
|
19
|
-
description: 'Not pep',
|
|
20
|
-
defaultMessage: `{
|
|
21
|
-
entityType, select,
|
|
22
|
-
PERSON {
|
|
23
|
-
Är du eller en närstående till dig en person i politisk utsatt ställning? (PEP)
|
|
24
|
-
}
|
|
25
|
-
CORPORATION {
|
|
26
|
-
Är {name} eller en närstående till {name} en person i politisk utsatt ställning? (PEP)
|
|
27
|
-
}
|
|
28
|
-
}`
|
|
29
|
-
},
|
|
30
|
-
[PepType.NOT_PEP]: {
|
|
31
|
-
id: 'pep.ispep.NOT_PEP',
|
|
32
|
-
description: 'Not pep',
|
|
33
|
-
defaultMessage: 'Nej'
|
|
34
|
-
},
|
|
35
|
-
[PepType.ME]: {
|
|
36
|
-
id: 'pep.ispep.ME',
|
|
37
|
-
description: 'The person is pep',
|
|
38
|
-
defaultMessage: `{
|
|
39
|
-
entityType, select,
|
|
40
|
-
PERSON {
|
|
41
|
-
Jag har en funktion som gör mig till PEP
|
|
42
|
-
}
|
|
43
|
-
CORPORATION {
|
|
44
|
-
På grund av sin funktion är {name} PEP
|
|
45
|
-
}
|
|
46
|
-
}`
|
|
47
|
-
},
|
|
48
|
-
[PepType.RELATIVE]: {
|
|
49
|
-
id: 'pep.ispep.RELATIVE',
|
|
50
|
-
description: 'Jag har en relation med en person som är PEP',
|
|
51
|
-
defaultMessage: `{
|
|
52
|
-
entityType, select,
|
|
53
|
-
PERSON {
|
|
54
|
-
Jag har en relation med en person som är PEP
|
|
55
|
-
}
|
|
56
|
-
CORPORATION {
|
|
57
|
-
{name} är medarbetare till, eller har en affärsrelation med, en person som är PEP
|
|
58
|
-
}
|
|
59
|
-
}`
|
|
60
|
-
},
|
|
61
|
-
[PepType.COLLEAGUE]: {
|
|
62
|
-
id: 'pep.ispep.COLLEAGUE',
|
|
63
|
-
description: 'The person has a colleague that is pep',
|
|
64
|
-
defaultMessage: `{
|
|
65
|
-
entityType, select,
|
|
66
|
-
PERSON {
|
|
67
|
-
Jag är medarbetare till, eller har en affärsrelation med, en person som är PEP
|
|
68
|
-
}
|
|
69
|
-
CORPORATION {
|
|
70
|
-
På grund av sin funktion är {name} PEP
|
|
71
|
-
}
|
|
72
|
-
}`
|
|
73
|
-
},
|
|
74
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
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,39 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useCallback, useContext } from "react";
|
|
2
|
-
import { Form, RadioGroup, RequiredValidator, PrimaryButton } 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], { entityType, name: ownerName }),
|
|
11
|
-
value: PepType.NOT_PEP
|
|
12
|
-
},
|
|
13
|
-
{ text: intl.formatMessage(messages[PepType.ME], { entityType, name: ownerName }), value: PepType.ME },
|
|
14
|
-
{
|
|
15
|
-
text: intl.formatMessage(messages[PepType.RELATIVE], { entityType, name: ownerName }),
|
|
16
|
-
value: PepType.RELATIVE
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
text: intl.formatMessage(messages[PepType.COLLEAGUE], { entityType, name: ownerName }),
|
|
20
|
-
value: PepType.COLLEAGUE
|
|
21
|
-
}
|
|
22
|
-
];
|
|
23
|
-
return (React.createElement(RadioGroup, { alternatives: IsPepAlternatives, onChange: alt => onChange(alt.value), value: IsPepAlternatives.find(alt => alt.value === type), header: intl.formatMessage(messages.header, { entityType, name: ownerName }), validators: [RequiredValidator(intl.formatMessage(messages.required))] }));
|
|
24
|
-
};
|
|
25
|
-
export const IsPepPage = ({ next }) => {
|
|
26
|
-
const pepContext = useContext(PepContext);
|
|
27
|
-
const formRef = useRef();
|
|
28
|
-
const nextPage = useCallback(() => {
|
|
29
|
-
if (formRef.current && formRef.current.isValid && next) {
|
|
30
|
-
next();
|
|
31
|
-
}
|
|
32
|
-
}, [formRef, next]);
|
|
33
|
-
return (React.createElement(Form, { onSubmit: nextPage, lysaFormRef: formRef },
|
|
34
|
-
React.createElement(IsPepRadioGroup, { entityType: pepContext.state.legalEntityType || EntityType.PERSON, ownerName: pepContext.state.ownerName || "", type: pepContext.state.type, onChange: type => {
|
|
35
|
-
pepContext.setState({ type });
|
|
36
|
-
} }),
|
|
37
|
-
React.createElement(PrimaryButton, { type: "submit" },
|
|
38
|
-
React.createElement(FormattedMessage, { id: "pep.ispep.next", description: "Next button", defaultMessage: 'G\u00E5 vidare' }))));
|
|
39
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
export declare const relationMessages: {
|
|
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
|
-
MARRIED_PARTNER: {
|
|
13
|
-
id: string;
|
|
14
|
-
description: string;
|
|
15
|
-
defaultMessage: string;
|
|
16
|
-
};
|
|
17
|
-
COLIVING_PARTNER: {
|
|
18
|
-
id: string;
|
|
19
|
-
description: string;
|
|
20
|
-
defaultMessage: string;
|
|
21
|
-
};
|
|
22
|
-
CHILD: {
|
|
23
|
-
id: string;
|
|
24
|
-
description: string;
|
|
25
|
-
defaultMessage: string;
|
|
26
|
-
};
|
|
27
|
-
PARENT: {
|
|
28
|
-
id: string;
|
|
29
|
-
description: string;
|
|
30
|
-
defaultMessage: string;
|
|
31
|
-
};
|
|
32
|
-
CHILD_MARRIED_PARTNER: {
|
|
33
|
-
id: string;
|
|
34
|
-
description: string;
|
|
35
|
-
defaultMessage: string;
|
|
36
|
-
};
|
|
37
|
-
CHILD_COLIVING_PARTNER: {
|
|
38
|
-
id: string;
|
|
39
|
-
description: string;
|
|
40
|
-
defaultMessage: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
export declare const businessRelationMessages: {
|
|
44
|
-
header: {
|
|
45
|
-
id: string;
|
|
46
|
-
description: string;
|
|
47
|
-
defaultMessage: string;
|
|
48
|
-
};
|
|
49
|
-
required: {
|
|
50
|
-
id: string;
|
|
51
|
-
description: string;
|
|
52
|
-
defaultMessage: string;
|
|
53
|
-
};
|
|
54
|
-
CO_OWNERSHIP: {
|
|
55
|
-
id: string;
|
|
56
|
-
description: string;
|
|
57
|
-
defaultMessage: string;
|
|
58
|
-
};
|
|
59
|
-
CLOSE_CONNECTION: {
|
|
60
|
-
id: string;
|
|
61
|
-
description: string;
|
|
62
|
-
defaultMessage: string;
|
|
63
|
-
};
|
|
64
|
-
COMPANY_FOR_PEP: {
|
|
65
|
-
id: string;
|
|
66
|
-
description: string;
|
|
67
|
-
defaultMessage: string;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
export declare const relativeNameMessages: {
|
|
71
|
-
header: {
|
|
72
|
-
id: string;
|
|
73
|
-
description: string;
|
|
74
|
-
defaultMessage: string;
|
|
75
|
-
};
|
|
76
|
-
required: {
|
|
77
|
-
id: string;
|
|
78
|
-
description: string;
|
|
79
|
-
defaultMessage: string;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
export declare const birthdayMessages: {
|
|
83
|
-
header: {
|
|
84
|
-
id: string;
|
|
85
|
-
description: string;
|
|
86
|
-
defaultMessage: string;
|
|
87
|
-
};
|
|
88
|
-
required: {
|
|
89
|
-
id: string;
|
|
90
|
-
description: string;
|
|
91
|
-
defaultMessage: string;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
export declare const colleagueNameMessages: {
|
|
95
|
-
header: {
|
|
96
|
-
id: string;
|
|
97
|
-
description: string;
|
|
98
|
-
defaultMessage: string;
|
|
99
|
-
};
|
|
100
|
-
required: {
|
|
101
|
-
id: string;
|
|
102
|
-
description: string;
|
|
103
|
-
defaultMessage: string;
|
|
104
|
-
};
|
|
105
|
-
};
|