@lysaab/lysa-pep 0.17.1 → 0.17.3
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.
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "./PepAnswers.scss";
|
|
3
3
|
import { countries } from "../model/Countries";
|
|
4
4
|
import { LABELS } from "../model/PepTexts";
|
|
5
5
|
import { roleAlternatives, militaryAlternatives } from "../pages/PepRolePage";
|
|
6
|
-
import { EntityType, PepType
|
|
6
|
+
import { EntityType, PepType } from "../pages/PepContext";
|
|
7
7
|
export const PepAnswers = ({ answer }) => {
|
|
8
|
-
const pepContext = useContext(PepContext);
|
|
9
8
|
if (!answer.type || answer.type === PepType.NOT_PEP) {
|
|
10
9
|
return React.createElement("div", null,
|
|
11
10
|
React.createElement("p", null, "Personen \u00E4r inte PEP"));
|
|
12
11
|
}
|
|
13
|
-
const entityType =
|
|
14
|
-
const labels = LABELS(
|
|
12
|
+
const entityType = answer.legalEntityType || EntityType.PERSON;
|
|
13
|
+
const labels = LABELS(answer.ownerName);
|
|
15
14
|
const country = countries.find(country => country.value === answer.country);
|
|
16
15
|
const role = roleAlternatives.find(alt => alt.value === answer.role);
|
|
17
16
|
const militaryRank = militaryAlternatives.find(alt => alt.value === answer.militaryRank);
|
|
@@ -24,7 +23,6 @@ export const PepAnswers = ({ answer }) => {
|
|
|
24
23
|
answer.ended ? (React.createElement(React.Fragment, null,
|
|
25
24
|
React.createElement(StaticInput, { label: "Status", value: "Avslutad" }),
|
|
26
25
|
React.createElement(StaticInput, { label: "Avslutades", value: answer.ended }))) : (React.createElement(StaticInput, { label: "Status", value: "P\u00E5g\u00E5ende" })),
|
|
27
|
-
answer.birthdayOfPEP && (React.createElement(StaticInput, { label: "Roll", value: answer.birthdayOfPEP })),
|
|
28
26
|
answer.country && (React.createElement(StaticInput, { label: "Land", value: country ? country.label : answer.country })),
|
|
29
27
|
role && React.createElement(StaticInput, { label: "Roll", value: role.text }),
|
|
30
28
|
answer.ambassadorCountry && (React.createElement(StaticInput, { label: "Ambassad\u00F6rsland", value: answer.ambassadorCountry })),
|
|
@@ -45,7 +45,7 @@ export const PepStatusPage = ({ next }) => {
|
|
|
45
45
|
} },
|
|
46
46
|
React.createElement(RadioGroup, { alternatives: stateAlternatives, header: labels[entityType].GENERIC.STATUS_ONGOING_HEADER, onChange: updateIsOngoing, value: stateAlternatives.find(alt => alt.value === pepContext.state.isOngoing), validators: [RequiredValidator("Du måste välja ett alternativ")] }),
|
|
47
47
|
pepContext.state.isOngoing &&
|
|
48
|
-
pepContext.state.isOngoing === PepStatus.ENDED ? (React.createElement(Datepicker, { label: "N\u00E4r avslutades uppdraget?", selected: pepContext.state.ended, onChange: event => pepContext.setState({ ended: event || undefined }), validators: [RequiredValidator("Du måste ange
|
|
48
|
+
pepContext.state.isOngoing === PepStatus.ENDED ? (React.createElement(Datepicker, { label: "N\u00E4r avslutades uppdraget?", selected: pepContext.state.ended, onChange: event => pepContext.setState({ ended: event || undefined }), validators: [RequiredValidator("Du måste ange datum")], showMonthYearPicker: true, dateFormat: "yyyy-MM", maxDate: new Date() })) : null,
|
|
49
49
|
React.createElement(RadioGroup, { alternatives: isSwedenAlternatives, header: labels[entityType].GENERIC.STATUS_COUNTRY_HEADER, onChange: updateIsSweden, value: isSwedenAlternatives.find(alt => alt.value === pepContext.state.isSweden), validators: [RequiredValidator("Du måste välja ett alternativ")] }),
|
|
50
50
|
pepContext.state.isSweden && pepContext.state.isSweden === "other" ? (React.createElement(CountrySelect, { label: "V\u00E4lj i vilket land befattningen \u00E4r", onChange: event => pepContext.setState({
|
|
51
51
|
country: event.value ? event.value.toString() : undefined,
|
package/package.json
CHANGED
|
@@ -4,21 +4,19 @@ import { PepRequest } from "../model/PepModel";
|
|
|
4
4
|
import { countries } from "../model/Countries";
|
|
5
5
|
import { LABELS } from "../model/PepTexts";
|
|
6
6
|
import { roleAlternatives, militaryAlternatives } from "../pages/PepRolePage";
|
|
7
|
-
import { EntityType, PepType
|
|
7
|
+
import { EntityType, PepType } from "../pages/PepContext";
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
10
|
answer: PepRequest;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const PepAnswers: FunctionComponent<Props> = ({ answer }) => {
|
|
14
|
-
const pepContext = useContext(PepContext);
|
|
15
|
-
|
|
16
14
|
if (!answer.type || answer.type === PepType.NOT_PEP) {
|
|
17
15
|
return <div><p>Personen är inte PEP</p></div>;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
const entityType =
|
|
21
|
-
const labels = LABELS(
|
|
18
|
+
const entityType = answer.legalEntityType || EntityType.PERSON;
|
|
19
|
+
const labels = LABELS(answer.ownerName);
|
|
22
20
|
const country = countries.find(country => country.value === answer.country);
|
|
23
21
|
const role = roleAlternatives.find(alt => alt.value === answer.role);
|
|
24
22
|
const militaryRank = militaryAlternatives.find(
|
|
@@ -69,9 +67,6 @@ export const PepAnswers: FunctionComponent<Props> = ({ answer }) => {
|
|
|
69
67
|
) : (
|
|
70
68
|
<StaticInput label="Status" value="Pågående" />
|
|
71
69
|
)}
|
|
72
|
-
{answer.birthdayOfPEP && (
|
|
73
|
-
<StaticInput label="Roll" value={answer.birthdayOfPEP} />
|
|
74
|
-
)}
|
|
75
70
|
{answer.country && (
|
|
76
71
|
<StaticInput
|
|
77
72
|
label="Land"
|
|
@@ -98,7 +98,7 @@ export const PepStatusPage: FunctionComponent<Props> = ({ next }) => {
|
|
|
98
98
|
onChange={event =>
|
|
99
99
|
pepContext.setState({ ended: event || undefined })
|
|
100
100
|
}
|
|
101
|
-
validators={[RequiredValidator("Du måste ange
|
|
101
|
+
validators={[RequiredValidator("Du måste ange datum")]}
|
|
102
102
|
showMonthYearPicker
|
|
103
103
|
dateFormat="yyyy-MM"
|
|
104
104
|
maxDate={new Date()}
|