@argusoft/medplat-core 1.0.9 → 1.0.11

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.
Files changed (116) hide show
  1. package/dist/index-D6bNg8bx.js +66 -0
  2. package/dist/index-D6bNg8bx.js.map +1 -0
  3. package/dist/index.css +1 -1
  4. package/dist/index.js +99455 -445
  5. package/dist/index.js.map +1 -1
  6. package/package.json +4 -1
  7. package/dist/AccessRights-sgIhYR30.js +0 -1238
  8. package/dist/AccessRights-sgIhYR30.js.map +0 -1
  9. package/dist/AddEditQueryBuilder-BaZxS2Cm.js +0 -289
  10. package/dist/AddEditQueryBuilder-BaZxS2Cm.js.map +0 -1
  11. package/dist/AddEditQueryBuilder.css +0 -1
  12. package/dist/AddFeatures-DLbjDGei.js +0 -212
  13. package/dist/AddFeatures-DLbjDGei.js.map +0 -1
  14. package/dist/AddLabelModal-DE3ploGD.js +0 -734
  15. package/dist/AddLabelModal-DE3ploGD.js.map +0 -1
  16. package/dist/AddMenuConfiguration-QWfpcnuP.js +0 -2237
  17. package/dist/AddMenuConfiguration-QWfpcnuP.js.map +0 -1
  18. package/dist/AddMenuConfiguration.css +0 -1
  19. package/dist/AddRoleDrawer-ZK1eejxI.js +0 -453
  20. package/dist/AddRoleDrawer-ZK1eejxI.js.map +0 -1
  21. package/dist/AppModal-BgZyfrd-.js +0 -428
  22. package/dist/AppModal-BgZyfrd-.js.map +0 -1
  23. package/dist/ChangePasswordModal-MV7g8tkA.js +0 -176
  24. package/dist/ChangePasswordModal-MV7g8tkA.js.map +0 -1
  25. package/dist/ConditionConfig-GDCXIg3C.js +0 -395
  26. package/dist/ConditionConfig-GDCXIg3C.js.map +0 -1
  27. package/dist/ConditionConfig.css +0 -1
  28. package/dist/EntityManagement-D-x6Qzal.js +0 -50
  29. package/dist/EntityManagement-D-x6Qzal.js.map +0 -1
  30. package/dist/EventConfigurations-jGCJ4LqP.js +0 -384
  31. package/dist/EventConfigurations-jGCJ4LqP.js.map +0 -1
  32. package/dist/EventConfigurations.css +0 -1
  33. package/dist/EventsExceptionModal-BF6E1Np7.js +0 -200
  34. package/dist/EventsExceptionModal-BF6E1Np7.js.map +0 -1
  35. package/dist/EventsSkeleton-BN7_0IGs.js +0 -74
  36. package/dist/EventsSkeleton-BN7_0IGs.js.map +0 -1
  37. package/dist/FeatureMenu-BYSRoNm0.js +0 -249
  38. package/dist/FeatureMenu-BYSRoNm0.js.map +0 -1
  39. package/dist/Features-CKMmuqcs.js +0 -11
  40. package/dist/Features-CKMmuqcs.js.map +0 -1
  41. package/dist/FlywayQuery-Cx2sly6g.js +0 -169
  42. package/dist/FlywayQuery-Cx2sly6g.js.map +0 -1
  43. package/dist/ImmunizationConfigurationBase-DZ8EqXlF.js +0 -5166
  44. package/dist/ImmunizationConfigurationBase-DZ8EqXlF.js.map +0 -1
  45. package/dist/ImmunizationConfigurationBase.css +0 -1
  46. package/dist/ImmunizationConfigurationsList-CQnxWa09.js +0 -335
  47. package/dist/ImmunizationConfigurationsList-CQnxWa09.js.map +0 -1
  48. package/dist/ImmunizationSkeleton-D2tdv5k-.js +0 -186
  49. package/dist/ImmunizationSkeleton-D2tdv5k-.js.map +0 -1
  50. package/dist/LanguagesModal-rk6IGQwY.js +0 -394
  51. package/dist/LanguagesModal-rk6IGQwY.js.map +0 -1
  52. package/dist/ManageDynamicFeature-BKkCnQvF.js +0 -4189
  53. package/dist/ManageDynamicFeature-BKkCnQvF.js.map +0 -1
  54. package/dist/ManageEventConfiguration-BJxS2Su0.js +0 -1017
  55. package/dist/ManageEventConfiguration-BJxS2Su0.js.map +0 -1
  56. package/dist/ManageEventConfiguration.css +0 -1
  57. package/dist/ManageNotification-B4prX-9Z.js +0 -6819
  58. package/dist/ManageNotification-B4prX-9Z.js.map +0 -1
  59. package/dist/ManageRole-BjIIXAlK.js +0 -728
  60. package/dist/ManageRole-BjIIXAlK.js.map +0 -1
  61. package/dist/ManageTranslation-BTxvSYKb.js +0 -616
  62. package/dist/ManageTranslation-BTxvSYKb.js.map +0 -1
  63. package/dist/ManageTranslation.css +0 -1
  64. package/dist/ManageUser-PHiTNyF8.js +0 -2160
  65. package/dist/ManageUser-PHiTNyF8.js.map +0 -1
  66. package/dist/ManageUser.css +0 -1
  67. package/dist/MobileMenuManagement-DmQU5TTo.js +0 -108
  68. package/dist/MobileMenuManagement-DmQU5TTo.js.map +0 -1
  69. package/dist/MobileTypeEventConfigModal-ChhO_A4f.js +0 -783
  70. package/dist/MobileTypeEventConfigModal-ChhO_A4f.js.map +0 -1
  71. package/dist/NewServerManagement-5YcAtF-g.js +0 -1002
  72. package/dist/NewServerManagement-5YcAtF-g.js.map +0 -1
  73. package/dist/NotificationFlywayQuery-BY8Zzml_.js +0 -244
  74. package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +0 -1
  75. package/dist/NotificationList-BkpOrCpM.js +0 -400
  76. package/dist/NotificationList-BkpOrCpM.js.map +0 -1
  77. package/dist/OtherTypeEventConfigModal-ZnCGWm9v.js +0 -1953
  78. package/dist/OtherTypeEventConfigModal-ZnCGWm9v.js.map +0 -1
  79. package/dist/QueryBuilder-Cus_mRwZ.js +0 -378
  80. package/dist/QueryBuilder-Cus_mRwZ.js.map +0 -1
  81. package/dist/QueryBuilder.css +0 -1
  82. package/dist/QueryManagement-DXA73N2j.js +0 -671
  83. package/dist/QueryManagement-DXA73N2j.js.map +0 -1
  84. package/dist/QueryManagement.css +0 -1
  85. package/dist/RoleManagement-v5Nyp1vr.js +0 -416
  86. package/dist/RoleManagement-v5Nyp1vr.js.map +0 -1
  87. package/dist/ServerSyncModal-uNjGCQJz.js +0 -869
  88. package/dist/ServerSyncModal-uNjGCQJz.js.map +0 -1
  89. package/dist/ShowFlywayQuery-DMsAbtOW.js +0 -130
  90. package/dist/ShowFlywayQuery-DMsAbtOW.js.map +0 -1
  91. package/dist/ShowFlywayQuery-DVRCd384.js +0 -259
  92. package/dist/ShowFlywayQuery-DVRCd384.js.map +0 -1
  93. package/dist/ShowQueryHistory-BDN0tzHg.js +0 -190
  94. package/dist/ShowQueryHistory-BDN0tzHg.js.map +0 -1
  95. package/dist/SubMenu-BHcSNSUF.js +0 -187
  96. package/dist/SubMenu-BHcSNSUF.js.map +0 -1
  97. package/dist/TableDetails-DzREeJkm.js +0 -1508
  98. package/dist/TableDetails-DzREeJkm.js.map +0 -1
  99. package/dist/TableList-B9hr05Hs.js +0 -428
  100. package/dist/TableList-B9hr05Hs.js.map +0 -1
  101. package/dist/TypeConfiguration-C-lk8Szs.js +0 -117
  102. package/dist/TypeConfiguration-C-lk8Szs.js.map +0 -1
  103. package/dist/UserList-BxB1tCwM.js +0 -13042
  104. package/dist/UserList-BxB1tCwM.js.map +0 -1
  105. package/dist/UserList.css +0 -1
  106. package/dist/UserListSkeleton-cglK2SaU.js +0 -184
  107. package/dist/UserListSkeleton-cglK2SaU.js.map +0 -1
  108. package/dist/WidgetList-BSApErov.js +0 -188
  109. package/dist/WidgetList-BSApErov.js.map +0 -1
  110. package/dist/_commonjsHelpers-BItOPCY9.js +0 -29
  111. package/dist/_commonjsHelpers-BItOPCY9.js.map +0 -1
  112. package/dist/i18next-CTOWN_jH.js +0 -1394
  113. package/dist/i18next-CTOWN_jH.js.map +0 -1
  114. package/dist/manageImmunization-B4swS745.js +0 -1204
  115. package/dist/manageImmunization-B4swS745.js.map +0 -1
  116. package/dist/manageImmunization.css +0 -1
@@ -1,728 +0,0 @@
1
- import { jsxs as s, jsx as a, Fragment as E } from "react/jsx-runtime";
2
- import { useRef as K, useState as Y, useEffect as de } from "react";
3
- import { Modal as ce, Box as j, IconButton as me, FormControl as v, FormGroup as ue, Button as X } from "@mui/material";
4
- import he from "@/hooks/useTrackEvent";
5
- import { g as ge, a as pe } from "./RoleManagement-v5Nyp1vr.js";
6
- import { getRoleList as fe, getLocationTypes as ye, execute as O } from "@/common/services/GlobalApis";
7
- import { showToast as W } from "@/common/toaster/toaster";
8
- import { useForm as be } from "react-hook-form";
9
- import { yupResolver as ve } from "@hookform/resolvers/yup";
10
- import "@/assets/scss/scrollBar.scss";
11
- import { FormItem as m } from "@/views/custom-components/FormItem.jsx";
12
- import * as N from "yup";
13
- import A from "@/views/custom-components/CustomTextField";
14
- import Ne from "@/views/custom-components/CustomDropdown";
15
- import $ from "@/views/custom-components/CustomCheckBox";
16
- import w from "@/views/custom-components/CustomAutoComplete";
17
- import { useTranslateProvider as Ie } from "@/common/languageTranslator/TranslationContext";
18
- import { FontAwesomeIcon as xe } from "@fortawesome/react-fontawesome";
19
- import { faXmark as we } from "@fortawesome/free-solid-svg-icons";
20
- import f from "@/common/services/util/GeneralUtil";
21
- import y from "prop-types";
22
- import J from "@/views/custom-components/CustomToggleSwitch";
23
- import { useSelector as Te } from "react-redux";
24
- import { getUseSkeleton as Me } from "@/store/reducers/SkeletonReducer";
25
- const Q = ({ children: I, isLoading: b }) => !Te(Me) || !b ? I : /* @__PURE__ */ s("div", { className: "pt-6 h-[88vh]", children: [
26
- /* @__PURE__ */ s("div", { className: "px-8 pt-2 pb-4 flex items-center justify-between", children: [
27
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-md w-32 h-8" }),
28
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-full w-10 h-10" })
29
- ] }),
30
- /* @__PURE__ */ s("div", { className: "px-8 pb-8 space-y-6 overflow-y-auto max-h-[80vh]", children: [
31
- /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [1, 2, 3].map((h) => /* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
32
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 mb-2 animate-pulse" }),
33
- /* @__PURE__ */ a("div", { className: "h-10 bg-gray-300 rounded animate-pulse w-full" })
34
- ] }, h)) }),
35
- /* @__PURE__ */ a("div", { className: "flex items-center gap-6 w-full", children: /* @__PURE__ */ s("div", { className: "w-full", children: [
36
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/4 mb-2 animate-pulse" }),
37
- /* @__PURE__ */ a("div", { className: "h-8 bg-gray-300 rounded-full w-16 animate-pulse" })
38
- ] }) }),
39
- /* @__PURE__ */ s("div", { className: "space-y-4", children: [
40
- [1, 2].map((h) => /* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
41
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/4 mb-2 animate-pulse" }),
42
- /* @__PURE__ */ a("div", { className: "h-10 bg-gray-300 rounded animate-pulse w-full" })
43
- ] }, h)),
44
- /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [1, 2].map((h) => /* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
45
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 mb-2 animate-pulse" }),
46
- /* @__PURE__ */ a("div", { className: "h-10 bg-gray-300 rounded animate-pulse w-full" })
47
- ] }, h)) }),
48
- [1, 2].map((h) => /* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
49
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 mb-2 animate-pulse" }),
50
- /* @__PURE__ */ a("div", { className: "h-10 bg-gray-300 rounded animate-pulse w-full" })
51
- ] }, h))
52
- ] }),
53
- /* @__PURE__ */ s("div", { className: "flex items-center gap-6", children: [
54
- /* @__PURE__ */ s("div", { className: "w-[60%]", children: [
55
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 mb-2 animate-pulse" }),
56
- /* @__PURE__ */ a("div", { className: "h-8 bg-gray-300 rounded-full w-16 animate-pulse" })
57
- ] }),
58
- /* @__PURE__ */ s("div", { className: "w-[40%] flex items-center gap-2", children: [
59
- /* @__PURE__ */ a("div", { className: "h-5 w-5 bg-gray-300 rounded animate-pulse" }),
60
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/3 animate-pulse" })
61
- ] })
62
- ] }),
63
- /* @__PURE__ */ s("div", { className: "space-y-2", children: [
64
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-300 rounded w-1/4 mb-2 animate-pulse" }),
65
- /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4", children: [1, 2, 3, 4].map((h) => /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
66
- /* @__PURE__ */ a("div", { className: "h-5 w-5 bg-gray-300 rounded animate-pulse" }),
67
- /* @__PURE__ */ a("div", { className: "h-4 w-16 bg-gray-300 rounded animate-pulse" })
68
- ] }, h)) })
69
- ] })
70
- ] }),
71
- /* @__PURE__ */ s("div", { className: "flex items-center justify-end gap-3 pt-6 px-8 pb-4 border-t border-slate-100", children: [
72
- /* @__PURE__ */ a("div", { className: "h-9 w-20 bg-gray-300 rounded animate-pulse" }),
73
- /* @__PURE__ */ a("div", { className: "h-9 w-24 bg-gray-300 rounded animate-pulse" })
74
- ] })
75
- ] });
76
- Q.propTypes = {
77
- children: y.any,
78
- isLoading: y.any
79
- };
80
- const Re = [{ name: "WEB" }, { name: "MOBILE" }, { name: "BOTH" }], Le = ({
81
- selectedId: I,
82
- isUpdate: b,
83
- open: L,
84
- setOpen: h,
85
- isRoleListModified: Z
86
- }) => {
87
- const G = K(null), z = K(!1), _ = he(), [i, V] = Y({}), [ee, D] = Y(!1), ae = N.object().shape({
88
- name: N.string().required("Enter Role Name"),
89
- locationTypes: N.array().when("isLocationRequired", {
90
- is: !0,
91
- then: (e) => e.min(1, "Select Location Type").required("Select Location Type"),
92
- otherwise: (e) => e.notRequired()
93
- }),
94
- roleType: N.string().required("Select Role Type"),
95
- isBankDetailsRequired: f.isTecho ? N.boolean().notRequired() : N.boolean().nullable().defined("Please Select a Value"),
96
- healthInfrastructureIds: N.array().when("isHealthInfraMandatory", {
97
- is: !0,
98
- then: (e) => e.min(1, "Select Health Infrastructure Type").required("Select Health Infrastructure Type"),
99
- otherwise: (e) => e.notRequired()
100
- })
101
- }), {
102
- control: d,
103
- handleSubmit: te,
104
- formState: { errors: u, isSubmitting: le },
105
- setValue: g,
106
- // getValues,
107
- watch: B,
108
- reset: se
109
- } = be({
110
- defaultValues: {
111
- name: "",
112
- locationTypes: [],
113
- maxPosition: "",
114
- maxHealthInfra: "",
115
- roleType: "",
116
- isLastNameMandatory: !1,
117
- isAadharNumMandatory: !1,
118
- isEmailMandatory: !1,
119
- isContactNumMandatory: !1,
120
- isConvoxIdMandatory: !1,
121
- isHealthInfraMandatory: !1,
122
- isGeolocationMandatory: !1,
123
- roleIds: [],
124
- canManageRoleIds: [],
125
- manageByTeamTypeIds: [],
126
- canSelfManage: !1,
127
- healthInfrastructureIds: [],
128
- categoryIds: [],
129
- isBankDetailsRequired: !1,
130
- isBankDetailsMandatory: !1,
131
- id: "",
132
- code: "",
133
- description: "",
134
- createdBy: "",
135
- state: "",
136
- createdOn: "",
137
- assignedFeatureList: "",
138
- assignedFeatures: "",
139
- isSmagTrainedMandatory: "",
140
- isLocationRequired: !0,
141
- isNodalMandatory: !1
142
- },
143
- resolver: ve(ae),
144
- mode: "onChange",
145
- shouldUnregister: !1
146
- }), ne = B("isBankDetailsRequired"), F = B("locationTypes"), { translate: P } = Ie(), re = B("isLocationRequired"), ie = B("isHealthInfraMandatory"), H = [
147
- { label: "Email", value: "isEmailMandatory" },
148
- ...(i == null ? void 0 : i.env) !== "chip" ? [{ label: "Aadhar Number", value: "isAadharNumMandatory" }] : [],
149
- { label: "Contact Number", value: "isContactNumMandatory" },
150
- ...(i == null ? void 0 : i.env) !== "chip" ? [{ label: "Convox Id", value: "isConvoxIdMandatory" }] : [],
151
- { label: "Last Name", value: "isLastNameMandatory" },
152
- { label: "Health Infrastructure", value: "isHealthInfraMandatory" },
153
- { label: "GeoLocation", value: "isGeolocationMandatory" },
154
- ...(i == null ? void 0 : i.env) !== "chip" ? [{ label: "Smag Trained", value: "isSmagTrainedMandatory" }] : [],
155
- { label: "Nodal", value: "isNodalMandatory" }
156
- ].filter((e) => f.isTecho ? ![
157
- "isGeolocationMandatory",
158
- "isHealthInfraMandatory",
159
- "isLastNameMandatory",
160
- "isSmagTrainedMandatory"
161
- ].includes(e.value) : f.isSewaRural || f.isPhmp || f.isImomcare ? e.value !== "isNodalMandatory" : f.isEkavach ? ![
162
- "isGeolocationMandatory",
163
- "isHealthInfraMandatory",
164
- "isLastNameMandatory",
165
- "isNodalMandatory",
166
- "isSmagTrainedMandatory"
167
- ].includes(e.value) : !0), k = () => {
168
- h(0), se(), _("conversion_event", {
169
- form: G.current,
170
- form_name: "Manage Role",
171
- submit: z.current
172
- }), _("button_click", {
173
- button_name: "add role close button",
174
- button_type: "cancel",
175
- button_id: "managerole-close-button"
176
- });
177
- }, x = (e, t, o) => {
178
- g(o, t);
179
- }, oe = async (e) => {
180
- var t, o;
181
- try {
182
- _("button_click", {
183
- button_name: b ? "update role button" : "add role button",
184
- button_type: "submit",
185
- button_id: "managerole-add-button"
186
- }), delete e.bankDetailsRequired, delete e.bankDetailsMandatory, b || (delete e.id, delete e.state, delete e.createdOn, delete e.createdBy, delete e.code, delete e.description, delete e.assignedFeatures, delete e.assignedFeatureList), e.roleIds = e.roleIds.map((l) => l == null ? void 0 : l.id), e.canManageRoleIds = e.canManageRoleIds.map(
187
- (l) => l == null ? void 0 : l.id
188
- ), e.manageByTeamTypeIds = e.manageByTeamTypeIds.map(
189
- (l) => l == null ? void 0 : l.id
190
- ), e.healthInfrastructureIds = e.healthInfrastructureIds.map(
191
- (l) => l == null ? void 0 : l.id
192
- ), e.categoryIds = e.categoryIds.map((l) => l == null ? void 0 : l.id), e.locationTypes = e.isLocationRequired === !0 ? e.locationTypes : [], delete e.isLocationRequired, e.manageByRoleIds = e.roleIds, await pe(e), W({
193
- type: "success",
194
- message: `Role ${b ? "Updated" : "Added"} Successfully`
195
- }), z.current = !0, k(), Z();
196
- } catch (l) {
197
- W({
198
- type: "error",
199
- message: `Role Cannot be added: ${(o = (t = l == null ? void 0 : l.response) == null ? void 0 : t.data) == null ? void 0 : o.message}`
200
- });
201
- }
202
- };
203
- return de(() => {
204
- (async () => {
205
- try {
206
- D((o) => !o);
207
- const t = f.getEnv();
208
- if (L !== 0) {
209
- const [o, l, q, C, S] = await Promise.all([
210
- fe(),
211
- ye(),
212
- O({
213
- code: "team_all_types_for_roles",
214
- parameters: {}
215
- }),
216
- O({
217
- code: "retrieve_field_values_for_form_field",
218
- parameters: {
219
- form: "WEB",
220
- fieldKey: "role_catg"
221
- }
222
- }),
223
- O({
224
- code: "retrieve_field_values_for_form_field",
225
- parameters: {
226
- form: "WEB",
227
- fieldKey: "infra_type"
228
- }
229
- })
230
- ]);
231
- if (V((p) => {
232
- var T, M, R;
233
- return {
234
- ...p,
235
- roles: o.data,
236
- locationData: l.data,
237
- manageTeam: (T = q == null ? void 0 : q.data) == null ? void 0 : T.result,
238
- category: (M = C == null ? void 0 : C.data) == null ? void 0 : M.result,
239
- healthInfraType: (R = S == null ? void 0 : S.data) == null ? void 0 : R.result
240
- };
241
- }), I) {
242
- const { data: p } = await ge(I);
243
- V((n) => ({ ...n, roleData: p, env: t })), Object.keys(p).map((n) => g(n, p[n])), g("isBankDetailsRequired", p.isBankDetailsRequired), g("isBankDetailsMandatory", p.isBankDetailsMandatory);
244
- const {
245
- manageByTeamTypeIds: T,
246
- healthInfrastructureIds: M,
247
- roleIds: R,
248
- categoryIds: U
249
- } = p;
250
- g(
251
- "manageByTeamTypeIds",
252
- T ? T.map(
253
- (n) => {
254
- var c;
255
- return (c = q.data.result) == null ? void 0 : c.find((r) => (r == null ? void 0 : r.id) === n);
256
- }
257
- ) : []
258
- ), g(
259
- "healthInfrastructureIds",
260
- M ? M.map(
261
- (n) => {
262
- var c;
263
- return (c = S.data.result) == null ? void 0 : c.find(
264
- (r) => (r == null ? void 0 : r.id) === n
265
- );
266
- }
267
- ).filter((n) => n !== void 0) : []
268
- ), g(
269
- "categoryIds",
270
- U ? U.map(
271
- (n) => {
272
- var c;
273
- return (c = C.data.result) == null ? void 0 : c.find((r) => (r == null ? void 0 : r.id) === n);
274
- }
275
- ) : []
276
- ), g(
277
- "roleIds",
278
- R ? R.map((n) => {
279
- var c;
280
- return (c = o.data) == null ? void 0 : c.find((r) => (r == null ? void 0 : r.id) === n);
281
- }).filter((n) => n !== void 0) : []
282
- ), g(
283
- "canManageRoleIds",
284
- p.canManageRoleIds ? p.canManageRoleIds.map((n) => {
285
- var c;
286
- return (c = o.data) == null ? void 0 : c.find((r) => (r == null ? void 0 : r.id) === n);
287
- }).filter((n) => n !== void 0) : []
288
- ), p.locationTypes.length > 0 ? g("isLocationRequired", !0) : g("isLocationRequired", !1);
289
- }
290
- }
291
- D((o) => !o);
292
- } catch (t) {
293
- W({
294
- message: `Error in manage role :${t == null ? void 0 : t.message}`,
295
- type: "error"
296
- }), D((o) => !o);
297
- }
298
- })();
299
- }, [I, L]), /* @__PURE__ */ a(
300
- ce,
301
- {
302
- open: L !== 0,
303
- onClose: k,
304
- "data-testid": "managerole-modal",
305
- children: /* @__PURE__ */ a("div", { className: "mt-10 fixed inset-0 z-[100] flex items-center justify-center p-4 animate-in fade-in duration-200", children: /* @__PURE__ */ a(
306
- j,
307
- {
308
- className: "w-full max-w-2xl rounded-[2.5rem] shadow-2xl shadow-blue-900/10 overflow-hidden flex flex-col animate-in zoom-in-95 duration-300",
309
- sx: { bgcolor: (e) => e.palette.custom.customBackground },
310
- children: /* @__PURE__ */ s(Q, { isLoading: ee, children: [
311
- /* @__PURE__ */ s("div", { className: "px-8 pt-8 pb-4 flex items-center justify-between", children: [
312
- /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
313
- j,
314
- {
315
- component: "h2",
316
- className: "text-2xl font-bold text-customBlue",
317
- sx: { color: "text.primary" },
318
- children: b ? "Update Role" : "Add New Role"
319
- }
320
- ) }),
321
- /* @__PURE__ */ a(
322
- me,
323
- {
324
- size: "small",
325
- onClick: k,
326
- className: "w-10 h-10 rounded-full bg-slate-100 flex items-center justify-center text-slate-400 hover:bg-slate-200 hover:text-slate-600 transition-all",
327
- "data-testid": "managerole-close-icon",
328
- children: /* @__PURE__ */ a(xe, { icon: we, size: "lg" })
329
- }
330
- )
331
- ] }),
332
- /* @__PURE__ */ s(
333
- "form",
334
- {
335
- onSubmit: te(oe),
336
- ref: G,
337
- className: "px-8 pb-8 space-y-6 overflow-y-auto max-h-[80vh]",
338
- children: [
339
- /* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
340
- /* @__PURE__ */ a(v, { variant: "outlined", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(m, { label: "Role Name", children: /* @__PURE__ */ a(
341
- A,
342
- {
343
- placeholder: "Role Name",
344
- name: "name",
345
- id: "name",
346
- errors: u,
347
- control: d,
348
- dataTestId: "managerole-role-name-field"
349
- }
350
- ) }) }) }),
351
- /* @__PURE__ */ a(v, { variant: "outlined", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
352
- m,
353
- {
354
- label: "Max Position",
355
- tooltip: "This is the maximum no of users that can be created at one location of this role type",
356
- children: /* @__PURE__ */ a(
357
- A,
358
- {
359
- name: "maxPosition",
360
- id: "maxPosition",
361
- errors: u,
362
- control: d,
363
- rules: {
364
- maxLength: 3,
365
- pattern: /^\d{1,3}$/
366
- },
367
- inputProps: {
368
- maxLength: 3,
369
- inputMode: "numeric",
370
- pattern: "[0-9]*",
371
- onInput: (e) => {
372
- e.target.value = e.target.value.replace(/\D/g, "");
373
- }
374
- },
375
- dataTestId: "managerole-max-position-field"
376
- }
377
- )
378
- }
379
- ) }) }),
380
- !f.isTecho && /* @__PURE__ */ a(v, { variant: "outlined", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(m, { label: "Max Health Infrastructure", children: /* @__PURE__ */ a(
381
- A,
382
- {
383
- name: "maxHealthInfra",
384
- id: "maxHealthInfra",
385
- control: d,
386
- errors: u,
387
- rules: {
388
- maxLength: 3,
389
- pattern: /^\d{1,3}$/
390
- },
391
- inputProps: {
392
- maxLength: 3,
393
- inputMode: "numeric",
394
- pattern: "[0-9]*",
395
- onInput: (e) => {
396
- e.target.value = e.target.value.replace(
397
- /\D/g,
398
- ""
399
- );
400
- }
401
- },
402
- dataTestId: "managerole-max-health-infra-field"
403
- }
404
- ) }) }) })
405
- ] }),
406
- /* @__PURE__ */ a("div", { className: "flex items-center gap-6 w-full", children: /* @__PURE__ */ a(
407
- v,
408
- {
409
- variant: "outlined",
410
- className: "flex flex-row items-center w-full ",
411
- children: /* @__PURE__ */ a(
412
- m,
413
- {
414
- label: "Location Required",
415
- required: !0,
416
- direction: "row",
417
- children: /* @__PURE__ */ a(
418
- J,
419
- {
420
- control: d,
421
- name: "isLocationRequired",
422
- options: [
423
- { label: "Yes", value: !0 },
424
- { label: "No", value: !1 }
425
- ],
426
- errors: u
427
- }
428
- )
429
- }
430
- )
431
- }
432
- ) }),
433
- /* @__PURE__ */ s("div", { className: "space-y-4", children: [
434
- (re === !0 || le) && /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
435
- m,
436
- {
437
- label: "Location",
438
- required: !0,
439
- tooltip: "The OU level where users of this role perform their job function",
440
- children: /* @__PURE__ */ a(
441
- w,
442
- {
443
- id: "locationTypes",
444
- control: d,
445
- name: "locationTypes",
446
- options: i.locationData,
447
- value: F == null ? void 0 : F.map(
448
- (e) => {
449
- var t;
450
- return (t = i.locationData) == null ? void 0 : t.find(
451
- (o) => o.type === (e == null ? void 0 : e.type)
452
- );
453
- }
454
- ),
455
- errors: u,
456
- getOptionLabel: (e) => e == null ? void 0 : e.name,
457
- dataTestId: "managerole-location-type-select",
458
- checkEquality: "type",
459
- onChange: (e, t) => x(e, t, "locationTypes")
460
- }
461
- )
462
- }
463
- ) }) }),
464
- /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
465
- m,
466
- {
467
- label: "Can Manage Role",
468
- tooltip: "Please select the roles that shall be managed by this role",
469
- children: /* @__PURE__ */ a(
470
- w,
471
- {
472
- name: "roleIds",
473
- id: "roleIds",
474
- errors: u,
475
- control: d,
476
- dataTestId: "managerole-manage-role-select",
477
- options: i.roles,
478
- onChange: (e, t) => x(e, t, "roleIds"),
479
- getOptionLabel: (e) => e == null ? void 0 : e.name
480
- }
481
- )
482
- }
483
- ) }),
484
- /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
485
- m,
486
- {
487
- label: "Managed From",
488
- tooltip: "Please select the roles that can manage this role",
489
- children: /* @__PURE__ */ a(
490
- w,
491
- {
492
- name: "canManageRoleIds",
493
- id: "canManageRoleIds",
494
- errors: u,
495
- control: d,
496
- dataTestId: "managerole-managed-by-role-select",
497
- options: i.roles,
498
- onChange: (e, t) => x(e, t, "canManageRoleIds"),
499
- getOptionLabel: (e) => e == null ? void 0 : e.name
500
- }
501
- )
502
- }
503
- ) }),
504
- /* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
505
- /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
506
- m,
507
- {
508
- label: "Role Type",
509
- tooltip: "Please select Role Type",
510
- required: !0,
511
- children: /* @__PURE__ */ a(
512
- Ne,
513
- {
514
- control: d,
515
- id: "roleType",
516
- name: "roleType",
517
- options: Re,
518
- displayName: "name",
519
- optionValue: "name",
520
- errors: u,
521
- dataTestId: "managerole-role-type-dropdown"
522
- }
523
- )
524
- }
525
- ) }),
526
- /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
527
- m,
528
- {
529
- label: "Can Manage Team",
530
- tooltip: "Please select the teams that shall be managed by this role",
531
- children: /* @__PURE__ */ a(
532
- w,
533
- {
534
- control: d,
535
- name: "manageByTeamTypeIds",
536
- id: "manageByTeamTypeIds",
537
- errors: u,
538
- options: i.manageTeam,
539
- dataTestId: "managerole-manage-team-select",
540
- onChange: (e, t) => x(e, t, "manageByTeamTypeIds"),
541
- getOptionLabel: (e) => e == null ? void 0 : e.type
542
- }
543
- )
544
- }
545
- ) })
546
- ] }),
547
- /* @__PURE__ */ a("div", { className: "space-y-4", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
548
- m,
549
- {
550
- label: "Select Health Infrastructure type",
551
- tooltip: "Please select the institute to be associated with the role",
552
- required: ie,
553
- children: /* @__PURE__ */ a(
554
- w,
555
- {
556
- options: i.healthInfraType,
557
- errors: u,
558
- name: "healthInfrastructureIds",
559
- id: "healthInfrastructureIds",
560
- dataTestId: "managerole-health-infrastructure-select",
561
- control: d,
562
- onChange: (e, t) => x(e, t, "healthInfrastructureIds"),
563
- getOptionLabel: (e) => e == null ? void 0 : e.value
564
- }
565
- )
566
- }
567
- ) }) }),
568
- !f.isBahaar && /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a("div", { className: "space-y-4", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: /* @__PURE__ */ a(
569
- m,
570
- {
571
- label: "Category",
572
- tooltip: "Please select the category to be associated with the role",
573
- children: /* @__PURE__ */ a(
574
- w,
575
- {
576
- id: "categoryIds",
577
- name: "categoryIds",
578
- errors: u,
579
- options: i.category,
580
- dataTestId: "managerole-role-category-select",
581
- control: d,
582
- onChange: (e, t) => x(e, t, "categoryIds"),
583
- getOptionLabel: (e) => e == null ? void 0 : e.value
584
- }
585
- )
586
- }
587
- ) }) }) })
588
- ] }),
589
- /* @__PURE__ */ s("div", { className: "flex items-center gap-6", children: [
590
- /* @__PURE__ */ a(
591
- v,
592
- {
593
- variant: "outlined",
594
- className: "flex flex-row items-center w-[60%] ",
595
- children: /* @__PURE__ */ a(
596
- m,
597
- {
598
- label: "Bank Details Required",
599
- tooltip: "Select if bank details are required for this role",
600
- required: !0,
601
- labelWidth: "50%",
602
- childrenWidth: "50%",
603
- direction: "row",
604
- children: /* @__PURE__ */ a(
605
- J,
606
- {
607
- control: d,
608
- name: "isBankDetailsRequired",
609
- options: [
610
- { label: "Yes", value: !0 },
611
- { label: "No", value: !1 }
612
- ],
613
- errors: u
614
- }
615
- )
616
- }
617
- )
618
- }
619
- ),
620
- !b && /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(v, { variant: "outlined ", className: "w-[40%]", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a(
621
- m,
622
- {
623
- label: "Self Manage",
624
- labelWidth: "60%",
625
- childrenWidth: "40%",
626
- direction: "row",
627
- children: /* @__PURE__ */ a(
628
- $,
629
- {
630
- name: "canSelfManage",
631
- control: d,
632
- isFullWidth: !1,
633
- "data-testid": "managerole-self-manage-checkbox"
634
- }
635
- )
636
- }
637
- ) }) }) })
638
- ] }),
639
- /* @__PURE__ */ a("div", { className: "flex items-center gap-6", children: /* @__PURE__ */ a(
640
- v,
641
- {
642
- variant: "outlined",
643
- className: "flex flex-col items-start justify-between",
644
- children: /* @__PURE__ */ a(
645
- m,
646
- {
647
- label: "Mandatory Fields",
648
- tooltip: "These fields are Mandatory when creating users of this role type",
649
- children: /* @__PURE__ */ s(ue, { row: !0, children: [
650
- H == null ? void 0 : H.map((e) => /* @__PURE__ */ a(
651
- $,
652
- {
653
- control: d,
654
- name: e.value,
655
- label: e.label,
656
- isFullWidth: !1,
657
- "data-testid": `managerole-mandatory-field-${e.value}`
658
- },
659
- e.value
660
- )),
661
- ne === !0 && /* @__PURE__ */ a(
662
- $,
663
- {
664
- name: "isBankDetailsMandatory",
665
- control: d,
666
- label: "Bank Details",
667
- isFullWidth: !1,
668
- "data-testid": "managerole-bank-details-mandatory-checkbox"
669
- }
670
- )
671
- ] })
672
- }
673
- )
674
- }
675
- ) }),
676
- /* @__PURE__ */ s(
677
- j,
678
- {
679
- className: "flex items-center justify-end gap-3 pt-6 border-t",
680
- sx: { borderColor: "divider" },
681
- children: [
682
- /* @__PURE__ */ a(
683
- X,
684
- {
685
- variant: "contained",
686
- color: "secondary",
687
- size: "small",
688
- onClick: k,
689
- "data-testid": "managerole-close-button",
690
- children: P("Close")
691
- }
692
- ),
693
- /* @__PURE__ */ a(
694
- X,
695
- {
696
- variant: "contained",
697
- color: "primary",
698
- size: "small",
699
- type: "submit",
700
- "data-testid": "managerole-submit-button",
701
- children: b ? `${P("Update Role")}` : `${P("Add Role")}`
702
- }
703
- )
704
- ]
705
- }
706
- )
707
- ]
708
- }
709
- )
710
- ] })
711
- }
712
- ) })
713
- }
714
- );
715
- };
716
- Le.propTypes = {
717
- isUpdate: y.bool,
718
- role: y.object,
719
- onClose: y.func,
720
- open: y.bool,
721
- setOpen: y.func,
722
- selectedId: y.string,
723
- isRoleListModified: y.bool
724
- };
725
- export {
726
- Le as default
727
- };
728
- //# sourceMappingURL=ManageRole-BjIIXAlK.js.map