@addsign/moje-agenda-shared-lib 0.0.63 → 0.0.64
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/dist/components/datatable/DataTableServer.js +28 -23
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +1 -1
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
- package/dist/components/form/FileInput.js +6 -1
- package/dist/components/form/FileInput.js.map +1 -1
- package/dist/components/form/PositionsSelectorSingle.js +2 -2
- package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
- package/dist/components/profiles/ProfileOverview.js +2 -2
- package/dist/components/profiles/ProfileOverview.js.map +1 -1
- package/dist/main.d.ts +2 -2
- package/dist/main.js +21 -20
- package/dist/types.d.ts +11 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/getFullName.d.ts +7 -4
- package/dist/utils/getFullName.js +50 -5
- package/dist/utils/getFullName.js.map +1 -1
- package/dist/utils/handleErrors.js +2 -2
- package/dist/utils/handleErrors.js.map +1 -1
- package/package.json +1 -1
- package/dist/utils/getFullNamePositionWithEmployee.d.ts +0 -5
- package/dist/utils/getFullNamePositionWithEmployee.js +0 -17
- package/dist/utils/getFullNamePositionWithEmployee.js.map +0 -1
|
@@ -65,7 +65,7 @@ function ProfileOverview({
|
|
|
65
65
|
isComplete: group.all && groupApprovers.length == groupApprovedSteps.length || !group.all && groupApprovedSteps.length > 0
|
|
66
66
|
};
|
|
67
67
|
});
|
|
68
|
-
}, [
|
|
68
|
+
}, [profileApprovers, steps]);
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
context.apiClient.get(
|
|
71
71
|
"/timeoff/approve-profile" + (employeeId ? "/" + employeeId : "")
|
|
@@ -79,7 +79,7 @@ function ProfileOverview({
|
|
|
79
79
|
);
|
|
80
80
|
console.error("Error submitting form:", error);
|
|
81
81
|
});
|
|
82
|
-
}, [employeeId]);
|
|
82
|
+
}, [employeeId, context.emitter, context.apiClient]);
|
|
83
83
|
const decisionsTranslations = (decision) => {
|
|
84
84
|
const translations = {
|
|
85
85
|
approved: "Schváleno",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileOverview.js","sources":["../../../lib/components/profiles/ProfileOverview.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\r\nimport SectionTitle from \"../layout/SectionTitle\";\r\nimport {\r\n EApproverRoles,\r\n IProfileApprover,\r\n IStep,\r\n getFullName,\r\n handleErrors,\r\n useFederationContext,\r\n} from \"../../main\";\r\nimport { AxiosResponse } from \"axios\";\r\nimport IconInCircle from \"../layout/IconInCircle\";\r\n\r\ninterface ProfileOverviewProps {\r\n employeeId?: number;\r\n onProfileApproversChange?: (data: IProfileApprover[]) => void;\r\n steps: IStep[];\r\n}\r\n\r\ninterface IApproverRoleGroup {\r\n name: string;\r\n roles: EApproverRoles[];\r\n all: boolean;\r\n parallel: boolean;\r\n stepType: number;\r\n}\r\n\r\nconst approverRoleGroups: IApproverRoleGroup[] = [\r\n {\r\n name: \"Předschvalovatelé\",\r\n roles: [EApproverRoles.predschvalovatel],\r\n all: true,\r\n parallel: true,\r\n stepType: 1,\r\n },\r\n {\r\n name: \"Schvalovatelé\",\r\n roles: [\r\n EApproverRoles.vedouci,\r\n EApproverRoles.zastupce,\r\n EApproverRoles.zastupce9,\r\n EApproverRoles.vyssiSchvalovatel,\r\n EApproverRoles.vyssiSchvalovatelZastupce,\r\n EApproverRoles.vyssiSchvalovatelZastupce9,\r\n ],\r\n all: false,\r\n parallel: true,\r\n stepType: 2,\r\n },\r\n {\r\n name: \"Docházkový vedoucí\",\r\n roles: [EApproverRoles.dochazkovyVedouci],\r\n all: true,\r\n parallel: false,\r\n stepType: 3,\r\n },\r\n];\r\n\r\nexport default function ProfileOverview({\r\n employeeId,\r\n onProfileApproversChange,\r\n steps,\r\n}: ProfileOverviewProps) {\r\n const [profileApprovers, setProfileApprovers] = useState<\r\n Array<IProfileApprover>\r\n >([]);\r\n const context = useFederationContext();\r\n\r\n const currentApprovers = useMemo(() => {\r\n return approverRoleGroups.map((group) => {\r\n const groupApprovers = profileApprovers.filter((approver) =>\r\n group.roles.includes(approver.role)\r\n );\r\n\r\n const groupApprovedSteps = steps.filter(\r\n (step) =>\r\n step.type == group.stepType &&\r\n groupApprovers.some(\r\n (approver) =>\r\n step.employee.employeeId == approver?.approver?.employeeId\r\n )\r\n );\r\n\r\n return {\r\n ...group,\r\n numberOfApprovers: groupApprovers.length,\r\n numberOfApprovedSteps: groupApprovedSteps.length,\r\n isComplete:\r\n (group.all && groupApprovers.length == groupApprovedSteps.length) ||\r\n (!group.all && groupApprovedSteps.length > 0),\r\n };\r\n });\r\n }, [approverRoleGroups, profileApprovers]);\r\n\r\n useEffect(() => {\r\n context.apiClient\r\n .get<IProfileApprover[]>(\r\n \"/timeoff/approve-profile\" + (employeeId ? \"/\" + employeeId : \"\")\r\n )\r\n .then((response: AxiosResponse) => {\r\n setProfileApprovers(response.data);\r\n })\r\n .catch((error) => {\r\n handleErrors(\r\n error,\r\n context.emitter,\r\n \"Nepodařilo se dohledat schvalovací profil pro uživatele \" +\r\n employeeId\r\n );\r\n console.error(\"Error submitting form:\", error);\r\n });\r\n }, [employeeId]);\r\n\r\n const decisionsTranslations = (decision: string): string | null => {\r\n const translations: { [key: string]: string } = {\r\n approved: \"Schváleno\",\r\n rejected: \"Zamítnuto\",\r\n cancelled: \"Stornováno\",\r\n evided: \"Zaevidováno\",\r\n };\r\n\r\n return translations[decision] || null;\r\n };\r\n // pri nacteni profileApprovers se muze dat vedet parent componente inbfo o aktualnich schvalovatelich\r\n useEffect(() => {\r\n if (onProfileApproversChange) onProfileApproversChange(profileApprovers);\r\n }, [profileApprovers, onProfileApproversChange]);\r\n\r\n const findStep = (\r\n steps: IStep[],\r\n group: IApproverRoleGroup,\r\n row: IProfileApprover\r\n ) => {\r\n return steps.find(\r\n (step) =>\r\n step.type == group.stepType &&\r\n step.employee.employeeId == row.position?.employee?.employeeId\r\n );\r\n };\r\n\r\n return (\r\n <>\r\n <SectionTitle>Postup schvalování</SectionTitle>\r\n <div className=\"flex gap-4\">\r\n {currentApprovers.map((group, index) => (\r\n <div\r\n key={group.name}\r\n className={\r\n \"w-full xl:w-1/3 rounded-lg shadow-xl p-5 border gap-4 flex flex-col \"\r\n }\r\n >\r\n <div className=\"flex justify-between\">\r\n <h3 className=\"text-xl font-bold\">\r\n {group.name} - {index}\r\n </h3>\r\n\r\n <IconInCircle\r\n isComplete={group.isComplete}\r\n title={\r\n group.numberOfApprovedSteps + \" / \" + group.numberOfApprovers\r\n }\r\n isPending={!group.isComplete}\r\n ></IconInCircle>\r\n </div>\r\n {profileApprovers\r\n .filter((it) => group.roles.includes(it.role))\r\n .map((row, index) => (\r\n <div\r\n key={index}\r\n className=\" border rounded-lg p-4 flex justify-between gap-5\"\r\n >\r\n <div>\r\n <h3 className=\"\">\r\n {getFullName(row.position?.employee, true)}\r\n </h3>\r\n <p className=\"text-sm \">{row.roleTxt}</p>\r\n {findStep(steps, group, row) && (\r\n <>\r\n <p className=\"text-sm \"></p>{\" \"}\r\n {findStep(steps, group, row)?.decision && (\r\n <p className=\"text-sm \">\r\n {decisionsTranslations(\r\n findStep(steps, group, row)?.decision || \"\"\r\n )}{\" \"}\r\n (\r\n {new Date(\r\n findStep(steps, group, row)?.date || 0\r\n ).toLocaleString()}\r\n )\r\n </p>\r\n )}\r\n {findStep(steps, group, row)?.comment && (\r\n <p className=\"text-sm \">\r\n <b>Komentář</b>:{\" \"}\r\n {findStep(steps, group, row)?.comment}{\" \"}\r\n </p>\r\n )}\r\n </>\r\n )}\r\n </div>\r\n <IconInCircle\r\n isComplete={findStep(steps, group, row) != null}\r\n isPending={!group.isComplete}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n ))}\r\n </div>\r\n </>\r\n );\r\n}\r\n"],"names":["steps","index"],"mappings":";;;;;;;;;;AA2BA,MAAM,qBAA2C;AAAA,EAC/C;AAA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AA,GAEJ;AAAA,kBACA;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,YAAY,SAAS,OAAO,OAAO,GAAG,KAAK;AAAA,sBAC3C,WAAW,CAAC,MAAM;AAAA,oBAAA;AAAA,kBACpB;AAAA,gBAAA;AAAA,cAAA;AAAA,cAnCKA;AAAAA,YAAA;AAAA,WAqCR;AAAA,QAAA;AAAA,MAAA;AAAA,MA3DE,MAAM;AAAA,IA6Dd,CAAA,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ProfileOverview.js","sources":["../../../lib/components/profiles/ProfileOverview.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\r\nimport SectionTitle from \"../layout/SectionTitle\";\r\nimport {\r\n EApproverRoles,\r\n IProfileApprover,\r\n IStep,\r\n getFullName,\r\n handleErrors,\r\n useFederationContext,\r\n} from \"../../main\";\r\nimport { AxiosResponse } from \"axios\";\r\nimport IconInCircle from \"../layout/IconInCircle\";\r\n\r\ninterface ProfileOverviewProps {\r\n employeeId?: number;\r\n onProfileApproversChange?: (data: IProfileApprover[]) => void;\r\n steps: IStep[];\r\n}\r\n\r\ninterface IApproverRoleGroup {\r\n name: string;\r\n roles: EApproverRoles[];\r\n all: boolean;\r\n parallel: boolean;\r\n stepType: number;\r\n}\r\n\r\nconst approverRoleGroups: IApproverRoleGroup[] = [\r\n {\r\n name: \"Předschvalovatelé\",\r\n roles: [EApproverRoles.predschvalovatel],\r\n all: true,\r\n parallel: true,\r\n stepType: 1,\r\n },\r\n {\r\n name: \"Schvalovatelé\",\r\n roles: [\r\n EApproverRoles.vedouci,\r\n EApproverRoles.zastupce,\r\n EApproverRoles.zastupce9,\r\n EApproverRoles.vyssiSchvalovatel,\r\n EApproverRoles.vyssiSchvalovatelZastupce,\r\n EApproverRoles.vyssiSchvalovatelZastupce9,\r\n ],\r\n all: false,\r\n parallel: true,\r\n stepType: 2,\r\n },\r\n {\r\n name: \"Docházkový vedoucí\",\r\n roles: [EApproverRoles.dochazkovyVedouci],\r\n all: true,\r\n parallel: false,\r\n stepType: 3,\r\n },\r\n];\r\n\r\nexport default function ProfileOverview({\r\n employeeId,\r\n onProfileApproversChange,\r\n steps,\r\n}: ProfileOverviewProps) {\r\n const [profileApprovers, setProfileApprovers] = useState<\r\n Array<IProfileApprover>\r\n >([]);\r\n const context = useFederationContext();\r\n\r\n const currentApprovers = useMemo(() => {\r\n return approverRoleGroups.map((group) => {\r\n const groupApprovers = profileApprovers.filter((approver) =>\r\n group.roles.includes(approver.role)\r\n );\r\n\r\n const groupApprovedSteps = steps.filter(\r\n (step) =>\r\n step.type == group.stepType &&\r\n groupApprovers.some(\r\n (approver) =>\r\n step.employee.employeeId == approver?.approver?.employeeId\r\n )\r\n );\r\n\r\n return {\r\n ...group,\r\n numberOfApprovers: groupApprovers.length,\r\n numberOfApprovedSteps: groupApprovedSteps.length,\r\n isComplete:\r\n (group.all && groupApprovers.length == groupApprovedSteps.length) ||\r\n (!group.all && groupApprovedSteps.length > 0),\r\n };\r\n });\r\n }, [profileApprovers, steps]);\r\n\r\n useEffect(() => {\r\n context.apiClient\r\n .get<IProfileApprover[]>(\r\n \"/timeoff/approve-profile\" + (employeeId ? \"/\" + employeeId : \"\")\r\n )\r\n .then((response: AxiosResponse) => {\r\n setProfileApprovers(response.data);\r\n })\r\n .catch((error) => {\r\n handleErrors(\r\n error,\r\n context.emitter,\r\n \"Nepodařilo se dohledat schvalovací profil pro uživatele \" +\r\n employeeId\r\n );\r\n console.error(\"Error submitting form:\", error);\r\n });\r\n }, [employeeId, context.emitter, context.apiClient]);\r\n\r\n const decisionsTranslations = (decision: string): string | null => {\r\n const translations: { [key: string]: string } = {\r\n approved: \"Schváleno\",\r\n rejected: \"Zamítnuto\",\r\n cancelled: \"Stornováno\",\r\n evided: \"Zaevidováno\",\r\n };\r\n\r\n return translations[decision] || null;\r\n };\r\n // pri nacteni profileApprovers se muze dat vedet parent componente inbfo o aktualnich schvalovatelich\r\n useEffect(() => {\r\n if (onProfileApproversChange) onProfileApproversChange(profileApprovers);\r\n }, [profileApprovers, onProfileApproversChange]);\r\n\r\n const findStep = (\r\n steps: IStep[],\r\n group: IApproverRoleGroup,\r\n row: IProfileApprover\r\n ) => {\r\n return steps.find(\r\n (step) =>\r\n step.type == group.stepType &&\r\n step.employee.employeeId == row.position?.employee?.employeeId\r\n );\r\n };\r\n\r\n return (\r\n <>\r\n <SectionTitle>Postup schvalování</SectionTitle>\r\n <div className=\"flex gap-4\">\r\n {currentApprovers.map((group, index) => (\r\n <div\r\n key={group.name}\r\n className={\r\n \"w-full xl:w-1/3 rounded-lg shadow-xl p-5 border gap-4 flex flex-col \"\r\n }\r\n >\r\n <div className=\"flex justify-between\">\r\n <h3 className=\"text-xl font-bold\">\r\n {group.name} - {index}\r\n </h3>\r\n\r\n <IconInCircle\r\n isComplete={group.isComplete}\r\n title={\r\n group.numberOfApprovedSteps + \" / \" + group.numberOfApprovers\r\n }\r\n isPending={!group.isComplete}\r\n ></IconInCircle>\r\n </div>\r\n {profileApprovers\r\n .filter((it) => group.roles.includes(it.role))\r\n .map((row, index) => (\r\n <div\r\n key={index}\r\n className=\" border rounded-lg p-4 flex justify-between gap-5\"\r\n >\r\n <div>\r\n <h3 className=\"\">\r\n {getFullName(row.position?.employee, true)}\r\n </h3>\r\n <p className=\"text-sm \">{row.roleTxt}</p>\r\n {findStep(steps, group, row) && (\r\n <>\r\n <p className=\"text-sm \"></p>{\" \"}\r\n {findStep(steps, group, row)?.decision && (\r\n <p className=\"text-sm \">\r\n {decisionsTranslations(\r\n findStep(steps, group, row)?.decision || \"\"\r\n )}{\" \"}\r\n (\r\n {new Date(\r\n findStep(steps, group, row)?.date || 0\r\n ).toLocaleString()}\r\n )\r\n </p>\r\n )}\r\n {findStep(steps, group, row)?.comment && (\r\n <p className=\"text-sm \">\r\n <b>Komentář</b>:{\" \"}\r\n {findStep(steps, group, row)?.comment}{\" \"}\r\n </p>\r\n )}\r\n </>\r\n )}\r\n </div>\r\n <IconInCircle\r\n isComplete={findStep(steps, group, row) != null}\r\n isPending={!group.isComplete}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n ))}\r\n </div>\r\n </>\r\n );\r\n}\r\n"],"names":["steps","index"],"mappings":";;;;;;;;;;AA2BA,MAAM,qBAA2C;AAAA,EAC/C;AAAA,IACE,MAAM;AAAA,IACN,OAAO,CAAC,eAAe,gBAAgB;AAAA,IACvC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,eAAe;AAAA,MACf,eAAe;AAAA,MACf,eAAe;AAAA,MACf,eAAe;AAAA,MACf,eAAe;AAAA,MACf,eAAe;AAAA,IACjB;AAAA,IACA,KAAK;AAAA,IACL,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO,CAAC,eAAe,iBAAiB;AAAA,IACxC,KAAK;AAAA,IACL,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AACF;AAEA,SAAwB,gBAAgB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAE9C,CAAE,CAAA;AACJ,QAAM,UAAU;AAEV,QAAA,mBAAmB,QAAQ,MAAM;AAC9B,WAAA,mBAAmB,IAAI,CAAC,UAAU;AACvC,YAAM,iBAAiB,iBAAiB;AAAA,QAAO,CAAC,aAC9C,MAAM,MAAM,SAAS,SAAS,IAAI;AAAA,MAAA;AAGpC,YAAM,qBAAqB,MAAM;AAAA,QAC/B,CAAC,SACC,KAAK,QAAQ,MAAM,YACnB,eAAe;AAAA,UACb,CAAC,aACC;;AAAA,wBAAK,SAAS,gBAAc,0CAAU,aAAV,mBAAoB;AAAA;AAAA,QACpD;AAAA,MAAA;AAGG,aAAA;AAAA,QACL,GAAG;AAAA,QACH,mBAAmB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A1B,mBAA6B,YAC5B,qBAAC,KAAE,EAAA,WAAU,YACX,UAAA;AAAA,wBAAA,oBAAC,OAAE,UAAQ,WAAA,CAAA;AAAA,wBAAI;AAAA,wBAAE;AAAA,yBAChB,cAAS,OAAO,OAAO,GAAG,MAA1B,mBAA6B;AAAA,wBAAS;AAAA,sBAAA,GACzC;AAAA,oBAAA,GAEJ;AAAA,kBAAA,GAEJ;AAAA,kBACA;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,YAAY,SAAS,OAAO,OAAO,GAAG,KAAK;AAAA,sBAC3C,WAAW,CAAC,MAAM;AAAA,oBAAA;AAAA,kBACpB;AAAA,gBAAA;AAAA,cAAA;AAAA,cAnCKA;AAAAA,YAAA;AAAA,WAqCR;AAAA,QAAA;AAAA,MAAA;AAAA,MA3DE,MAAM;AAAA,IA6Dd,CAAA,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
package/dist/main.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export { default as Button } from './components/Button.tsx';
|
|
3
3
|
export { default as AutocompleteSearchBar } from './components/form/AutocompleteSearchBar.tsx';
|
|
4
4
|
export { default as FormField } from './components/form/FormField.tsx';
|
|
5
|
+
export { default as SelectField } from './components/form/SelectField.tsx';
|
|
5
6
|
export { default as FileInput } from './components/form/FileInput.tsx';
|
|
6
7
|
export { default as SectionTitle } from './components/layout/SectionTitle.tsx';
|
|
7
8
|
export { default as PageTitle } from './components/layout/PageTitle.tsx';
|
|
@@ -15,8 +16,7 @@ export { default as ProfileOverview } from './components/profiles/ProfileOvervie
|
|
|
15
16
|
export * from './components/datatable/types.ts';
|
|
16
17
|
export * from './contexts/FederationContext.tsx';
|
|
17
18
|
export * from './contexts/useFederationContext.ts';
|
|
18
|
-
export * from './utils/getFullName.
|
|
19
|
-
export * from './utils/getFullNamePositionWithEmployee.ts';
|
|
19
|
+
export * from './utils/getFullName.tsx';
|
|
20
20
|
export * from './utils/getIntersectingDays.ts';
|
|
21
21
|
export * from './utils/handleErrors.ts';
|
|
22
22
|
export * from './types.ts';
|
package/dist/main.js
CHANGED
|
@@ -2,42 +2,43 @@ import './assets/tailwind.css';/* empty css */
|
|
|
2
2
|
import { default as default2 } from "./components/Button.js";
|
|
3
3
|
import { default as default3 } from "./components/form/AutocompleteSearchBar.js";
|
|
4
4
|
import { default as default4 } from "./components/form/FormField.js";
|
|
5
|
-
import { default as default5 } from "./components/form/
|
|
6
|
-
import { default as default6 } from "./components/
|
|
7
|
-
import { default as default7 } from "./components/layout/
|
|
8
|
-
import { default as default8 } from "./components/
|
|
5
|
+
import { default as default5 } from "./components/form/SelectField.js";
|
|
6
|
+
import { default as default6 } from "./components/form/FileInput.js";
|
|
7
|
+
import { default as default7 } from "./components/layout/SectionTitle.js";
|
|
8
|
+
import { default as default8 } from "./components/layout/PageTitle.js";
|
|
9
|
+
import { default as default9 } from "./components/Spinner.js";
|
|
9
10
|
import { ConfirmationModalDialog } from "./components/ConfirmationModalDialog.js";
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
11
|
+
import { default as default10 } from "./components/form/PositionsSelectorSingle.js";
|
|
12
|
+
import { default as default11 } from "./components/Calendar.js";
|
|
13
|
+
import { default as default12 } from "./components/datatable/DataTable.js";
|
|
14
|
+
import { default as default13 } from "./components/datatable/DataTableServer.js";
|
|
15
|
+
import { default as default14 } from "./components/profiles/ProfileOverview.js";
|
|
15
16
|
import { FederationContext, FederationContextProvider } from "./contexts/FederationContext.js";
|
|
16
17
|
import { useFederationContext } from "./contexts/useFederationContext.js";
|
|
17
|
-
import { getFullName, getFullNameList } from "./utils/getFullName.js";
|
|
18
|
-
import { getFullNameListPositionWithEmployee, getFullNamePositionWithEmployee } from "./utils/getFullNamePositionWithEmployee.js";
|
|
18
|
+
import { getFullName, getFullNameList, getFullNameListPositionWithEmployee, getFullNamePositionWithEmployee } from "./utils/getFullName.js";
|
|
19
19
|
import { getIntersectingDays } from "./utils/getIntersectingDays.js";
|
|
20
20
|
import { handleErrors } from "./utils/handleErrors.js";
|
|
21
21
|
import { EApproverRoles, EApproverTypes, EDecisionsTranslations } from "./types.js";
|
|
22
22
|
export {
|
|
23
23
|
default3 as AutocompleteSearchBar,
|
|
24
24
|
default2 as Button,
|
|
25
|
-
|
|
25
|
+
default11 as Calendar,
|
|
26
26
|
ConfirmationModalDialog,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
default12 as DataTable,
|
|
28
|
+
default13 as DataTableServer,
|
|
29
29
|
EApproverRoles,
|
|
30
30
|
EApproverTypes,
|
|
31
31
|
EDecisionsTranslations,
|
|
32
32
|
FederationContext,
|
|
33
33
|
FederationContextProvider,
|
|
34
|
-
|
|
34
|
+
default6 as FileInput,
|
|
35
35
|
default4 as FormField,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
default8 as PageTitle,
|
|
37
|
+
default10 as PositionsSelectorSingle,
|
|
38
|
+
default14 as ProfileOverview,
|
|
39
|
+
default7 as SectionTitle,
|
|
40
|
+
default5 as SelectField,
|
|
41
|
+
default9 as Spinner,
|
|
41
42
|
getFullName,
|
|
42
43
|
getFullNameList,
|
|
43
44
|
getFullNameListPositionWithEmployee,
|
package/dist/types.d.ts
CHANGED
|
@@ -18,7 +18,17 @@ export interface IUserInfo {
|
|
|
18
18
|
userId: string;
|
|
19
19
|
}
|
|
20
20
|
export interface IEmployee extends IUserInfo {
|
|
21
|
-
|
|
21
|
+
deleted: boolean;
|
|
22
|
+
hasComputer: string;
|
|
23
|
+
language: string;
|
|
24
|
+
manager: string;
|
|
25
|
+
parentFrId: number;
|
|
26
|
+
positionId: number;
|
|
27
|
+
validFrom: string;
|
|
28
|
+
validTo: string;
|
|
29
|
+
contractType: number;
|
|
30
|
+
exemption: number;
|
|
31
|
+
activatedOn: string;
|
|
22
32
|
}
|
|
23
33
|
export type IAuthApps = string[];
|
|
24
34
|
export interface IEventMessage {
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../lib/types.ts"],"sourcesContent":["import { AxiosInstance } from \"axios\";\r\nimport { Emitter } from \"mitt\";\r\n\r\n\r\nimport { UseFormReturn } from \"react-hook-form\";\r\n\r\nexport interface IUserInfo {\r\n contractGroup: number;\r\n degreeAfter: string;\r\n degreeBefore: string;\r\n departmentId: string;\r\n departmentName: string;\r\n departmentNameLong: string;\r\n email: string;\r\n employeeId: number;\r\n firstName: string;\r\n lastName: string;\r\n positionName: string;\r\n positionNumber: string;\r\n userId: string;\r\n}\r\nexport interface IEmployee extends IUserInfo {\r\n
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../lib/types.ts"],"sourcesContent":["import { AxiosInstance } from \"axios\";\r\nimport { Emitter } from \"mitt\";\r\n\r\n\r\nimport { UseFormReturn } from \"react-hook-form\";\r\n\r\nexport interface IUserInfo {\r\n contractGroup: number;\r\n degreeAfter: string;\r\n degreeBefore: string;\r\n departmentId: string;\r\n departmentName: string;\r\n departmentNameLong: string;\r\n email: string;\r\n employeeId: number;\r\n firstName: string;\r\n lastName: string;\r\n positionName: string;\r\n positionNumber: string;\r\n userId: string;\r\n}\r\nexport interface IEmployee extends IUserInfo {\r\n\r\n deleted: boolean\r\n hasComputer: string\r\n language: string\r\n manager: string\r\n parentFrId: number\r\n positionId: number\r\n validFrom: string\r\n validTo: string\r\n contractType: number\r\n exemption: number\r\n activatedOn: string\r\n}\r\n\r\nexport type IAuthApps = string[];\r\n\r\nexport interface IEventMessage {\r\n title?: string;\r\n message?: string;\r\n timeout?: number;\r\n classes?: string;\r\n}\r\n\r\nexport type Events = {\r\n message?: IEventMessage;\r\n loading?: boolean;\r\n};\r\n\r\nexport interface IContextValue {\r\n userInfo: IUserInfo;\r\n apiClient: AxiosInstance;\r\n authApps: IAuthApps;\r\n emitter: Emitter<Events>;\r\n}\r\nexport interface IOptionItem {\r\n value: string | number | null;\r\n label: string;\r\n description?: string;\r\n}\r\n\r\nexport type IFormProps = {\r\n formName: string;\r\n entityId: string;\r\n entityName: string;\r\n context: unknown;\r\n onSuccess: (path: string, message?: string) => void;\r\n};\r\n\r\nexport interface IPosition {\r\n id: number;\r\n departmentId: string;\r\n positionName: string;\r\n positionNumber: string;\r\n manager: string;\r\n virtual: boolean;\r\n title: string;\r\n}\r\nexport interface IPositionEmployee extends IPosition {\r\n employee: IEmployee;\r\n}\r\nexport interface IEmployeePosition extends IEmployee {\r\n position: IPosition;\r\n}\r\nexport type { ICalendarItem } from \"./components/Calendar\";\r\n\r\n\r\nexport interface ITimeOffCategoryDto {\r\n id?: number;\r\n name?: string;\r\n}\r\nexport interface ITimeOffData {\r\n id: number;\r\n startDate: string;\r\n endDate: string;\r\n days?: number;\r\n year?: number;\r\n comment?: string;\r\n applicant?: IEmployee;\r\n place?: string;\r\n leaveType?: string;\r\n initiator?: string;\r\n dateFromEvidence?: string;\r\n dateToEvidence?: string;\r\n status?: number;\r\n statusText?: string;\r\n timeOffCategoryDto: ITimeOffCategoryDto;\r\n applicantContractGroup?: number;\r\n name?: string;\r\n daysOfEvidence?: number;\r\n daysInStartMonth?: number;\r\n daysInEndMonth?: number;\r\n lastChange?: string;\r\n created?: string;\r\n updated?: string;\r\n attachment?: IAttachment;\r\n steps?: IStep[];\r\n}\r\n\r\nexport interface IDepartment {\r\n departmentId: string;\r\n nameLong: string;\r\n parentDepartmentId: string;\r\n parentLocationId: number;\r\n nameShort: string;\r\n}\r\n\r\nexport interface IPageable<T> {\r\n content: T[];\r\n empty: boolean;\r\n first: boolean;\r\n last: boolean;\r\n number: number;\r\n numberOfElements: number;\r\n size: number;\r\n totalElements: number;\r\n totalPages: number;\r\n}\r\n\r\n\r\nexport interface IFormFieldGlobalProps {\r\n label?: string;\r\n description?: string;\r\n name: string;\r\n type?: string;\r\n value?: any;\r\n\r\n methods?: UseFormReturn<any>;\r\n\r\n errors?: any;\r\n register?: any;\r\n disabled?: boolean;\r\n required?: boolean;\r\n clearable?: boolean;\r\n placeholder?: string;\r\n children?: React.ReactNode;\r\n className?: string;\r\n\r\n onInputChange: (\r\n e: React.ChangeEvent<\r\n HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | any\r\n >\r\n ) => void;\r\n}\r\n\r\n\r\nexport interface SysConfigHolidayEntityResponse {\r\n \"id\": number,\r\n \"date\": string,\r\n \"day\": number,\r\n \"month\": number,\r\n \"year\": number,\r\n \"dayOfWeek\": number\r\n}\r\n\r\n\r\nexport interface IProfileApprover {\r\n id: number;\r\n role: number;\r\n roleTxt: string;\r\n approverOrder: number;\r\n approver: IEmployee;\r\n position: IPositionEmployee;\r\n isEmployee: boolean;\r\n ignore: boolean;\r\n makePreapprover: boolean;\r\n}\r\n\r\n\r\nexport enum EApproverRoles {\r\n predschvalovatel = 10,\r\n zastupce = 20,\r\n zastupce9 = 30,\r\n vedouci = 40,\r\n vyssiSchvalovatel = 60,\r\n vyssiSchvalovatelZastupce = 61,\r\n vyssiSchvalovatelZastupce9 = 62,\r\n dochazkovyVedouci = 90,\r\n}\r\nexport enum EApproverTypes {\r\n vyssiSchvalovatel = \"vyssiSchvalovatel\",\r\n vyssiSchvalovatelZastupce = \"vyssiSchvalovatelZastupce\",\r\n vyssiSchvalovatelZastupce9 = \"vyssiSchvalovatelZastupce9\",\r\n vedouci = \"vedouci\",\r\n zastupce9 = \"zastupce9\",\r\n zastupce = \"zastupce\",\r\n predschvalovatel1 = \"predschvalovatel1\",\r\n predschvalovatel2 = \"predschvalovatel2\",\r\n predschvalovatel3 = \"predschvalovatel3\",\r\n dochazkovyVedouci = \"dochazkovyVedouci\",\r\n}\r\n\r\nexport interface IAttachment {\r\n\r\n\r\n id: number;\r\n created: string;\r\n createdByEmpId: string;\r\n updated: string;\r\n updatedByEmpId: string;\r\n mimeType: string;\r\n size: number;\r\n filename: string;\r\n\r\n}\r\n\r\n\r\n\r\nexport interface IStep {\r\n\r\n\r\n date: string;\r\n type: number;\r\n comment: string;\r\n decision: string;\r\n employee: IEmployee;\r\n\r\n}\r\n\r\n\r\nexport enum EDecisionsTranslations {\r\n approved = 'Schváleno',\r\n rejected = 'Zamítnuto',\r\n cancelled = 'Stornováno',\r\n evided = 'Zaevidováno',\r\n}\r\n\r\n"],"names":["EApproverRoles","EApproverTypes","EDecisionsTranslations"],"mappings":"AA8LY,IAAA,mCAAAA,oBAAL;AACLA,kBAAAA,gBAAA,sBAAmB,EAAnB,IAAA;AACAA,kBAAAA,gBAAA,cAAW,EAAX,IAAA;AACAA,kBAAAA,gBAAA,eAAY,EAAZ,IAAA;AACAA,kBAAAA,gBAAA,aAAU,EAAV,IAAA;AACAA,kBAAAA,gBAAA,uBAAoB,EAApB,IAAA;AACAA,kBAAAA,gBAAA,+BAA4B,EAA5B,IAAA;AACAA,kBAAAA,gBAAA,gCAA6B,EAA7B,IAAA;AACAA,kBAAAA,gBAAA,uBAAoB,EAApB,IAAA;AARUA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAUA,IAAA,mCAAAC,oBAAL;AACLA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,2BAA4B,IAAA;AAC5BA,kBAAA,4BAA6B,IAAA;AAC7BA,kBAAA,SAAU,IAAA;AACVA,kBAAA,WAAY,IAAA;AACZA,kBAAA,UAAW,IAAA;AACXA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,mBAAoB,IAAA;AAVVA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAyCA,IAAA,2CAAAC,4BAAL;AACLA,0BAAA,UAAW,IAAA;AACXA,0BAAA,UAAW,IAAA;AACXA,0BAAA,WAAY,IAAA;AACZA,0BAAA,QAAS,IAAA;AAJCA,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IEmployee, IPositionEmployee } from '../types';
|
|
2
2
|
|
|
3
|
-
declare const getFullName: (
|
|
4
|
-
declare const getFullNameList: (
|
|
5
|
-
|
|
3
|
+
declare const getFullName: (employee: IEmployee, showEmplNumb?: boolean, highlighManagers?: boolean) => string | import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const getFullNameList: (employee: IEmployee, showEmplNumb?: boolean, highlighManagers?: boolean) => string | import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const getFullNamePositionWithEmployee: (position: IPositionEmployee, showEmplNumb?: boolean, highlighManagers?: boolean) => string | import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const getFullNameListPositionWithEmployee: (position: IPositionEmployee, showEmplNumb?: boolean, highlighManagers?: boolean) => string | import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
export { getFullName, getFullNameList, getFullNamePositionWithEmployee, getFullNameListPositionWithEmployee, };
|
|
@@ -1,11 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { jsxs } from "react/jsx-runtime";
|
|
2
|
+
const getFullName = (employee, showEmplNumb = false, highlighManagers = true) => {
|
|
3
|
+
if (!employee) {
|
|
4
|
+
return "Neobsazené systemizované místo";
|
|
5
|
+
}
|
|
6
|
+
const fullName = ((employee == null ? void 0 : employee.degreeBefore) || "") + " " + ((employee == null ? void 0 : employee.firstName) || "") + " " + ((employee == null ? void 0 : employee.lastName) || "") + " " + ((employee == null ? void 0 : employee.degreeAfter) || "") + (showEmplNumb ? "(" + (employee == null ? void 0 : employee.employeeId) + ")" : "");
|
|
7
|
+
if (highlighManagers) {
|
|
8
|
+
if ((employee == null ? void 0 : employee.manager) == "1") {
|
|
9
|
+
return /* @__PURE__ */ jsxs("span", { className: "font-bold", children: [
|
|
10
|
+
" ",
|
|
11
|
+
fullName,
|
|
12
|
+
" "
|
|
13
|
+
] });
|
|
14
|
+
} else {
|
|
15
|
+
return fullName;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
return fullName;
|
|
19
|
+
}
|
|
3
20
|
};
|
|
4
|
-
const getFullNameList = (
|
|
5
|
-
|
|
21
|
+
const getFullNameList = (employee, showEmplNumb = false, highlighManagers = true) => {
|
|
22
|
+
if (!employee) {
|
|
23
|
+
return "Neobsazené systemizované místo";
|
|
24
|
+
}
|
|
25
|
+
const fullName = ((employee == null ? void 0 : employee.lastName) || "") + " " + ((employee == null ? void 0 : employee.firstName) || "") + " " + ((employee == null ? void 0 : employee.degreeBefore) || "") + " " + ((employee == null ? void 0 : employee.degreeAfter) || "") + (showEmplNumb ? "(" + (employee == null ? void 0 : employee.employeeId) + ")" : "");
|
|
26
|
+
if (highlighManagers) {
|
|
27
|
+
if ((employee == null ? void 0 : employee.manager) == "1") {
|
|
28
|
+
return /* @__PURE__ */ jsxs("span", { className: "font-bold", children: [
|
|
29
|
+
" ",
|
|
30
|
+
fullName,
|
|
31
|
+
" "
|
|
32
|
+
] });
|
|
33
|
+
} else {
|
|
34
|
+
return fullName;
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
return fullName;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const getFullNamePositionWithEmployee = (position, showEmplNumb = false, highlighManagers = true) => {
|
|
41
|
+
if (!position.employee)
|
|
42
|
+
return "Neobsazená pozice (" + position.positionNumber + ")";
|
|
43
|
+
return getFullName(position.employee, showEmplNumb, highlighManagers);
|
|
44
|
+
};
|
|
45
|
+
const getFullNameListPositionWithEmployee = (position, showEmplNumb = false, highlighManagers = true) => {
|
|
46
|
+
if (!position.employee)
|
|
47
|
+
return "Neobsazená pozice (" + position.positionNumber + ")";
|
|
48
|
+
return getFullNameList(position.employee, showEmplNumb, highlighManagers);
|
|
6
49
|
};
|
|
7
50
|
export {
|
|
8
51
|
getFullName,
|
|
9
|
-
getFullNameList
|
|
52
|
+
getFullNameList,
|
|
53
|
+
getFullNameListPositionWithEmployee,
|
|
54
|
+
getFullNamePositionWithEmployee
|
|
10
55
|
};
|
|
11
56
|
//# sourceMappingURL=getFullName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFullName.js","sources":["../../lib/utils/getFullName.
|
|
1
|
+
{"version":3,"file":"getFullName.js","sources":["../../lib/utils/getFullName.tsx"],"sourcesContent":["// userDataFetcher.ts\r\n\r\nimport { IEmployee, IPositionEmployee } from \"../types\";\r\n\r\nconst getFullName = (\r\n employee: IEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!employee) {\r\n return \"Neobsazené systemizované místo\";\r\n }\r\n const fullName =\r\n (employee?.degreeBefore || \"\") +\r\n \" \" +\r\n (employee?.firstName || \"\") +\r\n \" \" +\r\n (employee?.lastName || \"\") +\r\n \" \" +\r\n (employee?.degreeAfter || \"\") +\r\n (showEmplNumb ? \"(\" + employee?.employeeId + \")\" : \"\");\r\n\r\n if (highlighManagers) {\r\n if (employee?.manager == \"1\") {\r\n return <span className=\"font-bold\"> {fullName} </span>;\r\n } else {\r\n return fullName;\r\n }\r\n } else {\r\n return fullName;\r\n }\r\n};\r\nconst getFullNameList = (\r\n employee: IEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!employee) {\r\n return \"Neobsazené systemizované místo\";\r\n }\r\n const fullName =\r\n (employee?.lastName || \"\") +\r\n \" \" +\r\n (employee?.firstName || \"\") +\r\n \" \" +\r\n (employee?.degreeBefore || \"\") +\r\n \" \" +\r\n (employee?.degreeAfter || \"\") +\r\n (showEmplNumb ? \"(\" + employee?.employeeId + \")\" : \"\");\r\n\r\n if (highlighManagers) {\r\n if (employee?.manager == \"1\") {\r\n return <span className=\"font-bold\"> {fullName} </span>;\r\n } else {\r\n return fullName;\r\n }\r\n } else {\r\n return fullName;\r\n }\r\n};\r\n\r\nconst getFullNamePositionWithEmployee = (\r\n position: IPositionEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!position.employee)\r\n return \"Neobsazená pozice (\" + position.positionNumber + \")\";\r\n return getFullName(position.employee, showEmplNumb, highlighManagers);\r\n};\r\nconst getFullNameListPositionWithEmployee = (\r\n position: IPositionEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!position.employee)\r\n return \"Neobsazená pozice (\" + position.positionNumber + \")\";\r\n return getFullNameList(position.employee, showEmplNumb, highlighManagers);\r\n};\r\nexport {};\r\n\r\nexport {\r\n getFullName,\r\n getFullNameList,\r\n getFullNamePositionWithEmployee,\r\n getFullNameListPositionWithEmployee,\r\n};\r\n"],"names":[],"mappings":";AAIA,MAAM,cAAc,CAClB,UACA,eAAwB,OACxB,mBAA4B,SACzB;AACH,MAAI,CAAC,UAAU;AACN,WAAA;AAAA,EACT;AACM,QAAA,aACH,qCAAU,iBAAgB,MAC3B,QACC,qCAAU,cAAa,MACxB,QACC,qCAAU,aAAY,MACvB,QACC,qCAAU,gBAAe,OACzB,eAAe,OAAM,qCAAU,cAAa,MAAM;AAErD,MAAI,kBAAkB;AAChB,SAAA,qCAAU,YAAW,KAAK;AACrB,aAAA,qBAAC,QAAK,EAAA,WAAU,aAAY,UAAA;AAAA,QAAA;AAAA,QAAE;AAAA,QAAS;AAAA,MAAC,EAAA,CAAA;AAAA,IAAA,OAC1C;AACE,aAAA;AAAA,IACT;AAAA,EAAA,OACK;AACE,WAAA;AAAA,EACT;AACF;AACA,MAAM,kBAAkB,CACtB,UACA,eAAwB,OACxB,mBAA4B,SACzB;AACH,MAAI,CAAC,UAAU;AACN,WAAA;AAAA,EACT;AACM,QAAA,aACH,qCAAU,aAAY,MACvB,QACC,qCAAU,cAAa,MACxB,QACC,qCAAU,iBAAgB,MAC3B,QACC,qCAAU,gBAAe,OACzB,eAAe,OAAM,qCAAU,cAAa,MAAM;AAErD,MAAI,kBAAkB;AAChB,SAAA,qCAAU,YAAW,KAAK;AACrB,aAAA,qBAAC,QAAK,EAAA,WAAU,aAAY,UAAA;AAAA,QAAA;AAAA,QAAE;AAAA,QAAS;AAAA,MAAC,EAAA,CAAA;AAAA,IAAA,OAC1C;AACE,aAAA;AAAA,IACT;AAAA,EAAA,OACK;AACE,WAAA;AAAA,EACT;AACF;AAEA,MAAM,kCAAkC,CACtC,UACA,eAAwB,OACxB,mBAA4B,SACzB;AACH,MAAI,CAAC,SAAS;AACL,WAAA,wBAAwB,SAAS,iBAAiB;AAC3D,SAAO,YAAY,SAAS,UAAU,cAAc,gBAAgB;AACtE;AACA,MAAM,sCAAsC,CAC1C,UACA,eAAwB,OACxB,mBAA4B,SACzB;AACH,MAAI,CAAC,SAAS;AACL,WAAA,wBAAwB,SAAS,iBAAiB;AAC3D,SAAO,gBAAgB,SAAS,UAAU,cAAc,gBAAgB;AAC1E;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const handleErrors = (error, emitter, customMessage) => {
|
|
2
2
|
var _a, _b, _c, _d;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
let errmsgToDisplay = (customMessage || "") + " " + (((_c = (_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.error) == null ? void 0 : _c.message) || error.message || "");
|
|
4
|
+
let errorTitle = "";
|
|
5
5
|
if (error.code == "ERR_NETWORK") {
|
|
6
6
|
errorTitle = "Síťová chyba";
|
|
7
7
|
errmsgToDisplay = errmsgToDisplay + " " + (/* @__PURE__ */ new Date()).toLocaleString();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleErrors.js","sources":["../../lib/utils/handleErrors.ts"],"sourcesContent":["import { AxiosError } from \"axios\";\r\nimport { Emitter } from \"mitt\";\r\nimport { Events } from \"../types\";\r\n\r\nconst handleErrors = (error: AxiosError, emitter: Emitter<Events>, customMessage?: string) => {\r\n
|
|
1
|
+
{"version":3,"file":"handleErrors.js","sources":["../../lib/utils/handleErrors.ts"],"sourcesContent":["import { AxiosError } from \"axios\";\r\nimport { Emitter } from \"mitt\";\r\nimport { Events } from \"../types\";\r\n\r\nconst handleErrors = (error: AxiosError, emitter: Emitter<Events>, customMessage?: string) => {\r\n let errmsgToDisplay = (customMessage || \"\") + \" \" + ((error.response?.data as any)?.error?.message || error.message || \"\")\r\n\r\n let errorTitle = \"\"\r\n if (error.code == 'ERR_NETWORK') {\r\n errorTitle = \"Síťová chyba\"\r\n errmsgToDisplay = errmsgToDisplay + \" \" + new Date().toLocaleString();\r\n } else if (error.code == 'ERR_BAD_REQUEST') {\r\n\r\n errorTitle = \"Interní chyba aplikace\"\r\n errmsgToDisplay = new Date().toLocaleString() + \" (\" + error.response?.status + \") \\n\" + errmsgToDisplay;\r\n }\r\n console.error(error);\r\n emitter.emit(\"message\", {\r\n title: errorTitle,\r\n message: errmsgToDisplay,\r\n classes: \"bg-danger \",\r\n timeout: 0\r\n });\r\n}\r\nexport { handleErrors }"],"names":[],"mappings":"AAIA,MAAM,eAAe,CAAC,OAAmB,SAA0B,kBAA2B;AAA9F;AACQ,MAAA,mBAAmB,iBAAiB,MAAM,SAAQ,uBAAM,aAAN,mBAAgB,SAAhB,mBAA8B,UAA9B,mBAAqC,YAAW,MAAM,WAAW;AAEvH,MAAI,aAAa;AACb,MAAA,MAAM,QAAQ,eAAe;AAChB,iBAAA;AACb,sBAAkB,kBAAkB,OAAU,oBAAA,KAAA,GAAO;EAAe,WAC7D,MAAM,QAAQ,mBAAmB;AAE3B,iBAAA;AACK,uBAAA,oBAAI,KAAO,GAAA,mBAAmB,SAAO,WAAM,aAAN,mBAAgB,UAAS,SAAS;AAAA,EAC7F;AACA,UAAQ,MAAM,KAAK;AACnB,UAAQ,KAAK,WAAW;AAAA,IACpB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,EAAA,CACZ;AACL;"}
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IPositionEmployee } from '../types';
|
|
2
|
-
|
|
3
|
-
declare const getFullNamePositionWithEmployee: (position: IPositionEmployee, showEmplNumb?: boolean) => string;
|
|
4
|
-
declare const getFullNameListPositionWithEmployee: (position: IPositionEmployee, showEmplNumb?: boolean) => string;
|
|
5
|
-
export { getFullNamePositionWithEmployee, getFullNameListPositionWithEmployee };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const getFullNamePositionWithEmployee = (position, showEmplNumb = false) => {
|
|
2
|
-
var _a, _b, _c, _d;
|
|
3
|
-
if (!position.employee)
|
|
4
|
-
return "Neobsazená pozice (" + position.positionNumber + ")";
|
|
5
|
-
return (((_a = position.employee) == null ? void 0 : _a.degreeBefore) || "") + " " + (((_b = position.employee) == null ? void 0 : _b.firstName) || "") + " " + (((_c = position.employee) == null ? void 0 : _c.lastName) || "") + " " + (((_d = position.employee) == null ? void 0 : _d.degreeAfter) || "") + (showEmplNumb ? "(" + position.employee.employeeId + ")" : "");
|
|
6
|
-
};
|
|
7
|
-
const getFullNameListPositionWithEmployee = (position, showEmplNumb = false) => {
|
|
8
|
-
var _a, _b, _c, _d;
|
|
9
|
-
if (!position.employee)
|
|
10
|
-
return "Neobsazená pozice (" + position.positionNumber + ")";
|
|
11
|
-
return (((_a = position.employee) == null ? void 0 : _a.lastName) || "") + " " + (((_b = position.employee) == null ? void 0 : _b.firstName) || "") + " " + (((_c = position.employee) == null ? void 0 : _c.degreeBefore) || "") + " " + (((_d = position.employee) == null ? void 0 : _d.degreeAfter) || "") + (showEmplNumb ? "(" + position.employee.employeeId + ")" : "");
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
getFullNameListPositionWithEmployee,
|
|
15
|
-
getFullNamePositionWithEmployee
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=getFullNamePositionWithEmployee.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFullNamePositionWithEmployee.js","sources":["../../lib/utils/getFullNamePositionWithEmployee.ts"],"sourcesContent":["// userDataFetcher.ts\r\n\r\nimport { IPositionEmployee } from \"../types\";\r\n\r\nconst getFullNamePositionWithEmployee = (position: IPositionEmployee, showEmplNumb: boolean = false) => {\r\n if (!position.employee) return 'Neobsazená pozice (' + position.positionNumber + ')';\r\n return (\r\n (position.employee?.degreeBefore || \"\") +\r\n \" \" +\r\n (position.employee?.firstName || \"\") +\r\n \" \" +\r\n (position.employee?.lastName || \"\") +\r\n \" \" +\r\n (position.employee?.degreeAfter || \"\") +\r\n (showEmplNumb ? \"(\" + position.employee.employeeId + \")\" : \"\")\r\n );\r\n};\r\nconst getFullNameListPositionWithEmployee = (\r\n position: IPositionEmployee,\r\n showEmplNumb: boolean = false,\r\n) => {\r\n if (!position.employee) return 'Neobsazená pozice (' + position.positionNumber + ')';\r\n\r\n return (\r\n (position.employee?.lastName || \"\") +\r\n \" \" +\r\n (position.employee?.firstName || \"\") +\r\n \" \" +\r\n (position.employee?.degreeBefore || \"\") +\r\n \" \" +\r\n (position.employee?.degreeAfter || \"\") +\r\n (showEmplNumb ? \"(\" + position.employee.employeeId + \")\" : \"\")\r\n );\r\n};\r\nexport { getFullNamePositionWithEmployee, getFullNameListPositionWithEmployee };\r\n"],"names":[],"mappings":"AAIA,MAAM,kCAAkC,CAAC,UAA6B,eAAwB,UAAU;AAAxG;AACI,MAAI,CAAC,SAAS;AAAiB,WAAA,wBAAwB,SAAS,iBAAiB;AAE5E,YAAA,cAAS,aAAT,mBAAmB,iBAAgB,MACpC,SACC,cAAS,aAAT,mBAAmB,cAAa,MACjC,SACC,cAAS,aAAT,mBAAmB,aAAY,MAChC,SACC,cAAS,aAAT,mBAAmB,gBAAe,OAClC,eAAe,MAAM,SAAS,SAAS,aAAa,MAAM;AAEnE;AACA,MAAM,sCAAsC,CACxC,UACA,eAAwB,UACvB;AAhBL;AAiBI,MAAI,CAAC,SAAS;AAAiB,WAAA,wBAAwB,SAAS,iBAAiB;AAG5E,YAAA,cAAS,aAAT,mBAAmB,aAAY,MAChC,SACC,cAAS,aAAT,mBAAmB,cAAa,MACjC,SACC,cAAS,aAAT,mBAAmB,iBAAgB,MACpC,SACC,cAAS,aAAT,mBAAmB,gBAAe,OAClC,eAAe,MAAM,SAAS,SAAS,aAAa,MAAM;AAEnE;"}
|