@lysaab/lysa-pep 0.17.2 → 0.17.3

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.
@@ -1,17 +1,16 @@
1
- import React, { useContext } from "react";
1
+ import React from "react";
2
2
  import "./PepAnswers.scss";
3
3
  import { countries } from "../model/Countries";
4
4
  import { LABELS } from "../model/PepTexts";
5
5
  import { roleAlternatives, militaryAlternatives } from "../pages/PepRolePage";
6
- import { EntityType, PepType, PepContext } from "../pages/PepContext";
6
+ import { EntityType, PepType } from "../pages/PepContext";
7
7
  export const PepAnswers = ({ answer }) => {
8
- const pepContext = useContext(PepContext);
9
8
  if (!answer.type || answer.type === PepType.NOT_PEP) {
10
9
  return React.createElement("div", null,
11
10
  React.createElement("p", null, "Personen \u00E4r inte PEP"));
12
11
  }
13
- const entityType = pepContext.state.legalEntityType || EntityType.PERSON;
14
- const labels = LABELS(pepContext.state.ownerName);
12
+ const entityType = answer.legalEntityType || EntityType.PERSON;
13
+ const labels = LABELS(answer.ownerName);
15
14
  const country = countries.find(country => country.value === answer.country);
16
15
  const role = roleAlternatives.find(alt => alt.value === answer.role);
17
16
  const militaryRank = militaryAlternatives.find(alt => alt.value === answer.militaryRank);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lysaab/lysa-pep",
3
3
  "author": "Lysa AB",
4
- "version": "0.17.2",
4
+ "version": "0.17.3",
5
5
  "main": "./lib/Exports.js",
6
6
  "dependencies": {
7
7
  "@types/luxon": "^1.15.2",
@@ -4,21 +4,19 @@ import { PepRequest } from "../model/PepModel";
4
4
  import { countries } from "../model/Countries";
5
5
  import { LABELS } from "../model/PepTexts";
6
6
  import { roleAlternatives, militaryAlternatives } from "../pages/PepRolePage";
7
- import { EntityType, PepType, PepContext } from "../pages/PepContext";
7
+ import { EntityType, PepType } from "../pages/PepContext";
8
8
 
9
9
  interface Props {
10
10
  answer: PepRequest;
11
11
  }
12
12
 
13
13
  export const PepAnswers: FunctionComponent<Props> = ({ answer }) => {
14
- const pepContext = useContext(PepContext);
15
-
16
14
  if (!answer.type || answer.type === PepType.NOT_PEP) {
17
15
  return <div><p>Personen är inte PEP</p></div>;
18
16
  }
19
17
 
20
- const entityType = pepContext.state.legalEntityType || EntityType.PERSON;
21
- const labels = LABELS(pepContext.state.ownerName);
18
+ const entityType = answer.legalEntityType || EntityType.PERSON;
19
+ const labels = LABELS(answer.ownerName);
22
20
  const country = countries.find(country => country.value === answer.country);
23
21
  const role = roleAlternatives.find(alt => alt.value === answer.role);
24
22
  const militaryRank = militaryAlternatives.find(