@voplus/morpho-csp 6.0.96 → 6.0.98
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,22 +1,24 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Divider, Select } from "antd";
|
|
3
3
|
import { useCLDAForm, useCLDAFormStore } from "../../../../../data/clda-form";
|
|
4
4
|
import { faUserTag } from "@fortawesome/pro-light-svg-icons";
|
|
5
5
|
import { observe } from "@voplus/morpho-ui";
|
|
6
6
|
import { useIncorporationFormContext } from "../../incorporation/context";
|
|
7
7
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
8
|
-
import
|
|
9
|
-
import UnitReference from "@voplus/morpho-org/es/controls/UnitReference";
|
|
8
|
+
import FolderEdit from "@voplus/morpho-document/es/controls/FolderEdit";
|
|
10
9
|
import Section from "../../../controls/Section";
|
|
11
10
|
import Tips from "../../../controls/Tips/Tip";
|
|
11
|
+
import classnames from "classnames";
|
|
12
|
+
import styles from "@voplus/morpho-org/es/controls/UnitReference/index.less";
|
|
12
13
|
const DataProtectionOfficer = (props) => {
|
|
13
|
-
|
|
14
|
-
const [showDialog, setShowDialog] = useState(false);
|
|
14
|
+
var _a;
|
|
15
15
|
const store = useCLDAFormStore();
|
|
16
16
|
const context = useIncorporationFormContext();
|
|
17
17
|
const incorporation = useCLDAForm(props.id);
|
|
18
|
+
const [showEditIcon, setShowEditIcon] = useState((_a = context.editable) !== null && _a !== void 0 ? _a : true);
|
|
19
|
+
const [editable, setEditable] = useState(false);
|
|
18
20
|
return observe(() => {
|
|
19
|
-
var _a, _b;
|
|
21
|
+
var _a, _b, _c, _d;
|
|
20
22
|
return (React.createElement(Section, { title: React.createElement(React.Fragment, null,
|
|
21
23
|
React.createElement(FontAwesomeIcon, { icon: faUserTag }),
|
|
22
24
|
"Data Protection Officer",
|
|
@@ -32,18 +34,36 @@ const DataProtectionOfficer = (props) => {
|
|
|
32
34
|
React.createElement("div", { className: "internal-use-section secretary-list" },
|
|
33
35
|
React.createElement("div", { className: "sub-title" }, "DPO"),
|
|
34
36
|
React.createElement(Divider, { style: { margin: "10px 0" } }),
|
|
35
|
-
React.createElement("
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
React.createElement(FolderEdit, { showEditIcon: showEditIcon, onEditIconClick: onEditWorkType }, editable ? (React.createElement(Select, { showSearch: true, allowClear: true, style: { width: "280px" }, placeholder: "select a contact", optionFilterProp: "label", value: (_a = incorporation.content) === null || _a === void 0 ? void 0 : _a.dpo, onChange: onSave, popupClassName: "director-select-contact", options: ((_c = (_b = incorporation.content) === null || _b === void 0 ? void 0 : _b.contacts) !== null && _c !== void 0 ? _c : []).map((item) => {
|
|
38
|
+
return {
|
|
39
|
+
value: item.id,
|
|
40
|
+
label: item.name,
|
|
41
|
+
};
|
|
42
|
+
}) })) : ((_d = incorporation.content) === null || _d === void 0 ? void 0 : _d.dpo) ? (React.createElement("div", { className: classnames(styles["unit-reference-node"], { symbol: true }) }, `@ ${findSelectedDPO(incorporation.content.dpo).name}`)) : (React.createElement("div", { style: { minHeight: "26px" } },
|
|
43
|
+
React.createElement("span", { className: "add-info-style" }, "Select Contact")))))));
|
|
38
44
|
});
|
|
39
|
-
function
|
|
40
|
-
|
|
45
|
+
function onEditWorkType() {
|
|
46
|
+
setEditable(true);
|
|
47
|
+
setShowEditIcon(false);
|
|
48
|
+
}
|
|
49
|
+
function onBulurWorkType() {
|
|
50
|
+
setShowEditIcon(true);
|
|
51
|
+
setEditable(false);
|
|
52
|
+
}
|
|
53
|
+
function findSelectedDPO(id) {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
let selectedDPO = [];
|
|
56
|
+
(_b = (_a = incorporation.content) === null || _a === void 0 ? void 0 : _a.contacts) === null || _b === void 0 ? void 0 : _b.map((c) => {
|
|
57
|
+
if (c.id === id) {
|
|
58
|
+
selectedDPO.push(c);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return selectedDPO[0];
|
|
41
62
|
}
|
|
42
|
-
async function onSave(
|
|
43
|
-
var _a;
|
|
63
|
+
async function onSave(contactId) {
|
|
44
64
|
await store
|
|
45
|
-
.edit(id, { data: { DPO:
|
|
46
|
-
.then(() =>
|
|
65
|
+
.edit(props.id, { data: { DPO: contactId || "" }, error: "message" })
|
|
66
|
+
.then(() => onBulurWorkType());
|
|
47
67
|
}
|
|
48
68
|
};
|
|
49
69
|
export default DataProtectionOfficer;
|
package/es/modules/self-registration/clda-form/components/DataProtectionOfficer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/self-registration/clda-form/components/DataProtectionOfficer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/self-registration/clda-form/components/DataProtectionOfficer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,UAAU,MAAM,gDAAgD,CAAC;AACxE,OAAO,OAAO,MAAM,2BAA2B,CAAC;AAChD,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAC9C,OAAO,UAAU,MAAM,YAAY,CAAC;AACp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