@addsign/moje-agenda-shared-lib 0.0.52 → 0.0.53
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.
|
@@ -9,6 +9,7 @@ import SectionTitle from "../layout/SectionTitle.js";
|
|
|
9
9
|
import "../../contexts/FederationContext.js";
|
|
10
10
|
import { useFederationContext } from "../../contexts/useFederationContext.js";
|
|
11
11
|
import { getFullName } from "../../utils/getFullName.js";
|
|
12
|
+
import { handleErrors } from "../../utils/handleErrors.js";
|
|
12
13
|
import { G as GenIcon } from "../../iconBase-BY_L6Cb_.js";
|
|
13
14
|
function CiEdit(props) {
|
|
14
15
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "g", "attr": { "id": "Edit" }, "child": [{ "tag": "g", "attr": {}, "child": [{ "tag": "path", "attr": { "d": "M3.548,20.938h16.9a.5.5,0,0,0,0-1H3.548a.5.5,0,0,0,0,1Z" }, "child": [] }, { "tag": "path", "attr": { "d": "M9.71,17.18a2.587,2.587,0,0,0,1.12-.65l9.54-9.54a1.75,1.75,0,0,0,0-2.47l-.94-.93a1.788,1.788,0,0,0-2.47,0L7.42,13.12a2.473,2.473,0,0,0-.64,1.12L6.04,17a.737.737,0,0,0,.19.72.767.767,0,0,0,.53.22Zm.41-1.36a1.468,1.468,0,0,1-.67.39l-.97.26-1-1,.26-.97a1.521,1.521,0,0,1,.39-.67l.38-.37,1.99,1.99Zm1.09-1.08L9.22,12.75l6.73-6.73,1.99,1.99Zm8.45-8.45L18.65,7.3,16.66,5.31l1.01-1.02a.748.748,0,0,1,1.06,0l.93.94A.754.754,0,0,1,19.66,6.29Z" }, "child": [] }] }] }] })(props);
|
|
@@ -21,13 +22,13 @@ function PositionsSelectorSingle({
|
|
|
21
22
|
disabled,
|
|
22
23
|
initDepartmentId
|
|
23
24
|
}) {
|
|
24
|
-
var _a;
|
|
25
25
|
const [isModalOpen, setModalOpen] = useState(false);
|
|
26
26
|
const [department, setDepartment] = useState("");
|
|
27
27
|
const [positions, setPositions] = useState([]);
|
|
28
28
|
const [selectedPositionEmployee, setSelectedPositionEmployee] = useState();
|
|
29
29
|
const [storedPositionEmployee, setStoredPositionEmployee] = useState();
|
|
30
|
-
const
|
|
30
|
+
const federationContext = useFederationContext();
|
|
31
|
+
const apiClient = federationContext == null ? void 0 : federationContext.apiClient;
|
|
31
32
|
useEffect(() => {
|
|
32
33
|
const handleKeyDown = (event) => {
|
|
33
34
|
if (event.key === "Escape") {
|
|
@@ -57,13 +58,6 @@ function PositionsSelectorSingle({
|
|
|
57
58
|
setModalOpen(false);
|
|
58
59
|
};
|
|
59
60
|
const handleSelectedPositionEmployee = (position) => {
|
|
60
|
-
console.log(
|
|
61
|
-
"%csrcsharedPositionsSelectorSingle.tsx:54 position",
|
|
62
|
-
"color: #007acc;",
|
|
63
|
-
position,
|
|
64
|
-
selectedPositionEmployee,
|
|
65
|
-
position.id == (selectedPositionEmployee == null ? void 0 : selectedPositionEmployee.id)
|
|
66
|
-
);
|
|
67
61
|
if (!selectedPositionEmployee || position.id !== (selectedPositionEmployee == null ? void 0 : selectedPositionEmployee.id)) {
|
|
68
62
|
setSelectedPositionEmployee(position);
|
|
69
63
|
} else {
|
|
@@ -71,7 +65,6 @@ function PositionsSelectorSingle({
|
|
|
71
65
|
}
|
|
72
66
|
};
|
|
73
67
|
const handleDepartmentChange = (e) => {
|
|
74
|
-
console.log("%csrcsharedTransferListModal.tsx:109 e", "color: #007acc;", e);
|
|
75
68
|
setDepartment(e);
|
|
76
69
|
};
|
|
77
70
|
useEffect(() => {
|
|
@@ -79,13 +72,14 @@ function PositionsSelectorSingle({
|
|
|
79
72
|
apiClient.get(
|
|
80
73
|
"os/positions/employees?maxResults=1000&departmentId=" + department
|
|
81
74
|
).then((response) => {
|
|
82
|
-
var
|
|
83
|
-
setPositions((
|
|
75
|
+
var _a;
|
|
76
|
+
setPositions((_a = response.data) == null ? void 0 : _a.content);
|
|
84
77
|
}).catch((error) => {
|
|
85
78
|
console.error(
|
|
86
79
|
"There was an error fetching positions/employees",
|
|
87
80
|
error
|
|
88
81
|
);
|
|
82
|
+
handleErrors(error, federationContext.emitter);
|
|
89
83
|
});
|
|
90
84
|
}
|
|
91
85
|
}, [apiClient, department, isModalOpen]);
|
|
@@ -156,7 +150,7 @@ function PositionsSelectorSingle({
|
|
|
156
150
|
showId: true
|
|
157
151
|
}
|
|
158
152
|
) }),
|
|
159
|
-
/* @__PURE__ */ jsx("div", { className: "col-span-12 h-[400px]", children: /* @__PURE__ */ jsxs("div", { className: "pt-4 w-full ", children: [
|
|
153
|
+
/* @__PURE__ */ jsx("div", { className: "col-span-12 h-[400px] overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "pt-4 w-full ", children: [
|
|
160
154
|
/* @__PURE__ */ jsx("div", { className: "text-slate-700 text-sm leading-tight font-medium my-4", children: "Nalezené pozice:" }),
|
|
161
155
|
positions.map((position) => /* @__PURE__ */ jsx(
|
|
162
156
|
"div",
|