@lysaab/lysa-pep 1.0.0 → 1.0.2-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 +66 -0
- package/lib/pages/IsPep/IsPepPage.d.ts +14 -0
- package/lib/pages/IsPep/IsPepPage.js +59 -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 +283 -0
- package/lib/pages/RelationPage/RelationPage.d.ts +6 -0
- package/lib/pages/RelationPage/RelationPage.js +153 -0
- package/lib/pages/RolePage/RoleMessages.d.ts +185 -0
- package/lib/pages/RolePage/RoleMessages.js +385 -0
- package/lib/pages/RolePage/RolePage.d.ts +11 -0
- package/lib/pages/RolePage/RolePage.js +220 -0
- package/lib/pages/StatusPage/StatusMessages.d.ts +72 -0
- package/lib/pages/StatusPage/StatusMessages.js +266 -0
- package/lib/pages/StatusPage/StatusPage.d.ts +6 -0
- package/lib/pages/StatusPage/StatusPage.js +95 -0
- package/lib/utils/Possession.d.ts +1 -0
- package/lib/utils/Possession.js +18 -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 +67 -0
- package/src/pages/IsPep/IsPepPage.tsx +114 -0
- package/src/pages/PepContext.tsx +144 -144
- package/src/pages/RelationPage/RelationMessages.ts +288 -0
- package/src/pages/RelationPage/RelationPage.tsx +299 -0
- package/src/pages/RolePage/RoleMessages.ts +393 -0
- package/src/pages/RolePage/RolePage.tsx +356 -0
- package/src/pages/StatusPage/StatusMessages.ts +272 -0
- package/src/pages/StatusPage/StatusPage.tsx +207 -0
- package/src/utils/Possession.ts +21 -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
package/lib/Exports.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export * from "./pages/PepContext";
|
|
2
|
-
export * from "./model/PepModel";
|
|
3
|
-
export * from "./
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export { PepAnswers } from "./components/PepAnswers";
|
|
1
|
+
export * from "./pages/PepContext";
|
|
2
|
+
export * from "./model/PepModel";
|
|
3
|
+
export * from "./pages/IsPep/IsPepPage";
|
|
4
|
+
export { RelationPage } from "./pages/RelationPage/RelationPage";
|
|
5
|
+
export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts } from "./pages/RolePage/RolePage";
|
|
6
|
+
export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
|
|
7
|
+
export { PepAnswers } from "./components/PepAnswers";
|
package/lib/Exports.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export * from "./pages/PepContext";
|
|
2
|
-
export * from "./model/PepModel";
|
|
3
|
-
export * from "./
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export { PepAnswers } from "./components/PepAnswers";
|
|
1
|
+
export * from "./pages/PepContext";
|
|
2
|
+
export * from "./model/PepModel";
|
|
3
|
+
export * from "./pages/IsPep/IsPepPage";
|
|
4
|
+
export { RelationPage } from "./pages/RelationPage/RelationPage";
|
|
5
|
+
export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts } from "./pages/RolePage/RolePage";
|
|
6
|
+
export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
|
|
7
|
+
export { PepAnswers } from "./components/PepAnswers";
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
import { FunctionComponent } from "react";
|
|
2
|
-
import { Alternative } from "@lysaab/ui-2";
|
|
3
|
-
import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
value?: string;
|
|
17
|
-
onChange?(value: Alternative<string>): void;
|
|
18
|
-
label: string;
|
|
19
|
-
removeSweden?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare const CountrySelect: FunctionComponent<Props>;
|
|
22
|
-
export {};
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
import { Alternative } from "@lysaab/ui-2";
|
|
3
|
+
import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
|
|
4
|
+
export interface Country {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
interface Props extends ValidationProps {
|
|
9
|
+
value?: string;
|
|
10
|
+
onChange?(value: Alternative<string>): void;
|
|
11
|
+
label: string;
|
|
12
|
+
omitCountries?: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare const CountrySelect: FunctionComponent<Props>;
|
|
15
|
+
export {};
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import React, { useState } from "react";
|
|
13
|
-
import { Select } from "@lysaab/ui-2";
|
|
14
|
-
import { countries } from "../model/Countries";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useState } from "react";
|
|
13
|
+
import { Select } from "@lysaab/ui-2";
|
|
14
|
+
import { countries } from "../model/Countries";
|
|
15
|
+
import { defineMessages, useIntl } from "react-intl";
|
|
16
|
+
const messages = defineMessages({
|
|
17
|
+
placeholder: {
|
|
18
|
+
id: 'component.select.country',
|
|
19
|
+
description: 'Select a country placeholder',
|
|
20
|
+
defaultMessage: 'Välj ett land'
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export const CountrySelect = (_a) => {
|
|
24
|
+
var { value, omitCountries = [] } = _a, props = __rest(_a, ["value", "omitCountries"]);
|
|
25
|
+
const intl = useIntl();
|
|
26
|
+
const [countryAlternatives] = useState(countries
|
|
27
|
+
.filter(country => !omitCountries.includes(country.value))
|
|
28
|
+
.map(country => ({ text: country.label, value: country.value })));
|
|
29
|
+
return (React.createElement(Select, Object.assign({ alternatives: countryAlternatives, placeholder: intl.formatMessage(messages.placeholder), value: countryAlternatives.find(country => country.value === value) }, props)));
|
|
30
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FunctionComponent } from "react";
|
|
2
|
-
import "./PepAnswers.scss";
|
|
3
|
-
import { PepRequest } from "../model/PepModel";
|
|
4
|
-
interface Props {
|
|
5
|
-
answer: PepRequest;
|
|
6
|
-
}
|
|
7
|
-
export declare const PepAnswers: FunctionComponent<Props>;
|
|
8
|
-
export {};
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
import "./PepAnswers.scss";
|
|
3
|
+
import { PepRequest } from "../model/PepModel";
|
|
4
|
+
interface Props {
|
|
5
|
+
answer: PepRequest;
|
|
6
|
+
}
|
|
7
|
+
export declare const PepAnswers: FunctionComponent<Props>;
|
|
8
|
+
export {};
|
|
@@ -1,39 +1,131 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./PepAnswers.scss";
|
|
3
|
-
import { countries } from "../model/Countries";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./PepAnswers.scss";
|
|
3
|
+
import { countries } from "../model/Countries";
|
|
4
|
+
import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
|
|
5
|
+
import { EntityType, PepType } from "../pages/PepContext";
|
|
6
|
+
import { useIntl, defineMessages, FormattedMessage } from "react-intl";
|
|
7
|
+
import { messages as isPepMessages } from "../pages/IsPep/IsPepMessages";
|
|
8
|
+
import { relationMessages, businessRelationMessages } from "../pages/RelationPage/RelationMessages";
|
|
9
|
+
const messages = defineMessages({
|
|
10
|
+
whoIsPepLabel: {
|
|
11
|
+
id: "pep.anwers.who.label",
|
|
12
|
+
description: "Who is pep label",
|
|
13
|
+
defaultMessage: "Vem är pep"
|
|
14
|
+
},
|
|
15
|
+
relationLabel: {
|
|
16
|
+
id: "pep.anwers.relation.label",
|
|
17
|
+
description: "Relation label",
|
|
18
|
+
defaultMessage: "Relation"
|
|
19
|
+
},
|
|
20
|
+
businessRelationLabel: {
|
|
21
|
+
id: "pep.anwers.businessRelation.label",
|
|
22
|
+
description: "Business relation label",
|
|
23
|
+
defaultMessage: "Vem är pep"
|
|
24
|
+
},
|
|
25
|
+
nameOfPepLabel: {
|
|
26
|
+
id: "pep.anwers.nameOfPep.label",
|
|
27
|
+
description: "Name of pep label",
|
|
28
|
+
defaultMessage: "Namn på personen"
|
|
29
|
+
},
|
|
30
|
+
birthdayOfPEPLabel: {
|
|
31
|
+
id: "pep.anwers.birthdayOfPEP.label",
|
|
32
|
+
description: "Birthday of pep label",
|
|
33
|
+
defaultMessage: "Födelsedag för personen"
|
|
34
|
+
},
|
|
35
|
+
statusLabel: {
|
|
36
|
+
id: "pep.anwers.status.label",
|
|
37
|
+
description: "Status label",
|
|
38
|
+
defaultMessage: "Status"
|
|
39
|
+
},
|
|
40
|
+
statusEndedValue: {
|
|
41
|
+
id: "pep.anwers.statusEnded.value",
|
|
42
|
+
description: "Status ended value",
|
|
43
|
+
defaultMessage: "Avslutad"
|
|
44
|
+
},
|
|
45
|
+
statusOngoingValue: {
|
|
46
|
+
id: "pep.anwers.statusOngoing.value",
|
|
47
|
+
description: "Status ongoing value",
|
|
48
|
+
defaultMessage: "Pågående"
|
|
49
|
+
},
|
|
50
|
+
endedLabel: {
|
|
51
|
+
id: "pep.anwers.endedStatus.label",
|
|
52
|
+
description: "Ended label",
|
|
53
|
+
defaultMessage: "Avslutades"
|
|
54
|
+
},
|
|
55
|
+
roleLabel: {
|
|
56
|
+
id: "pep.anwers.role.label",
|
|
57
|
+
description: "Role label",
|
|
58
|
+
defaultMessage: "Roll"
|
|
59
|
+
},
|
|
60
|
+
countryLabel: {
|
|
61
|
+
id: "pep.anwers.country.label",
|
|
62
|
+
description: "Country label",
|
|
63
|
+
defaultMessage: "Land"
|
|
64
|
+
},
|
|
65
|
+
ambassadorCountryLabel: {
|
|
66
|
+
id: "pep.anwers.ambassadorCountry.label",
|
|
67
|
+
description: "Ambassador country label",
|
|
68
|
+
defaultMessage: "Ambassadörsland"
|
|
69
|
+
},
|
|
70
|
+
governmentCompanyNameLabel: {
|
|
71
|
+
id: "pep.anwers.governmentCompanyName.label",
|
|
72
|
+
description: "Government company name label",
|
|
73
|
+
defaultMessage: "Företags namn"
|
|
74
|
+
},
|
|
75
|
+
governmentCompanyRoleLabel: {
|
|
76
|
+
id: "pep.anwers.governmentCompanyRole.label",
|
|
77
|
+
description: "Government company role label",
|
|
78
|
+
defaultMessage: "Roll på företaget"
|
|
79
|
+
},
|
|
80
|
+
internationalOrganisationNameLabel: {
|
|
81
|
+
id: "pep.anwers.companyName.label",
|
|
82
|
+
description: "International organisation name label",
|
|
83
|
+
defaultMessage: "Organisationens namn"
|
|
84
|
+
},
|
|
85
|
+
internationalOrganisationRoleLabel: {
|
|
86
|
+
id: "pep.anwers.companyRole.label",
|
|
87
|
+
description: "International organisation role label",
|
|
88
|
+
defaultMessage: "Roll i organisationen"
|
|
89
|
+
},
|
|
90
|
+
militaryGradeLabel: {
|
|
91
|
+
id: "pep.anwers.militaryRank.label",
|
|
92
|
+
description: "Military rank label",
|
|
93
|
+
defaultMessage: "Roll i organisationen"
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
export const PepAnswers = ({ answer }) => {
|
|
97
|
+
var _a;
|
|
98
|
+
const intl = useIntl();
|
|
99
|
+
if (!answer.type || answer.type === PepType.NOT_PEP) {
|
|
100
|
+
return (React.createElement("div", null,
|
|
101
|
+
React.createElement("p", null,
|
|
102
|
+
React.createElement(FormattedMessage, { id: "pep.anwers.notpep", description: "Not pep", defaultMessage: "Personen \u00E4r inte PEP" }))));
|
|
103
|
+
}
|
|
104
|
+
const country = countries.find(country => country.value === answer.country);
|
|
105
|
+
const role = getRoleAlts(intl).find(alt => alt.value === answer.role);
|
|
106
|
+
const militaryRank = getMilitaryAlts(intl).find(alt => alt.value === answer.militaryRank);
|
|
107
|
+
return (React.createElement("div", null,
|
|
108
|
+
answer.type && (React.createElement(StaticInput, { label: intl.formatMessage(messages.whoIsPepLabel), value: intl.formatMessage(isPepMessages[answer.type], {
|
|
109
|
+
entityType: EntityType.PERSON
|
|
110
|
+
}) })),
|
|
111
|
+
answer.relationToPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.relationLabel), value: intl.formatMessage(relationMessages[answer.relationToPEP]) })),
|
|
112
|
+
answer.businessRelation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.businessRelationLabel), value: intl.formatMessage(businessRelationMessages[answer.businessRelation]) })),
|
|
113
|
+
answer.nameOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.nameOfPepLabel), value: answer.nameOfPEP })),
|
|
114
|
+
answer.birthdayOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.birthdayOfPEPLabel), value: answer.birthdayOfPEP })),
|
|
115
|
+
answer.ended ? (React.createElement(React.Fragment, null,
|
|
116
|
+
React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusEndedValue) }),
|
|
117
|
+
React.createElement(StaticInput, { label: intl.formatMessage(messages.endedLabel), value: answer.ended }))) : (React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusOngoingValue) })),
|
|
118
|
+
answer.country && (React.createElement(StaticInput, { label: intl.formatMessage(messages.countryLabel), value: country ? country.label : answer.country })),
|
|
119
|
+
role && (React.createElement(StaticInput, { label: intl.formatMessage(messages.roleLabel), value: role.text })),
|
|
120
|
+
answer.ambassadorCountry && (React.createElement(StaticInput, { label: intl.formatMessage(messages.ambassadorCountryLabel), value: ((_a = countries.find(country => country.value === answer.ambassadorCountry)) === null || _a === void 0 ? void 0 : _a.label) || answer.ambassadorCountry })),
|
|
121
|
+
answer.governmentCompany && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyNameLabel), value: answer.governmentCompany })),
|
|
122
|
+
answer.governmentCompanyRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyRoleLabel), value: answer.governmentCompanyRole })),
|
|
123
|
+
answer.internationalOrganisation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationNameLabel), value: answer.internationalOrganisation })),
|
|
124
|
+
answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationRoleLabel), value: answer.internationalOrganisationRole })),
|
|
125
|
+
militaryRank && (React.createElement(StaticInput, { label: intl.formatMessage(messages.militaryGradeLabel), value: militaryRank.value }))));
|
|
126
|
+
};
|
|
127
|
+
const StaticInput = ({ label, value }) => {
|
|
128
|
+
return (React.createElement("div", { className: "static-input" },
|
|
129
|
+
React.createElement("div", { className: "label" }, label),
|
|
130
|
+
React.createElement("div", { className: "value" }, value)));
|
|
131
|
+
};
|
|
@@ -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
|
+
}
|
package/lib/model/Countries.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const countries: {
|
|
2
|
-
label: string;
|
|
3
|
-
value: string;
|
|
4
|
-
}[];
|
|
1
|
+
export declare const countries: {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}[];
|