@argusoft/medplat-form-engine 1.0.13 → 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 (121) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +52390 -3
  3. package/dist/index.js.map +1 -1
  4. package/package.json +4 -1
  5. package/dist/AccessRights-sgIhYR30-Dg6B4KJM.js +0 -1238
  6. package/dist/AccessRights-sgIhYR30-Dg6B4KJM.js.map +0 -1
  7. package/dist/AddEditQueryBuilder-BaZxS2Cm-emLM3Oli.js +0 -289
  8. package/dist/AddEditQueryBuilder-BaZxS2Cm-emLM3Oli.js.map +0 -1
  9. package/dist/AddEditQueryBuilder-BaZxS2Cm.css +0 -1
  10. package/dist/AddFeatures-DLbjDGei-Dg8WYww8.js +0 -212
  11. package/dist/AddFeatures-DLbjDGei-Dg8WYww8.js.map +0 -1
  12. package/dist/AddLabelModal-DE3ploGD-BV_K8Q7c.js +0 -734
  13. package/dist/AddLabelModal-DE3ploGD-BV_K8Q7c.js.map +0 -1
  14. package/dist/AddMenuConfiguration-QWfpcnuP-TAM2c68S.js +0 -5389
  15. package/dist/AddMenuConfiguration-QWfpcnuP-TAM2c68S.js.map +0 -1
  16. package/dist/AddMenuConfiguration-QWfpcnuP.css +0 -1
  17. package/dist/AddRoleDrawer-ZK1eejxI-xMb2iVGk.js +0 -453
  18. package/dist/AddRoleDrawer-ZK1eejxI-xMb2iVGk.js.map +0 -1
  19. package/dist/AppModal-BgZyfrd--CZPgx1UG.js +0 -428
  20. package/dist/AppModal-BgZyfrd--CZPgx1UG.js.map +0 -1
  21. package/dist/ChangePasswordModal-MV7g8tkA-B9b1sWWJ.js +0 -176
  22. package/dist/ChangePasswordModal-MV7g8tkA-B9b1sWWJ.js.map +0 -1
  23. package/dist/ConditionConfig-GDCXIg3C-COtWwHe3.js +0 -395
  24. package/dist/ConditionConfig-GDCXIg3C-COtWwHe3.js.map +0 -1
  25. package/dist/ConditionConfig-GDCXIg3C.css +0 -1
  26. package/dist/EntityManagement-D-x6Qzal-BE01iKNR.js +0 -50
  27. package/dist/EntityManagement-D-x6Qzal-BE01iKNR.js.map +0 -1
  28. package/dist/EventConfigurations-jGCJ4LqP-B_ftXinp.js +0 -384
  29. package/dist/EventConfigurations-jGCJ4LqP-B_ftXinp.js.map +0 -1
  30. package/dist/EventConfigurations-jGCJ4LqP.css +0 -1
  31. package/dist/EventsExceptionModal-BF6E1Np7-DHT7pQsx.js +0 -200
  32. package/dist/EventsExceptionModal-BF6E1Np7-DHT7pQsx.js.map +0 -1
  33. package/dist/EventsSkeleton-BN7_0IGs-BAnd1Vug.js +0 -74
  34. package/dist/EventsSkeleton-BN7_0IGs-BAnd1Vug.js.map +0 -1
  35. package/dist/FeatureMenu-BYSRoNm0-9p5IIVx2.js +0 -249
  36. package/dist/FeatureMenu-BYSRoNm0-9p5IIVx2.js.map +0 -1
  37. package/dist/Features-CKMmuqcs-ClXAzWGV.js +0 -11
  38. package/dist/Features-CKMmuqcs-ClXAzWGV.js.map +0 -1
  39. package/dist/FlywayQuery-Cx2sly6g-B1LLSyLE.js +0 -169
  40. package/dist/FlywayQuery-Cx2sly6g-B1LLSyLE.js.map +0 -1
  41. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-D1gCzYi3.js +0 -5162
  42. package/dist/ImmunizationConfigurationBase-DZ8EqXlF-D1gCzYi3.js.map +0 -1
  43. package/dist/ImmunizationConfigurationBase-DZ8EqXlF.css +0 -1
  44. package/dist/ImmunizationConfigurationsList-CQnxWa09-DIujYt0W.js +0 -335
  45. package/dist/ImmunizationConfigurationsList-CQnxWa09-DIujYt0W.js.map +0 -1
  46. package/dist/ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js +0 -186
  47. package/dist/ImmunizationSkeleton-D2tdv5k--B7SY-gnr.js.map +0 -1
  48. package/dist/LanguagesModal-rk6IGQwY-BaAI1s2W.js +0 -394
  49. package/dist/LanguagesModal-rk6IGQwY-BaAI1s2W.js.map +0 -1
  50. package/dist/ManageDynamicFeature-BKkCnQvF-CinU35NS.js +0 -4189
  51. package/dist/ManageDynamicFeature-BKkCnQvF-CinU35NS.js.map +0 -1
  52. package/dist/ManageEventConfiguration-BJxS2Su0-DBdaQcPo.js +0 -1017
  53. package/dist/ManageEventConfiguration-BJxS2Su0-DBdaQcPo.js.map +0 -1
  54. package/dist/ManageEventConfiguration-BJxS2Su0.css +0 -1
  55. package/dist/ManageNotification-B4prX-9Z-B4mRuGir.js +0 -6819
  56. package/dist/ManageNotification-B4prX-9Z-B4mRuGir.js.map +0 -1
  57. package/dist/ManageRole-BjIIXAlK-DY39p0FD.js +0 -728
  58. package/dist/ManageRole-BjIIXAlK-DY39p0FD.js.map +0 -1
  59. package/dist/ManageTranslation-BTxvSYKb-C2CZwkRN.js +0 -616
  60. package/dist/ManageTranslation-BTxvSYKb-C2CZwkRN.js.map +0 -1
  61. package/dist/ManageTranslation-BTxvSYKb.css +0 -1
  62. package/dist/ManageUser-PHiTNyF8-DXXBZWL6.js +0 -2160
  63. package/dist/ManageUser-PHiTNyF8-DXXBZWL6.js.map +0 -1
  64. package/dist/ManageUser-PHiTNyF8.css +0 -1
  65. package/dist/MedplatFormWrapper-s7j3X__p.js +0 -44782
  66. package/dist/MedplatFormWrapper-s7j3X__p.js.map +0 -1
  67. package/dist/MedplatFormWrapper.css +0 -1
  68. package/dist/MobileMenuManagement-DmQU5TTo-D7n_NP0X.js +0 -108
  69. package/dist/MobileMenuManagement-DmQU5TTo-D7n_NP0X.js.map +0 -1
  70. package/dist/MobileTypeEventConfigModal-ChhO_A4f-Dpq9010c.js +0 -783
  71. package/dist/MobileTypeEventConfigModal-ChhO_A4f-Dpq9010c.js.map +0 -1
  72. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js +0 -1002
  73. package/dist/NewServerManagement-5YcAtF-g-DHV6PFTR.js.map +0 -1
  74. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js +0 -244
  75. package/dist/NotificationFlywayQuery-BY8Zzml_-C7G-28dx.js.map +0 -1
  76. package/dist/NotificationList-BkpOrCpM-B-vKDGd_.js +0 -400
  77. package/dist/NotificationList-BkpOrCpM-B-vKDGd_.js.map +0 -1
  78. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-CsQiv68d.js +0 -1953
  79. package/dist/OtherTypeEventConfigModal-ZnCGWm9v-CsQiv68d.js.map +0 -1
  80. package/dist/QueryBuilder-Cus_mRwZ-DLXSM32i.js +0 -378
  81. package/dist/QueryBuilder-Cus_mRwZ-DLXSM32i.js.map +0 -1
  82. package/dist/QueryBuilder-Cus_mRwZ.css +0 -1
  83. package/dist/QueryManagement-DXA73N2j-BByBVpSS.js +0 -671
  84. package/dist/QueryManagement-DXA73N2j-BByBVpSS.js.map +0 -1
  85. package/dist/QueryManagement-DXA73N2j.css +0 -1
  86. package/dist/RoleManagement-v5Nyp1vr-BsTLfcMm.js +0 -416
  87. package/dist/RoleManagement-v5Nyp1vr-BsTLfcMm.js.map +0 -1
  88. package/dist/ServerSyncModal-uNjGCQJz--PJ3F3xg.js +0 -869
  89. package/dist/ServerSyncModal-uNjGCQJz--PJ3F3xg.js.map +0 -1
  90. package/dist/ShowFlywayQuery-DMsAbtOW-TT9XXzUi.js +0 -130
  91. package/dist/ShowFlywayQuery-DMsAbtOW-TT9XXzUi.js.map +0 -1
  92. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js +0 -259
  93. package/dist/ShowFlywayQuery-DVRCd384-BypXcNWX.js.map +0 -1
  94. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js +0 -190
  95. package/dist/ShowQueryHistory-BDN0tzHg-17BxK88Z.js.map +0 -1
  96. package/dist/SubMenu-BHcSNSUF-eLmX3DkH.js +0 -187
  97. package/dist/SubMenu-BHcSNSUF-eLmX3DkH.js.map +0 -1
  98. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js +0 -1508
  99. package/dist/TableDetails-DzREeJkm-B-WEBbQz.js.map +0 -1
  100. package/dist/TableList-B9hr05Hs-BIsMbnIV.js +0 -428
  101. package/dist/TableList-B9hr05Hs-BIsMbnIV.js.map +0 -1
  102. package/dist/TypeConfiguration-C-lk8Szs-qaofDyyM.js +0 -117
  103. package/dist/TypeConfiguration-C-lk8Szs-qaofDyyM.js.map +0 -1
  104. package/dist/UserList-BxB1tCwM-7YIwwGQ9.js +0 -13039
  105. package/dist/UserList-BxB1tCwM-7YIwwGQ9.js.map +0 -1
  106. package/dist/UserList-BxB1tCwM.css +0 -1
  107. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js +0 -184
  108. package/dist/UserListSkeleton-cglK2SaU-B_Tj5gUp.js.map +0 -1
  109. package/dist/WidgetList-BSApErov-D05f9srr.js +0 -188
  110. package/dist/WidgetList-BSApErov-D05f9srr.js.map +0 -1
  111. package/dist/_commonjsHelpers-BItOPCY9-B9tZyK9c.js +0 -29
  112. package/dist/_commonjsHelpers-BItOPCY9-B9tZyK9c.js.map +0 -1
  113. package/dist/i18next-CTOWN_jH-BKKbdDel.js +0 -1389
  114. package/dist/i18next-CTOWN_jH-BKKbdDel.js.map +0 -1
  115. package/dist/index-B4r0wjBD.js +0 -563
  116. package/dist/index-B4r0wjBD.js.map +0 -1
  117. package/dist/index-Cve8KTWl.js +0 -542
  118. package/dist/index-Cve8KTWl.js.map +0 -1
  119. package/dist/manageImmunization-B4swS745-JldexHrO.js +0 -1204
  120. package/dist/manageImmunization-B4swS745-JldexHrO.js.map +0 -1
  121. package/dist/manageImmunization-B4swS745.css +0 -1
@@ -1,734 +0,0 @@
1
- import { jsx as n, jsxs as s, Fragment as J } from "react/jsx-runtime";
2
- import { useRef as oe, useState as S, useCallback as Ve, useMemo as Te, useEffect as de } from "react";
3
- import v from "prop-types";
4
- import { useForm as qe } from "react-hook-form";
5
- import { yupResolver as Fe } from "@hookform/resolvers/yup";
6
- import h from "@mui/material/Grid2";
7
- import * as y from "yup";
8
- import { Modal as ze, Typography as Oe, IconButton as Ie, FormControl as V, Box as k, Button as ue } from "@mui/material";
9
- import P from "@/views/custom-components/CustomTextField";
10
- import { showToast as N } from "@/common/toaster/toaster";
11
- import { t as Be, e as Re, f as Y, h as Ke, i as Me } from "./ManageTranslation-BTxvSYKb-C2CZwkRN.js";
12
- import { executeQuery as ce, execute as W } from "@/common/services/GlobalApis";
13
- import Xe from "@/views/custom-components/CustomAutoComplete";
14
- import Ge from "@/hooks/useTrackEvent";
15
- import { useTranslateProvider as Pe } from "@/common/languageTranslator/TranslationContext";
16
- import We from "@mui/material/Tabs";
17
- import De from "@mui/material/Tab";
18
- import { faXmark as Qe } from "@fortawesome/free-solid-svg-icons";
19
- import { FontAwesomeIcon as Ue } from "@fortawesome/react-fontawesome";
20
- import He from "@/views/custom-components/CustomDropdown";
21
- function pe($) {
22
- const { children: D, value: O, index: w, selectedTab: f, ...m } = $;
23
- return /* @__PURE__ */ n(
24
- "div",
25
- {
26
- role: "tabpanel",
27
- hidden: O !== f,
28
- id: `simple-tabpanel-${w}`,
29
- "aria-labelledby": `simple-tab-${w}`,
30
- ...m,
31
- children: O === f && /* @__PURE__ */ n(k, { className: "p-3", children: D })
32
- }
33
- );
34
- }
35
- pe.propTypes = {
36
- selectedTab: v.any,
37
- children: v.node,
38
- index: v.number.isRequired,
39
- value: v.number.isRequired
40
- };
41
- function Je($) {
42
- return {
43
- id: `simple-tab-${$}`,
44
- "aria-controls": `simple-tabpanel-${$}`
45
- };
46
- }
47
- const Ye = ({
48
- open: $,
49
- handleClose: D,
50
- apps: O,
51
- languageList: w = [],
52
- addAppFlag: f = !1,
53
- fieldsData: m,
54
- refetch: I,
55
- addNameSpaceFlag: _ = !1,
56
- editLabelFlag: x = !1,
57
- labelKey: Z = null,
58
- isLoading: me = !1
59
- }) => {
60
- var ee;
61
- const B = (ee = w == null ? void 0 : w.find(
62
- (e) => e.languageValue === "English"
63
- )) == null ? void 0 : ee.id, ae = oe(null), T = oe(!1), Q = Ge(), [q, le] = S([]), [A, ne] = S([]), [ve, ge] = S([]), [R, he] = S([]), [U, te] = S(null), [fe, be] = S([]), { translate: E } = Pe(), ye = (e, l) => {
64
- te(l);
65
- };
66
- let F;
67
- if (f) {
68
- const e = m == null ? void 0 : m.reduce((l, a) => (l[`${a.languagevalue}`] = y.string().required(
69
- `Enter value for ${a.languagevalue}`
70
- ), l), {});
71
- F = y.object().shape({
72
- apps: y.array().min(1, "Select at least one App").required("Select App"),
73
- ...e
74
- // Spread the dynamically created validations
75
- });
76
- } else if (_)
77
- F = y.object().shape({
78
- namespace: y.array().min(1, "Select at least one Namespace").required("Select Namespace")
79
- });
80
- else if (x) {
81
- let e = R.reduce((l, a) => ((a == null ? void 0 : a.languagevalue) !== "English" && (a == null ? void 0 : a.appvalue) === U && (l[`${a.app}_${a.languagevalue}`] = y.string().required(`Enter value for ${a.languagevalue}`).test(
82
- "placeholders-match",
83
- "Placeholders do not match the original English text.",
84
- function(i) {
85
- const { path: t, createError: o, parent: d } = this, u = (d == null ? void 0 : d[`${a.app}_English`]) || "", r = M(u), p = M(i);
86
- return Object.keys(r).length === Object.keys(p).length && Object.keys(r).every(
87
- (b) => p[b] === r[b]
88
- ) || o({
89
- path: t,
90
- message: "Placeholders do not match the original English text."
91
- });
92
- }
93
- )), l), {});
94
- F = y.object().shape({
95
- ...e
96
- });
97
- } else {
98
- const e = w.reduce((l, a) => ((a == null ? void 0 : a.language_value) !== "English" && (l[a.language_value] = y.string().required(`Enter value for ${a.language_value}`).test(
99
- "placeholders-match",
100
- "Placeholders do not match the original English text.",
101
- function(i) {
102
- const { path: t, createError: o, parent: d } = this, u = (d == null ? void 0 : d.englishValue) || "", r = M(u), p = M(i);
103
- return Object.keys(r).length === Object.keys(p).length && Object.keys(r).every(
104
- (b) => p[b] === r[b]
105
- ) || o({
106
- path: t,
107
- message: "Placeholders do not match the original English text."
108
- });
109
- }
110
- )), l), {});
111
- F = y.object().shape({
112
- apps: y.array().min(1, "Select at least one App").required("Select App"),
113
- namespace: y.array().min(1, "Select at least one Namespace").required("Select Namespace"),
114
- englishValue: y.string().required("Enter Value for English"),
115
- ...e
116
- // Spread the dynamically created validations
117
- });
118
- }
119
- const ie = Ve(async (e) => {
120
- try {
121
- await Le(e);
122
- } catch (l) {
123
- console.error(l);
124
- }
125
- }, []), xe = (e, l) => {
126
- let a;
127
- return (...i) => {
128
- a && clearTimeout(a), a = setTimeout(() => {
129
- e(...i);
130
- }, l);
131
- };
132
- }, Ne = Te(
133
- () => xe(ie, 300),
134
- [ie]
135
- ), {
136
- control: j,
137
- handleSubmit: ke,
138
- reset: we,
139
- setValue: K,
140
- getValues: re,
141
- formState: { errors: L }
142
- } = qe({
143
- defaultValues: {},
144
- resolver: Fe(F),
145
- mode: "onChange"
146
- }), M = (e) => {
147
- if (!e) return {};
148
- const l = [...e.matchAll(/{(.*?)}/g)], a = {};
149
- return l.forEach((i) => {
150
- const t = i[1];
151
- a[t] = (a[t] || 0) + 1;
152
- }), a;
153
- };
154
- de(() => {
155
- if (Ae(), m && f) {
156
- let e = [];
157
- m == null || m.forEach((l) => {
158
- K(l == null ? void 0 : l.languagevalue, l == null ? void 0 : l.value), e.push({ id: l == null ? void 0 : l.language, value: l == null ? void 0 : l.value });
159
- }), ne(e), Ce();
160
- }
161
- m && _ && _e(m.key);
162
- }, [m]), de(() => {
163
- x && Ee();
164
- }, [x]);
165
- const Ee = async () => {
166
- var e, l, a, i;
167
- try {
168
- const t = await ce({
169
- code: "labels_selected_apps_for_editing",
170
- parameters: { key: Z }
171
- });
172
- he((e = t == null ? void 0 : t.data) == null ? void 0 : e.result);
173
- let o = (a = (l = t == null ? void 0 : t.data) == null ? void 0 : l.result) == null ? void 0 : a.map((d) => d.appvalue).filter((d, u, r) => u === r.findIndex((p) => p === d));
174
- (i = t == null ? void 0 : t.data) == null || i.result.forEach((d) => {
175
- const u = `${d.app}_${d.languagevalue}`;
176
- K(u, d.value || "");
177
- }), le(o), te(o[0]);
178
- } catch (t) {
179
- console.error(t), N({ message: "Error in editing label", type: "error" });
180
- }
181
- }, H = (e, l, a = null) => {
182
- let i = [...A], t = !1;
183
- i == null || i.forEach((o) => {
184
- (o == null ? void 0 : o.id) === e && (o.value = l, t = !0);
185
- }), t || (a ? i.push({ id: e, value: l, labelid: a }) : i.push({ id: e, value: l })), ne(i);
186
- }, _e = async (e) => {
187
- var l, a;
188
- try {
189
- const i = await W({
190
- code: "get_namespaces_from_key",
191
- parameters: { key: e }
192
- });
193
- let t = (a = (l = i == null ? void 0 : i.data) == null ? void 0 : l.result) == null ? void 0 : a.map((o) => o.value);
194
- K("namespace", t || []);
195
- } catch (i) {
196
- console.error(i);
197
- }
198
- }, Ae = async () => {
199
- var e;
200
- try {
201
- const l = await W({
202
- code: "get_distinct_namespce",
203
- parameters: {}
204
- });
205
- be((e = l == null ? void 0 : l.data) == null ? void 0 : e.result);
206
- } catch (l) {
207
- console.error(l);
208
- }
209
- }, Ce = async () => {
210
- var e, l, a;
211
- try {
212
- let i = {
213
- code: "labels_selected_apps_for_editing",
214
- parameters: { key: (e = m[0]) == null ? void 0 : e.key.replace(/'/g, "''") }
215
- };
216
- const t = await ce(i);
217
- let o = (a = (l = t == null ? void 0 : t.data) == null ? void 0 : l.result) == null ? void 0 : a.map((d) => d.appvalue).filter((d, u, r) => u === r.findIndex((p) => p === d)).join(", ");
218
- le(o);
219
- } catch (i) {
220
- console.error(i), N({ message: "Error in Adding App", type: "error" });
221
- }
222
- }, $e = (e, l) => {
223
- ge(l), K("apps", l);
224
- }, je = (e) => (e == null ? void 0 : e.appValue) || "", C = () => {
225
- Q("conversion_event", {
226
- form: ae.current,
227
- form_name: "Add Label Configuration",
228
- submit: T.current
229
- }), D();
230
- }, Le = async (e) => {
231
- var l;
232
- try {
233
- let a;
234
- if ((e == null ? void 0 : e.id) === B) {
235
- let i;
236
- f ? (a = A.filter((t) => t.id !== B).map((t) => t.id).join(","), A == null || A.forEach((t) => {
237
- (t == null ? void 0 : t.id) === B && (i = t == null ? void 0 : t.value);
238
- })) : (a = w.filter((t) => t.languageKey !== "en").map((t) => t.id).join(","), i = (l = re()) == null ? void 0 : l.englishValue), i ? await Be(a, i) : N({ message: "Enter english text", type: "info" });
239
- }
240
- } catch (a) {
241
- console.error(a), N({ message: "Error in Translation", type: "error" });
242
- }
243
- }, Se = async (e) => {
244
- var l, a, i, t, o, d;
245
- try {
246
- Q("button_click", {
247
- button_name: "add-label-add-button",
248
- button_type: "submit",
249
- button_id: "add-label-submit-button"
250
- });
251
- let u = [];
252
- if (f)
253
- (l = e == null ? void 0 : e.apps) == null || l.forEach((r) => {
254
- A == null || A.forEach((p) => {
255
- u.push({
256
- language: p == null ? void 0 : p.id,
257
- value: p == null ? void 0 : p.value,
258
- app: r == null ? void 0 : r.id,
259
- isActive: !0,
260
- key: m[0].key
261
- });
262
- });
263
- }), await Y(u), T.current = !0, I(), N({ message: "App Added Successfully", type: "success" }), C();
264
- else if (_) {
265
- let r = (e == null ? void 0 : e.namespace) || [];
266
- await Ke({
267
- key: m.key,
268
- namespace: r
269
- }), T.current = !0, I(), N({
270
- message: "NameSpace Updated Successfully",
271
- type: "success"
272
- }), C();
273
- } else if (x) {
274
- const r = re(), p = Object.entries(r).reduce(
275
- (b, [X, c]) => {
276
- const [g, z] = X.split("_");
277
- if (c === "") return b;
278
- const G = R.find(
279
- (se) => se.app === parseInt(g) && se.languagevalue === z
280
- );
281
- return G && G.value !== c && b.push({
282
- id: G.id || null,
283
- language: G.language || z,
284
- value: c,
285
- app: parseInt(g),
286
- isActive: !0,
287
- key: Z
288
- }), b;
289
- },
290
- []
291
- );
292
- await Y(p), T.current = !0, I(), N({ message: "Label Updated Successfully", type: "success" }), C();
293
- } else {
294
- const r = e.englishValue.replace(/ /g, "");
295
- (a = e == null ? void 0 : e.apps) == null || a.forEach((c) => {
296
- u.push({
297
- language: B,
298
- value: e == null ? void 0 : e.englishValue,
299
- app: c == null ? void 0 : c.id,
300
- isActive: !0,
301
- key: r
302
- }), A == null || A.forEach((g) => {
303
- u.push({
304
- language: g == null ? void 0 : g.id,
305
- value: g == null ? void 0 : g.value,
306
- app: c == null ? void 0 : c.id,
307
- isActive: !0,
308
- key: r
309
- });
310
- });
311
- });
312
- let p = (e == null ? void 0 : e.namespace) || [], b = [];
313
- for (const c of p)
314
- try {
315
- const g = await W({
316
- code: "check_key_namespace_exist",
317
- parameters: {
318
- key: r,
319
- namespace: c
320
- }
321
- });
322
- ((t = (i = g == null ? void 0 : g.data) == null ? void 0 : i.result) == null ? void 0 : t.length) === 0 && b.push(c);
323
- } catch (g) {
324
- console.error("Error while checking namespace:", c, g);
325
- }
326
- await Me({
327
- key: r,
328
- namespace: b
329
- });
330
- let X = !1;
331
- for (const c of u) {
332
- let g = {
333
- code: "translation_label_app_language_key_check",
334
- parameters: {
335
- key: c == null ? void 0 : c.key,
336
- language: c == null ? void 0 : c.language,
337
- app: c == null ? void 0 : c.app
338
- }
339
- };
340
- const z = await W(g);
341
- if (((d = (o = z == null ? void 0 : z.data) == null ? void 0 : o.result) == null ? void 0 : d.length) > 0) {
342
- N({
343
- message: "The Label containing Same App, Language and Key Already Exists.",
344
- type: "error"
345
- }), X = !0;
346
- break;
347
- }
348
- }
349
- !X && u.length > 0 && (await Y(u), T.current = !0, I(), N({
350
- message: "Label Added Successfully",
351
- type: "success"
352
- }), C());
353
- }
354
- } catch (u) {
355
- console.error(u), N({ message: "Error in Adding Label", type: "error" });
356
- }
357
- };
358
- return /* @__PURE__ */ n(
359
- ze,
360
- {
361
- "data-testid": "add-label-modal",
362
- open: $,
363
- onClose: () => {
364
- C(), we();
365
- },
366
- className: "translation-modal",
367
- children: /* @__PURE__ */ n(Re, { isLoading: me, children: /* @__PURE__ */ s(
368
- h,
369
- {
370
- container: !0,
371
- sx: {
372
- display: "flex",
373
- flexDirection: "column",
374
- position: "absolute",
375
- top: 40,
376
- left: "50%",
377
- transform: "translateX(-50%)",
378
- width: "95%",
379
- maxWidth: { sm: 600, md: 700, lg: 800 },
380
- bgcolor: "background.paper",
381
- boxShadow: 24,
382
- border: 1,
383
- borderColor: "divider",
384
- borderRadius: 0.5
385
- },
386
- children: [
387
- /* @__PURE__ */ s(
388
- h,
389
- {
390
- sx: {
391
- p: 1.25,
392
- px: 3,
393
- display: "flex",
394
- justifyContent: "space-between",
395
- borderBottom: 1,
396
- borderColor: "divider"
397
- },
398
- "data-testid": "add-label-header",
399
- children: [
400
- /* @__PURE__ */ s(
401
- Oe,
402
- {
403
- variant: "body1",
404
- className: "text-customBlue",
405
- sx: { fontWeight: "medium", fontSize: "1.125rem" },
406
- children: [
407
- !f && !_ && !x && E("Add Label"),
408
- _ && E("Add NameSpace"),
409
- f && E("Add App"),
410
- x && E("Edit Label")
411
- ]
412
- }
413
- ),
414
- /* @__PURE__ */ n(
415
- Ie,
416
- {
417
- size: "small",
418
- onClick: () => {
419
- C();
420
- },
421
- "data-testid": "add-label-close-button",
422
- children: /* @__PURE__ */ n(Ue, { icon: Qe })
423
- }
424
- )
425
- ]
426
- }
427
- ),
428
- /* @__PURE__ */ n(h, { item: "true", className: "overflow-y-auto max-h-[60vh]", children: /* @__PURE__ */ s(
429
- h,
430
- {
431
- container: !0,
432
- justifyContent: "flex-start",
433
- className: "p-3 pl-5 pr-7",
434
- children: [
435
- _ && /* @__PURE__ */ s("div", { children: [
436
- "Add Namespace for ",
437
- m == null ? void 0 : m.key
438
- ] }),
439
- f && /* @__PURE__ */ s("div", { children: [
440
- "Label already exists in ",
441
- q
442
- ] }),
443
- /* @__PURE__ */ s(
444
- "form",
445
- {
446
- onSubmit: ke(Se),
447
- className: "w-full",
448
- ref: ae,
449
- children: [
450
- !_ && !x && /* @__PURE__ */ n(h, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ n(
451
- V,
452
- {
453
- variant: "outlined",
454
- className: "w-full",
455
- "data-testid": "add-label-base-date-field",
456
- children: /* @__PURE__ */ s(k, { className: "custom-flex-container", children: [
457
- /* @__PURE__ */ s("div", { className: "w-[30%]", children: [
458
- E("App"),
459
- /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" })
460
- ] }),
461
- /* @__PURE__ */ n(
462
- Xe,
463
- {
464
- control: j,
465
- name: "apps",
466
- size: "small",
467
- options: O || [],
468
- errors: L,
469
- value: ve,
470
- onChange: $e,
471
- getOptionLabel: je
472
- }
473
- )
474
- ] })
475
- }
476
- ) }),
477
- !f && !x && /* @__PURE__ */ n(h, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ n(
478
- V,
479
- {
480
- variant: "outlined",
481
- className: "w-full",
482
- "data-testid": "add-label-base-date-field",
483
- children: /* @__PURE__ */ s(k, { className: "custom-flex-container", children: [
484
- /* @__PURE__ */ s("div", { className: "w-[30%]", children: [
485
- E("Namespace"),
486
- /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" }),
487
- /* @__PURE__ */ n("br", {}),
488
- /* @__PURE__ */ n("div", { className: "text-sm text-gray-600 pr-3", children: "(Note: Add to General if no specific namespace)" })
489
- ] }),
490
- /* @__PURE__ */ n(
491
- He,
492
- {
493
- control: j,
494
- name: "namespace",
495
- options: fe || [],
496
- errors: L,
497
- displayName: "label",
498
- optionValue: "value",
499
- multiple: !0
500
- }
501
- )
502
- ] })
503
- }
504
- ) }),
505
- !f && !_ && !x && /* @__PURE__ */ s(J, { children: [
506
- /* @__PURE__ */ n(h, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ n(
507
- V,
508
- {
509
- variant: "outlined",
510
- className: "w-full",
511
- "data-testid": "add-label-field",
512
- children: /* @__PURE__ */ s(
513
- k,
514
- {
515
- className: "custom-flex-container",
516
- display: "flex",
517
- children: [
518
- /* @__PURE__ */ s("div", { className: "w-[30%]", children: [
519
- E("English"),
520
- /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" })
521
- ] }),
522
- /* @__PURE__ */ n(
523
- P,
524
- {
525
- control: j,
526
- id: "englishValue",
527
- name: "englishValue",
528
- errors: L,
529
- label: "",
530
- size: "small",
531
- className: "w-full",
532
- "data-testid": "add-label-language-english"
533
- }
534
- )
535
- ]
536
- }
537
- )
538
- }
539
- ) }),
540
- w == null ? void 0 : w.map((e, l) => {
541
- if ((e == null ? void 0 : e.language_value) !== "English")
542
- return /* @__PURE__ */ n(h, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ n(
543
- V,
544
- {
545
- variant: "outlined",
546
- className: "w-full",
547
- "data-testid": "add-label-base-date-field",
548
- children: /* @__PURE__ */ s(k, { className: "custom-flex-container", children: [
549
- /* @__PURE__ */ s("div", { className: "w-[30%]", children: [
550
- e == null ? void 0 : e.language_value,
551
- /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" })
552
- ] }),
553
- /* @__PURE__ */ n(
554
- P,
555
- {
556
- control: j,
557
- id: e == null ? void 0 : e.language_value,
558
- name: e == null ? void 0 : e.language_value,
559
- errors: L,
560
- onChange: (a) => {
561
- var i;
562
- H(
563
- e == null ? void 0 : e.id,
564
- (i = a == null ? void 0 : a.target) == null ? void 0 : i.value
565
- );
566
- },
567
- label: "",
568
- size: "small",
569
- className: "w-full",
570
- "data-testid": "add-label-language"
571
- }
572
- )
573
- ] })
574
- }
575
- ) }, l + 1);
576
- })
577
- ] }),
578
- f && /* @__PURE__ */ n(J, { children: m == null ? void 0 : m.map((e, l) => /* @__PURE__ */ n(h, { item: "true", className: "pb-[5px]", children: /* @__PURE__ */ n(
579
- V,
580
- {
581
- variant: "outlined",
582
- className: "w-full",
583
- "data-testid": "add-label-base-date-field",
584
- children: /* @__PURE__ */ s(k, { className: "custom-flex-container", children: [
585
- /* @__PURE__ */ s("div", { className: "w-[30%]", children: [
586
- e == null ? void 0 : e.languagevalue,
587
- /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" })
588
- ] }),
589
- /* @__PURE__ */ n(
590
- P,
591
- {
592
- control: j,
593
- id: e == null ? void 0 : e.languagevalue,
594
- name: e == null ? void 0 : e.languagevalue,
595
- errors: L,
596
- onChange: (a) => {
597
- var i;
598
- H(
599
- e == null ? void 0 : e.language,
600
- (i = a == null ? void 0 : a.target) == null ? void 0 : i.value
601
- ), Ne({ id: e == null ? void 0 : e.language });
602
- },
603
- label: "",
604
- size: "small",
605
- className: "w-full",
606
- "data-testid": "add-label-language"
607
- }
608
- )
609
- ] })
610
- }
611
- ) }, l + 1)) }),
612
- x && /* @__PURE__ */ s(J, { children: [
613
- " ",
614
- /* @__PURE__ */ n(h, { item: !0, className: "pb-[5px]", children: /* @__PURE__ */ n(k, { className: "w-full", children: /* @__PURE__ */ n(k, { className: "label-edit-tabs", children: /* @__PURE__ */ n(
615
- We,
616
- {
617
- value: U,
618
- onChange: ye,
619
- "aria-label": "basic tabs example",
620
- children: q == null ? void 0 : q.map((e, l) => /* @__PURE__ */ n(
621
- De,
622
- {
623
- label: e,
624
- value: e,
625
- ...Je(l)
626
- },
627
- l + 1
628
- ))
629
- }
630
- ) }) }) }),
631
- q == null ? void 0 : q.map((e, l) => /* @__PURE__ */ n(h, { item: !0, children: /* @__PURE__ */ n(h, { children: /* @__PURE__ */ n(
632
- pe,
633
- {
634
- value: e,
635
- selectedTab: U,
636
- index: l,
637
- children: R == null ? void 0 : R.map((a, i) => {
638
- if ((a == null ? void 0 : a.appvalue) === e)
639
- return /* @__PURE__ */ n(h, { item: !0, className: "pb-[5px]", children: /* @__PURE__ */ n(
640
- V,
641
- {
642
- variant: "outlined",
643
- className: "w-full",
644
- "data-testid": "label-edit-field",
645
- children: /* @__PURE__ */ s(k, { className: "custom-flex-container", children: [
646
- /* @__PURE__ */ n("div", { className: "w-[30%]", children: a == null ? void 0 : a.languagevalue }),
647
- /* @__PURE__ */ n(
648
- P,
649
- {
650
- control: j,
651
- id: `${a == null ? void 0 : a.app}-${a.languagevalue}`,
652
- name: `${a == null ? void 0 : a.app}_${a.languagevalue}`,
653
- errors: L,
654
- onChange: (t) => {
655
- var o;
656
- return H(
657
- a == null ? void 0 : a.language,
658
- (o = t == null ? void 0 : t.target) == null ? void 0 : o.value,
659
- a == null ? void 0 : a.id
660
- );
661
- },
662
- label: "",
663
- size: "small",
664
- className: "w-full",
665
- "data-testid": "label-edit-input"
666
- }
667
- )
668
- ] })
669
- }
670
- ) }, i + 1);
671
- })
672
- },
673
- l + 1
674
- ) }) }, l + 1))
675
- ] }),
676
- /* @__PURE__ */ n(h, { item: "true", className: "pb-[5px] flex justify-end", children: /* @__PURE__ */ s(k, { className: "custom-flex-button", children: [
677
- /* @__PURE__ */ n(
678
- ue,
679
- {
680
- size: "small",
681
- variant: "contained",
682
- "data-testid": "add-label-back-button",
683
- color: "secondary",
684
- onClick: () => {
685
- C(), Q("button_click", {
686
- button_name: "add-label-back-button",
687
- button_type: "cancel",
688
- button_id: "add-label-back-button"
689
- });
690
- },
691
- children: E("Cancel")
692
- }
693
- ),
694
- /* @__PURE__ */ n(
695
- ue,
696
- {
697
- type: "submit",
698
- size: "small",
699
- variant: "contained",
700
- "data-testid": "add-label-save-button",
701
- color: "primary",
702
- children: E("Save")
703
- }
704
- )
705
- ] }) })
706
- ]
707
- }
708
- )
709
- ]
710
- }
711
- ) })
712
- ]
713
- }
714
- ) })
715
- }
716
- );
717
- };
718
- Ye.propTypes = {
719
- open: v.any,
720
- handleClose: v.any,
721
- languageList: v.any,
722
- apps: v.any,
723
- addAppFlag: v.any,
724
- fieldsData: v.any,
725
- refetch: v.any,
726
- addNameSpaceFlag: v.any,
727
- editLabelFlag: v.any,
728
- labelKey: v.any,
729
- isLoading: v.any
730
- };
731
- export {
732
- Ye as default
733
- };
734
- //# sourceMappingURL=AddLabelModal-DE3ploGD-BV_K8Q7c.js.map