@lysaab/lysa-pep 3.0.3 → 3.0.4

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 (41) hide show
  1. package/Exports.d.ts +7 -7
  2. package/Exports.js +7 -7
  3. package/components/CountrySelect.d.ts +11 -11
  4. package/components/CountrySelect.js +41 -41
  5. package/components/PepAnswers.d.ts +8 -8
  6. package/components/PepAnswers.js +137 -137
  7. package/model/PepModel.d.ts +7 -7
  8. package/model/PepModel.js +40 -40
  9. package/package.json +1 -1
  10. package/pages/IsPep/IsPepMessages.d.ts +32 -32
  11. package/pages/IsPep/IsPepMessages.js +34 -34
  12. package/pages/IsPep/IsPepPage.d.ts +15 -15
  13. package/pages/IsPep/IsPepPage.js +61 -61
  14. package/pages/PepContext.d.ts +81 -80
  15. package/pages/PepContext.js +89 -88
  16. package/pages/RelationPage/RelationMessages.d.ts +105 -105
  17. package/pages/RelationPage/RelationMessages.js +107 -107
  18. package/pages/RelationPage/RelationPage.d.ts +6 -6
  19. package/pages/RelationPage/RelationPage.js +156 -156
  20. package/pages/RolePage/RoleMessages.d.ts +185 -185
  21. package/pages/RolePage/RoleMessages.js +187 -187
  22. package/pages/RolePage/RolePage.d.ts +11 -11
  23. package/pages/RolePage/RolePage.js +223 -223
  24. package/pages/StatusPage/StatusMessages.d.ts +72 -72
  25. package/pages/StatusPage/StatusMessages.js +74 -74
  26. package/pages/StatusPage/StatusPage.d.ts +8 -8
  27. package/pages/StatusPage/StatusPage.js +105 -105
  28. package/utils/Possession.d.ts +1 -1
  29. package/utils/Possession.js +27 -27
  30. package/model/Countries.d.ts +0 -4
  31. package/model/Countries.js +0 -1002
  32. package/model/PepTexts.d.ts +0 -380
  33. package/model/PepTexts.js +0 -552
  34. package/pages/PepIsPepPage.d.ts +0 -15
  35. package/pages/PepIsPepPage.js +0 -59
  36. package/pages/PepRelationPage.d.ts +0 -6
  37. package/pages/PepRelationPage.js +0 -79
  38. package/pages/PepRolePage.d.ts +0 -10
  39. package/pages/PepRolePage.js +0 -127
  40. package/pages/PepStatusPage.d.ts +0 -6
  41. package/pages/PepStatusPage.js +0 -58
package/Exports.d.ts CHANGED
@@ -1,7 +1,7 @@
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
+ 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/Exports.js CHANGED
@@ -1,7 +1,7 @@
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
+ 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,11 +1,11 @@
1
- /// <reference types="react" />
2
- import { Alternative } from "@lysaab/ui-2";
3
- import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
4
- interface Props extends ValidationProps {
5
- value?: string;
6
- onChange?(value: Alternative<string>): void;
7
- label: string;
8
- omitCountries?: string[];
9
- }
10
- export declare const CountrySelect: ({ value, omitCountries, ...props }: Props) => JSX.Element;
11
- export {};
1
+ /// <reference types="react" />
2
+ import { Alternative } from "@lysaab/ui-2";
3
+ import { ValidationProps } from "@lysaab/ui-2/hooks/useValidation";
4
+ interface Props extends ValidationProps {
5
+ value?: string;
6
+ onChange?(value: Alternative<string>): void;
7
+ label: string;
8
+ omitCountries?: string[];
9
+ }
10
+ export declare const CountrySelect: ({ value, omitCountries, ...props }: Props) => JSX.Element;
11
+ export {};
@@ -1,41 +1,41 @@
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, useEffect } from "react";
13
- import { Select } from "@lysaab/ui-2";
14
- import countries from "@lysaab/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: "Select a country",
21
- },
22
- });
23
- function getCountries(lang, omitCountries) {
24
- return (countries[lang] || countries["en"])
25
- .filter((country) => !omitCountries.includes(country.value))
26
- .map((country) => ({
27
- text: country.label,
28
- value: country.value,
29
- }));
30
- }
31
- const EMPTY_OMIT_COUNTRIES = [];
32
- export const CountrySelect = (_a) => {
33
- var { value, omitCountries = EMPTY_OMIT_COUNTRIES } = _a, props = __rest(_a, ["value", "omitCountries"]);
34
- const intl = useIntl();
35
- const lang = intl.locale.slice(0, 2);
36
- const [countryAlternatives, setCountryAlternatives] = useState(getCountries(lang, omitCountries));
37
- useEffect(() => {
38
- setCountryAlternatives(getCountries(lang, omitCountries));
39
- }, [lang, omitCountries]);
40
- return (React.createElement(Select, Object.assign({ alternatives: countryAlternatives, placeholder: intl.formatMessage(messages.placeholder), value: countryAlternatives.find((country) => country.value === value) }, props)));
41
- };
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, useEffect } from "react";
13
+ import { Select } from "@lysaab/ui-2";
14
+ import countries from "@lysaab/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: "Select a country",
21
+ },
22
+ });
23
+ function getCountries(lang, omitCountries) {
24
+ return (countries[lang] || countries["en"])
25
+ .filter((country) => !omitCountries.includes(country.value))
26
+ .map((country) => ({
27
+ text: country.label,
28
+ value: country.value,
29
+ }));
30
+ }
31
+ const EMPTY_OMIT_COUNTRIES = [];
32
+ export const CountrySelect = (_a) => {
33
+ var { value, omitCountries = EMPTY_OMIT_COUNTRIES } = _a, props = __rest(_a, ["value", "omitCountries"]);
34
+ const intl = useIntl();
35
+ const lang = intl.locale.slice(0, 2);
36
+ const [countryAlternatives, setCountryAlternatives] = useState(getCountries(lang, omitCountries));
37
+ useEffect(() => {
38
+ setCountryAlternatives(getCountries(lang, omitCountries));
39
+ }, [lang, omitCountries]);
40
+ return (React.createElement(Select, Object.assign({ alternatives: countryAlternatives, placeholder: intl.formatMessage(messages.placeholder), value: countryAlternatives.find((country) => country.value === value) }, props)));
41
+ };
@@ -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,137 +1,137 @@
1
- import React from "react";
2
- import "./PepAnswers.scss";
3
- import countries from "@lysaab/countries";
4
- import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
5
- import { 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.answers.who.label",
12
- description: "Who is pep label",
13
- defaultMessage: "Who is PEP?",
14
- },
15
- relationLabel: {
16
- id: "pep.answers.relationship.label",
17
- description: "Relationship label",
18
- defaultMessage: "Relationship",
19
- },
20
- businessRelationLabel: {
21
- id: "pep.answers.businessRelationship.label",
22
- description: "Business relationship label",
23
- defaultMessage: "Who is PEP?",
24
- },
25
- nameOfPepLabel: {
26
- id: "pep.answers.nameOfPep.label",
27
- description: "Name of pep label",
28
- defaultMessage: "The person's name",
29
- },
30
- birthdayOfPEPLabel: {
31
- id: "pep.answers.birthdayOfPEP.label",
32
- description: "Birthday of pep label",
33
- defaultMessage: "The person's birthday",
34
- },
35
- statusLabel: {
36
- id: "pep.answers.status.label",
37
- description: "Status label",
38
- defaultMessage: "Status",
39
- },
40
- statusEndedValue: {
41
- id: "pep.answers.statusEnded.value",
42
- description: "Status ended value",
43
- defaultMessage: "Ended",
44
- },
45
- statusOngoingValue: {
46
- id: "pep.answers.statusOngoing.value",
47
- description: "Status ongoing value",
48
- defaultMessage: "Ongoing",
49
- },
50
- endedLabel: {
51
- id: "pep.answers.endedStatus.label",
52
- description: "Ended label",
53
- defaultMessage: "Ended",
54
- },
55
- roleLabel: {
56
- id: "pep.answers.role.label",
57
- description: "Role label",
58
- defaultMessage: "Role",
59
- },
60
- countryLabel: {
61
- id: "pep.answers.country.label",
62
- description: "Country label",
63
- defaultMessage: "Country",
64
- },
65
- ambassadorCountryLabel: {
66
- id: "pep.answers.ambassadorCountry.label",
67
- description: "Ambassador country label",
68
- defaultMessage: "Ambassador country",
69
- },
70
- governmentCompanyNameLabel: {
71
- id: "pep.answers.governmentCompanyName.label",
72
- description: "Government company name label",
73
- defaultMessage: "Company name",
74
- },
75
- governmentCompanyRoleLabel: {
76
- id: "pep.answers.governmentCompanyRole.label",
77
- description: "Government company role label",
78
- defaultMessage: "Company role",
79
- },
80
- internationalOrganisationNameLabel: {
81
- id: "pep.answers.companyName.label",
82
- description: "International organisation name label",
83
- defaultMessage: "Company name",
84
- },
85
- internationalOrganisationRoleLabel: {
86
- id: "pep.answers.companyRole.label",
87
- description: "International organisation role label",
88
- defaultMessage: "Company role",
89
- },
90
- militaryGradeLabel: {
91
- id: "pep.answers.militaryRank.label",
92
- description: "Military rank label",
93
- defaultMessage: "Military rank",
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.answers.notpep", description: "Not pep", defaultMessage: "The person is not PEP" }))));
103
- }
104
- const entityType = answer.legalEntityType;
105
- const lang = intl.locale.slice(0, 2);
106
- const country = (countries[lang] || countries["en"]).find((country) => country.value === answer.country);
107
- const role = getRoleAlts(intl).find((alt) => alt.value === answer.role);
108
- const militaryRank = getMilitaryAlts(intl).find((alt) => alt.value === answer.militaryRank);
109
- return (React.createElement("div", null,
110
- answer.type && (React.createElement(StaticInput, { label: intl.formatMessage(messages.whoIsPepLabel), value: intl.formatMessage(isPepMessages[answer.type], {
111
- entityType,
112
- name: answer.ownerName,
113
- }) })),
114
- answer.relationToPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.relationLabel), value: intl.formatMessage(relationMessages[answer.relationToPEP], {
115
- entityType,
116
- name: answer.ownerName,
117
- }) })),
118
- answer.businessRelation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.businessRelationLabel), value: intl.formatMessage(businessRelationMessages[answer.businessRelation], { entityType, name: answer.ownerName }) })),
119
- answer.nameOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.nameOfPepLabel), value: answer.nameOfPEP })),
120
- answer.birthdayOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.birthdayOfPEPLabel), value: answer.birthdayOfPEP })),
121
- answer.ended ? (React.createElement(React.Fragment, null,
122
- React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusEndedValue) }),
123
- React.createElement(StaticInput, { label: intl.formatMessage(messages.endedLabel), value: answer.ended }))) : (React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusOngoingValue) })),
124
- answer.country && (React.createElement(StaticInput, { label: intl.formatMessage(messages.countryLabel), value: country ? country.label : answer.country })),
125
- role && (React.createElement(StaticInput, { label: intl.formatMessage(messages.roleLabel), value: role.text })),
126
- answer.ambassadorCountry && (React.createElement(StaticInput, { label: intl.formatMessage(messages.ambassadorCountryLabel), value: ((_a = (countries[lang] || countries["en"]).find((country) => country.value === answer.ambassadorCountry)) === null || _a === void 0 ? void 0 : _a.label) || answer.ambassadorCountry })),
127
- answer.governmentCompany && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyNameLabel), value: answer.governmentCompany })),
128
- answer.governmentCompanyRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyRoleLabel), value: answer.governmentCompanyRole })),
129
- answer.internationalOrganisation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationNameLabel), value: answer.internationalOrganisation })),
130
- answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationRoleLabel), value: answer.internationalOrganisationRole })),
131
- militaryRank && (React.createElement(StaticInput, { label: intl.formatMessage(messages.militaryGradeLabel), value: militaryRank.text }))));
132
- };
133
- const StaticInput = ({ label, value }) => {
134
- return (React.createElement("div", { className: "static-input" },
135
- React.createElement("div", { className: "label" }, label),
136
- React.createElement("div", { className: "value" }, value)));
137
- };
1
+ import React from "react";
2
+ import "./PepAnswers.scss";
3
+ import countries from "@lysaab/countries";
4
+ import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
5
+ import { 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.answers.who.label",
12
+ description: "Who is pep label",
13
+ defaultMessage: "Who is PEP?",
14
+ },
15
+ relationLabel: {
16
+ id: "pep.answers.relationship.label",
17
+ description: "Relationship label",
18
+ defaultMessage: "Relationship",
19
+ },
20
+ businessRelationLabel: {
21
+ id: "pep.answers.businessRelationship.label",
22
+ description: "Business relationship label",
23
+ defaultMessage: "Who is PEP?",
24
+ },
25
+ nameOfPepLabel: {
26
+ id: "pep.answers.nameOfPep.label",
27
+ description: "Name of pep label",
28
+ defaultMessage: "The person's name",
29
+ },
30
+ birthdayOfPEPLabel: {
31
+ id: "pep.answers.birthdayOfPEP.label",
32
+ description: "Birthday of pep label",
33
+ defaultMessage: "The person's birthday",
34
+ },
35
+ statusLabel: {
36
+ id: "pep.answers.status.label",
37
+ description: "Status label",
38
+ defaultMessage: "Status",
39
+ },
40
+ statusEndedValue: {
41
+ id: "pep.answers.statusEnded.value",
42
+ description: "Status ended value",
43
+ defaultMessage: "Ended",
44
+ },
45
+ statusOngoingValue: {
46
+ id: "pep.answers.statusOngoing.value",
47
+ description: "Status ongoing value",
48
+ defaultMessage: "Ongoing",
49
+ },
50
+ endedLabel: {
51
+ id: "pep.answers.endedStatus.label",
52
+ description: "Ended label",
53
+ defaultMessage: "Ended",
54
+ },
55
+ roleLabel: {
56
+ id: "pep.answers.role.label",
57
+ description: "Role label",
58
+ defaultMessage: "Role",
59
+ },
60
+ countryLabel: {
61
+ id: "pep.answers.country.label",
62
+ description: "Country label",
63
+ defaultMessage: "Country",
64
+ },
65
+ ambassadorCountryLabel: {
66
+ id: "pep.answers.ambassadorCountry.label",
67
+ description: "Ambassador country label",
68
+ defaultMessage: "Ambassador country",
69
+ },
70
+ governmentCompanyNameLabel: {
71
+ id: "pep.answers.governmentCompanyName.label",
72
+ description: "Government company name label",
73
+ defaultMessage: "Company name",
74
+ },
75
+ governmentCompanyRoleLabel: {
76
+ id: "pep.answers.governmentCompanyRole.label",
77
+ description: "Government company role label",
78
+ defaultMessage: "Company role",
79
+ },
80
+ internationalOrganisationNameLabel: {
81
+ id: "pep.answers.companyName.label",
82
+ description: "International organisation name label",
83
+ defaultMessage: "Company name",
84
+ },
85
+ internationalOrganisationRoleLabel: {
86
+ id: "pep.answers.companyRole.label",
87
+ description: "International organisation role label",
88
+ defaultMessage: "Company role",
89
+ },
90
+ militaryGradeLabel: {
91
+ id: "pep.answers.militaryRank.label",
92
+ description: "Military rank label",
93
+ defaultMessage: "Military rank",
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.answers.notpep", description: "Not pep", defaultMessage: "The person is not PEP" }))));
103
+ }
104
+ const entityType = answer.legalEntityType;
105
+ const lang = intl.locale.slice(0, 2);
106
+ const country = (countries[lang] || countries["en"]).find((country) => country.value === answer.country);
107
+ const role = getRoleAlts(intl).find((alt) => alt.value === answer.role);
108
+ const militaryRank = getMilitaryAlts(intl).find((alt) => alt.value === answer.militaryRank);
109
+ return (React.createElement("div", null,
110
+ answer.type && (React.createElement(StaticInput, { label: intl.formatMessage(messages.whoIsPepLabel), value: intl.formatMessage(isPepMessages[answer.type], {
111
+ entityType,
112
+ name: answer.ownerName,
113
+ }) })),
114
+ answer.relationToPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.relationLabel), value: intl.formatMessage(relationMessages[answer.relationToPEP], {
115
+ entityType,
116
+ name: answer.ownerName,
117
+ }) })),
118
+ answer.businessRelation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.businessRelationLabel), value: intl.formatMessage(businessRelationMessages[answer.businessRelation], { entityType, name: answer.ownerName }) })),
119
+ answer.nameOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.nameOfPepLabel), value: answer.nameOfPEP })),
120
+ answer.birthdayOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.birthdayOfPEPLabel), value: answer.birthdayOfPEP })),
121
+ answer.ended ? (React.createElement(React.Fragment, null,
122
+ React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusEndedValue) }),
123
+ React.createElement(StaticInput, { label: intl.formatMessage(messages.endedLabel), value: answer.ended }))) : (React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusOngoingValue) })),
124
+ answer.country && (React.createElement(StaticInput, { label: intl.formatMessage(messages.countryLabel), value: country ? country.label : answer.country })),
125
+ role && (React.createElement(StaticInput, { label: intl.formatMessage(messages.roleLabel), value: role.text })),
126
+ answer.ambassadorCountry && (React.createElement(StaticInput, { label: intl.formatMessage(messages.ambassadorCountryLabel), value: ((_a = (countries[lang] || countries["en"]).find((country) => country.value === answer.ambassadorCountry)) === null || _a === void 0 ? void 0 : _a.label) || answer.ambassadorCountry })),
127
+ answer.governmentCompany && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyNameLabel), value: answer.governmentCompany })),
128
+ answer.governmentCompanyRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyRoleLabel), value: answer.governmentCompanyRole })),
129
+ answer.internationalOrganisation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationNameLabel), value: answer.internationalOrganisation })),
130
+ answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationRoleLabel), value: answer.internationalOrganisationRole })),
131
+ militaryRank && (React.createElement(StaticInput, { label: intl.formatMessage(messages.militaryGradeLabel), value: militaryRank.text }))));
132
+ };
133
+ const StaticInput = ({ label, value }) => {
134
+ return (React.createElement("div", { className: "static-input" },
135
+ React.createElement("div", { className: "label" }, label),
136
+ React.createElement("div", { className: "value" }, value)));
137
+ };
@@ -1,7 +1,7 @@
1
- import { PepState } from "../pages/PepContext";
2
- export interface PepRequest extends Omit<PepState, "isLocalCountry" | "isOngoing" | "ended" | "birthdayOfPEP"> {
3
- ended?: string;
4
- birthdayOfPEP?: string;
5
- }
6
- export declare function stateToRequest(pepState: PepState): PepRequest;
7
- export declare function requestToState({ ended, birthdayOfPEP, ...serverData }: PepRequest, countryCode: string): PepState;
1
+ import { PepState } from "../pages/PepContext";
2
+ export interface PepRequest extends Omit<PepState, "isLocalCountry" | "isOngoing" | "ended" | "birthdayOfPEP"> {
3
+ ended?: string;
4
+ birthdayOfPEP?: string;
5
+ }
6
+ export declare function stateToRequest(pepState: PepState): PepRequest;
7
+ export declare function requestToState({ ended, birthdayOfPEP, ...serverData }: PepRequest, countryCode: string): PepState;
package/model/PepModel.js CHANGED
@@ -1,40 +1,40 @@
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 { PepType, EntityType, PepStatus } from "../pages/PepContext";
13
- import { DateTime } from "luxon";
14
- export function stateToRequest(pepState) {
15
- const state = Object.assign({}, pepState);
16
- delete state.isLocalCountry;
17
- delete state.isOngoing;
18
- delete state.ownerName;
19
- if (state.legalEntityType === EntityType.PERSON) {
20
- delete state.tin;
21
- }
22
- return Object.assign(Object.assign({}, state), { country: state.type === PepType.NOT_PEP ? undefined : state.country, ended: state.ended
23
- ? DateTime.fromJSDate(state.ended).toFormat("yyyy-MM")
24
- : undefined, birthdayOfPEP: state.birthdayOfPEP
25
- ? DateTime.fromJSDate(state.birthdayOfPEP).toFormat("yyyy-MM-dd")
26
- : undefined });
27
- }
28
- export function requestToState(_a, countryCode) {
29
- var { ended, birthdayOfPEP } = _a, serverData = __rest(_a, ["ended", "birthdayOfPEP"]);
30
- const state = Object.assign({}, serverData);
31
- if (ended) {
32
- state.ended = DateTime.fromFormat(ended, "yyyy-MM").toJSDate();
33
- }
34
- if (birthdayOfPEP) {
35
- state.birthdayOfPEP = DateTime.fromFormat(birthdayOfPEP, "yyyy-MM-dd").toJSDate();
36
- }
37
- state.isLocalCountry = state.country === countryCode ? "local" : "other";
38
- state.isOngoing = state.ended ? PepStatus.ENDED : PepStatus.ONGOING;
39
- return state;
40
- }
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 { PepType, EntityType, PepStatus } from "../pages/PepContext";
13
+ import { DateTime } from "luxon";
14
+ export function stateToRequest(pepState) {
15
+ const state = Object.assign({}, pepState);
16
+ delete state.isLocalCountry;
17
+ delete state.isOngoing;
18
+ delete state.ownerName;
19
+ if (state.legalEntityType === EntityType.PERSON) {
20
+ delete state.tin;
21
+ }
22
+ return Object.assign(Object.assign({}, state), { country: state.type === PepType.NOT_PEP ? undefined : state.country, ended: state.ended
23
+ ? DateTime.fromJSDate(state.ended).toFormat("yyyy-MM")
24
+ : undefined, birthdayOfPEP: state.birthdayOfPEP
25
+ ? DateTime.fromJSDate(state.birthdayOfPEP).toFormat("yyyy-MM-dd")
26
+ : undefined });
27
+ }
28
+ export function requestToState(_a, countryCode) {
29
+ var { ended, birthdayOfPEP } = _a, serverData = __rest(_a, ["ended", "birthdayOfPEP"]);
30
+ const state = Object.assign({}, serverData);
31
+ if (ended) {
32
+ state.ended = DateTime.fromFormat(ended, "yyyy-MM").toJSDate();
33
+ }
34
+ if (birthdayOfPEP) {
35
+ state.birthdayOfPEP = DateTime.fromFormat(birthdayOfPEP, "yyyy-MM-dd").toJSDate();
36
+ }
37
+ state.isLocalCountry = state.country === countryCode ? "local" : "other";
38
+ state.isOngoing = state.ended ? PepStatus.ENDED : PepStatus.ONGOING;
39
+ return state;
40
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lysaab/lysa-pep",
3
3
  "author": "Lysa AB",
4
- "version": "3.0.3",
4
+ "version": "3.0.4",
5
5
  "main": "./Exports.js",
6
6
  "dependencies": {
7
7
  "@lysaab/countries": "^3.1.1",
@@ -1,32 +1,32 @@
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
+ 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
+ };