@lysaab/lysa-pep 0.12.0 → 0.13.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/lib/Exports.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export * from "./pages/PepContext";
2
- export * from './model/PepModel';
3
- export * from './model/PepTexts';
4
- export { PepIsPepPage } from './pages/PepIsPepPage';
5
- export { PepRelationPage } from './pages/PepRelationPage';
6
- export { PepRolePage, militaryAlternatives, roleAlternatives } from './pages/PepRolePage';
7
- export { PepStatusPage } from './pages/PepStatusPage';
2
+ export * from "./model/PepModel";
3
+ export * from "./model/PepTexts";
4
+ export { PepIsPepPage } from "./pages/PepIsPepPage";
5
+ export { PepRelationPage } from "./pages/PepRelationPage";
6
+ export { PepRolePage, militaryAlternatives, roleAlternatives } from "./pages/PepRolePage";
7
+ export { PepStatusPage } from "./pages/PepStatusPage";
8
+ export { PepAnswers } from "./components/PepAnswers";
package/lib/Exports.js CHANGED
@@ -1,7 +1,8 @@
1
1
  export * from "./pages/PepContext";
2
- export * from './model/PepModel';
3
- export * from './model/PepTexts';
4
- export { PepIsPepPage } from './pages/PepIsPepPage';
5
- export { PepRelationPage } from './pages/PepRelationPage';
6
- export { PepRolePage, militaryAlternatives, roleAlternatives } from './pages/PepRolePage';
7
- export { PepStatusPage } from './pages/PepStatusPage';
2
+ export * from "./model/PepModel";
3
+ export * from "./model/PepTexts";
4
+ export { PepIsPepPage } from "./pages/PepIsPepPage";
5
+ export { PepRelationPage } from "./pages/PepRelationPage";
6
+ export { PepRolePage, militaryAlternatives, roleAlternatives } from "./pages/PepRolePage";
7
+ export { PepStatusPage } from "./pages/PepStatusPage";
8
+ export { PepAnswers } from "./components/PepAnswers";
@@ -0,0 +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 {};
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import "./PepAnswers.scss";
3
+ import { countries } from "../model/Countries";
4
+ import { LABELS } from "../model/PepTexts";
5
+ import { roleAlternatives, militaryAlternatives } from "../pages/PepRolePage";
6
+ import { EntityType, PepType } from "../pages/PepContext";
7
+ export const PepAnswers = ({ answer }) => {
8
+ if (!answer.type || answer.type === PepType.NOT_PEP) {
9
+ return React.createElement("div", null, "Inte PEP");
10
+ }
11
+ const labels = LABELS("");
12
+ const country = countries.find(country => country.value === answer.country);
13
+ const role = roleAlternatives.find(alt => alt.value === answer.role);
14
+ const militaryRank = militaryAlternatives.find(alt => alt.value === answer.militaryRank);
15
+ return (React.createElement("div", null,
16
+ answer.type && (React.createElement(StaticInput, { label: "Vem \u00E4r pep", value: labels[EntityType.PERSON].GENERIC.IS_PEP[answer.type] })),
17
+ answer.relationToPEP && (React.createElement(StaticInput, { label: "Relation", value: labels[EntityType.PERSON][PepType.RELATIVE].RELATION[answer.relationToPEP] })),
18
+ answer.businessRelation && (React.createElement(StaticInput, { label: "Relation", value: labels[EntityType.PERSON][PepType.COLLEAGUE].BUSINESS_RELATION[answer.businessRelation] })),
19
+ answer.nameOfPEP && (React.createElement(StaticInput, { label: "Namn p\u00E5 personen", value: answer.nameOfPEP })),
20
+ answer.birthdayOfPEP && (React.createElement(StaticInput, { label: "F\u00F6delsedag f\u00F6r personen", value: answer.birthdayOfPEP })),
21
+ answer.ended ? (React.createElement(React.Fragment, null,
22
+ React.createElement(StaticInput, { label: "Status", value: "Avslutad" }),
23
+ React.createElement(StaticInput, { label: "Avslutades", value: answer.ended }))) : (React.createElement(StaticInput, { label: "Status", value: "P\u00E5g\u00E5ende" })),
24
+ answer.birthdayOfPEP && (React.createElement(StaticInput, { label: "Roll", value: answer.birthdayOfPEP })),
25
+ answer.country && (React.createElement(StaticInput, { label: "Land", value: country ? country.label : answer.country })),
26
+ role && React.createElement(StaticInput, { label: "Roll", value: role.text }),
27
+ answer.ambassadorCountry && (React.createElement(StaticInput, { label: "Ambassad\u00F6rsland", value: answer.ambassadorCountry })),
28
+ answer.governmentCompany && (React.createElement(StaticInput, { label: "F\u00F6retagets namn", value: answer.governmentCompany })),
29
+ answer.governmentCompanyRole && (React.createElement(StaticInput, { label: "Roll p\u00E5 f\u00F6retaget", value: answer.governmentCompanyRole })),
30
+ answer.internationalOrganisation && (React.createElement(StaticInput, { label: "Organisationens namn", value: answer.internationalOrganisation })),
31
+ answer.internationalOrganisationRole && (React.createElement(StaticInput, { label: "Roll i organisationen", value: answer.internationalOrganisationRole })),
32
+ militaryRank && (React.createElement(StaticInput, { label: "Milit\u00E4r grad", value: militaryRank.value }))));
33
+ };
34
+ const StaticInput = ({ label, value }) => {
35
+ return (React.createElement("div", { className: "static-input" },
36
+ React.createElement("div", { className: "label" }, label),
37
+ React.createElement("div", { className: "value" }, value)));
38
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lysaab/lysa-pep",
3
3
  "author": "Lysa AB",
4
- "version": "0.12.0",
4
+ "version": "0.13.0",
5
5
  "main": "./lib/Exports.js",
6
6
  "dependencies": {
7
7
  "@lysaab/ui-2": "^8.7.0",
package/src/Exports.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  export * from "./pages/PepContext";
2
- export * from './model/PepModel';
3
- export * from './model/PepTexts';
2
+ export * from "./model/PepModel";
3
+ export * from "./model/PepTexts";
4
4
 
5
- export { PepIsPepPage } from './pages/PepIsPepPage';
6
- export { PepRelationPage } from './pages/PepRelationPage';
7
- export { PepRolePage, militaryAlternatives, roleAlternatives } from './pages/PepRolePage';
8
- export { PepStatusPage } from './pages/PepStatusPage';
5
+ export { PepIsPepPage } from "./pages/PepIsPepPage";
6
+ export { PepRelationPage } from "./pages/PepRelationPage";
7
+ export {
8
+ PepRolePage,
9
+ militaryAlternatives,
10
+ roleAlternatives
11
+ } from "./pages/PepRolePage";
12
+ export { PepStatusPage } from "./pages/PepStatusPage";
13
+
14
+ export { PepAnswers } from "./components/PepAnswers";