@lysaab/lysa-pep 7.0.0 → 7.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.
Files changed (85) hide show
  1. package/{src/Exports.ts → Exports.d.ts} +2 -7
  2. package/{lib/Exports.js → Exports.js} +2 -2
  3. package/{lib/components → components}/PepAnswers.d.ts +6 -0
  4. package/components/PepAnswers.js +182 -0
  5. package/package.json +8 -8
  6. package/{lib/pages → pages}/IsPep/IsPepPage.d.ts +2 -0
  7. package/{lib/pages → pages}/IsPep/IsPepPage.js +7 -4
  8. package/lib/Exports.d.ts +0 -7
  9. package/lib/README.md +0 -51
  10. package/lib/components/PepAnswers.js +0 -101
  11. package/lib/package.json +0 -73
  12. package/public/favicon.ico +0 -0
  13. package/public/index.html +0 -43
  14. package/public/logo192.png +0 -0
  15. package/public/logo512.png +0 -0
  16. package/public/manifest.json +0 -25
  17. package/public/robots.txt +0 -2
  18. package/src/App.scss +0 -5
  19. package/src/App.test.tsx +0 -9
  20. package/src/App.tsx +0 -17
  21. package/src/components/PepAnswers.scss +0 -7
  22. package/src/components/PepAnswers.tsx +0 -218
  23. package/src/demo/Done.tsx +0 -21
  24. package/src/demo/Localization.tsx +0 -66
  25. package/src/demo/LocalizationContext.tsx +0 -61
  26. package/src/demo/Pep.tsx +0 -172
  27. package/src/index.css +0 -13
  28. package/src/index.tsx +0 -13
  29. package/src/locales/da.json +0 -98
  30. package/src/locales/de.json +0 -98
  31. package/src/locales/defaultMessages.json +0 -335
  32. package/src/locales/en.json +0 -98
  33. package/src/locales/fi.json +0 -98
  34. package/src/locales/sv.json +0 -98
  35. package/src/locales/whitelist_da.json +0 -2
  36. package/src/locales/whitelist_en.json +0 -2
  37. package/src/locales/whitelist_fi.json +0 -2
  38. package/src/locales/whitelist_sv.json +0 -2
  39. package/src/logo.svg +0 -1
  40. package/src/model/PepModel.ts +0 -54
  41. package/src/pages/IsPep/IsPepMessages.ts +0 -11
  42. package/src/pages/IsPep/IsPepPage.tsx +0 -119
  43. package/src/pages/PepContext.tsx +0 -150
  44. package/src/pages/RelationPage/RelationMessages.ts +0 -74
  45. package/src/pages/RelationPage/RelationPage.tsx +0 -306
  46. package/src/pages/RolePage/RoleMessages.ts +0 -128
  47. package/src/pages/RolePage/RolePage.tsx +0 -359
  48. package/src/pages/StatusPage/StatusMessages.ts +0 -59
  49. package/src/pages/StatusPage/StatusPage.tsx +0 -237
  50. package/src/react-app-env.d.ts +0 -1
  51. package/src/serviceWorker.ts +0 -143
  52. package/src/utils/Possession.ts +0 -41
  53. package/translationRunner.js +0 -7
  54. package/tsconfig.json +0 -26
  55. package/tsconfig_build.json +0 -19
  56. /package/{lib/components → components}/PepAnswers.scss +0 -0
  57. /package/{lib/messages → messages}/src/components/PepAnswers.json +0 -0
  58. /package/{lib/messages → messages}/src/pages/IsPep/IsPepMessages.json +0 -0
  59. /package/{lib/messages → messages}/src/pages/IsPep/IsPepPage.json +0 -0
  60. /package/{lib/messages → messages}/src/pages/RelationPage/RelationMessages.json +0 -0
  61. /package/{lib/messages → messages}/src/pages/RelationPage/RelationPage.json +0 -0
  62. /package/{lib/messages → messages}/src/pages/RolePage/RoleMessages.json +0 -0
  63. /package/{lib/messages → messages}/src/pages/RolePage/RolePage.json +0 -0
  64. /package/{lib/messages → messages}/src/pages/StatusPage/StatusMessages.json +0 -0
  65. /package/{lib/messages → messages}/src/pages/StatusPage/StatusPage.json +0 -0
  66. /package/{lib/model → model}/PepModel.d.ts +0 -0
  67. /package/{lib/model → model}/PepModel.js +0 -0
  68. /package/{lib/pages → pages}/IsPep/IsPepMessages.d.ts +0 -0
  69. /package/{lib/pages → pages}/IsPep/IsPepMessages.js +0 -0
  70. /package/{lib/pages → pages}/PepContext.d.ts +0 -0
  71. /package/{lib/pages → pages}/PepContext.js +0 -0
  72. /package/{lib/pages → pages}/RelationPage/RelationMessages.d.ts +0 -0
  73. /package/{lib/pages → pages}/RelationPage/RelationMessages.js +0 -0
  74. /package/{lib/pages → pages}/RelationPage/RelationPage.d.ts +0 -0
  75. /package/{lib/pages → pages}/RelationPage/RelationPage.js +0 -0
  76. /package/{lib/pages → pages}/RolePage/RoleMessages.d.ts +0 -0
  77. /package/{lib/pages → pages}/RolePage/RoleMessages.js +0 -0
  78. /package/{lib/pages → pages}/RolePage/RolePage.d.ts +0 -0
  79. /package/{lib/pages → pages}/RolePage/RolePage.js +0 -0
  80. /package/{lib/pages → pages}/StatusPage/StatusMessages.d.ts +0 -0
  81. /package/{lib/pages → pages}/StatusPage/StatusMessages.js +0 -0
  82. /package/{lib/pages → pages}/StatusPage/StatusPage.d.ts +0 -0
  83. /package/{lib/pages → pages}/StatusPage/StatusPage.js +0 -0
  84. /package/{lib/utils → utils}/Possession.d.ts +0 -0
  85. /package/{lib/utils → utils}/Possession.js +0 -0
@@ -2,11 +2,6 @@ export * from "./pages/PepContext";
2
2
  export * from "./model/PepModel";
3
3
  export * from "./pages/IsPep/IsPepPage";
4
4
  export { RelationPage } from "./pages/RelationPage/RelationPage";
5
- export {
6
- RolePage as PepRolePage,
7
- getMilitaryAlts,
8
- getRoleAlts
9
- } from "./pages/RolePage/RolePage";
5
+ export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts, } from "./pages/RolePage/RolePage";
10
6
  export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
11
-
12
- export { PepAnswers } from "./components/PepAnswers";
7
+ export { PepAnswers, getPepAnswersTexts } from "./components/PepAnswers";
@@ -2,6 +2,6 @@ export * from "./pages/PepContext";
2
2
  export * from "./model/PepModel";
3
3
  export * from "./pages/IsPep/IsPepPage";
4
4
  export { RelationPage } from "./pages/RelationPage/RelationPage";
5
- export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts } from "./pages/RolePage/RolePage";
5
+ export { RolePage as PepRolePage, getMilitaryAlts, getRoleAlts, } from "./pages/RolePage/RolePage";
6
6
  export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
7
- export { PepAnswers } from "./components/PepAnswers";
7
+ export { PepAnswers, getPepAnswersTexts } from "./components/PepAnswers";
@@ -1,8 +1,14 @@
1
1
  import { FunctionComponent } from "react";
2
2
  import "./PepAnswers.scss";
3
3
  import { PepRequest } from "../model/PepModel";
4
+ import { IntlShape } from "react-intl";
4
5
  interface Props {
5
6
  answer: PepRequest;
6
7
  }
8
+ interface PepAnswerText {
9
+ label: string;
10
+ value: string;
11
+ }
12
+ export declare function getPepAnswersTexts(answer: PepRequest, intl: IntlShape): string | PepAnswerText[];
7
13
  export declare const PepAnswers: FunctionComponent<Props>;
8
14
  export {};
@@ -0,0 +1,182 @@
1
+ import React from "react";
2
+ import "./PepAnswers.scss";
3
+ import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
4
+ import { PepType } from "../pages/PepContext";
5
+ import { useIntl, defineMessages } from "react-intl";
6
+ import { messages as isPepMessages } from "../pages/IsPep/IsPepMessages";
7
+ import { relationMessages, businessRelationMessages, } from "../pages/RelationPage/RelationMessages";
8
+ const messages = defineMessages({
9
+ whoIsPepLabel: {
10
+ id: "pep.answers.who.label",
11
+ },
12
+ relationLabel: {
13
+ id: "pep.answers.relationship.label",
14
+ },
15
+ businessRelationLabel: {
16
+ id: "pep.answers.businessRelationship.label",
17
+ },
18
+ nameOfPepLabel: {
19
+ id: "pep.answers.nameOfPep.label",
20
+ },
21
+ birthdayOfPEPLabel: {
22
+ id: "pep.answers.birthdayOfPEP.label",
23
+ },
24
+ statusLabel: {
25
+ id: "pep.answers.status.label",
26
+ },
27
+ statusEndedValue: {
28
+ id: "pep.answers.statusEnded.value",
29
+ },
30
+ statusOngoingValue: {
31
+ id: "pep.answers.statusOngoing.value",
32
+ },
33
+ endedLabel: {
34
+ id: "pep.answers.endedStatus.label",
35
+ },
36
+ roleLabel: {
37
+ id: "pep.answers.role.label",
38
+ },
39
+ countryLabel: {
40
+ id: "pep.answers.country.label",
41
+ },
42
+ ambassadorCountryLabel: {
43
+ id: "pep.answers.ambassadorCountry.label",
44
+ },
45
+ governmentCompanyNameLabel: {
46
+ id: "pep.answers.governmentCompanyName.label",
47
+ },
48
+ governmentCompanyRoleLabel: {
49
+ id: "pep.answers.governmentCompanyRole.label",
50
+ },
51
+ internationalOrganisationNameLabel: {
52
+ id: "pep.answers.companyName.label",
53
+ },
54
+ internationalOrganisationRoleLabel: {
55
+ id: "pep.answers.companyRole.label",
56
+ },
57
+ militaryGradeLabel: {
58
+ id: "pep.answers.militaryRank.label",
59
+ },
60
+ });
61
+ export function getPepAnswersTexts(answer, intl) {
62
+ var _a, _b;
63
+ if (!answer.type || answer.type === PepType.NOT_PEP) {
64
+ return intl.formatMessage({ id: "pep.answers.notpep" });
65
+ }
66
+ const entityType = answer.legalEntityType;
67
+ const role = getRoleAlts(intl).find((alt) => alt.value === answer.role);
68
+ const militaryRank = getMilitaryAlts(intl).find((alt) => alt.value === answer.militaryRank);
69
+ const result = [];
70
+ if (answer.type) {
71
+ result.push({
72
+ label: intl.formatMessage(messages.whoIsPepLabel),
73
+ value: intl.formatMessage(isPepMessages[answer.type], {
74
+ entityType,
75
+ name: answer.ownerName,
76
+ }),
77
+ });
78
+ }
79
+ if (answer.relationToPEP) {
80
+ result.push({
81
+ label: intl.formatMessage(messages.relationLabel),
82
+ value: intl.formatMessage(relationMessages[answer.relationToPEP], {
83
+ entityType,
84
+ name: answer.ownerName,
85
+ }),
86
+ });
87
+ }
88
+ if (answer.businessRelation) {
89
+ result.push({
90
+ label: intl.formatMessage(messages.businessRelationLabel),
91
+ value: intl.formatMessage(businessRelationMessages[answer.businessRelation], { entityType, name: answer.ownerName }),
92
+ });
93
+ }
94
+ if (answer.nameOfPEP) {
95
+ result.push({
96
+ label: intl.formatMessage(messages.nameOfPepLabel),
97
+ value: answer.nameOfPEP,
98
+ });
99
+ }
100
+ if (answer.birthdayOfPEP) {
101
+ result.push({
102
+ label: intl.formatMessage(messages.birthdayOfPEPLabel),
103
+ value: answer.birthdayOfPEP,
104
+ });
105
+ }
106
+ if (answer.ended) {
107
+ result.push({
108
+ label: intl.formatMessage(messages.statusLabel),
109
+ value: intl.formatMessage(messages.statusEndedValue),
110
+ }, {
111
+ label: intl.formatMessage(messages.endedLabel),
112
+ value: answer.ended,
113
+ });
114
+ }
115
+ else {
116
+ result.push({
117
+ label: intl.formatMessage(messages.statusLabel),
118
+ value: intl.formatMessage(messages.statusOngoingValue),
119
+ });
120
+ }
121
+ if (answer.country) {
122
+ result.push({
123
+ label: intl.formatMessage(messages.countryLabel),
124
+ value: (_a = intl.formatDisplayName(answer.country, { type: "region" })) !== null && _a !== void 0 ? _a : "-",
125
+ });
126
+ }
127
+ if (role) {
128
+ result.push({
129
+ label: intl.formatMessage(messages.roleLabel),
130
+ value: role.text,
131
+ });
132
+ }
133
+ if (answer.ambassadorCountry) {
134
+ result.push({
135
+ label: intl.formatMessage(messages.ambassadorCountryLabel),
136
+ value: (_b = intl.formatDisplayName(answer.ambassadorCountry, {
137
+ type: "region",
138
+ })) !== null && _b !== void 0 ? _b : "-",
139
+ });
140
+ }
141
+ if (answer.governmentCompany) {
142
+ result.push({
143
+ label: intl.formatMessage(messages.governmentCompanyNameLabel),
144
+ value: answer.governmentCompany,
145
+ });
146
+ }
147
+ if (answer.governmentCompanyRole) {
148
+ result.push({
149
+ label: intl.formatMessage(messages.governmentCompanyRoleLabel),
150
+ value: answer.governmentCompanyRole,
151
+ });
152
+ }
153
+ if (answer.internationalOrganisation) {
154
+ result.push({
155
+ label: intl.formatMessage(messages.internationalOrganisationNameLabel),
156
+ value: answer.internationalOrganisation,
157
+ });
158
+ }
159
+ if (answer.internationalOrganisationRole) {
160
+ result.push({
161
+ label: intl.formatMessage(messages.internationalOrganisationRoleLabel),
162
+ value: answer.internationalOrganisationRole,
163
+ });
164
+ }
165
+ if (militaryRank) {
166
+ result.push({
167
+ label: intl.formatMessage(messages.militaryGradeLabel),
168
+ value: militaryRank.text,
169
+ });
170
+ }
171
+ return result;
172
+ }
173
+ export const PepAnswers = ({ answer }) => {
174
+ const intl = useIntl();
175
+ const texts = getPepAnswersTexts(answer, intl);
176
+ return (React.createElement("div", null, typeof texts === "string" ? (React.createElement("p", null, texts)) : (texts.map((item, index) => (React.createElement(StaticInput, { key: index, label: item.label, value: item.value }))))));
177
+ };
178
+ const StaticInput = ({ label, value }) => {
179
+ return (React.createElement("div", { className: "static-input" },
180
+ React.createElement("div", { className: "label" }, label),
181
+ React.createElement("div", { className: "value" }, value)));
182
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lysaab/lysa-pep",
3
3
  "author": "Lysa AB",
4
- "version": "7.0.0",
4
+ "version": "7.1.0",
5
5
  "main": "./Exports.js",
6
6
  "dependencies": {
7
7
  "@types/luxon": "^1.15.2",
@@ -47,13 +47,13 @@
47
47
  "copyscss": "copyfiles -u 1 \"src/components/**/*.scss\" lib/",
48
48
  "copymessages": "copyfiles -u 1 \"build/messages/**/*.json\" lib/",
49
49
  "copypkgfiles": "cp README.md ./lib/ && cp package.json ./lib/",
50
- "postversioning": "npm run translations:extract && npm run copymessages && npm run copypkgfiles && cd lib",
51
- "release:patch": "npm run build:lib && npm version patch && npm run postversioning && npm publish",
52
- "release:minor": "npm run build:lib && npm version minor && npm run postversioning && npm publish",
53
- "release:major": "npm run build:lib && npm version major && npm run postversioning && npm publish",
54
- "release:premajor": "npm run build:lib && npm version premajor && npm run postversioning && npm publish --tag next",
55
- "release:prepatch": "npm run build:lib && npm version prepatch && npm run postversioning && npm publish --tag next",
56
- "release:prerelease": "npm run build:lib && npm version prerelease && npm run postversioning && npm publish --tag next"
50
+ "postversioning": "npm run translations:extract && npm run copymessages && npm run copypkgfiles",
51
+ "release:patch": "npm run build:lib && npm version patch && npm run postversioning && cd lib && npm publish",
52
+ "release:minor": "npm run build:lib && npm version minor && npm run postversioning && cd lib && npm publish",
53
+ "release:major": "npm run build:lib && npm version major && npm run postversioning && cd lib && npm publish",
54
+ "release:premajor": "npm run build:lib && npm version premajor && npm run postversioning && cd lib && npm publish --tag next",
55
+ "release:prepatch": "npm run build:lib && npm version prepatch && npm run postversioning && cd lib && npm publish --tag next",
56
+ "release:prerelease": "npm run build:lib && npm version prerelease && npm run postversioning && cd lib && npm publish --tag next"
57
57
  },
58
58
  "eslintConfig": {
59
59
  "extends": "react-app"
@@ -1,5 +1,7 @@
1
1
  import React, { FunctionComponent } from "react";
2
2
  import { PepType, EntityType } from "../PepContext";
3
+ import { IntlShape } from "react-intl";
4
+ export declare function getIsPepQuestionText(entityType: EntityType | undefined, name: string | undefined, intl: IntlShape): string;
3
5
  export interface QuestionsProps {
4
6
  ownerName?: string;
5
7
  entityType?: EntityType;
@@ -3,6 +3,12 @@ import { Form, RadioGroup, RequiredValidator, Button, Card, } from "@lysaab/ui-2
3
3
  import { PepType, PepContext, EntityType } from "../PepContext";
4
4
  import { useIntl, FormattedMessage } from "react-intl";
5
5
  import { messages } from "./IsPepMessages";
6
+ export function getIsPepQuestionText(entityType, name, intl) {
7
+ return intl.formatMessage(messages.header, {
8
+ entityType,
9
+ name,
10
+ });
11
+ }
6
12
  export const IsPepQuestion = ({ ownerName, entityType, type, onChange, resetValues, }) => {
7
13
  const intl = useIntl();
8
14
  const IsPepAlternatives = [
@@ -38,10 +44,7 @@ export const IsPepQuestion = ({ ownerName, entityType, type, onChange, resetValu
38
44
  return (React.createElement(RadioGroup, { alternatives: IsPepAlternatives, onChange: (alternative) => {
39
45
  onChange(alternative.value);
40
46
  resetValues === null || resetValues === void 0 ? void 0 : resetValues();
41
- }, value: IsPepAlternatives.find((alt) => alt.value === type), header: intl.formatMessage(messages.header, {
42
- entityType,
43
- name: ownerName,
44
- }), validators: [
47
+ }, value: IsPepAlternatives.find((alt) => alt.value === type), header: getIsPepQuestionText(entityType, ownerName, intl), validators: [
45
48
  new RequiredValidator(intl.formatMessage(messages.required)),
46
49
  ], "data-test-id": "pep-ispep" }));
47
50
  };
package/lib/Exports.d.ts DELETED
@@ -1,7 +0,0 @@
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/README.md DELETED
@@ -1,51 +0,0 @@
1
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2
-
3
- ## Available Scripts
4
-
5
- In the project directory, you can run:
6
-
7
- ### `npm start`
8
-
9
- Runs the app in the development mode.<br />
10
- Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11
-
12
- The page will reload if you make edits.<br />
13
- You will also see any lint errors in the console.
14
-
15
- ### `npm test`
16
-
17
- Launches the test runner in the interactive watch mode.<br />
18
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19
-
20
- ### `npm run build`
21
-
22
- Builds the app for production to the `build` folder.<br />
23
- It correctly bundles React in production mode and optimizes the build for the best performance.
24
-
25
- The build is minified and the filenames include the hashes.<br />
26
- Your app is ready to be deployed!
27
-
28
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29
-
30
- ### `npm run eject`
31
-
32
- **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33
-
34
- If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35
-
36
- Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37
-
38
- You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39
-
40
- ## Learn More
41
-
42
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43
-
44
- To learn React, check out the [React documentation](https://reactjs.org/).
45
-
46
- ## Testing pre-release version
47
-
48
- 1. `npm run build`
49
- 2. Copy the built files to where you want to use them. Example (standing in a
50
- project that you want to test the new version in):
51
- `cp -r ../lysa-pep/lib/* node_modules/\@lysaab/lysa-pep/`
@@ -1,101 +0,0 @@
1
- import React from "react";
2
- import "./PepAnswers.scss";
3
- import { getRoleAlts, getMilitaryAlts } from "../pages/RolePage/RolePage";
4
- import { PepType } from "../pages/PepContext";
5
- import { useIntl, defineMessages, FormattedMessage } from "react-intl";
6
- import { messages as isPepMessages } from "../pages/IsPep/IsPepMessages";
7
- import { relationMessages, businessRelationMessages, } from "../pages/RelationPage/RelationMessages";
8
- const messages = defineMessages({
9
- whoIsPepLabel: {
10
- id: "pep.answers.who.label",
11
- },
12
- relationLabel: {
13
- id: "pep.answers.relationship.label",
14
- },
15
- businessRelationLabel: {
16
- id: "pep.answers.businessRelationship.label",
17
- },
18
- nameOfPepLabel: {
19
- id: "pep.answers.nameOfPep.label",
20
- },
21
- birthdayOfPEPLabel: {
22
- id: "pep.answers.birthdayOfPEP.label",
23
- },
24
- statusLabel: {
25
- id: "pep.answers.status.label",
26
- },
27
- statusEndedValue: {
28
- id: "pep.answers.statusEnded.value",
29
- },
30
- statusOngoingValue: {
31
- id: "pep.answers.statusOngoing.value",
32
- },
33
- endedLabel: {
34
- id: "pep.answers.endedStatus.label",
35
- },
36
- roleLabel: {
37
- id: "pep.answers.role.label",
38
- },
39
- countryLabel: {
40
- id: "pep.answers.country.label",
41
- },
42
- ambassadorCountryLabel: {
43
- id: "pep.answers.ambassadorCountry.label",
44
- },
45
- governmentCompanyNameLabel: {
46
- id: "pep.answers.governmentCompanyName.label",
47
- },
48
- governmentCompanyRoleLabel: {
49
- id: "pep.answers.governmentCompanyRole.label",
50
- },
51
- internationalOrganisationNameLabel: {
52
- id: "pep.answers.companyName.label",
53
- },
54
- internationalOrganisationRoleLabel: {
55
- id: "pep.answers.companyRole.label",
56
- },
57
- militaryGradeLabel: {
58
- id: "pep.answers.militaryRank.label",
59
- },
60
- });
61
- export const PepAnswers = ({ answer }) => {
62
- const intl = useIntl();
63
- if (!answer.type || answer.type === PepType.NOT_PEP) {
64
- return (React.createElement("div", null,
65
- React.createElement("p", null,
66
- React.createElement(FormattedMessage, { id: "pep.answers.notpep" }))));
67
- }
68
- const entityType = answer.legalEntityType;
69
- const role = getRoleAlts(intl).find((alt) => alt.value === answer.role);
70
- const militaryRank = getMilitaryAlts(intl).find((alt) => alt.value === answer.militaryRank);
71
- return (React.createElement("div", null,
72
- answer.type && (React.createElement(StaticInput, { label: intl.formatMessage(messages.whoIsPepLabel), value: intl.formatMessage(isPepMessages[answer.type], {
73
- entityType,
74
- name: answer.ownerName,
75
- }) })),
76
- answer.relationToPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.relationLabel), value: intl.formatMessage(relationMessages[answer.relationToPEP], {
77
- entityType,
78
- name: answer.ownerName,
79
- }) })),
80
- answer.businessRelation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.businessRelationLabel), value: intl.formatMessage(businessRelationMessages[answer.businessRelation], { entityType, name: answer.ownerName }) })),
81
- answer.nameOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.nameOfPepLabel), value: answer.nameOfPEP })),
82
- answer.birthdayOfPEP && (React.createElement(StaticInput, { label: intl.formatMessage(messages.birthdayOfPEPLabel), value: answer.birthdayOfPEP })),
83
- answer.ended ? (React.createElement(React.Fragment, null,
84
- React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusEndedValue) }),
85
- React.createElement(StaticInput, { label: intl.formatMessage(messages.endedLabel), value: answer.ended }))) : (React.createElement(StaticInput, { label: intl.formatMessage(messages.statusLabel), value: intl.formatMessage(messages.statusOngoingValue) })),
86
- answer.country && (React.createElement(StaticInput, { label: intl.formatMessage(messages.countryLabel), value: intl.formatDisplayName(answer.country, { type: "region" }) })),
87
- role && (React.createElement(StaticInput, { label: intl.formatMessage(messages.roleLabel), value: role.text })),
88
- answer.ambassadorCountry && (React.createElement(StaticInput, { label: intl.formatMessage(messages.ambassadorCountryLabel), value: intl.formatDisplayName(answer.ambassadorCountry, {
89
- type: "region",
90
- }) })),
91
- answer.governmentCompany && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyNameLabel), value: answer.governmentCompany })),
92
- answer.governmentCompanyRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.governmentCompanyRoleLabel), value: answer.governmentCompanyRole })),
93
- answer.internationalOrganisation && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationNameLabel), value: answer.internationalOrganisation })),
94
- answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: intl.formatMessage(messages.internationalOrganisationRoleLabel), value: answer.internationalOrganisationRole })),
95
- militaryRank && (React.createElement(StaticInput, { label: intl.formatMessage(messages.militaryGradeLabel), value: militaryRank.text }))));
96
- };
97
- const StaticInput = ({ label, value }) => {
98
- return (React.createElement("div", { className: "static-input" },
99
- React.createElement("div", { className: "label" }, label),
100
- React.createElement("div", { className: "value" }, value)));
101
- };
package/lib/package.json DELETED
@@ -1,73 +0,0 @@
1
- {
2
- "name": "@lysaab/lysa-pep",
3
- "author": "Lysa AB",
4
- "version": "7.0.0",
5
- "main": "./Exports.js",
6
- "dependencies": {
7
- "@types/luxon": "^1.15.2",
8
- "luxon": "^1.21.1"
9
- },
10
- "devDependencies": {
11
- "@formatjs/cli": "^1.1.22",
12
- "@lysaab/ui-2": "^45.0.1",
13
- "@types/jest": "24.0.20",
14
- "@types/luxon": "^1.15.2",
15
- "@types/node": "12.11.7",
16
- "@types/react": "^18.3.3",
17
- "@types/react-datepicker": "^6.2.0",
18
- "@types/react-dom": "^18.3.0",
19
- "copyfiles": "^2.3.0",
20
- "eslint-plugin-formatjs": "^3.0.0",
21
- "luxon": "^1.21.1",
22
- "react": "^18.3.1",
23
- "react-datepicker": "^6.9.0",
24
- "react-dom": "^18.3.1",
25
- "react-intl": "^6.6.8",
26
- "react-intl-translations-manager": "^5.0.3",
27
- "react-router-dom": "^5.2.0",
28
- "react-scripts": "^5.0.0",
29
- "sass": "^1.50.0",
30
- "typescript": "^4.3.4"
31
- },
32
- "peerDependencies": {
33
- "@lysaab/ui-2": "^45.0.1",
34
- "react": "17 - 18",
35
- "react-intl": "^6.6.8",
36
- "react-router-dom": "^5.2.0"
37
- },
38
- "scripts": {
39
- "start": "react-scripts start",
40
- "build": "react-scripts build",
41
- "test": "react-scripts test",
42
- "eject": "react-scripts eject",
43
- "build:lib": "tsc -p ./tsconfig_build.json && npm run copyscss",
44
- "translations:extract": "formatjs extract --messages-dir ./build/messages \"./src/**/*.tsx\" \"./src/**/*.ts\"",
45
- "translations:manage": "node ./translationRunner.js",
46
- "translations": "npm run translations:extract && npm run translations:manage",
47
- "copyscss": "copyfiles -u 1 \"src/components/**/*.scss\" lib/",
48
- "copymessages": "copyfiles -u 1 \"build/messages/**/*.json\" lib/",
49
- "copypkgfiles": "cp README.md ./lib/ && cp package.json ./lib/",
50
- "postversioning": "npm run translations:extract && npm run copymessages && npm run copypkgfiles && cd lib",
51
- "release:patch": "npm run build:lib && npm version patch && npm run postversioning && npm publish",
52
- "release:minor": "npm run build:lib && npm version minor && npm run postversioning && npm publish",
53
- "release:major": "npm run build:lib && npm version major && npm run postversioning && npm publish",
54
- "release:premajor": "npm run build:lib && npm version premajor && npm run postversioning && npm publish --tag next",
55
- "release:prepatch": "npm run build:lib && npm version prepatch && npm run postversioning && npm publish --tag next",
56
- "release:prerelease": "npm run build:lib && npm version prerelease && npm run postversioning && npm publish --tag next"
57
- },
58
- "eslintConfig": {
59
- "extends": "react-app"
60
- },
61
- "browserslist": {
62
- "production": [
63
- ">0.2%",
64
- "not dead",
65
- "not op_mini all"
66
- ],
67
- "development": [
68
- "last 1 chrome version",
69
- "last 1 firefox version",
70
- "last 1 safari version"
71
- ]
72
- }
73
- }
Binary file
package/public/index.html DELETED
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <meta
9
- name="description"
10
- content="Web site created using create-react-app"
11
- />
12
- <link rel="apple-touch-icon" href="logo192.png" />
13
- <!--
14
- manifest.json provides metadata used when your web app is installed on a
15
- user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
- -->
17
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
- <!--
19
- Notice the use of %PUBLIC_URL% in the tags above.
20
- It will be replaced with the URL of the `public` folder during the build.
21
- Only files inside the `public` folder can be referenced from the HTML.
22
-
23
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
- work correctly both with client-side routing and a non-root public URL.
25
- Learn how to configure a non-root public URL by running `npm run build`.
26
- -->
27
- <title>React App</title>
28
- </head>
29
- <body>
30
- <noscript>You need to enable JavaScript to run this app.</noscript>
31
- <div id="root"></div>
32
- <!--
33
- This HTML file is a template.
34
- If you open it directly in the browser, you will see an empty page.
35
-
36
- You can add webfonts, meta tags, or analytics to this file.
37
- The build step will place the bundled scripts into the <body> tag.
38
-
39
- To begin the development, run `npm start` or `yarn start`.
40
- To create a production bundle, use `npm run build` or `yarn build`.
41
- -->
42
- </body>
43
- </html>
Binary file
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/public/robots.txt DELETED
@@ -1,2 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
package/src/App.scss DELETED
@@ -1,5 +0,0 @@
1
- @import "~@lysaab/ui-2/components/styling/layout";
2
-
3
- .lysa-story .lysa-story-body {
4
- min-height: calc(100vh - 300px) !important;
5
- }
package/src/App.test.tsx DELETED
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
3
- import App from './App';
4
-
5
- it('renders without crashing', () => {
6
- const div = document.createElement('div');
7
- ReactDOM.render(<App />, div);
8
- ReactDOM.unmountComponentAtNode(div);
9
- });
package/src/App.tsx DELETED
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- import { LocalizationContextProvider } from "./demo/LocalizationContext";
3
- import { Pep } from "./demo/Pep";
4
- import { PepContextProvider } from "./pages/PepContext";
5
- import "./App.scss";
6
-
7
- const App: React.FC = () => {
8
- return (
9
- <LocalizationContextProvider>
10
- <PepContextProvider>
11
- <Pep />
12
- </PepContextProvider>
13
- </LocalizationContextProvider>
14
- );
15
- };
16
-
17
- export default App;
@@ -1,7 +0,0 @@
1
- .static-input {
2
- margin-bottom: 8px;
3
-
4
- .label {
5
- font-weight: bold;
6
- }
7
- }