@argusoft/medplat-core 1.0.14 → 1.0.15

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 (111) hide show
  1. package/dist/AccessRights-Bvd5Bm5K.js +1259 -0
  2. package/dist/AccessRights-Bvd5Bm5K.js.map +1 -0
  3. package/dist/{AddEditQueryBuilder-7JRplV5J.js → AddEditQueryBuilder-Bcjl5mXE.js} +2 -2
  4. package/dist/{AddEditQueryBuilder-7JRplV5J.js.map → AddEditQueryBuilder-Bcjl5mXE.js.map} +1 -1
  5. package/dist/{AddFeatures-CkTu7sOI.js → AddFeatures-CE5rBxEG.js} +2 -2
  6. package/dist/{AddFeatures-CkTu7sOI.js.map → AddFeatures-CE5rBxEG.js.map} +1 -1
  7. package/dist/{AddLabelModal-DE3ploGD.js → AddLabelModal-CB8E8cYG.js} +2 -2
  8. package/dist/{AddLabelModal-DE3ploGD.js.map → AddLabelModal-CB8E8cYG.js.map} +1 -1
  9. package/dist/{AddRoleDrawer-ZK1eejxI.js → AddRoleDrawer-SvntLdRu.js} +44 -43
  10. package/dist/AddRoleDrawer-SvntLdRu.js.map +1 -0
  11. package/dist/{AppModal-BgZyfrd-.js → AppModal-BKgIwe1h.js} +2 -2
  12. package/dist/{AppModal-BgZyfrd-.js.map → AppModal-BKgIwe1h.js.map} +1 -1
  13. package/dist/{ChangePasswordModalCore-DIe4rzW-.js → ChangePasswordModalCore-CTGy8Ttf.js} +2 -2
  14. package/dist/{ChangePasswordModalCore-DIe4rzW-.js.map → ChangePasswordModalCore-CTGy8Ttf.js.map} +1 -1
  15. package/dist/{ConditionConfig-GDCXIg3C.js → ConditionConfig-DB0FqwgG.js} +2 -2
  16. package/dist/{ConditionConfig-GDCXIg3C.js.map → ConditionConfig-DB0FqwgG.js.map} +1 -1
  17. package/dist/{EntityManagement-D-x6Qzal.js → EntityManagement-DQKXnEzz.js} +2 -2
  18. package/dist/{EntityManagement-D-x6Qzal.js.map → EntityManagement-DQKXnEzz.js.map} +1 -1
  19. package/dist/EventConfigurations-DZvSJ5EZ.js +395 -0
  20. package/dist/EventConfigurations-DZvSJ5EZ.js.map +1 -0
  21. package/dist/{EventsExceptionModal-BF6E1Np7.js → EventsExceptionModal-DsvngLi8.js} +2 -2
  22. package/dist/{EventsExceptionModal-BF6E1Np7.js.map → EventsExceptionModal-DsvngLi8.js.map} +1 -1
  23. package/dist/EventsSkeleton-DCXwwPbb.js +76 -0
  24. package/dist/EventsSkeleton-DCXwwPbb.js.map +1 -0
  25. package/dist/FeatureMenu-CLX8VNZ-.js +265 -0
  26. package/dist/FeatureMenu-CLX8VNZ-.js.map +1 -0
  27. package/dist/Features-Cpf1PDx0.js +13 -0
  28. package/dist/Features-Cpf1PDx0.js.map +1 -0
  29. package/dist/FileSaver.min-CN9EpL2h.js.map +1 -1
  30. package/dist/ImmunizationConfigurationsList-K2ddBpPJ.js +345 -0
  31. package/dist/ImmunizationConfigurationsList-K2ddBpPJ.js.map +1 -0
  32. package/dist/ImmunizationSkeleton-D2tdv5k-.js.map +1 -1
  33. package/dist/{LanguagesModal-rk6IGQwY.js → LanguagesModal-CX3oS8rk.js} +2 -2
  34. package/dist/{LanguagesModal-rk6IGQwY.js.map → LanguagesModal-CX3oS8rk.js.map} +1 -1
  35. package/dist/{ManageDynamicFeature-C2I7Ho7i.js → ManageDynamicFeature-CsIett5x.js} +2 -2
  36. package/dist/{ManageDynamicFeature-C2I7Ho7i.js.map → ManageDynamicFeature-CsIett5x.js.map} +1 -1
  37. package/dist/{ManageEventConfiguration-BJxS2Su0.js → ManageEventConfiguration-0YBDaxOI.js} +60 -60
  38. package/dist/ManageEventConfiguration-0YBDaxOI.js.map +1 -0
  39. package/dist/{ManageNotification-DMN2szWy.js → ManageNotification-EQgnOO0U.js} +632 -632
  40. package/dist/ManageNotification-EQgnOO0U.js.map +1 -0
  41. package/dist/{ManageRole-CuXmWQyp.js → ManageRole-Cbs9dUhc.js} +244 -191
  42. package/dist/ManageRole-Cbs9dUhc.js.map +1 -0
  43. package/dist/ManageTranslation-D9IScGhk.js +625 -0
  44. package/dist/ManageTranslation-D9IScGhk.js.map +1 -0
  45. package/dist/{ManageUser-Dr3ptCYp.js → ManageUser-C9uMe9av.js} +744 -735
  46. package/dist/ManageUser-C9uMe9av.js.map +1 -0
  47. package/dist/{MobileTypeEventConfigModal-ChhO_A4f.js → MobileTypeEventConfigModal-Ltm529jG.js} +2 -2
  48. package/dist/{MobileTypeEventConfigModal-ChhO_A4f.js.map → MobileTypeEventConfigModal-Ltm529jG.js.map} +1 -1
  49. package/dist/NotificationList-BZwvgsf6.js +402 -0
  50. package/dist/NotificationList-BZwvgsf6.js.map +1 -0
  51. package/dist/{OtherTypeEventConfigModal-ZnCGWm9v.js → OtherTypeEventConfigModal-dXt2qDg_.js} +2 -2
  52. package/dist/OtherTypeEventConfigModal-dXt2qDg_.js.map +1 -0
  53. package/dist/{QueryBuilder-BPfavHH9.js → QueryBuilder-DXexUIe8.js} +154 -148
  54. package/dist/QueryBuilder-DXexUIe8.js.map +1 -0
  55. package/dist/{QueryManagement-DXA73N2j.js → QueryManagement-BpIRH8hI.js} +228 -214
  56. package/dist/QueryManagement-BpIRH8hI.js.map +1 -0
  57. package/dist/RoleManagement-BThAL5LO.js +422 -0
  58. package/dist/RoleManagement-BThAL5LO.js.map +1 -0
  59. package/dist/SubMenu-BGznOP2a.js +191 -0
  60. package/dist/SubMenu-BGznOP2a.js.map +1 -0
  61. package/dist/TableDetails-DztbjsIA.js +2069 -0
  62. package/dist/TableDetails-DztbjsIA.js.map +1 -0
  63. package/dist/TableList-DYwotUDO.js +1425 -0
  64. package/dist/TableList-DYwotUDO.js.map +1 -0
  65. package/dist/{TypeConfiguration-C-lk8Szs.js → TypeConfiguration-DYbBG_hZ.js} +2 -2
  66. package/dist/{TypeConfiguration-C-lk8Szs.js.map → TypeConfiguration-DYbBG_hZ.js.map} +1 -1
  67. package/dist/{UserList-S5Q76wO7.js → UserList-BH6OpZvq.js} +410 -400
  68. package/dist/UserList-BH6OpZvq.js.map +1 -0
  69. package/dist/UserListSkeleton-cglK2SaU.js.map +1 -1
  70. package/dist/WidgetList-D-fIf3N2.js +200 -0
  71. package/dist/WidgetList-D-fIf3N2.js.map +1 -0
  72. package/dist/i18next-CTOWN_jH.js.map +1 -1
  73. package/dist/index.css +1 -1
  74. package/dist/index.js +13 -13
  75. package/dist/xlsx.min-D1LFqt_b.js.map +1 -1
  76. package/package.json +1 -1
  77. package/dist/AccessRights-BMRM1u9S.js +0 -1228
  78. package/dist/AccessRights-BMRM1u9S.js.map +0 -1
  79. package/dist/AddRoleDrawer-ZK1eejxI.js.map +0 -1
  80. package/dist/EventConfigurations-jGCJ4LqP.js +0 -384
  81. package/dist/EventConfigurations-jGCJ4LqP.js.map +0 -1
  82. package/dist/EventsSkeleton-BN7_0IGs.js +0 -74
  83. package/dist/EventsSkeleton-BN7_0IGs.js.map +0 -1
  84. package/dist/FeatureMenu-Ds6lFg4w.js +0 -249
  85. package/dist/FeatureMenu-Ds6lFg4w.js.map +0 -1
  86. package/dist/Features-Cshdl06N.js +0 -12
  87. package/dist/Features-Cshdl06N.js.map +0 -1
  88. package/dist/ImmunizationConfigurationsList-CQnxWa09.js +0 -335
  89. package/dist/ImmunizationConfigurationsList-CQnxWa09.js.map +0 -1
  90. package/dist/ManageEventConfiguration-BJxS2Su0.js.map +0 -1
  91. package/dist/ManageNotification-DMN2szWy.js.map +0 -1
  92. package/dist/ManageRole-CuXmWQyp.js.map +0 -1
  93. package/dist/ManageTranslation-BTxvSYKb.js +0 -616
  94. package/dist/ManageTranslation-BTxvSYKb.js.map +0 -1
  95. package/dist/ManageUser-Dr3ptCYp.js.map +0 -1
  96. package/dist/NotificationList-BqibwMaM.js +0 -400
  97. package/dist/NotificationList-BqibwMaM.js.map +0 -1
  98. package/dist/OtherTypeEventConfigModal-ZnCGWm9v.js.map +0 -1
  99. package/dist/QueryBuilder-BPfavHH9.js.map +0 -1
  100. package/dist/QueryManagement-DXA73N2j.js.map +0 -1
  101. package/dist/RoleManagement-C0feJCuq.js +0 -410
  102. package/dist/RoleManagement-C0feJCuq.js.map +0 -1
  103. package/dist/SubMenu-DAfZC9Xi.js +0 -188
  104. package/dist/SubMenu-DAfZC9Xi.js.map +0 -1
  105. package/dist/TableDetails-DzREeJkm.js +0 -1508
  106. package/dist/TableDetails-DzREeJkm.js.map +0 -1
  107. package/dist/TableList-B9hr05Hs.js +0 -428
  108. package/dist/TableList-B9hr05Hs.js.map +0 -1
  109. package/dist/UserList-S5Q76wO7.js.map +0 -1
  110. package/dist/WidgetList-BSApErov.js +0 -188
  111. package/dist/WidgetList-BSApErov.js.map +0 -1
@@ -1,616 +0,0 @@
1
- import { jsxs as u, jsx as a } from "react/jsx-runtime";
2
- import { useRef as be, useState as l, useEffect as ve, useCallback as ya, useMemo as U, Suspense as F, createElement as ba, lazy as J } from "react";
3
- import { api as m } from "@/common/interceptors/AxiosInterceptor";
4
- import { execute as va, executeQuery as E } from "@/common/services/GlobalApis";
5
- import { showToast as y } from "@/common/toaster/toaster";
6
- import p from "@mui/material/Grid2";
7
- import { getAssignedFeatures as xa } from "@/utils/feature";
8
- import { FormControl as G, Typography as T, Select as Aa, MenuItem as Sa, Autocomplete as La, TextField as xe, Chip as Na, Box as Ae, Button as I, FormGroup as Ca, FormControlLabel as ka, Checkbox as Ta } from "@mui/material";
9
- import Ia from "@/hooks/usePagination";
10
- import Ma from "@/views/custom-components/CustomConfirmationModal";
11
- import { useTranslateProvider as wa } from "@/common/languageTranslator/TranslationContext";
12
- import f from "prop-types";
13
- import { useSelector as z } from "react-redux";
14
- import { getUseSkeleton as O } from "@/store/reducers/SkeletonReducer";
15
- import _a from "@/views/custom-components/CustomizedTable/CustomizedTableV2";
16
- import { faPen as Fa, faBars as Ea } from "@fortawesome/free-solid-svg-icons";
17
- import { FontAwesomeIcon as Se } from "@fortawesome/react-fontawesome";
18
- import './ManageTranslation.css';const it = (s) => m.post("/translation/languages", s), ct = (s) => m.put("/translation/languages", s), za = () => m.get("/translation/languages"), dt = (s) => m.post("/translation/apps", s), pt = (s) => m.post("/translation/apps", s), Oa = () => m.get("/translation/apps"), ut = (s) => m.post("/translation/labels", s), gt = (s) => m.post("/translation/map", s), mt = (s) => m.post("/translation/mapUpdate", s), ja = (s, d, g) => {
19
- const j = new URLSearchParams({
20
- key: s,
21
- isActive: d,
22
- app: g
23
- }).toString();
24
- return m.put(`/translation/toggleActive?${j}`, { key: s, isActive: d, app: g });
25
- }, ft = (s, d) => m.get("/translation/translate", { params: { targetLangs: s, englishText: d } }), Le = ({ children: s, isLoading: d }) => !z(O) || !d ? s : /* @__PURE__ */ u("div", { className: "flex flex-col mt-6 gap-2 w-full", children: [
26
- /* @__PURE__ */ u("div", { className: "flex w-full items-center justify-between space-x-2", children: [
27
- /* @__PURE__ */ u("div", { className: "flex space-x-2", children: [
28
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
29
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-40 h-10" }),
30
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-60 h-10" })
31
- ] }),
32
- /* @__PURE__ */ u("div", { className: "flex space-x-2", children: [
33
- /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-40 h-10" }),
34
- /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" }),
35
- /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" }),
36
- /* @__PURE__ */ a("div", { className: "bg-gray-300 rounded-sm animate-pulse w-20 h-10" })
37
- ] })
38
- ] }),
39
- /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm w-full h-100" })
40
- ] });
41
- Le.propTypes = {
42
- children: f.any,
43
- isLoading: f.any
44
- };
45
- const Va = ({ children: s, isLoading: d = !0 }) => !z(O) || !d ? s : /* @__PURE__ */ u("div", { className: "flex flex-col absolute top-10 left-1/2 -translate-x-1/2 w-[95%] sm:w-[600px] md:w-[700px] lg:w-[800px] bg-white shadow-2xl border border-gray-300 rounded-sm h-[60vh]", children: [
46
- /* @__PURE__ */ a("div", { className: "h-15 w-full bg-gray-200 rounded mb-6" }),
47
- /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4" }),
48
- /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4" }),
49
- /* @__PURE__ */ a("div", { className: "h-10 w-[90%] bg-gray-200 rounded m-4 " }),
50
- /* @__PURE__ */ a("div", { className: "h-9 w-1/3 bg-gray-200 rounded mt-auto ml-auto mb-2 mr-3" })
51
- ] });
52
- Va.propTypes = {
53
- children: f.any,
54
- isLoading: f.any
55
- };
56
- const Da = ({ children: s, isLoading: d = !0 }) => !z(O) || !d ? s : /* @__PURE__ */ a("div", { className: "w-full flex justify-end pb-[10px]", children: /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm h-[32px] w-[100px]" }) });
57
- Da.propTypes = {
58
- children: f.any,
59
- isLoading: f.any
60
- };
61
- const Wa = ({ children: s, isLoading: d = !0 }) => !z(O) || !d ? s : /* @__PURE__ */ a("div", { className: "flex justify-end w-full", children: /* @__PURE__ */ a("div", { className: "bg-gray-300 animate-pulse rounded-sm h-[32px] w-[120px]" }) });
62
- Wa.propTypes = {
63
- children: f.any,
64
- isLoading: f.any
65
- };
66
- f.any, f.any;
67
- const Ba = J(() => import("./AppModal-BgZyfrd-.js")), Ka = J(() => import("./LanguagesModal-rk6IGQwY.js")), qa = J(() => import("./AddLabelModal-DE3ploGD.js"));
68
- function $a() {
69
- const { translate: s } = wa(), d = be(null), [g, j] = l([]), M = be(!1), [Ne, X] = l([]), [Ce, Y] = l(!1), [ke, V] = l(null), [Te, D] = l(!1), [Z, Ie] = l([]), [P, R] = l(!1), [ee, ae] = l(!1), [te, Me] = l(!0), [h, W] = l(""), [L, we] = l([]), [se, N] = l(!1), [_e, B] = l(null), [C, ne] = l(""), [b, re] = l(""), [A, le] = l(!1), [S, Fe] = l({}), [Ee, K] = l(!1), [ze, Oe] = l(""), [je, Ve] = l(""), [o, De] = l({}), [We, oe] = l(!1), [Be, ie] = l(null), [ce, q] = l(!1), [Ke, de] = l(!1), [w, qe] = l(!1), [$e, $] = l(!1), [pe, He] = l([]), [v, ue] = l([]), Qe = async () => {
70
- var e;
71
- try {
72
- const t = await va({
73
- code: "get_distinct_namespce",
74
- parameters: {}
75
- });
76
- He((e = t == null ? void 0 : t.data) == null ? void 0 : e.result);
77
- } catch (t) {
78
- console.error(t);
79
- }
80
- };
81
- ve(() => {
82
- Ue(), Qe();
83
- }, []);
84
- const Ue = async () => {
85
- try {
86
- await H();
87
- const { data: e } = await xa(
88
- "techo.manage.manageTranslation"
89
- );
90
- Fe(JSON.parse(e));
91
- } catch (e) {
92
- console.error(e), y({ message: "Error in manage Translation", type: "error" });
93
- }
94
- }, H = async () => {
95
- var e, t;
96
- try {
97
- let n = await Oa();
98
- const i = (e = n == null ? void 0 : n.data) == null ? void 0 : e.filter((c) => c.isActive === !0);
99
- j(i), n = await za();
100
- const r = (t = n == null ? void 0 : n.data) == null ? void 0 : t.filter((c) => c.active === !0);
101
- we(r);
102
- } catch (n) {
103
- console.error(n), y({ message: "Error in manage Translation", type: "error" });
104
- }
105
- }, Ge = (e) => {
106
- var t;
107
- W((t = e == null ? void 0 : e.target) == null ? void 0 : t.value);
108
- }, ge = ya((e) => {
109
- const t = (e.match(/{/g) || []).length, n = (e.match(/}/g) || []).length;
110
- t > n || ne(e);
111
- }, []), Je = (e, t) => {
112
- let n;
113
- return (...i) => {
114
- n && clearTimeout(n), n = setTimeout(() => {
115
- e(...i);
116
- }, t);
117
- };
118
- }, Xe = U(
119
- () => Je(ge, 300),
120
- [ge]
121
- ), Ye = (e) => {
122
- const { value: t } = e.target;
123
- Xe(t);
124
- }, me = (e) => {
125
- re(e);
126
- }, fe = [
127
- { field: "Sr. No.", label: "Sr.No", align: "left" },
128
- { field: "Actions", label: "Actions" },
129
- { field: "app", label: "App", align: "left" },
130
- { field: "state", label: "State", align: "left" },
131
- { field: "key", label: "Key", align: "left" }
132
- ];
133
- L == null || L.map(
134
- (e) => {
135
- var t;
136
- return fe.push({
137
- field: (t = e == null ? void 0 : e.languageValue) == null ? void 0 : t.toLowerCase(),
138
- label: e == null ? void 0 : e.languageValue,
139
- align: "left"
140
- });
141
- }
142
- );
143
- const Ze = (e) => {
144
- Oe(
145
- (e == null ? void 0 : e.state) === "Active" ? "Mark as Inactive" : "Mark as Active"
146
- ), Ve(
147
- (e == null ? void 0 : e.state) === "Active" ? "Are you sure you want to change the state from active to inactive?" : "Are you sure you want to change the state from inactive to active?"
148
- ), De(e);
149
- }, Pe = () => {
150
- K((e) => !e);
151
- }, Re = async () => {
152
- try {
153
- V({ key: o == null ? void 0 : o.key }), de(!0), N((e) => !e);
154
- } catch (e) {
155
- console.error(e), y({ message: "Error in opening Add App Modal", type: "error" });
156
- }
157
- }, ea = async () => {
158
- var e, t, n;
159
- try {
160
- let r = {
161
- code: "labels_selected_apps_for_editing",
162
- parameters: { key: o == null ? void 0 : o.key.replace(/'/g, "''") }
163
- };
164
- const c = await E(r);
165
- let ga = (e = c == null ? void 0 : c.data) == null ? void 0 : e.result;
166
- B((t = c == null ? void 0 : c.data) == null ? void 0 : t.result);
167
- let ma = {
168
- code: "labels_app_data_for_prepopulating",
169
- parameters: {
170
- key: o == null ? void 0 : o.key,
171
- appValue: o == null ? void 0 : o.app
172
- }
173
- }, fa = ga.map((x) => x.app), ye = g.filter((x) => fa.indexOf(x.id) === -1);
174
- if (ye.length > 0) {
175
- const x = await E(ma);
176
- V((n = x == null ? void 0 : x.data) == null ? void 0 : n.result), X(ye), Y(!0), N((ha) => !ha);
177
- } else
178
- y({
179
- message: "Label already present in all apps",
180
- type: "info"
181
- });
182
- } catch (i) {
183
- console.error(i), y({ message: "Error in opening Add App Modal", type: "error" });
184
- }
185
- }, aa = async () => {
186
- try {
187
- let e = (o == null ? void 0 : o.state) === "Active";
188
- await ja(o == null ? void 0 : o.key, !e, o == null ? void 0 : o.appId), _(), K((t) => !t);
189
- } catch (e) {
190
- console.error(e), y({ message: "Error in Toggle State", type: "error" });
191
- }
192
- }, ta = async (e) => {
193
- var t;
194
- try {
195
- D(!0), N((c) => !c), oe((c) => !c);
196
- let n = e == null ? void 0 : e.key.replace(/'/g, "''");
197
- ie(n);
198
- const r = await E({
199
- code: "labels_selected_apps_for_editing",
200
- parameters: { key: n }
201
- });
202
- B((t = r == null ? void 0 : r.data) == null ? void 0 : t.result), D(!1);
203
- } catch (n) {
204
- console.error(n), y({ message: "Error in Editing label", type: "error" }), D(!1);
205
- }
206
- }, sa = [
207
- { label: s(ze), onClick: Pe },
208
- { label: s("Add app"), onClick: ea },
209
- { label: s("Add Namespace"), onClick: Re }
210
- ], na = [
211
- {
212
- label: "",
213
- icon: /* @__PURE__ */ a(Se, { icon: Fa }),
214
- onClick: ta,
215
- condition: (e) => (e == null ? void 0 : e.state) !== "Inactive",
216
- dataTestId: "manage-translation-edit-icon"
217
- },
218
- {
219
- label: "",
220
- icon: /* @__PURE__ */ a(Se, { icon: Ea }),
221
- menuClick: Ze,
222
- dataTestId: "manage-translation-menu-icon",
223
- menuItems: sa
224
- }
225
- ], ra = () => {
226
- R((e) => !e);
227
- }, la = () => {
228
- ae((e) => !e);
229
- }, oa = () => {
230
- N((e) => !e), X(g);
231
- }, Q = (e) => e == null ? e : e.replace(/'/g, "''"), ia = async (e, t) => {
232
- var n;
233
- try {
234
- t && !w ? (M.current = !0, q(!0)) : t && w && $(!0);
235
- let i = {
236
- code: "fetch_labels_translation_translation_master",
237
- parameters: {
238
- appId: h || null,
239
- searchString: Q(C || ""),
240
- startsWith: Q(b || ""),
241
- namespaceArray: v.length > 0 ? v.map((c) => Q(c)).join(",") : "",
242
- showInactive: A || !1,
243
- limit: (e == null ? void 0 : e.limit) || 100,
244
- offset: (e == null ? void 0 : e.offset) || 0
245
- }
246
- };
247
- const r = await E(i);
248
- return (n = r == null ? void 0 : r.data) == null ? void 0 : n.result;
249
- } catch (i) {
250
- M.current = !1, console.error(i), $(!1), q(!1), y({ message: "Error in loading data", type: "error" });
251
- }
252
- }, he = U(() => C === "" && b === "" && A === !1 && h === "" && v.length === 0, [C, b, A, h, v]), ca = U(
253
- () => [
254
- "translation",
255
- h,
256
- C,
257
- b,
258
- A,
259
- v
260
- ],
261
- [h, C, b, A, v]
262
- ), {
263
- data: k,
264
- fetchNextPage: da,
265
- hasNextPage: pa,
266
- refetch: _
267
- } = Ia({
268
- key: ca,
269
- queryFn: ({ pageParam: e }) => {
270
- const t = !w, i = (!(e != null && e.offset) || (e == null ? void 0 : e.offset) === 0) && t;
271
- return ia(e, i);
272
- },
273
- limit: 100
274
- });
275
- ve(() => {
276
- var e;
277
- if (k) {
278
- let t = ((e = k == null ? void 0 : k.pages) == null ? void 0 : e.flat()) || [];
279
- const n = Object.values(
280
- t == null ? void 0 : t.reduce((i, r) => {
281
- const c = (r == null ? void 0 : r.key) + "-" + (r == null ? void 0 : r.app);
282
- return i[c] || (i[c] = {
283
- appId: r == null ? void 0 : r.appid,
284
- key: r == null ? void 0 : r.key,
285
- app: r == null ? void 0 : r.app,
286
- state: r != null && r.is_active ? "Active" : "Inactive"
287
- }), i[c][r == null ? void 0 : r.language.toLowerCase()] = r == null ? void 0 : r.value, r != null && r.is_active && (i[c].state = "Active"), i;
288
- }, {})
289
- );
290
- Me(pa), Ie(n), M.current && (w ? $(!1) : (q(!1), qe(!0)), M.current = !1);
291
- }
292
- }, [k]);
293
- const ua = () => {
294
- ne(""), re(""), le(!1), W(""), ue([]), d.current.value = "";
295
- };
296
- return /* @__PURE__ */ u(p, { container: !0, mt: 3, spacing: 2, children: [
297
- /* @__PURE__ */ a(F, { children: P && /* @__PURE__ */ a(
298
- Ba,
299
- {
300
- open: P,
301
- handleClose: () => R((e) => !e),
302
- languages: L,
303
- refresh: H,
304
- refetch: _,
305
- selectedApp: h,
306
- setSelectedApp: W
307
- }
308
- ) }),
309
- /* @__PURE__ */ a(F, { children: ee && /* @__PURE__ */ a(
310
- Ka,
311
- {
312
- open: ee,
313
- handleClose: () => {
314
- ae((e) => !e);
315
- },
316
- refresh: H,
317
- refetch: _
318
- }
319
- ) }),
320
- /* @__PURE__ */ a(F, { children: se && /* @__PURE__ */ a(
321
- qa,
322
- {
323
- open: se,
324
- handleClose: () => {
325
- N((e) => !e), Y(!1), de(!1), B(null), V(null), oe(!1), ie(null);
326
- },
327
- apps: Ne,
328
- addAppFlag: Ce,
329
- addNameSpaceFlag: Ke,
330
- languageList: L,
331
- editLabel: _e,
332
- fieldsData: ke,
333
- editLabelFlag: We,
334
- labelKey: Be,
335
- refetch: _,
336
- isLoading: Te
337
- }
338
- ) }),
339
- /* @__PURE__ */ a(F, {}),
340
- /* @__PURE__ */ a(
341
- Ma,
342
- {
343
- description: je,
344
- title: "CONFIRM ACTION",
345
- handleClick: aa,
346
- open: Ee,
347
- handleClose: () => {
348
- K((e) => !e);
349
- },
350
- "data-testid": "manageTranslation-modal-customconfirmation"
351
- }
352
- ),
353
- /* @__PURE__ */ a(p, { container: !0, spacing: 1, className: "grow", children: /* @__PURE__ */ u(Le, { isLoading: ce, children: [
354
- /* @__PURE__ */ a(p, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(G, { variant: "outlined", fullWidth: !0, children: [
355
- /* @__PURE__ */ a(T, { className: "pl-2", children: /* @__PURE__ */ a("span", { children: s("App") }) }),
356
- /* @__PURE__ */ a(
357
- Aa,
358
- {
359
- value: h,
360
- onChange: Ge,
361
- size: "small",
362
- displayEmpty: !0,
363
- sx: {
364
- bgcolor: "background.paper",
365
- color: h ? "text.primary" : "text.disabled"
366
- // gray when empty
367
- },
368
- renderValue: (e) => {
369
- var t;
370
- return e ? (t = g.find((n) => n.id === e)) == null ? void 0 : t.appValue : "Select App";
371
- },
372
- children: g == null ? void 0 : g.map((e) => /* @__PURE__ */ a(Sa, { value: e == null ? void 0 : e.id, children: e == null ? void 0 : e.appValue }, e == null ? void 0 : e.id))
373
- }
374
- )
375
- ] }) }),
376
- /* @__PURE__ */ a(p, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(G, { variant: "outlined", fullWidth: !0, children: [
377
- /* @__PURE__ */ a(T, { className: "", children: /* @__PURE__ */ a("span", { children: s("Name Spaces") }) }),
378
- /* @__PURE__ */ a(
379
- La,
380
- {
381
- multiple: !0,
382
- options: pe ?? [],
383
- getOptionLabel: (e) => (e == null ? void 0 : e.label) ?? "",
384
- value: pe.filter(
385
- (e) => v.includes(e.value)
386
- ),
387
- onChange: (e, t) => {
388
- ue(t.map((n) => n.value));
389
- },
390
- filterSelectedOptions: !0,
391
- disableCloseOnSelect: !0,
392
- size: "small",
393
- renderTags: (e, t) => e.map((n, i) => /* @__PURE__ */ ba(
394
- Na,
395
- {
396
- variant: "outlined",
397
- size: "small",
398
- label: n.label,
399
- ...t({ index: i }),
400
- key: n.label,
401
- sx: {
402
- bgcolor: "action.hover"
403
- }
404
- }
405
- )),
406
- renderInput: (e) => /* @__PURE__ */ a(
407
- xe,
408
- {
409
- ...e,
410
- placeholder: "Select Name Space",
411
- sx: { bgcolor: "background.paper" },
412
- "data-testid": "autocomplete-namespace"
413
- }
414
- )
415
- }
416
- )
417
- ] }) }),
418
- /* @__PURE__ */ a(p, { size: { xs: 6, sm: 6, md: 3 }, children: /* @__PURE__ */ u(G, { variant: "outlined", fullWidth: !0, children: [
419
- /* @__PURE__ */ a(T, { sx: { pl: 1 }, children: /* @__PURE__ */ u("span", { children: [
420
- s("Search For"),
421
- ":"
422
- ] }) }),
423
- /* @__PURE__ */ a(
424
- xe,
425
- {
426
- inputRef: d,
427
- name: "searchQuery",
428
- id: "searchQuery",
429
- placeholder: "Enter Search Value",
430
- size: "small",
431
- onChange: Ye,
432
- sx: { bgcolor: "background.paper" },
433
- "data-testid": "managetranslation-search-textfield"
434
- }
435
- )
436
- ] }) }),
437
- /* @__PURE__ */ a(
438
- p,
439
- {
440
- size: { xs: 12, sm: 12, md: 2 },
441
- sx: {
442
- display: "flex",
443
- mt: 3,
444
- justifyContent: "end",
445
- alignItems: "center"
446
- },
447
- children: /* @__PURE__ */ a(Ae, { children: /* @__PURE__ */ a(
448
- I,
449
- {
450
- variant: "contained",
451
- disabled: he,
452
- sx: {
453
- lineHeight: "35px",
454
- ml: 1,
455
- mt: 1,
456
- display: "inline-block",
457
- ...he ? {} : {
458
- bgcolor: "error.main",
459
- color: "error.contrastText",
460
- "&:hover": { bgcolor: "error.dark" }
461
- }
462
- },
463
- onClick: ua,
464
- children: "Clear All Filters"
465
- }
466
- ) })
467
- }
468
- ),
469
- /* @__PURE__ */ a(
470
- p,
471
- {
472
- size: { xs: 12, sm: 12, md: 6.5 },
473
- sx: {
474
- pl: 1,
475
- display: "flex",
476
- justifyContent: "start",
477
- alignItems: "center"
478
- },
479
- children: /* @__PURE__ */ u(Ae, { className: "overflow-x-auto whitespace-nowrap", children: [
480
- /* @__PURE__ */ a(T, { className: "pb-[7px]", children: /* @__PURE__ */ u("span", { children: [
481
- s("Starts With"),
482
- ":"
483
- ] }) }),
484
- Array.from({ length: 26 }, (e, t) => {
485
- const n = String.fromCharCode(65 + t);
486
- return /* @__PURE__ */ a(
487
- T,
488
- {
489
- component: "span",
490
- className: `${b === n ? "selected-letter" : "letter-style"} inline-block cursor-pointer`,
491
- onClick: () => me(n),
492
- children: n
493
- },
494
- n
495
- );
496
- }),
497
- /* @__PURE__ */ a(
498
- I,
499
- {
500
- variant: "contained",
501
- color: "secondary",
502
- disabled: b.length === 0,
503
- className: "x-button ml-2 inline-block",
504
- onClick: () => me(""),
505
- children: "×"
506
- }
507
- )
508
- ] })
509
- }
510
- ),
511
- /* @__PURE__ */ a(
512
- p,
513
- {
514
- size: { xs: 12, sm: 12, md: 5.5 },
515
- display: "flex",
516
- alignItems: "center",
517
- children: /* @__PURE__ */ u(
518
- p,
519
- {
520
- container: !0,
521
- justifyContent: "flex-end",
522
- alignItems: "center",
523
- spacing: 1,
524
- children: [
525
- /* @__PURE__ */ a(p, { item: "true", children: /* @__PURE__ */ a(Ca, { children: /* @__PURE__ */ a(
526
- ka,
527
- {
528
- control: /* @__PURE__ */ a(
529
- Ta,
530
- {
531
- checked: A,
532
- onChange: (e) => le(e.target.checked)
533
- }
534
- ),
535
- label: `${s("Show Inactive")}`,
536
- labelPlacement: "end",
537
- className: "translation-inactive"
538
- }
539
- ) }) }),
540
- /* @__PURE__ */ a(p, { item: "true", children: (S == null ? void 0 : S.canManage) && /* @__PURE__ */ a(
541
- I,
542
- {
543
- size: "small",
544
- variant: "contained",
545
- "data-testid": "manageTranslation-manage-apps-button",
546
- color: "primary",
547
- onClick: ra,
548
- children: s("Manage Apps")
549
- }
550
- ) }),
551
- /* @__PURE__ */ a(p, { item: "true", children: (S == null ? void 0 : S.canManage) && /* @__PURE__ */ a(
552
- I,
553
- {
554
- size: "small",
555
- variant: "contained",
556
- "data-testid": "managetranslation-manage-language-button",
557
- onClick: la,
558
- children: s("Manage Language")
559
- }
560
- ) }),
561
- /* @__PURE__ */ a(p, { item: "true", children: /* @__PURE__ */ a(
562
- I,
563
- {
564
- size: "small",
565
- variant: "contained",
566
- "data-testid": "manageTranalation-add-label-button",
567
- onClick: oa,
568
- children: s("Add Label")
569
- }
570
- ) })
571
- ]
572
- }
573
- )
574
- }
575
- ),
576
- /* @__PURE__ */ a(p, { className: "mt-2", size: { xs: 12 }, children: /* @__PURE__ */ a(
577
- _a,
578
- {
579
- columns: fe,
580
- tableData: Z,
581
- actions: na,
582
- paginationConfig: {
583
- pagination: !0,
584
- paginationType: "infinite-scroll",
585
- loadMore: () => te && da({ cancelRefetch: !1 }),
586
- hasMore: te
587
- },
588
- dataTestId: "manageTranslation-table",
589
- isLoading: Z ? ce || $e : !1,
590
- styleConfig: { tableStyle: { maxHeight: 120 } }
591
- }
592
- ) })
593
- ] }) })
594
- ] });
595
- }
596
- const ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
597
- __proto__: null,
598
- default: $a
599
- }, Symbol.toStringTag, { value: "Module" }));
600
- export {
601
- Da as A,
602
- Wa as L,
603
- ht as M,
604
- za as a,
605
- ct as b,
606
- dt as c,
607
- it as d,
608
- Va as e,
609
- ut as f,
610
- Oa as g,
611
- gt as h,
612
- mt as i,
613
- ft as t,
614
- pt as u
615
- };
616
- //# sourceMappingURL=ManageTranslation-BTxvSYKb.js.map