@lysaab/lysa-pep 3.0.3 → 4.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.
Files changed (40) hide show
  1. package/components/PepAnswers.js +1 -35
  2. package/messages/src/components/PepAnswers.json +1 -1
  3. package/messages/src/pages/IsPep/IsPepMessages.json +1 -1
  4. package/messages/src/pages/IsPep/IsPepPage.json +1 -1
  5. package/messages/src/pages/RelationPage/RelationMessages.json +1 -1
  6. package/messages/src/pages/RelationPage/RelationPage.json +1 -1
  7. package/messages/src/pages/RolePage/RoleMessages.json +1 -1
  8. package/messages/src/pages/RolePage/RolePage.json +1 -1
  9. package/messages/src/pages/StatusPage/StatusMessages.json +1 -1
  10. package/messages/src/pages/StatusPage/StatusPage.json +1 -1
  11. package/package.json +3 -3
  12. package/pages/IsPep/IsPepMessages.d.ts +0 -12
  13. package/pages/IsPep/IsPepMessages.js +6 -66
  14. package/pages/IsPep/IsPepPage.js +1 -1
  15. package/pages/RelationPage/RelationMessages.d.ts +0 -38
  16. package/pages/RelationPage/RelationMessages.js +0 -218
  17. package/pages/RelationPage/RelationPage.js +4 -2
  18. package/pages/RolePage/RoleMessages.d.ts +0 -70
  19. package/pages/RolePage/RoleMessages.js +0 -268
  20. package/pages/RolePage/RolePage.d.ts +2 -0
  21. package/pages/RolePage/RolePage.js +4 -5
  22. package/pages/StatusPage/StatusMessages.d.ts +0 -24
  23. package/pages/StatusPage/StatusMessages.js +0 -222
  24. package/pages/StatusPage/StatusPage.d.ts +2 -0
  25. package/pages/StatusPage/StatusPage.js +4 -5
  26. package/components/CountrySelect.d.ts +0 -11
  27. package/components/CountrySelect.js +0 -41
  28. package/messages/src/components/CountrySelect.json +0 -1
  29. package/model/Countries.d.ts +0 -4
  30. package/model/Countries.js +0 -1002
  31. package/model/PepTexts.d.ts +0 -380
  32. package/model/PepTexts.js +0 -552
  33. package/pages/PepIsPepPage.d.ts +0 -15
  34. package/pages/PepIsPepPage.js +0 -59
  35. package/pages/PepRelationPage.d.ts +0 -6
  36. package/pages/PepRelationPage.js +0 -79
  37. package/pages/PepRolePage.d.ts +0 -10
  38. package/pages/PepRolePage.js +0 -127
  39. package/pages/PepStatusPage.d.ts +0 -6
  40. package/pages/PepStatusPage.js +0 -58
@@ -3,383 +3,115 @@ import { Role, MilitaryRank } from "../PepContext";
3
3
  export const roleMessages = defineMessages({
4
4
  header: {
5
5
  id: "pep.role.roles.header",
6
- description: "Header",
7
- defaultMessage: `{
8
- entityType, select,
9
- PERSON {
10
- {
11
- pepType, select,
12
- ME {
13
- State your role
14
- }
15
- RELATIVE {
16
- {
17
- relation, select,
18
- MARRIED_PARTNER {
19
- State the role of your spouse
20
- }
21
- COLIVING_PARTNER {
22
- State the role of your partner
23
- }
24
- CHILD {
25
- State the role of your parent
26
- }
27
- PARENT {
28
- State the role of your child
29
- }
30
- CHILD_MARRIED_PARTNER {
31
- State the role of the parent of your spouce
32
- }
33
- CHILD_COLIVING_PARTNER {
34
- State the role of the parent of your partner
35
- }
36
- other {}
37
- }
38
- }
39
- COLLEAGUE {
40
- {
41
- relation, select,
42
- CO_OWNERSHIP {
43
- State the role of the person in a politically exposed position that you have a relationship with
44
- }
45
- CLOSE_CONNECTION {
46
- State the role of the person in a politically exposed position that you have a relationship with
47
- }
48
- COMPANY_FOR_PEP {
49
- State the role of the person in a politically exposed position that you have a relationship with
50
- }
51
- other {}
52
- }
53
- }
54
- other {}
55
- }
56
- }
57
- CORPORATION {
58
- {
59
- pepType, select,
60
- ME {
61
- State the role of {name}
62
- }
63
- RELATIVE {
64
- {
65
- relation, select,
66
- MARRIED_PARTNER {
67
- State the role of the spouse of {name}
68
- }
69
- COLIVING_PARTNER {
70
- State the role of the partner of {name}
71
- }
72
- CHILD {
73
- State the role of the parent of {name}
74
- }
75
- PARENT {
76
- State the role of the child of {name}
77
- }
78
- CHILD_MARRIED_PARTNER {
79
- State the role of the parent of the spouse of {name}
80
- }
81
- CHILD_COLIVING_PARTNER {
82
- State the role of the parent of the partner of {name}
83
- }
84
- other {}
85
- }
86
- }
87
- COLLEAGUE {
88
- {
89
- relation, select,
90
- CO_OWNERSHIP {
91
- State the role of the person in a politically exposed position that {name} has a relationship with
92
- }
93
- CLOSE_CONNECTION {
94
- State the role of the person in a politically exposed position that {name} has a relationship with
95
- }
96
- COMPANY_FOR_PEP {
97
- State the role of the person in a politically exposed position that {name} has a relationship with
98
- }
99
- other {}
100
- }
101
- }
102
- other {}
103
- }
104
- }
105
- other {}
106
- }`,
107
6
  },
108
7
  placeholder: {
109
8
  id: "pep.role.roles.placeholder",
110
- description: "Role placeholder",
111
- defaultMessage: "Choose a role",
112
9
  },
113
10
  required: {
114
11
  id: "pep.role.roles.required",
115
- description: "Required validation error",
116
- defaultMessage: "You need to choose a role",
117
12
  },
118
13
  [Role.HEAD_OF_GOVERNMENT]: {
119
14
  id: "pep.role.roles.alt.HEAD_OF_GOVERNMENT",
120
- description: "Head of government alt",
121
- defaultMessage: "Head of state",
122
15
  },
123
16
  [Role.MINISTER]: {
124
17
  id: "pep.role.roles.alt.MINISTER",
125
- description: "Minister alt",
126
- defaultMessage: "Minister or Deputy Minister",
127
18
  },
128
19
  [Role.PARLIMENT_MEMBER]: {
129
20
  id: "pep.role.roles.alt.PARLIMENT_MEMBER",
130
- description: "Parlament alt",
131
- defaultMessage: "Member of the parliament",
132
21
  },
133
22
  [Role.CENTRAL_BANK_MEMBER]: {
134
23
  id: "pep.role.roles.alt.CENTRAL_BANK_MEMBER",
135
- description: "Central bank member alt",
136
- defaultMessage: "Member of the Board of the Central Bank",
137
24
  },
138
25
  [Role.BOARD_MEMBER_POLITICAL_PARTY]: {
139
26
  id: "pep.role.roles.alt.BOARD_MEMBER_POLITICAL_PARTY",
140
- description: "Political party board member alt",
141
- defaultMessage: "Member of the Board in a political party in the parliament",
142
27
  },
143
28
  [Role.JUDGE_SUPREME_COURT]: {
144
29
  id: "pep.role.roles.alt.JUDGE_SUPREME_COURT",
145
- description: "Supreme court judge alt",
146
- defaultMessage: "Supreme Court judge",
147
30
  },
148
31
  [Role.JUDGE_OTHER_HIGH_COURT]: {
149
32
  id: "pep.role.roles.alt.JUDGE_OTHER_HIGH_COURT",
150
- description: "High court judge alt",
151
- defaultMessage: "Judge in a constitutional court of law or other high-level judicial body whose decisions only exceptionally can be appealed",
152
33
  },
153
34
  [Role.REVISION_INSTITUTE]: {
154
35
  id: "pep.role.roles.alt.REVISION_INSTITUTE",
155
- description: "Revision institute worker alt",
156
- defaultMessage: "Senior official at a governmental audit authority",
157
36
  },
158
37
  [Role.AMBASSADOR]: {
159
38
  id: "pep.role.roles.alt.AMBASSADOR",
160
- description: "Ambassador alt",
161
- defaultMessage: "Ambassador or head of mission",
162
39
  },
163
40
  [Role.MILITARY_OFFICER]: {
164
41
  id: "pep.role.roles.alt.MILITARY_OFFICER",
165
- description: "Military officer alt",
166
- defaultMessage: "Senior ranking officer in the armed forces",
167
42
  },
168
43
  [Role.GOVERNMENT_COMPANY]: {
169
44
  id: "pep.role.roles.alt.GOVERNMENT_COMPANY",
170
- description: "Government company leader alt",
171
- defaultMessage: "Person part of a state-owned company's administrative-, managerial- or control bopdy",
172
45
  },
173
46
  [Role.EU_HIGH_RANKING_POSITION]: {
174
47
  id: "pep.role.roles.alt.EU_HIGH_RANKING_POSITION",
175
- description: "High ranking EU position alt",
176
- defaultMessage: "Member of the European Parliament",
177
48
  },
178
49
  [Role.HIGH_RANKING_POSITION_INTERNALTIONAL_CORP]: {
179
50
  id: "pep.role.roles.alt.HIGH_RANKING_POSITION_INTERNALTIONAL_CORP",
180
- description: "High ranking position in an international organisation alt",
181
- defaultMessage: "Senior management in an international organisation",
182
51
  },
183
52
  });
184
53
  export const militaryMessages = defineMessages({
185
54
  header: {
186
55
  id: "pep.role.military.name.header",
187
- description: "International company name header",
188
- defaultMessage: `{
189
- entityType, select,
190
- PERSON {
191
- {
192
- pepType, select,
193
- ME {
194
- State your rank
195
- }
196
- RELATIVE {
197
- {
198
- relation, select,
199
- MARRIED_PARTNER {
200
- State the rank of your spouce
201
- }
202
- COLIVING_PARTNER {
203
- State the rank of your partner
204
- }
205
- CHILD {
206
- State the rank of your parent
207
- }
208
- PARENT {
209
- State the rank of your child
210
- }
211
- CHILD_MARRIED_PARTNER {
212
- State the rank of your spouce's parent
213
- }
214
- CHILD_COLIVING_PARTNER {
215
- State the rank of your partner's parent
216
- }
217
- other {}
218
- }
219
- }
220
- COLLEAGUE {
221
- {
222
- relation, select,
223
- CO_OWNERSHIP {
224
- State the rank of the person that you have a relationship with that is controlling the company and is in a politically exposed position
225
- }
226
- CLOSE_CONNECTION {
227
- State the rank of the person that you have or have had a close relationship with
228
- }
229
- COMPANY_FOR_PEP {
230
- What rank does the person have
231
- }
232
- other {}
233
- }
234
- }
235
- other {}
236
- }
237
- }
238
- CORPORATION {
239
- {
240
- pepType, select,
241
- ME {
242
- State the rank of {name}
243
- }
244
- RELATIVE {
245
- {
246
- relation, select,
247
- MARRIED_PARTNER {
248
- State the rank of the spouse of {name}
249
- }
250
- COLIVING_PARTNER {
251
- State the rank of the partner of {name}
252
- }
253
- CHILD {
254
- State the rank of the parent of {name}
255
- }
256
- PARENT {
257
- State the rank of the child of {name}
258
- }
259
- CHILD_MARRIED_PARTNER {
260
- State the rank of the parent of the spouse of {name}
261
- }
262
- CHILD_COLIVING_PARTNER {
263
- State the rank of the parent of the partner of {name}
264
- }
265
- other {}
266
- }
267
- }
268
- COLLEAGUE {
269
- {
270
- relation, select,
271
- CO_OWNERSHIP {
272
- State the rank of the person in a politically exposed position that {name} has a relationship with
273
- }
274
- CLOSE_CONNECTION {
275
- State the rank of the person in a politically exposed position that {name} has a relationship with
276
- }
277
- COMPANY_FOR_PEP {
278
- What rank does the person have
279
- }
280
- other {}
281
- }
282
- }
283
- other {}
284
- }
285
- }
286
- other {}
287
- }`,
288
56
  },
289
57
  placeholder: {
290
58
  id: "pep.role.military.header",
291
- description: "Header",
292
- defaultMessage: "Choose a role",
293
59
  },
294
60
  required: {
295
61
  id: "pep.role.military.required",
296
- description: "Required validation error",
297
- defaultMessage: "You need to choose a role",
298
62
  },
299
63
  [MilitaryRank.GENERAL]: {
300
64
  id: "pep.role.military.alt.GENERAL",
301
- description: "General alt",
302
- defaultMessage: "General",
303
65
  },
304
66
  [MilitaryRank.LIEUTENANT_GENERAL]: {
305
67
  id: "pep.role.military.alt.LIEUTENANT_GENERAL",
306
- description: "Lieutenant general alt",
307
- defaultMessage: "Lieutenant general",
308
68
  },
309
69
  [MilitaryRank.MAJOR_GENERAL]: {
310
70
  id: "pep.role.military.alt.MAJOR_GENERAL",
311
- description: "Major general alt",
312
- defaultMessage: "Major general",
313
71
  },
314
72
  [MilitaryRank.ADMIRAL]: {
315
73
  id: "pep.role.military.alt.ADMIRAL",
316
- description: "Admiral alt",
317
- defaultMessage: "Admiral",
318
74
  },
319
75
  [MilitaryRank.VICE_ADMIRAL]: {
320
76
  id: "pep.role.military.alt.VICE_ADMIRAL",
321
- description: "Vice admiral alt",
322
- defaultMessage: "Vice admiral",
323
77
  },
324
78
  [MilitaryRank.REAR_ADMIRAL]: {
325
79
  id: "pep.role.military.alt.REAR_ADMIRAL",
326
- description: "Rear admiral alt",
327
- defaultMessage: "Conter admiral",
328
80
  },
329
81
  });
330
82
  export const ambassadorMessages = defineMessages({
331
83
  header: {
332
84
  id: "pep.role.ambassador.header",
333
- description: "Ambassador header",
334
- defaultMessage: "State the country",
335
85
  },
336
86
  required: {
337
87
  id: "pep.role.ambassador.required",
338
- description: "Ambassador required error",
339
- defaultMessage: "You need to choose a country",
340
88
  },
341
89
  });
342
90
  export const governmentCompanyMessages = defineMessages({
343
91
  nameHeader: {
344
92
  id: "pep.role.governmentCompany.name.header",
345
- description: "Government company name header",
346
- defaultMessage: "State the name of the company",
347
93
  },
348
94
  nameRequired: {
349
95
  id: "pep.role.governmentCompany.name.required",
350
- description: "Government company name required error",
351
- defaultMessage: "You need to state a name",
352
96
  },
353
97
  roleHeader: {
354
98
  id: "pep.role.governmentCompany.role.header",
355
- description: "Government company role header",
356
- defaultMessage: "State role",
357
99
  },
358
100
  roleRequired: {
359
101
  id: "pep.role.governmentCompany.role.required",
360
- description: "Government company role required error",
361
- defaultMessage: "You need to state a role",
362
102
  },
363
103
  });
364
104
  export const intCompanyMessages = defineMessages({
365
105
  nameHeader: {
366
106
  id: "pep.role.intCompany.name.header",
367
- description: "International company name header",
368
- defaultMessage: "State the organization's name",
369
107
  },
370
108
  nameRequired: {
371
109
  id: "pep.role.intCompany.name.required",
372
- description: "International company name required error",
373
- defaultMessage: "You need to state a name",
374
110
  },
375
111
  roleHeader: {
376
112
  id: "pep.role.intCompany.role.header",
377
- description: "International company role header",
378
- defaultMessage: "State role",
379
113
  },
380
114
  roleRequired: {
381
115
  id: "pep.role.intCompany.role.required",
382
- description: "International company role required error",
383
- defaultMessage: "You need to state a role",
384
116
  },
385
117
  });
@@ -1,8 +1,10 @@
1
1
  import { FunctionComponent } from "react";
2
2
  import { Alternative } from "@lysaab/ui-2/components/input/InputAPI";
3
+ import { Language } from "@lysaab/ui-2";
3
4
  import { Role, MilitaryRank } from "../PepContext";
4
5
  import { IntlShape } from "react-intl";
5
6
  interface Props {
7
+ language: Language;
6
8
  next: () => void;
7
9
  }
8
10
  export declare const RolePage: FunctionComponent<Props>;
@@ -1,11 +1,10 @@
1
1
  import React, { useRef, useCallback, useContext, } from "react";
2
- import { Form, PrimaryButton, RequiredValidator, TextInput, Select, Card, } from "@lysaab/ui-2";
2
+ import { Form, PrimaryButton, RequiredValidator, TextInput, Select, Card, CountrySelect, } from "@lysaab/ui-2";
3
3
  import { PepContext, Role, MilitaryRank, PepType, EntityType, } from "../PepContext";
4
- import { CountrySelect } from "../../components/CountrySelect";
5
4
  import { useIntl, FormattedMessage } from "react-intl";
6
5
  import { roleMessages, ambassadorMessages, governmentCompanyMessages, intCompanyMessages, militaryMessages, } from "./RoleMessages";
7
6
  import { formatPossessive } from "../../utils/Possession";
8
- export const RolePage = ({ next }) => {
7
+ export const RolePage = ({ language, next }) => {
9
8
  const pepContext = useContext(PepContext);
10
9
  const formRef = useRef();
11
10
  const intl = useIntl();
@@ -60,7 +59,7 @@ export const RolePage = ({ next }) => {
60
59
  : undefined,
61
60
  }), value: pepContext.state.ambassadorCountry, validators: [
62
61
  new RequiredValidator(intl.formatMessage(ambassadorMessages.required)),
63
- ] })) : null,
62
+ ], language: language })) : null,
64
63
  pepContext.state.role &&
65
64
  pepContext.state.role === Role.GOVERNMENT_COMPANY ? (React.createElement(React.Fragment, null,
66
65
  React.createElement(TextInput, { label: intl.formatMessage(governmentCompanyMessages.nameHeader, {
@@ -135,7 +134,7 @@ export const RolePage = ({ next }) => {
135
134
  new RequiredValidator(intl.formatMessage(militaryMessages.required)),
136
135
  ] })) : null),
137
136
  React.createElement(PrimaryButton, { block: true, type: "submit" },
138
- React.createElement(FormattedMessage, { id: "pep.role.next", description: "Next button", defaultMessage: "Next" }))));
137
+ React.createElement(FormattedMessage, { id: "pep.role.next" }))));
139
138
  };
140
139
  export function getRoleAlts(intl) {
141
140
  return [
@@ -1,72 +1,48 @@
1
1
  export declare const isOngoingMessages: {
2
2
  header: {
3
3
  id: string;
4
- description: string;
5
- defaultMessage: string;
6
4
  };
7
5
  required: {
8
6
  id: string;
9
- description: string;
10
- defaultMessage: string;
11
7
  };
12
8
  };
13
9
  export declare const endedMessages: {
14
10
  header: {
15
11
  id: string;
16
- description: string;
17
- defaultMessage: string;
18
12
  };
19
13
  required: {
20
14
  id: string;
21
- description: string;
22
- defaultMessage: string;
23
15
  };
24
16
  };
25
17
  export declare const isLocalCountryMessages: {
26
18
  header: {
27
19
  id: string;
28
- description: string;
29
- defaultMessage: string;
30
20
  };
31
21
  required: {
32
22
  id: string;
33
- description: string;
34
- defaultMessage: string;
35
23
  };
36
24
  };
37
25
  export declare const countrySelectionMessages: {
38
26
  header: {
39
27
  id: string;
40
- description: string;
41
- defaultMessage: string;
42
28
  };
43
29
  required: {
44
30
  id: string;
45
- description: string;
46
- defaultMessage: string;
47
31
  };
48
32
  };
49
33
  export declare const localCountryAltMessages: {
50
34
  localCountry: {
51
35
  id: string;
52
- description: string;
53
- defaultMessage: string;
54
36
  };
55
37
  otherCountry: {
56
38
  id: string;
57
- description: string;
58
- defaultMessage: string;
59
39
  };
60
40
  };
61
41
  export declare const stateAltMessages: {
62
42
  ONGOING: {
63
43
  id: string;
64
- description: string;
65
- defaultMessage: string;
66
44
  };
67
45
  ENDED: {
68
46
  id: string;
69
- description: string;
70
- defaultMessage: string;
71
47
  };
72
48
  };