@lysaab/lysa-pep 1.0.0 → 1.0.1-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/.vscode/settings.json +4 -0
- package/lib/Exports.d.ts +7 -8
- package/lib/Exports.js +7 -8
- package/lib/components/CountrySelect.d.ts +15 -22
- package/lib/components/CountrySelect.js +30 -21
- package/lib/components/PepAnswers.d.ts +8 -8
- package/lib/components/PepAnswers.js +131 -39
- 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 +322 -380
- package/lib/model/PepTexts.js +467 -552
- package/lib/pages/IsPep/IsPepMessages.d.ts +32 -0
- package/lib/pages/IsPep/IsPepMessages.js +74 -0
- package/lib/pages/IsPep/IsPepPage.d.ts +14 -0
- package/lib/pages/IsPep/IsPepPage.js +39 -0
- package/lib/pages/PepContext.d.ts +80 -80
- package/lib/pages/PepContext.js +88 -88
- package/lib/pages/PepIsPepPage.d.ts +6 -15
- package/lib/pages/PepIsPepPage.js +57 -59
- package/lib/pages/PepRelationPage.d.ts +6 -6
- package/lib/pages/PepRelationPage.js +83 -79
- package/lib/pages/PepRolePage.d.ts +9 -10
- package/lib/pages/PepRolePage.js +127 -127
- package/lib/pages/PepStatusPage.d.ts +6 -6
- package/lib/pages/PepStatusPage.js +57 -58
- package/lib/pages/RelationPage/RelationMessages.d.ts +105 -0
- package/lib/pages/RelationPage/RelationMessages.js +282 -0
- package/lib/pages/RelationPage/RelationPage.d.ts +6 -0
- package/lib/pages/RelationPage/RelationPage.js +142 -0
- package/lib/pages/RolePage/RoleMessages.d.ts +185 -0
- package/lib/pages/RolePage/RoleMessages.js +381 -0
- package/lib/pages/RolePage/RolePage.d.ts +11 -0
- package/lib/pages/RolePage/RolePage.js +214 -0
- package/lib/pages/StatusPage/StatusMessages.d.ts +72 -0
- package/lib/pages/StatusPage/StatusMessages.js +74 -0
- package/lib/pages/StatusPage/StatusPage.d.ts +6 -0
- package/lib/pages/StatusPage/StatusPage.js +75 -0
- package/package.json +57 -53
- package/src/Exports.ts +12 -13
- package/src/components/CountrySelect.tsx +47 -43
- package/src/components/PepAnswers.scss +7 -7
- package/src/components/PepAnswers.tsx +252 -120
- package/src/demo/Done.tsx +16 -20
- package/src/demo/Pep.tsx +112 -106
- package/src/model/PepModel.ts +52 -52
- package/src/pages/IsPep/IsPepMessages.ts +75 -0
- package/src/pages/IsPep/IsPepPage.tsx +94 -0
- package/src/pages/PepContext.tsx +144 -144
- package/src/pages/RelationPage/RelationMessages.ts +287 -0
- package/src/pages/RelationPage/RelationPage.tsx +269 -0
- package/src/pages/RolePage/RoleMessages.ts +389 -0
- package/src/pages/RolePage/RolePage.tsx +342 -0
- package/src/pages/StatusPage/StatusMessages.ts +80 -0
- package/src/pages/StatusPage/StatusPage.tsx +172 -0
- package/src/model/PepTexts.ts +0 -607
- package/src/pages/PepIsPepPage.tsx +0 -107
- package/src/pages/PepRelationPage.tsx +0 -188
- package/src/pages/PepRolePage.tsx +0 -272
- package/src/pages/PepStatusPage.tsx +0 -157
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { defineMessages } from "react-intl";
|
|
2
|
+
import { BusinessRelation, Relation } from "../PepContext";
|
|
3
|
+
export const relationMessages = defineMessages({
|
|
4
|
+
header: {
|
|
5
|
+
id: "pep.relation.relation.header",
|
|
6
|
+
description: "Relation header",
|
|
7
|
+
defaultMessage: `{
|
|
8
|
+
entityType, select,
|
|
9
|
+
PERSON {
|
|
10
|
+
Vilken relation har du till personen i politiskt utsatt ställning?
|
|
11
|
+
}
|
|
12
|
+
CORPORATION {
|
|
13
|
+
Vilken relation har {name} till personen i politiskt utsatt ställning?
|
|
14
|
+
}
|
|
15
|
+
}`
|
|
16
|
+
},
|
|
17
|
+
required: {
|
|
18
|
+
id: "pep.relation.relation.required",
|
|
19
|
+
description: "Required error message",
|
|
20
|
+
defaultMessage: `Du måste välja ett alternativ`
|
|
21
|
+
},
|
|
22
|
+
[Relation.MARRIED_PARTNER]: {
|
|
23
|
+
id: "pep.relation.relation.MARRIED_PARTNER",
|
|
24
|
+
description: "The person is married to someone who is pep",
|
|
25
|
+
defaultMessage: `Make/Maka till PEP`
|
|
26
|
+
},
|
|
27
|
+
[Relation.COLIVING_PARTNER]: {
|
|
28
|
+
id: "pep.relation.relation.COLIVING_PARTNER",
|
|
29
|
+
description: "The person is married to someone who is pep",
|
|
30
|
+
defaultMessage: `Sambo till PEP`
|
|
31
|
+
},
|
|
32
|
+
[Relation.CHILD]: {
|
|
33
|
+
id: "pep.relation.relation.CHILD",
|
|
34
|
+
description: "The person is married to someone who is pep",
|
|
35
|
+
defaultMessage: `Barn till PEP`
|
|
36
|
+
},
|
|
37
|
+
[Relation.PARENT]: {
|
|
38
|
+
id: "pep.relation.relation.PARENT",
|
|
39
|
+
description: "The person is married to someone who is pep",
|
|
40
|
+
defaultMessage: `Förälder till PEP`
|
|
41
|
+
},
|
|
42
|
+
[Relation.CHILD_MARRIED_PARTNER]: {
|
|
43
|
+
id: "pep.relation.relation.CHILD_MARRIED_PARTNER",
|
|
44
|
+
description: "The person is married to someone who is pep",
|
|
45
|
+
defaultMessage: `Make/Maka till barn till PEP`
|
|
46
|
+
},
|
|
47
|
+
[Relation.CHILD_COLIVING_PARTNER]: {
|
|
48
|
+
id: "pep.relation.relation.CHILD_COLIVING_PARTNER",
|
|
49
|
+
description: "The person is married to someone who is pep",
|
|
50
|
+
defaultMessage: `Sambo till barn till PEP`
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export const businessRelationMessages = defineMessages({
|
|
54
|
+
header: {
|
|
55
|
+
id: "pep.relation.businessrelation.header",
|
|
56
|
+
description: "Business relation header",
|
|
57
|
+
defaultMessage: `{
|
|
58
|
+
entityType, select,
|
|
59
|
+
PERSON {
|
|
60
|
+
Vilken relation har du till personen i politisk utsatt ställning?
|
|
61
|
+
}
|
|
62
|
+
CORPORATION {
|
|
63
|
+
Vilken relation har {name} till personen i politisk utsatt ställning?
|
|
64
|
+
}
|
|
65
|
+
}`
|
|
66
|
+
},
|
|
67
|
+
required: {
|
|
68
|
+
id: "pep.relation.businessrelation.required",
|
|
69
|
+
description: "Required error message",
|
|
70
|
+
defaultMessage: `Du måste välja ett alternativ`
|
|
71
|
+
},
|
|
72
|
+
[BusinessRelation.CO_OWNERSHIP]: {
|
|
73
|
+
id: "pep.relation.businessrelation.alt.CO_OWNERSHIP",
|
|
74
|
+
description: "Co-ownership alternative",
|
|
75
|
+
defaultMessage: `{
|
|
76
|
+
entityType, select,
|
|
77
|
+
PERSON {
|
|
78
|
+
Jag är verklig huvudman till en juridisk person, eller juridiska konstruktioner, tillsammans med en PEP
|
|
79
|
+
}
|
|
80
|
+
CORPORATION {
|
|
81
|
+
Vilken relation har {name} till personen i politisk utsatt ställning?
|
|
82
|
+
}
|
|
83
|
+
}`
|
|
84
|
+
},
|
|
85
|
+
[BusinessRelation.CLOSE_CONNECTION]: {
|
|
86
|
+
id: "pep.relation.businessrelation.alt.CLOSE_CONNECTION",
|
|
87
|
+
description: "The person is married to someone who is pep",
|
|
88
|
+
defaultMessage: `{
|
|
89
|
+
entityType, select,
|
|
90
|
+
PERSON {
|
|
91
|
+
Jag är en person som på annat sätt har eller har haft nära förbindelser med en PEP
|
|
92
|
+
}
|
|
93
|
+
CORPORATION {
|
|
94
|
+
Vilken relation har {name} till personen i politisk utsatt ställning?
|
|
95
|
+
}
|
|
96
|
+
}`
|
|
97
|
+
},
|
|
98
|
+
[BusinessRelation.COMPANY_FOR_PEP]: {
|
|
99
|
+
id: "pep.relation.businessrelation.alt.COMPANY_FOR_PEP",
|
|
100
|
+
description: "The person is married to someone who is pep",
|
|
101
|
+
defaultMessage: `{
|
|
102
|
+
entityType, select,
|
|
103
|
+
PERSON {
|
|
104
|
+
Jag är verklig huvudman till en juridisk person, eller juridiska konstruktioner, tillsammans med en PEP
|
|
105
|
+
}
|
|
106
|
+
CORPORATION {
|
|
107
|
+
Vilken relation har {name} till personen i politisk utsatt ställning?
|
|
108
|
+
}
|
|
109
|
+
}`
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
export const relativeNameMessages = defineMessages({
|
|
113
|
+
header: {
|
|
114
|
+
id: "pep.relation.relative.name.header",
|
|
115
|
+
description: "Relative name",
|
|
116
|
+
defaultMessage: `{
|
|
117
|
+
entityType, select,
|
|
118
|
+
PERSON {
|
|
119
|
+
{
|
|
120
|
+
relation, select,
|
|
121
|
+
MARRIED_PARTNER {
|
|
122
|
+
Vad heter din make/maka?
|
|
123
|
+
}
|
|
124
|
+
COLIVING_PARTNER {
|
|
125
|
+
Vad heter din sambo?
|
|
126
|
+
}
|
|
127
|
+
CHILD {
|
|
128
|
+
Vad heter din förälder?
|
|
129
|
+
}
|
|
130
|
+
PARENT {
|
|
131
|
+
Vad heter ditt barn?
|
|
132
|
+
}
|
|
133
|
+
CHILD_MARRIED_PARTNER {
|
|
134
|
+
Vad heter föräldern till din make/maka?
|
|
135
|
+
}
|
|
136
|
+
CHILD_COLIVING_PARTNER {
|
|
137
|
+
Vad heter föräldern till din sambo?
|
|
138
|
+
}
|
|
139
|
+
other {}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
CORPORATION {
|
|
143
|
+
{
|
|
144
|
+
relation, select,
|
|
145
|
+
MARRIED_PARTNER {
|
|
146
|
+
Vad heter {name} make/maka?
|
|
147
|
+
}
|
|
148
|
+
COLIVING_PARTNER {
|
|
149
|
+
Vad heter {name} sambo?
|
|
150
|
+
}
|
|
151
|
+
CHILD {
|
|
152
|
+
Vad heter {name} förälder?
|
|
153
|
+
}
|
|
154
|
+
PARENT {
|
|
155
|
+
Vad heter {name} barn?
|
|
156
|
+
}
|
|
157
|
+
CHILD_MARRIED_PARTNER {
|
|
158
|
+
Vad heter föräldern till {name} make/maka?
|
|
159
|
+
}
|
|
160
|
+
CHILD_COLIVING_PARTNER {
|
|
161
|
+
Vad heter föräldern till {name} sambo?
|
|
162
|
+
}
|
|
163
|
+
other {}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
other {}
|
|
167
|
+
}`
|
|
168
|
+
},
|
|
169
|
+
required: {
|
|
170
|
+
id: "pep.relation.relative.name.required",
|
|
171
|
+
description: "Required error message",
|
|
172
|
+
defaultMessage: `Du måste välja ett alternativ`
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
export const birthdayMessages = defineMessages({
|
|
176
|
+
header: {
|
|
177
|
+
id: "pep.relation.birthday.header",
|
|
178
|
+
description: "Relative birthday",
|
|
179
|
+
defaultMessage: `{
|
|
180
|
+
entityType, select,
|
|
181
|
+
PERSON {
|
|
182
|
+
{
|
|
183
|
+
relation, select,
|
|
184
|
+
MARRIED_PARTNER {
|
|
185
|
+
När är din make/maka född?
|
|
186
|
+
}
|
|
187
|
+
COLIVING_PARTNER {
|
|
188
|
+
När är din sambo född?
|
|
189
|
+
}
|
|
190
|
+
CHILD {
|
|
191
|
+
När är din förälder född?
|
|
192
|
+
}
|
|
193
|
+
PARENT {
|
|
194
|
+
När är ditt barn fött?
|
|
195
|
+
}
|
|
196
|
+
CHILD_MARRIED_PARTNER {
|
|
197
|
+
När är föräldern till din make/maka född?
|
|
198
|
+
}
|
|
199
|
+
CHILD_COLIVING_PARTNER {
|
|
200
|
+
När är föräldern till din sambo född?
|
|
201
|
+
}
|
|
202
|
+
other {}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
CORPORATION {
|
|
206
|
+
{
|
|
207
|
+
relation, select,
|
|
208
|
+
MARRIED_PARTNER {
|
|
209
|
+
När är {name} make/maka född?
|
|
210
|
+
}
|
|
211
|
+
COLIVING_PARTNER {
|
|
212
|
+
När är {name} sambo född?
|
|
213
|
+
}
|
|
214
|
+
CHILD {
|
|
215
|
+
När är {name} förälder född?
|
|
216
|
+
}
|
|
217
|
+
PARENT {
|
|
218
|
+
När är {name} barn fött?
|
|
219
|
+
}
|
|
220
|
+
CHILD_MARRIED_PARTNER {
|
|
221
|
+
När är föräldern till {name} make/maka född?
|
|
222
|
+
}
|
|
223
|
+
CHILD_COLIVING_PARTNER {
|
|
224
|
+
När är föräldern till {name} sambo född?
|
|
225
|
+
}
|
|
226
|
+
other {}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
other {}
|
|
230
|
+
}`
|
|
231
|
+
},
|
|
232
|
+
required: {
|
|
233
|
+
id: "pep.relation.birthday.required",
|
|
234
|
+
description: "Required error message",
|
|
235
|
+
defaultMessage: `Ange datum`
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
export const colleagueNameMessages = defineMessages({
|
|
239
|
+
header: {
|
|
240
|
+
id: "pep.relation.colleague.name.header",
|
|
241
|
+
description: "Colleague name",
|
|
242
|
+
defaultMessage: `{
|
|
243
|
+
entityType, select,
|
|
244
|
+
PERSON {
|
|
245
|
+
{
|
|
246
|
+
relation, select,
|
|
247
|
+
CO_OWNERSHIP {
|
|
248
|
+
Vad heter personen i politisk utsatt ställning som du har en relation till?
|
|
249
|
+
}
|
|
250
|
+
CLOSE_CONNECTION {
|
|
251
|
+
Vad heter personen i politisk utsatt ställning som du har en relation till?
|
|
252
|
+
}
|
|
253
|
+
COMPANY_FOR_PEP {
|
|
254
|
+
Vad heter personen i politisk utsatt ställning som den juridiska personen eller konstruktionen har upprättats till förmån till?
|
|
255
|
+
}
|
|
256
|
+
other {}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
CORPORATION {
|
|
260
|
+
{
|
|
261
|
+
relation, select,
|
|
262
|
+
CO_OWNERSHIP {
|
|
263
|
+
Vad heter personen i politisk utsatt ställning som {name} har en relation till?
|
|
264
|
+
}
|
|
265
|
+
CLOSE_CONNECTION {
|
|
266
|
+
Vad heter personen i politisk utsatt ställning som {name} har en relation till?
|
|
267
|
+
}
|
|
268
|
+
COMPANY_FOR_PEP {
|
|
269
|
+
Vad heter personen i politisk utsatt ställning som den juridiska personen eller konstruktionen har upprättats till förmån till?
|
|
270
|
+
}
|
|
271
|
+
other {}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
other {}
|
|
275
|
+
}`
|
|
276
|
+
},
|
|
277
|
+
required: {
|
|
278
|
+
id: "pep.relation.colleague.name.required",
|
|
279
|
+
description: "Required error message",
|
|
280
|
+
defaultMessage: `Du måste välja ett alternativ`
|
|
281
|
+
}
|
|
282
|
+
});
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import React, { useContext, useRef, useCallback } from "react";
|
|
2
|
+
import { PepContext, PepType, BusinessRelation, Relation, EntityType } from "../PepContext";
|
|
3
|
+
import { RadioGroup, Form, RequiredValidator, TextInput, Datepicker, PrimaryButton } from "@lysaab/ui-2";
|
|
4
|
+
import { DateTime } from "luxon";
|
|
5
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
6
|
+
import { relationMessages, businessRelationMessages, relativeNameMessages, birthdayMessages, colleagueNameMessages } from "./RelationMessages";
|
|
7
|
+
const DATEPICKER_START_DATE = DateTime.fromISO("1970-01-01").toJSDate();
|
|
8
|
+
export const RelationPage = ({ next }) => {
|
|
9
|
+
const intl = useIntl();
|
|
10
|
+
const pepContext = useContext(PepContext);
|
|
11
|
+
const formRef = useRef();
|
|
12
|
+
const entityType = pepContext.state.legalEntityType || EntityType.PERSON;
|
|
13
|
+
const type = pepContext.state.type;
|
|
14
|
+
const businessRelationAlternatives = getBusinessRelationAlternatives(intl, entityType, pepContext);
|
|
15
|
+
const relationAlternatives = getRelationAlternatives(intl, entityType, pepContext);
|
|
16
|
+
const nextPage = useCallback(() => {
|
|
17
|
+
if (formRef.current && formRef.current.isValid) {
|
|
18
|
+
next();
|
|
19
|
+
}
|
|
20
|
+
}, [formRef, next]);
|
|
21
|
+
return (React.createElement(Form, { onSubmit: () => nextPage(), lysaFormRef: formRef },
|
|
22
|
+
type === PepType.RELATIVE ? (React.createElement(RadioGroup, { alternatives: relationAlternatives, onChange: alternative => {
|
|
23
|
+
pepContext.setState({
|
|
24
|
+
relationToPEP: alternative.value
|
|
25
|
+
});
|
|
26
|
+
}, value: relationAlternatives.find(alt => alt.value === pepContext.state.relationToPEP), header: intl.formatMessage(relationMessages.header, {
|
|
27
|
+
entityType,
|
|
28
|
+
name: pepContext.state.ownerName
|
|
29
|
+
}), validators: [
|
|
30
|
+
RequiredValidator(intl.formatMessage(relationMessages.required))
|
|
31
|
+
] })) : null,
|
|
32
|
+
type === PepType.COLLEAGUE ? (React.createElement(RadioGroup, { alternatives: businessRelationAlternatives, onChange: alternative => {
|
|
33
|
+
pepContext.setState({
|
|
34
|
+
businessRelation: alternative.value
|
|
35
|
+
});
|
|
36
|
+
}, value: businessRelationAlternatives.find(alt => alt.value === pepContext.state.businessRelation), header: intl.formatMessage(businessRelationMessages.header, {
|
|
37
|
+
entityType,
|
|
38
|
+
name: pepContext.state.ownerName
|
|
39
|
+
}), validators: [
|
|
40
|
+
RequiredValidator(intl.formatMessage(businessRelationMessages.required))
|
|
41
|
+
] })) : null,
|
|
42
|
+
pepContext.state.relationToPEP && type === PepType.RELATIVE ? (React.createElement(React.Fragment, null,
|
|
43
|
+
React.createElement(TextInput, { label: intl.formatMessage(relativeNameMessages.header, {
|
|
44
|
+
entityType,
|
|
45
|
+
name: pepContext.state.ownerName,
|
|
46
|
+
relation: pepContext.state.relationToPEP
|
|
47
|
+
}), value: pepContext.state.nameOfPEP || "", onChange: value => {
|
|
48
|
+
pepContext.setState({ nameOfPEP: value });
|
|
49
|
+
}, validators: [
|
|
50
|
+
RequiredValidator(intl.formatMessage(relativeNameMessages.required))
|
|
51
|
+
] }),
|
|
52
|
+
React.createElement(Datepicker, { label: intl.formatMessage(birthdayMessages.header, {
|
|
53
|
+
entityType,
|
|
54
|
+
name: pepContext.state.ownerName,
|
|
55
|
+
relation: pepContext.state.relationToPEP
|
|
56
|
+
}), selected: pepContext.state.birthdayOfPEP, onChange: event => pepContext.setState({ birthdayOfPEP: event || undefined }), validators: [
|
|
57
|
+
RequiredValidator(intl.formatMessage(birthdayMessages.required))
|
|
58
|
+
], maxDate: new Date(), openToDate: pepContext.state.birthdayOfPEP || DATEPICKER_START_DATE }))) : null,
|
|
59
|
+
pepContext.state.businessRelation && type === PepType.COLLEAGUE ? (React.createElement(React.Fragment, null,
|
|
60
|
+
React.createElement(TextInput, { label: intl.formatMessage(colleagueNameMessages.header, {
|
|
61
|
+
entityType,
|
|
62
|
+
name: pepContext.state.ownerName,
|
|
63
|
+
relation: pepContext.state.businessRelation
|
|
64
|
+
}), value: pepContext.state.nameOfPEP || "", onChange: value => {
|
|
65
|
+
pepContext.setState({ nameOfPEP: value });
|
|
66
|
+
}, validators: [
|
|
67
|
+
RequiredValidator(intl.formatMessage(colleagueNameMessages.required))
|
|
68
|
+
] }))) : null,
|
|
69
|
+
React.createElement(PrimaryButton, { type: "submit" },
|
|
70
|
+
React.createElement(FormattedMessage, { id: "pep.relation.next", description: "Next button", defaultMessage: "G\u00E5 vidare" }))));
|
|
71
|
+
};
|
|
72
|
+
function getRelationAlternatives(intl, entityType, pepContext) {
|
|
73
|
+
return [
|
|
74
|
+
{
|
|
75
|
+
text: intl.formatMessage(relationMessages[Relation.MARRIED_PARTNER], {
|
|
76
|
+
entityType,
|
|
77
|
+
name: pepContext.state.ownerName
|
|
78
|
+
}),
|
|
79
|
+
value: Relation.MARRIED_PARTNER
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
text: intl.formatMessage(relationMessages[Relation.COLIVING_PARTNER], {
|
|
83
|
+
entityType,
|
|
84
|
+
name: pepContext.state.ownerName
|
|
85
|
+
}),
|
|
86
|
+
value: Relation.COLIVING_PARTNER
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
text: intl.formatMessage(relationMessages[Relation.CHILD], {
|
|
90
|
+
entityType,
|
|
91
|
+
name: pepContext.state.ownerName
|
|
92
|
+
}),
|
|
93
|
+
value: Relation.CHILD
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
text: intl.formatMessage(relationMessages[Relation.PARENT], {
|
|
97
|
+
entityType,
|
|
98
|
+
name: pepContext.state.ownerName
|
|
99
|
+
}),
|
|
100
|
+
value: Relation.PARENT
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
text: intl.formatMessage(relationMessages[Relation.CHILD_MARRIED_PARTNER], {
|
|
104
|
+
entityType,
|
|
105
|
+
name: pepContext.state.ownerName
|
|
106
|
+
}),
|
|
107
|
+
value: Relation.CHILD_MARRIED_PARTNER
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
text: intl.formatMessage(relationMessages[Relation.CHILD_COLIVING_PARTNER], {
|
|
111
|
+
entityType,
|
|
112
|
+
name: pepContext.state.ownerName
|
|
113
|
+
}),
|
|
114
|
+
value: Relation.CHILD_COLIVING_PARTNER
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
function getBusinessRelationAlternatives(intl, entityType, pepContext) {
|
|
119
|
+
return [
|
|
120
|
+
{
|
|
121
|
+
text: intl.formatMessage(businessRelationMessages[BusinessRelation.CO_OWNERSHIP], {
|
|
122
|
+
entityType,
|
|
123
|
+
name: pepContext.state.ownerName
|
|
124
|
+
}),
|
|
125
|
+
value: BusinessRelation.CO_OWNERSHIP
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
text: intl.formatMessage(businessRelationMessages[BusinessRelation.CLOSE_CONNECTION], {
|
|
129
|
+
entityType,
|
|
130
|
+
name: pepContext.state.ownerName
|
|
131
|
+
}),
|
|
132
|
+
value: BusinessRelation.CLOSE_CONNECTION
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
text: intl.formatMessage(businessRelationMessages[BusinessRelation.COMPANY_FOR_PEP], {
|
|
136
|
+
entityType,
|
|
137
|
+
name: pepContext.state.ownerName
|
|
138
|
+
}),
|
|
139
|
+
value: BusinessRelation.COMPANY_FOR_PEP
|
|
140
|
+
}
|
|
141
|
+
];
|
|
142
|
+
}
|