@lysaab/lysa-pep 6.1.1 → 7.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.
- package/README.md +7 -0
- package/lib/README.md +51 -0
- package/lib/package.json +73 -0
- package/{pages → lib/pages}/IsPep/IsPepPage.js +2 -3
- package/{pages → lib/pages}/PepContext.d.ts +3 -3
- package/{pages → lib/pages}/RelationPage/RelationPage.js +2 -3
- package/{pages → lib/pages}/RolePage/RolePage.js +2 -3
- package/{pages → lib/pages}/StatusPage/StatusPage.js +2 -3
- package/package.json +20 -21
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +2 -0
- package/src/App.scss +5 -0
- package/src/App.test.tsx +9 -0
- package/src/App.tsx +17 -0
- package/src/Exports.ts +12 -0
- package/src/components/PepAnswers.scss +7 -0
- package/src/components/PepAnswers.tsx +218 -0
- package/src/demo/Done.tsx +21 -0
- package/src/demo/Localization.tsx +66 -0
- package/src/demo/LocalizationContext.tsx +61 -0
- package/src/demo/Pep.tsx +172 -0
- package/src/index.css +13 -0
- package/src/index.tsx +13 -0
- package/src/locales/da.json +98 -0
- package/src/locales/de.json +98 -0
- package/src/locales/defaultMessages.json +335 -0
- package/src/locales/en.json +98 -0
- package/src/locales/fi.json +98 -0
- package/src/locales/sv.json +98 -0
- package/src/locales/whitelist_da.json +2 -0
- package/src/locales/whitelist_en.json +2 -0
- package/src/locales/whitelist_fi.json +2 -0
- package/src/locales/whitelist_sv.json +2 -0
- package/src/logo.svg +1 -0
- package/src/model/PepModel.ts +54 -0
- package/src/pages/IsPep/IsPepMessages.ts +11 -0
- package/src/pages/IsPep/IsPepPage.tsx +119 -0
- package/src/pages/PepContext.tsx +150 -0
- package/src/pages/RelationPage/RelationMessages.ts +74 -0
- package/src/pages/RelationPage/RelationPage.tsx +306 -0
- package/src/pages/RolePage/RoleMessages.ts +128 -0
- package/src/pages/RolePage/RolePage.tsx +359 -0
- package/src/pages/StatusPage/StatusMessages.ts +59 -0
- package/src/pages/StatusPage/StatusPage.tsx +237 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/serviceWorker.ts +143 -0
- package/src/utils/Possession.ts +41 -0
- package/translationRunner.js +7 -0
- package/tsconfig.json +26 -0
- package/tsconfig_build.json +19 -0
- /package/{Exports.d.ts → lib/Exports.d.ts} +0 -0
- /package/{Exports.js → lib/Exports.js} +0 -0
- /package/{components → lib/components}/PepAnswers.d.ts +0 -0
- /package/{components → lib/components}/PepAnswers.js +0 -0
- /package/{components → lib/components}/PepAnswers.scss +0 -0
- /package/{messages → lib/messages}/src/components/PepAnswers.json +0 -0
- /package/{messages → lib/messages}/src/pages/IsPep/IsPepMessages.json +0 -0
- /package/{messages → lib/messages}/src/pages/IsPep/IsPepPage.json +0 -0
- /package/{messages → lib/messages}/src/pages/RelationPage/RelationMessages.json +0 -0
- /package/{messages → lib/messages}/src/pages/RelationPage/RelationPage.json +0 -0
- /package/{messages → lib/messages}/src/pages/RolePage/RoleMessages.json +0 -0
- /package/{messages → lib/messages}/src/pages/RolePage/RolePage.json +0 -0
- /package/{messages → lib/messages}/src/pages/StatusPage/StatusMessages.json +0 -0
- /package/{messages → lib/messages}/src/pages/StatusPage/StatusPage.json +0 -0
- /package/{model → lib/model}/PepModel.d.ts +0 -0
- /package/{model → lib/model}/PepModel.js +0 -0
- /package/{pages → lib/pages}/IsPep/IsPepMessages.d.ts +0 -0
- /package/{pages → lib/pages}/IsPep/IsPepMessages.js +0 -0
- /package/{pages → lib/pages}/IsPep/IsPepPage.d.ts +0 -0
- /package/{pages → lib/pages}/PepContext.js +0 -0
- /package/{pages → lib/pages}/RelationPage/RelationMessages.d.ts +0 -0
- /package/{pages → lib/pages}/RelationPage/RelationMessages.js +0 -0
- /package/{pages → lib/pages}/RelationPage/RelationPage.d.ts +0 -0
- /package/{pages → lib/pages}/RolePage/RoleMessages.d.ts +0 -0
- /package/{pages → lib/pages}/RolePage/RoleMessages.js +0 -0
- /package/{pages → lib/pages}/RolePage/RolePage.d.ts +0 -0
- /package/{pages → lib/pages}/StatusPage/StatusMessages.d.ts +0 -0
- /package/{pages → lib/pages}/StatusPage/StatusMessages.js +0 -0
- /package/{pages → lib/pages}/StatusPage/StatusPage.d.ts +0 -0
- /package/{utils → lib/utils}/Possession.d.ts +0 -0
- /package/{utils → lib/utils}/Possession.js +0 -0
package/README.md
CHANGED
|
@@ -42,3 +42,10 @@ You don’t have to ever use `eject`. The curated feature set is suitable for sm
|
|
|
42
42
|
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
|
43
43
|
|
|
44
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/`
|
package/lib/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
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/`
|
package/lib/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useCallback, useContext, } from "react";
|
|
2
|
-
import { Form, RadioGroup, RequiredValidator,
|
|
2
|
+
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";
|
|
@@ -56,6 +56,5 @@ export const IsPepPage = ({ next }) => {
|
|
|
56
56
|
return (React.createElement(Form, { onSubmit: nextPage, lysaFormRef: formRef },
|
|
57
57
|
React.createElement(Card, null,
|
|
58
58
|
React.createElement(IsPepQuestion, { ownerName: pepContext.state.ownerName, entityType: pepContext.state.legalEntityType || EntityType.PERSON, type: pepContext.state.type, onChange: (type) => pepContext.setState({ type }) })),
|
|
59
|
-
React.createElement(
|
|
60
|
-
React.createElement(FormattedMessage, { id: "pep.ispep.next" }))));
|
|
59
|
+
React.createElement(Button, { label: React.createElement(FormattedMessage, { id: "pep.ispep.next" }), block: true, type: "submit" })));
|
|
61
60
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WorldCountry } from "@lysaab/
|
|
1
|
+
import { WorldCountry } from "@lysaab/ui-2";
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare enum EntityType {
|
|
4
4
|
PERSON = "PERSON",
|
|
@@ -78,5 +78,5 @@ export interface PepContextProps {
|
|
|
78
78
|
setState: (newState: Partial<PepState>) => void;
|
|
79
79
|
}
|
|
80
80
|
export declare const PepContext: React.Context<PepContextProps>;
|
|
81
|
-
export declare const withPep: <P extends object>(Component: React.ComponentType<P
|
|
82
|
-
export declare const PepContextProvider: React.FC
|
|
81
|
+
export declare const withPep: <P extends object>(Component: React.ComponentType<React.PropsWithChildren<P>>) => React.FC<React.PropsWithChildren<Omit<P, keyof PepContextProps>>>;
|
|
82
|
+
export declare const PepContextProvider: React.FC<React.PropsWithChildren<unknown>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useRef, useCallback, } from "react";
|
|
2
2
|
import { PepContext, PepType, BusinessRelation, Relation, EntityType, } from "../PepContext";
|
|
3
|
-
import { RadioGroup, Form, RequiredValidator, TextInput, Datepicker,
|
|
3
|
+
import { RadioGroup, Form, RequiredValidator, TextInput, Datepicker, Button, Card, } from "@lysaab/ui-2";
|
|
4
4
|
import { DateTime } from "luxon";
|
|
5
5
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
6
6
|
import { relationMessages, businessRelationMessages, relativeNameMessages, birthdayMessages, colleagueNameMessages, } from "./RelationMessages";
|
|
@@ -82,8 +82,7 @@ export const RelationPage = ({ next }) => {
|
|
|
82
82
|
}, validators: [
|
|
83
83
|
new RequiredValidator(intl.formatMessage(colleagueNameMessages.required)),
|
|
84
84
|
] }))) : null),
|
|
85
|
-
React.createElement(
|
|
86
|
-
React.createElement(FormattedMessage, { id: "pep.relation.next" }))));
|
|
85
|
+
React.createElement(Button, { block: true, type: "submit", label: React.createElement(FormattedMessage, { id: "pep.relation.next" }) })));
|
|
87
86
|
};
|
|
88
87
|
function getRelationAlternatives(intl, entityType, pepContext) {
|
|
89
88
|
return [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useCallback, useContext, } from "react";
|
|
2
|
-
import { Form,
|
|
2
|
+
import { Form, RequiredValidator, TextInput, Select, Card, CountrySelect, Button, } from "@lysaab/ui-2";
|
|
3
3
|
import { PepContext, Role, MilitaryRank, PepType, EntityType, } from "../PepContext";
|
|
4
4
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
5
|
import { roleMessages, ambassadorMessages, governmentCompanyMessages, intCompanyMessages, militaryMessages, } from "./RoleMessages";
|
|
@@ -131,8 +131,7 @@ export const RolePage = ({ language, next }) => {
|
|
|
131
131
|
}, validators: [
|
|
132
132
|
new RequiredValidator(intl.formatMessage(militaryMessages.required)),
|
|
133
133
|
] })) : null),
|
|
134
|
-
React.createElement(
|
|
135
|
-
React.createElement(FormattedMessage, { id: "pep.role.next" }))));
|
|
134
|
+
React.createElement(Button, { block: true, type: "submit", label: React.createElement(FormattedMessage, { id: "pep.role.next" }) })));
|
|
136
135
|
};
|
|
137
136
|
export function getRoleAlts(intl) {
|
|
138
137
|
return [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useCallback, useContext, } from "react";
|
|
2
|
-
import { Form, RadioGroup, RequiredValidator,
|
|
2
|
+
import { Form, RadioGroup, RequiredValidator, Datepicker, Card, CountrySelect, Button, } from "@lysaab/ui-2";
|
|
3
3
|
import { PepContext, PepStatus, EntityType, PepType } from "../PepContext";
|
|
4
4
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
5
|
import { isOngoingMessages, endedMessages, isLocalCountryMessages, countrySelectionMessages, localCountryAltMessages, stateAltMessages, } from "./StatusMessages";
|
|
@@ -73,8 +73,7 @@ export const StatusPage = ({ countryName, countryCode, language, next, }) => {
|
|
|
73
73
|
}), validators: [
|
|
74
74
|
new RequiredValidator(intl.formatMessage(countrySelectionMessages.required)),
|
|
75
75
|
], value: pepContext.state.country, omitList: [countryCode], language: language, placeholder: intl.formatMessage(countrySelectionMessages.placeholder) })) : null),
|
|
76
|
-
React.createElement(
|
|
77
|
-
React.createElement(FormattedMessage, { id: "pep.status.next" })))));
|
|
76
|
+
React.createElement(Button, { label: React.createElement(FormattedMessage, { id: "pep.status.next" }), block: true, type: "submit" }))));
|
|
78
77
|
};
|
|
79
78
|
function getIsLocalCountryAlternatives(intl, countryName) {
|
|
80
79
|
return [
|
package/package.json
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lysaab/lysa-pep",
|
|
3
3
|
"author": "Lysa AB",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0",
|
|
5
5
|
"main": "./Exports.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@lysaab/countries": "^5.0.2",
|
|
8
7
|
"@types/luxon": "^1.15.2",
|
|
9
|
-
"@types/react-intl": "^3.0.0",
|
|
10
8
|
"luxon": "^1.21.1"
|
|
11
9
|
},
|
|
12
10
|
"devDependencies": {
|
|
13
11
|
"@formatjs/cli": "^1.1.22",
|
|
14
|
-
"@lysaab/ui-2": "^
|
|
12
|
+
"@lysaab/ui-2": "^45.0.1",
|
|
15
13
|
"@types/jest": "24.0.20",
|
|
16
14
|
"@types/luxon": "^1.15.2",
|
|
17
15
|
"@types/node": "12.11.7",
|
|
18
|
-
"@types/react": "^
|
|
19
|
-
"@types/react-datepicker": "^
|
|
20
|
-
"@types/react-dom": "^
|
|
16
|
+
"@types/react": "^18.3.3",
|
|
17
|
+
"@types/react-datepicker": "^6.2.0",
|
|
18
|
+
"@types/react-dom": "^18.3.0",
|
|
21
19
|
"copyfiles": "^2.3.0",
|
|
22
20
|
"eslint-plugin-formatjs": "^3.0.0",
|
|
23
21
|
"luxon": "^1.21.1",
|
|
24
|
-
"react": "^
|
|
25
|
-
"react-datepicker": "^
|
|
26
|
-
"react-dom": "^
|
|
27
|
-
"react-intl": "^
|
|
22
|
+
"react": "^18.3.1",
|
|
23
|
+
"react-datepicker": "^6.9.0",
|
|
24
|
+
"react-dom": "^18.3.1",
|
|
25
|
+
"react-intl": "^6.6.8",
|
|
28
26
|
"react-intl-translations-manager": "^5.0.3",
|
|
29
27
|
"react-router-dom": "^5.2.0",
|
|
30
28
|
"react-scripts": "^5.0.0",
|
|
31
|
-
"sass": "^1.
|
|
29
|
+
"sass": "^1.50.0",
|
|
32
30
|
"typescript": "^4.3.4"
|
|
33
31
|
},
|
|
34
32
|
"peerDependencies": {
|
|
35
|
-
"@lysaab/ui-2": "^
|
|
36
|
-
"react": "
|
|
37
|
-
"react-intl": "^
|
|
33
|
+
"@lysaab/ui-2": "^45.0.1",
|
|
34
|
+
"react": "17 - 18",
|
|
35
|
+
"react-intl": "^6.6.8",
|
|
38
36
|
"react-router-dom": "^5.2.0"
|
|
39
37
|
},
|
|
40
38
|
"scripts": {
|
|
@@ -49,12 +47,13 @@
|
|
|
49
47
|
"copyscss": "copyfiles -u 1 \"src/components/**/*.scss\" lib/",
|
|
50
48
|
"copymessages": "copyfiles -u 1 \"build/messages/**/*.json\" lib/",
|
|
51
49
|
"copypkgfiles": "cp README.md ./lib/ && cp package.json ./lib/",
|
|
52
|
-
"postversioning": "npm run translations:extract && npm run copymessages && npm run copypkgfiles && cd lib
|
|
53
|
-
"release:patch": "npm run build:lib && npm version patch && npm run postversioning",
|
|
54
|
-
"release:minor": "npm run build:lib && npm version minor && npm run postversioning",
|
|
55
|
-
"release:major": "npm run build:lib && npm version major && npm run postversioning",
|
|
56
|
-
"release:premajor": "npm run build:lib && npm version premajor && npm run postversioning",
|
|
57
|
-
"release:prepatch": "npm run build:lib && npm version prepatch && npm run postversioning"
|
|
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"
|
|
58
57
|
},
|
|
59
58
|
"eslintConfig": {
|
|
60
59
|
"extends": "react-app"
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
|
@@ -0,0 +1,25 @@
|
|
|
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/src/App.scss
ADDED
package/src/App.test.tsx
ADDED
package/src/App.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
package/src/Exports.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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 {
|
|
6
|
+
RolePage as PepRolePage,
|
|
7
|
+
getMilitaryAlts,
|
|
8
|
+
getRoleAlts
|
|
9
|
+
} from "./pages/RolePage/RolePage";
|
|
10
|
+
export { StatusPage as PepStatusPage } from "./pages/StatusPage/StatusPage";
|
|
11
|
+
|
|
12
|
+
export { PepAnswers } from "./components/PepAnswers";
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import React, { FunctionComponent } from "react";
|
|
2
|
+
import "./PepAnswers.scss";
|
|
3
|
+
import { PepRequest } from "../model/PepModel";
|
|
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 {
|
|
9
|
+
relationMessages,
|
|
10
|
+
businessRelationMessages,
|
|
11
|
+
} from "../pages/RelationPage/RelationMessages";
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
answer: PepRequest;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const messages = defineMessages({
|
|
18
|
+
whoIsPepLabel: {
|
|
19
|
+
id: "pep.answers.who.label",
|
|
20
|
+
},
|
|
21
|
+
relationLabel: {
|
|
22
|
+
id: "pep.answers.relationship.label",
|
|
23
|
+
},
|
|
24
|
+
businessRelationLabel: {
|
|
25
|
+
id: "pep.answers.businessRelationship.label",
|
|
26
|
+
},
|
|
27
|
+
nameOfPepLabel: {
|
|
28
|
+
id: "pep.answers.nameOfPep.label",
|
|
29
|
+
},
|
|
30
|
+
birthdayOfPEPLabel: {
|
|
31
|
+
id: "pep.answers.birthdayOfPEP.label",
|
|
32
|
+
},
|
|
33
|
+
statusLabel: {
|
|
34
|
+
id: "pep.answers.status.label",
|
|
35
|
+
},
|
|
36
|
+
statusEndedValue: {
|
|
37
|
+
id: "pep.answers.statusEnded.value",
|
|
38
|
+
},
|
|
39
|
+
statusOngoingValue: {
|
|
40
|
+
id: "pep.answers.statusOngoing.value",
|
|
41
|
+
},
|
|
42
|
+
endedLabel: {
|
|
43
|
+
id: "pep.answers.endedStatus.label",
|
|
44
|
+
},
|
|
45
|
+
roleLabel: {
|
|
46
|
+
id: "pep.answers.role.label",
|
|
47
|
+
},
|
|
48
|
+
countryLabel: {
|
|
49
|
+
id: "pep.answers.country.label",
|
|
50
|
+
},
|
|
51
|
+
ambassadorCountryLabel: {
|
|
52
|
+
id: "pep.answers.ambassadorCountry.label",
|
|
53
|
+
},
|
|
54
|
+
governmentCompanyNameLabel: {
|
|
55
|
+
id: "pep.answers.governmentCompanyName.label",
|
|
56
|
+
},
|
|
57
|
+
governmentCompanyRoleLabel: {
|
|
58
|
+
id: "pep.answers.governmentCompanyRole.label",
|
|
59
|
+
},
|
|
60
|
+
internationalOrganisationNameLabel: {
|
|
61
|
+
id: "pep.answers.companyName.label",
|
|
62
|
+
},
|
|
63
|
+
internationalOrganisationRoleLabel: {
|
|
64
|
+
id: "pep.answers.companyRole.label",
|
|
65
|
+
},
|
|
66
|
+
militaryGradeLabel: {
|
|
67
|
+
id: "pep.answers.militaryRank.label",
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export const PepAnswers: FunctionComponent<Props> = ({ answer }) => {
|
|
72
|
+
const intl = useIntl();
|
|
73
|
+
|
|
74
|
+
if (!answer.type || answer.type === PepType.NOT_PEP) {
|
|
75
|
+
return (
|
|
76
|
+
<div>
|
|
77
|
+
<p>
|
|
78
|
+
<FormattedMessage id="pep.answers.notpep" />
|
|
79
|
+
</p>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const entityType = answer.legalEntityType;
|
|
85
|
+
const role = getRoleAlts(intl).find((alt) => alt.value === answer.role);
|
|
86
|
+
const militaryRank = getMilitaryAlts(intl).find(
|
|
87
|
+
(alt) => alt.value === answer.militaryRank
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<div>
|
|
92
|
+
{answer.type && (
|
|
93
|
+
<StaticInput
|
|
94
|
+
label={intl.formatMessage(messages.whoIsPepLabel)}
|
|
95
|
+
value={intl.formatMessage(isPepMessages[answer.type], {
|
|
96
|
+
entityType,
|
|
97
|
+
name: answer.ownerName,
|
|
98
|
+
})}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
{answer.relationToPEP && (
|
|
102
|
+
<StaticInput
|
|
103
|
+
label={intl.formatMessage(messages.relationLabel)}
|
|
104
|
+
value={intl.formatMessage(relationMessages[answer.relationToPEP], {
|
|
105
|
+
entityType,
|
|
106
|
+
name: answer.ownerName,
|
|
107
|
+
})}
|
|
108
|
+
/>
|
|
109
|
+
)}
|
|
110
|
+
{answer.businessRelation && (
|
|
111
|
+
<StaticInput
|
|
112
|
+
label={intl.formatMessage(messages.businessRelationLabel)}
|
|
113
|
+
value={intl.formatMessage(
|
|
114
|
+
businessRelationMessages[answer.businessRelation],
|
|
115
|
+
{ entityType, name: answer.ownerName }
|
|
116
|
+
)}
|
|
117
|
+
/>
|
|
118
|
+
)}
|
|
119
|
+
{answer.nameOfPEP && (
|
|
120
|
+
<StaticInput
|
|
121
|
+
label={intl.formatMessage(messages.nameOfPepLabel)}
|
|
122
|
+
value={answer.nameOfPEP}
|
|
123
|
+
/>
|
|
124
|
+
)}
|
|
125
|
+
{answer.birthdayOfPEP && (
|
|
126
|
+
<StaticInput
|
|
127
|
+
label={intl.formatMessage(messages.birthdayOfPEPLabel)}
|
|
128
|
+
value={answer.birthdayOfPEP}
|
|
129
|
+
/>
|
|
130
|
+
)}
|
|
131
|
+
{answer.ended ? (
|
|
132
|
+
<React.Fragment>
|
|
133
|
+
<StaticInput
|
|
134
|
+
label={intl.formatMessage(messages.statusLabel)}
|
|
135
|
+
value={intl.formatMessage(messages.statusEndedValue)}
|
|
136
|
+
/>
|
|
137
|
+
<StaticInput
|
|
138
|
+
label={intl.formatMessage(messages.endedLabel)}
|
|
139
|
+
value={answer.ended}
|
|
140
|
+
/>
|
|
141
|
+
</React.Fragment>
|
|
142
|
+
) : (
|
|
143
|
+
<StaticInput
|
|
144
|
+
label={intl.formatMessage(messages.statusLabel)}
|
|
145
|
+
value={intl.formatMessage(messages.statusOngoingValue)}
|
|
146
|
+
/>
|
|
147
|
+
)}
|
|
148
|
+
{answer.country && (
|
|
149
|
+
<StaticInput
|
|
150
|
+
label={intl.formatMessage(messages.countryLabel)}
|
|
151
|
+
value={intl.formatDisplayName(answer.country, { type: "region" })}
|
|
152
|
+
/>
|
|
153
|
+
)}
|
|
154
|
+
{role && (
|
|
155
|
+
<StaticInput
|
|
156
|
+
label={intl.formatMessage(messages.roleLabel)}
|
|
157
|
+
value={role.text}
|
|
158
|
+
/>
|
|
159
|
+
)}
|
|
160
|
+
{answer.ambassadorCountry && (
|
|
161
|
+
<StaticInput
|
|
162
|
+
label={intl.formatMessage(messages.ambassadorCountryLabel)}
|
|
163
|
+
value={intl.formatDisplayName(answer.ambassadorCountry, {
|
|
164
|
+
type: "region",
|
|
165
|
+
})}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
168
|
+
{answer.governmentCompany && (
|
|
169
|
+
<StaticInput
|
|
170
|
+
label={intl.formatMessage(messages.governmentCompanyNameLabel)}
|
|
171
|
+
value={answer.governmentCompany}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
{answer.governmentCompanyRole && (
|
|
175
|
+
<StaticInput
|
|
176
|
+
label={intl.formatMessage(messages.governmentCompanyRoleLabel)}
|
|
177
|
+
value={answer.governmentCompanyRole}
|
|
178
|
+
/>
|
|
179
|
+
)}
|
|
180
|
+
{answer.internationalOrganisation && (
|
|
181
|
+
<StaticInput
|
|
182
|
+
label={intl.formatMessage(
|
|
183
|
+
messages.internationalOrganisationNameLabel
|
|
184
|
+
)}
|
|
185
|
+
value={answer.internationalOrganisation}
|
|
186
|
+
/>
|
|
187
|
+
)}
|
|
188
|
+
{answer.internationalOrganisationRole && (
|
|
189
|
+
<StaticInput
|
|
190
|
+
label={intl.formatMessage(
|
|
191
|
+
messages.internationalOrganisationRoleLabel
|
|
192
|
+
)}
|
|
193
|
+
value={answer.internationalOrganisationRole}
|
|
194
|
+
/>
|
|
195
|
+
)}
|
|
196
|
+
{militaryRank && (
|
|
197
|
+
<StaticInput
|
|
198
|
+
label={intl.formatMessage(messages.militaryGradeLabel)}
|
|
199
|
+
value={militaryRank.text}
|
|
200
|
+
/>
|
|
201
|
+
)}
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
interface StaticInputProps {
|
|
207
|
+
label: string;
|
|
208
|
+
value: string | React.ReactNode;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const StaticInput: FunctionComponent<StaticInputProps> = ({ label, value }) => {
|
|
212
|
+
return (
|
|
213
|
+
<div className="static-input">
|
|
214
|
+
<div className="label">{label}</div>
|
|
215
|
+
<div className="value">{value}</div>
|
|
216
|
+
</div>
|
|
217
|
+
);
|
|
218
|
+
};
|