@argusoft/medplat-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AccessRights-sgIhYR30.js +1238 -0
- package/dist/AccessRights-sgIhYR30.js.map +1 -0
- package/dist/AddEditQueryBuilder-BaZxS2Cm.js +289 -0
- package/dist/AddEditQueryBuilder-BaZxS2Cm.js.map +1 -0
- package/dist/AddEditQueryBuilder.css +1 -0
- package/dist/AddFeatures-BxXCC6ex.js +212 -0
- package/dist/AddFeatures-BxXCC6ex.js.map +1 -0
- package/dist/AddLabelModal-DE3ploGD.js +734 -0
- package/dist/AddLabelModal-DE3ploGD.js.map +1 -0
- package/dist/AddMenuConfiguration-QWfpcnuP.js +2237 -0
- package/dist/AddMenuConfiguration-QWfpcnuP.js.map +1 -0
- package/dist/AddMenuConfiguration.css +1 -0
- package/dist/AddRoleDrawer-ZK1eejxI.js +453 -0
- package/dist/AddRoleDrawer-ZK1eejxI.js.map +1 -0
- package/dist/AppModal-BgZyfrd-.js +428 -0
- package/dist/AppModal-BgZyfrd-.js.map +1 -0
- package/dist/ChangePasswordModal-MV7g8tkA.js +176 -0
- package/dist/ChangePasswordModal-MV7g8tkA.js.map +1 -0
- package/dist/ConditionConfig-BqWe0NKO.js +395 -0
- package/dist/ConditionConfig-BqWe0NKO.js.map +1 -0
- package/dist/ConditionConfig.css +1 -0
- package/dist/EntityManagement-D-x6Qzal.js +50 -0
- package/dist/EntityManagement-D-x6Qzal.js.map +1 -0
- package/dist/EventConfigurations-jGCJ4LqP.js +384 -0
- package/dist/EventConfigurations-jGCJ4LqP.js.map +1 -0
- package/dist/EventConfigurations.css +1 -0
- package/dist/EventsExceptionModal-BF6E1Np7.js +200 -0
- package/dist/EventsExceptionModal-BF6E1Np7.js.map +1 -0
- package/dist/EventsSkeleton-BN7_0IGs.js +74 -0
- package/dist/EventsSkeleton-BN7_0IGs.js.map +1 -0
- package/dist/FeatureMenu-BYSRoNm0.js +249 -0
- package/dist/FeatureMenu-BYSRoNm0.js.map +1 -0
- package/dist/Features-CKMmuqcs.js +11 -0
- package/dist/Features-CKMmuqcs.js.map +1 -0
- package/dist/FlywayQuery-Cx2sly6g.js +169 -0
- package/dist/FlywayQuery-Cx2sly6g.js.map +1 -0
- package/dist/ImmunizationConfigurationBase-CdCgDaAl.js +5299 -0
- package/dist/ImmunizationConfigurationBase-CdCgDaAl.js.map +1 -0
- package/dist/ImmunizationConfigurationBase.css +1 -0
- package/dist/ImmunizationConfigurationsList-CQnxWa09.js +335 -0
- package/dist/ImmunizationConfigurationsList-CQnxWa09.js.map +1 -0
- package/dist/ImmunizationSkeleton-D2tdv5k-.js +186 -0
- package/dist/ImmunizationSkeleton-D2tdv5k-.js.map +1 -0
- package/dist/LanguagesModal-rk6IGQwY.js +394 -0
- package/dist/LanguagesModal-rk6IGQwY.js.map +1 -0
- package/dist/ManageDynamicFeature-CeeqiS3K.js +4189 -0
- package/dist/ManageDynamicFeature-CeeqiS3K.js.map +1 -0
- package/dist/ManageEventConfiguration-BRXh51fc.js +1017 -0
- package/dist/ManageEventConfiguration-BRXh51fc.js.map +1 -0
- package/dist/ManageEventConfiguration.css +1 -0
- package/dist/ManageNotification-B4prX-9Z.js +6819 -0
- package/dist/ManageNotification-B4prX-9Z.js.map +1 -0
- package/dist/ManageRole-ByqBmjuc.js +699 -0
- package/dist/ManageRole-ByqBmjuc.js.map +1 -0
- package/dist/ManageTranslation-BTxvSYKb.js +616 -0
- package/dist/ManageTranslation-BTxvSYKb.js.map +1 -0
- package/dist/ManageTranslation.css +1 -0
- package/dist/ManageUser-PHiTNyF8.js +2160 -0
- package/dist/ManageUser-PHiTNyF8.js.map +1 -0
- package/dist/ManageUser.css +1 -0
- package/dist/MobileMenuManagement-DmQU5TTo.js +108 -0
- package/dist/MobileMenuManagement-DmQU5TTo.js.map +1 -0
- package/dist/MobileTypeEventConfigModal-BCp-SF4-.js +783 -0
- package/dist/MobileTypeEventConfigModal-BCp-SF4-.js.map +1 -0
- package/dist/NewServerManagement-5YcAtF-g.js +1002 -0
- package/dist/NewServerManagement-5YcAtF-g.js.map +1 -0
- package/dist/NotificationFlywayQuery-BY8Zzml_.js +244 -0
- package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +1 -0
- package/dist/NotificationList-BkpOrCpM.js +400 -0
- package/dist/NotificationList-BkpOrCpM.js.map +1 -0
- package/dist/OtherTypeEventConfigModal-DPB8IYzj.js +2001 -0
- package/dist/OtherTypeEventConfigModal-DPB8IYzj.js.map +1 -0
- package/dist/QueryBuilder-Cus_mRwZ.js +378 -0
- package/dist/QueryBuilder-Cus_mRwZ.js.map +1 -0
- package/dist/QueryBuilder.css +1 -0
- package/dist/QueryManagement-DXA73N2j.js +671 -0
- package/dist/QueryManagement-DXA73N2j.js.map +1 -0
- package/dist/QueryManagement.css +1 -0
- package/dist/RoleManagement-CLaEJ90J.js +410 -0
- package/dist/RoleManagement-CLaEJ90J.js.map +1 -0
- package/dist/ServerSyncModal-uNjGCQJz.js +869 -0
- package/dist/ServerSyncModal-uNjGCQJz.js.map +1 -0
- package/dist/ShowFlywayQuery-DMsAbtOW.js +130 -0
- package/dist/ShowFlywayQuery-DMsAbtOW.js.map +1 -0
- package/dist/ShowFlywayQuery-DVRCd384.js +259 -0
- package/dist/ShowFlywayQuery-DVRCd384.js.map +1 -0
- package/dist/ShowQueryHistory-BDN0tzHg.js +190 -0
- package/dist/ShowQueryHistory-BDN0tzHg.js.map +1 -0
- package/dist/SubMenu-BHcSNSUF.js +187 -0
- package/dist/SubMenu-BHcSNSUF.js.map +1 -0
- package/dist/TableDetails-DzREeJkm.js +1508 -0
- package/dist/TableDetails-DzREeJkm.js.map +1 -0
- package/dist/TableList-B9hr05Hs.js +428 -0
- package/dist/TableList-B9hr05Hs.js.map +1 -0
- package/dist/TypeConfiguration-BYM8PjV9.js +117 -0
- package/dist/TypeConfiguration-BYM8PjV9.js.map +1 -0
- package/dist/UserList-BxB1tCwM.js +13042 -0
- package/dist/UserList-BxB1tCwM.js.map +1 -0
- package/dist/UserList.css +1 -0
- package/dist/UserListSkeleton-cglK2SaU.js +184 -0
- package/dist/UserListSkeleton-cglK2SaU.js.map +1 -0
- package/dist/WidgetList-BSApErov.js +188 -0
- package/dist/WidgetList-BSApErov.js.map +1 -0
- package/dist/_commonjsHelpers-BItOPCY9.js +29 -0
- package/dist/_commonjsHelpers-BItOPCY9.js.map +1 -0
- package/dist/i18next-CTOWN_jH.js +1394 -0
- package/dist/i18next-CTOWN_jH.js.map +1 -0
- package/dist/index.js +481 -0
- package/dist/index.js.map +1 -0
- package/dist/manageImmunization-B4swS745.js +1204 -0
- package/dist/manageImmunization-B4swS745.js.map +1 -0
- package/dist/manageImmunization.css +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,1017 @@
|
|
|
1
|
+
import { jsxs as r, Fragment as at, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { b as it, c as rt, d as lt, M as ot, s as st } from "./EventsSkeleton-BN7_0IGs.js";
|
|
3
|
+
import { retrieveAllNotifications as ct, getReportsList as dt } from "@/common/services/GlobalApis";
|
|
4
|
+
import { showToast as F } from "@/common/toaster/toaster";
|
|
5
|
+
import Ce from "@/views/custom-components/CustomTextArea";
|
|
6
|
+
import _ from "@/views/custom-components/CustomTextField";
|
|
7
|
+
import { yupResolver as ut } from "@hookform/resolvers/yup";
|
|
8
|
+
import mt from "@/views/custom-components/CustomDropdown";
|
|
9
|
+
import { Card as ft, CardHeader as gt, CardContent as ht, FormControl as T, Typography as c, Box as x, Select as B, MenuItem as p, Divider as G, Button as W, TableContainer as pt, Paper as vt, Table as yt, TableHead as bt, TableRow as Te, TableCell as A, TableBody as Ct, CardActions as Tt } from "@mui/material";
|
|
10
|
+
import h from "@mui/material/Grid2";
|
|
11
|
+
import { useRef as Ne, useState as u, useEffect as Ee, Suspense as we, lazy as X } from "react";
|
|
12
|
+
import { useForm as Nt, Controller as Y } from "react-hook-form";
|
|
13
|
+
import { useNavigate as Et } from "react-router";
|
|
14
|
+
import { useParams as wt } from "react-router-dom";
|
|
15
|
+
import * as I from "yup";
|
|
16
|
+
import { useTranslateProvider as xt } from "@/common/languageTranslator/TranslationContext";
|
|
17
|
+
import It from "@/hooks/useTrackEvent";
|
|
18
|
+
import { FontAwesomeIcon as $ } from "@fortawesome/react-fontawesome";
|
|
19
|
+
import { faPen as Mt, faTrash as xe, faPlus as Ie } from "@fortawesome/free-solid-svg-icons";
|
|
20
|
+
import './ManageEventConfiguration.css';const Dt = X(() => import("./ConditionConfig-BqWe0NKO.js")), Rt = X(
|
|
21
|
+
() => import("./MobileTypeEventConfigModal-BCp-SF4-.js")
|
|
22
|
+
), qt = X(
|
|
23
|
+
() => import("./OtherTypeEventConfigModal-DPB8IYzj.js")
|
|
24
|
+
);
|
|
25
|
+
function Jt() {
|
|
26
|
+
var ve, ye, be;
|
|
27
|
+
const { translate: l } = xt(), Z = Ne(null), ee = Ne(!1), { id: O } = wt(), te = Et(), [z, Me] = u(null), [ne, De] = u(null), [ae, Re] = u({}), [v, M] = u(
|
|
28
|
+
[]
|
|
29
|
+
), [ie, qe] = u(null), [H, Se] = u(null), [Ae, re] = u(null), [Oe, Le] = u(null), [D, L] = u(null), [_e, le] = u(null), [$e, ze] = u(null), [R, q] = u(null), [oe, Ue] = u(!1), [se, ce] = u(!1), [de, j] = u(!1), [U, S] = u([]), [ke, k] = u(!1), [Pe, Fe] = u([]), Be = window.getComputedStyle(document.body).lineHeight, ue = () => Ue(!oe), We = I.object().shape({
|
|
30
|
+
name: I.string().required("Enter Name"),
|
|
31
|
+
eventType: I.string().required("Select Event Type"),
|
|
32
|
+
recursionInterval: I.number().typeError("Recursion Interval must be a number").when([], {
|
|
33
|
+
is: () => m === "RECURSION",
|
|
34
|
+
then: (e) => e.required("Recursion Interval is required").moreThan(0, "Recursion Interval must be greater than or equal to 1").lessThan(1441, "Recursion Interval must be less than or equal to 1440"),
|
|
35
|
+
otherwise: (e) => e.notRequired()
|
|
36
|
+
}),
|
|
37
|
+
trigerWhen: I.string().test(
|
|
38
|
+
"is-required",
|
|
39
|
+
"trigerWhen is required",
|
|
40
|
+
function(e) {
|
|
41
|
+
return m === "TIMMER_BASED" ? !!e : !0;
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
day: I.string().test("is-required", "day is required", function(e) {
|
|
45
|
+
return m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY") ? !!e : !0;
|
|
46
|
+
}),
|
|
47
|
+
hour: I.string().test(
|
|
48
|
+
"is-required",
|
|
49
|
+
"hour is required",
|
|
50
|
+
function(e) {
|
|
51
|
+
return m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "DAILY") ? !!e : !0;
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
minute: I.string().notRequired()
|
|
55
|
+
// notificationConfigDetails: Yup.array().of(
|
|
56
|
+
// Yup.object().shape({
|
|
57
|
+
// query: Yup.string().required('Query is required'), // Ensure query is present
|
|
58
|
+
// // condition: Yup.string().required('Condition is required'), // Ensure condition is present
|
|
59
|
+
// // action: Yup.string().required('Action is required'), // Ensure action is present
|
|
60
|
+
// })
|
|
61
|
+
// ),
|
|
62
|
+
}), {
|
|
63
|
+
control: C,
|
|
64
|
+
handleSubmit: Ye,
|
|
65
|
+
setValue: P,
|
|
66
|
+
setError: V,
|
|
67
|
+
clearErrors: K,
|
|
68
|
+
getValues: me,
|
|
69
|
+
watch: fe,
|
|
70
|
+
formState: { errors: s }
|
|
71
|
+
} = Nt({
|
|
72
|
+
defaultValues: {
|
|
73
|
+
name: "",
|
|
74
|
+
description: "",
|
|
75
|
+
eventType: "",
|
|
76
|
+
recursionInterval: 0,
|
|
77
|
+
minute: 0
|
|
78
|
+
},
|
|
79
|
+
resolver: ut(We),
|
|
80
|
+
mode: "onChange"
|
|
81
|
+
}), m = fe("eventType");
|
|
82
|
+
let f = fe("trigerWhen");
|
|
83
|
+
Ee(() => {
|
|
84
|
+
let e = Z.current;
|
|
85
|
+
return () => {
|
|
86
|
+
Q("conversion_event", {
|
|
87
|
+
form: e,
|
|
88
|
+
form_name: "Manage Event Configuration",
|
|
89
|
+
submit: ee.current
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
}, []);
|
|
93
|
+
const He = async (e) => {
|
|
94
|
+
try {
|
|
95
|
+
if (v.length > 0) {
|
|
96
|
+
e.minute = Number(e.minute || 0), e.notificationConfigDetails = v;
|
|
97
|
+
const n = m === "TIMMER_BASED", i = m === "FORM_SUBMITTED", a = m === "MANUAL", o = m === "RECURSION";
|
|
98
|
+
n || (delete e.trigerWhen, delete e.day, delete e.hour, delete e.minute), i || delete e.formTypeId, !i && !a && (delete e.eventTypeDetailCode, delete e.eventTypeDetailId), o ? (delete e.formTypeId, e.trigerWhen = "RECURSION") : delete e.recursionInterval;
|
|
99
|
+
const g = ["AFTER", "MONTHLY", "WEEKLY"], E = ["AFTER", "MONTHLY", "DAILY", "WEEKLY"];
|
|
100
|
+
g.includes(f) || delete e.day, E.includes(f) || (delete e.day, delete e.hour), f === "IMMEDIATELY" && (delete e.day, delete e.hour, delete e.minute);
|
|
101
|
+
const w = v.map((y) => {
|
|
102
|
+
var d;
|
|
103
|
+
return {
|
|
104
|
+
...y,
|
|
105
|
+
conditions: (d = y.conditions) == null ? void 0 : d.map((b) => ({
|
|
106
|
+
...b,
|
|
107
|
+
notificaitonConfigsType: b.notificaitonConfigsType ? b.notificaitonConfigsType.map((N) => ({
|
|
108
|
+
...N,
|
|
109
|
+
queryCode: N.queryCode === "" ? null : N.queryCode
|
|
110
|
+
})) : b.notificaitonConfigsType
|
|
111
|
+
}))
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
e.notificationConfigDetails = w, await st(e), Q("button_click", {
|
|
115
|
+
button_name: "manageeventconfiguration-save-button",
|
|
116
|
+
button_type: "submit",
|
|
117
|
+
button_id: "manageeventconfiguration-save-button"
|
|
118
|
+
}), F({
|
|
119
|
+
message: O ? "Event Configuration Updated successfully" : "submit successfully",
|
|
120
|
+
type: "success"
|
|
121
|
+
}), ee.current = !0, te("/ui/medplat/notification/all");
|
|
122
|
+
} else
|
|
123
|
+
F({
|
|
124
|
+
message: "Please add atleast query / condition for the configuration",
|
|
125
|
+
type: "warn"
|
|
126
|
+
});
|
|
127
|
+
} catch {
|
|
128
|
+
F({ message: "submit problem", type: "error" }), k((n) => !n);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
Ee(() => {
|
|
132
|
+
je();
|
|
133
|
+
}, []);
|
|
134
|
+
const je = async () => {
|
|
135
|
+
var e, n, i, a;
|
|
136
|
+
try {
|
|
137
|
+
k((d) => !d);
|
|
138
|
+
const o = await it({ is_active: !0 });
|
|
139
|
+
Me(o == null ? void 0 : o.data);
|
|
140
|
+
const g = await rt();
|
|
141
|
+
De(g == null ? void 0 : g.data);
|
|
142
|
+
const E = await ct(!0);
|
|
143
|
+
let w = {};
|
|
144
|
+
(e = E == null ? void 0 : E.data) == null || e.forEach((d) => {
|
|
145
|
+
w[d == null ? void 0 : d.id] = d == null ? void 0 : d.notificationName;
|
|
146
|
+
}), Re(w);
|
|
147
|
+
const { data: y } = await dt();
|
|
148
|
+
if (Fe(y || []), O) {
|
|
149
|
+
const d = await lt(O);
|
|
150
|
+
(i = (n = d == null ? void 0 : d.data) == null ? void 0 : n.notificationConfigDetails) == null || i.forEach((N) => {
|
|
151
|
+
ge(N);
|
|
152
|
+
});
|
|
153
|
+
let b = d == null ? void 0 : d.data;
|
|
154
|
+
(a = Object.keys(b)) == null || a.forEach((N) => {
|
|
155
|
+
b[N] !== void 0 && b[N] !== null && P(N, b[N]);
|
|
156
|
+
}), M((b == null ? void 0 : b.notificationConfigDetails) || []);
|
|
157
|
+
}
|
|
158
|
+
k((d) => !d);
|
|
159
|
+
} catch (o) {
|
|
160
|
+
F({
|
|
161
|
+
message: "Error in loading manage events",
|
|
162
|
+
type: `Error:${o == null ? void 0 : o.message}`
|
|
163
|
+
}), k((g) => !g);
|
|
164
|
+
}
|
|
165
|
+
}, ge = (e) => {
|
|
166
|
+
e.implicitParam = ["#resourceId#"];
|
|
167
|
+
const n = /\bFROM\b/gi, i = /\bSELECT\b/gi;
|
|
168
|
+
if (e != null && e.query) {
|
|
169
|
+
const a = (e.query.match(n) || []).length, o = (e.query.match(i) || []).length;
|
|
170
|
+
let g;
|
|
171
|
+
if (o > 0) {
|
|
172
|
+
a > 1 && a === o ? g = e.query.substring(6, e.query.search(/\bfrom\b(?!(.|\n)*(from))/i)).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/g) : a !== o ? g = e.query.substring(6).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi) : a === 1 && a === o ? g = e.query.substring(6, e.query.toLowerCase().indexOf("from")).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi) : g = e.query.substring(6).match(/(\w*\(.*?\) as \w*|[^\(\),]+)(?=\s*,|\s*$)/gi);
|
|
173
|
+
const E = g == null ? void 0 : g.filter(
|
|
174
|
+
(w) => w.trim().length > 0
|
|
175
|
+
);
|
|
176
|
+
E == null || E.forEach((w) => {
|
|
177
|
+
let y = w.trim();
|
|
178
|
+
if (y.toLowerCase().indexOf("as") === 0 && (y = w), y.endsWith(";") && (y = y.slice(0, -1)), y !== "*") {
|
|
179
|
+
const d = y.toLowerCase().lastIndexOf(" as ");
|
|
180
|
+
if (d >= 0) {
|
|
181
|
+
const b = y.substring(d + 4).trim();
|
|
182
|
+
e.implicitParam.push("#" + b + "#");
|
|
183
|
+
} else
|
|
184
|
+
e.implicitParam.push("#" + y + "#");
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}, Ve = (e) => {
|
|
190
|
+
const n = v == null ? void 0 : v.filter(
|
|
191
|
+
(i, a) => a !== e
|
|
192
|
+
);
|
|
193
|
+
M(n);
|
|
194
|
+
}, Ke = (e, n) => {
|
|
195
|
+
const i = [...v], a = i[e].conditions.filter((o, g) => g !== n);
|
|
196
|
+
i[e].conditions = a, M(i);
|
|
197
|
+
}, J = async (e, n, i, a) => {
|
|
198
|
+
Se(e), qe(n), i ? (re(i), le(!0), L(JSON.parse(JSON.stringify(i))), S((i == null ? void 0 : i.notificaitonConfigsType) || []), Le(a)) : (re({}), L({}), S([]), le(!1)), q({}), ue();
|
|
199
|
+
}, Je = (e, n) => {
|
|
200
|
+
const i = [...v];
|
|
201
|
+
i[e].query = n, M(i);
|
|
202
|
+
}, Qe = async () => {
|
|
203
|
+
let e = [...v], n = !0;
|
|
204
|
+
v.forEach((i, a) => {
|
|
205
|
+
if (i.query === "") {
|
|
206
|
+
n = !1;
|
|
207
|
+
const o = `notificationConfigDetails.${a}.query`;
|
|
208
|
+
V(o, { type: "manual", message: "Query Required" });
|
|
209
|
+
}
|
|
210
|
+
}), n && (e.push({ query: "", conditions: [], queryParam: null }), M(e));
|
|
211
|
+
}, he = async (e, n) => {
|
|
212
|
+
e ? (e.index = n, ze(e), q({
|
|
213
|
+
...JSON.parse(JSON.stringify(e)),
|
|
214
|
+
implicitParam: H.implicitParam
|
|
215
|
+
}), ce(!0)) : (q({ ...R, implicitParam: H.implicitParam }), ce(!1)), Ge();
|
|
216
|
+
}, Ge = () => {
|
|
217
|
+
j((e) => !e);
|
|
218
|
+
}, pe = (e) => {
|
|
219
|
+
if (se) {
|
|
220
|
+
const n = U.map((i, a) => a === e.index ? { ...i, ...e } : i);
|
|
221
|
+
S(n);
|
|
222
|
+
} else
|
|
223
|
+
S([...U, e]);
|
|
224
|
+
et(e);
|
|
225
|
+
}, Xe = (e) => {
|
|
226
|
+
S(
|
|
227
|
+
(n) => n.filter((i, a) => a !== e)
|
|
228
|
+
);
|
|
229
|
+
}, Ze = (e) => {
|
|
230
|
+
he(U[e], e);
|
|
231
|
+
}, et = (e) => {
|
|
232
|
+
let n = { ...D };
|
|
233
|
+
D.notificaitonConfigsType || (n.notificaitonConfigsType = []), se ? n.notificaitonConfigsType[$e.index] = e : n.notificaitonConfigsType.push(e), L(n), q({});
|
|
234
|
+
}, Q = It(), tt = (e) => {
|
|
235
|
+
if (_e) {
|
|
236
|
+
const n = [...v];
|
|
237
|
+
L({ ...D, ...e });
|
|
238
|
+
let i = { ...D, ...e };
|
|
239
|
+
n[ie].conditions[Oe] = i, M(n), S([]);
|
|
240
|
+
} else {
|
|
241
|
+
const n = [...v];
|
|
242
|
+
L({ ...D, ...e });
|
|
243
|
+
let i = { ...D, ...e };
|
|
244
|
+
n[ie].conditions.push(i), M(n), S([]);
|
|
245
|
+
}
|
|
246
|
+
}, nt = (e) => {
|
|
247
|
+
q({ ...R, ...e });
|
|
248
|
+
};
|
|
249
|
+
return /* @__PURE__ */ r(at, { children: [
|
|
250
|
+
/* @__PURE__ */ t(ot, { isLoading: ke, children: /* @__PURE__ */ r(
|
|
251
|
+
ft,
|
|
252
|
+
{
|
|
253
|
+
className: "manage-eventConfiguration-type-body",
|
|
254
|
+
component: "form",
|
|
255
|
+
ref: Z,
|
|
256
|
+
onSubmit: Ye(He),
|
|
257
|
+
"data-testid": "manageeventconfiguration-form",
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ t(
|
|
260
|
+
gt,
|
|
261
|
+
{
|
|
262
|
+
className: "p-2.5 px-5 flex border-b text-customBlue",
|
|
263
|
+
subheader: l(
|
|
264
|
+
`${O ? "UPDATE" : "ADD"} EVENT CONFIGURATION`
|
|
265
|
+
),
|
|
266
|
+
slotProps: {
|
|
267
|
+
subheader: { className: "font-medium text-lg text-customBlue" }
|
|
268
|
+
},
|
|
269
|
+
"data-testid": "manageeventconfiguration-cardheader-subheader"
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
/* @__PURE__ */ r(ht, { "data-testid": "manageeventconfiguration-cardcontent", children: [
|
|
273
|
+
/* @__PURE__ */ r(h, { container: !0, spacing: 2, children: [
|
|
274
|
+
/* @__PURE__ */ t(
|
|
275
|
+
h,
|
|
276
|
+
{
|
|
277
|
+
item: !0,
|
|
278
|
+
size: { xs: 12, sm: 6 },
|
|
279
|
+
"data-testid": "manageeventconfiguration-name-field",
|
|
280
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
281
|
+
/* @__PURE__ */ r(c, { variant: "body2", children: [
|
|
282
|
+
l("Name"),
|
|
283
|
+
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
|
|
284
|
+
] }),
|
|
285
|
+
/* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
|
|
286
|
+
_,
|
|
287
|
+
{
|
|
288
|
+
control: C,
|
|
289
|
+
id: "name",
|
|
290
|
+
name: "name",
|
|
291
|
+
errors: s,
|
|
292
|
+
label: "",
|
|
293
|
+
size: "small",
|
|
294
|
+
dataTestId: "manageeventconfiguration-name-textfield"
|
|
295
|
+
}
|
|
296
|
+
) })
|
|
297
|
+
] })
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ t(
|
|
301
|
+
h,
|
|
302
|
+
{
|
|
303
|
+
item: !0,
|
|
304
|
+
size: { xs: 12, sm: 6 },
|
|
305
|
+
"data-testid": "manageeventconfiguration-description-field",
|
|
306
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
307
|
+
/* @__PURE__ */ t(c, { variant: "body2", children: l("Description") }),
|
|
308
|
+
/* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
|
|
309
|
+
Ce,
|
|
310
|
+
{
|
|
311
|
+
control: C,
|
|
312
|
+
id: "description",
|
|
313
|
+
name: "description",
|
|
314
|
+
errors: s,
|
|
315
|
+
label: "",
|
|
316
|
+
minRows: 2,
|
|
317
|
+
"data-testid": "manageeventconfiguration-description-textarea"
|
|
318
|
+
}
|
|
319
|
+
) })
|
|
320
|
+
] })
|
|
321
|
+
}
|
|
322
|
+
),
|
|
323
|
+
/* @__PURE__ */ t(
|
|
324
|
+
h,
|
|
325
|
+
{
|
|
326
|
+
item: !0,
|
|
327
|
+
size: { xs: 12, sm: 6 },
|
|
328
|
+
"data-testid": "manageeventconfiguration-eventtype-field",
|
|
329
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
330
|
+
/* @__PURE__ */ r(c, { variant: "body2", children: [
|
|
331
|
+
l("Event Type"),
|
|
332
|
+
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
|
|
333
|
+
] }),
|
|
334
|
+
/* @__PURE__ */ r(x, { className: "w-full", children: [
|
|
335
|
+
/* @__PURE__ */ t(
|
|
336
|
+
Y,
|
|
337
|
+
{
|
|
338
|
+
name: "eventType",
|
|
339
|
+
control: C,
|
|
340
|
+
defaultValue: "",
|
|
341
|
+
className: "w-full",
|
|
342
|
+
render: ({ field: e }) => /* @__PURE__ */ r(
|
|
343
|
+
B,
|
|
344
|
+
{
|
|
345
|
+
className: "w-full",
|
|
346
|
+
labelId: "event-type-label",
|
|
347
|
+
id: "reportgroup",
|
|
348
|
+
...e,
|
|
349
|
+
error: s.eventType,
|
|
350
|
+
size: "small",
|
|
351
|
+
"data-testid": "manageeventconfiguration-eventtype-select",
|
|
352
|
+
children: [
|
|
353
|
+
/* @__PURE__ */ t(p, { value: "FORM_SUBMITTED", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Form Submitted") }) }),
|
|
354
|
+
/* @__PURE__ */ t(p, { value: "TIMMER_BASED", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Timer Based") }) }),
|
|
355
|
+
/* @__PURE__ */ t(p, { value: "MANUAL", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Manual") }) }),
|
|
356
|
+
/* @__PURE__ */ t(p, { value: "RECURSION", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Recursion") }) })
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
(s == null ? void 0 : s.eventType) && /* @__PURE__ */ t(
|
|
363
|
+
"p",
|
|
364
|
+
{
|
|
365
|
+
className: "error-helper-manage-event",
|
|
366
|
+
"data-testid": "custom-error-message",
|
|
367
|
+
children: (ve = s == null ? void 0 : s.eventType) == null ? void 0 : ve.message
|
|
368
|
+
}
|
|
369
|
+
)
|
|
370
|
+
] })
|
|
371
|
+
] })
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
m === "FORM_SUBMITTED" && /* @__PURE__ */ t(
|
|
375
|
+
h,
|
|
376
|
+
{
|
|
377
|
+
item: !0,
|
|
378
|
+
size: { xs: 12, sm: 6 },
|
|
379
|
+
"data-testid": "manageeventconfiguration-formtype-field",
|
|
380
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
381
|
+
/* @__PURE__ */ t(c, { variant: "body2", children: l("Form Type") }),
|
|
382
|
+
/* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
|
|
383
|
+
Y,
|
|
384
|
+
{
|
|
385
|
+
className: "w-full",
|
|
386
|
+
name: "formTypeId",
|
|
387
|
+
control: C,
|
|
388
|
+
defaultValue: "",
|
|
389
|
+
render: ({ field: e }) => /* @__PURE__ */ r(
|
|
390
|
+
B,
|
|
391
|
+
{
|
|
392
|
+
...e,
|
|
393
|
+
className: "w-full",
|
|
394
|
+
labelId: "event-type-label",
|
|
395
|
+
displayEmpty: !0,
|
|
396
|
+
size: "small",
|
|
397
|
+
onChange: (n) => {
|
|
398
|
+
const i = n.target.value;
|
|
399
|
+
e.onChange(i);
|
|
400
|
+
const a = z.find(
|
|
401
|
+
(o) => o.id === i
|
|
402
|
+
);
|
|
403
|
+
P(
|
|
404
|
+
"eventTypeDetailCode",
|
|
405
|
+
a == null ? void 0 : a.code
|
|
406
|
+
), P(
|
|
407
|
+
"eventTypeDetailId",
|
|
408
|
+
(a == null ? void 0 : a.detaiId) || null
|
|
409
|
+
);
|
|
410
|
+
},
|
|
411
|
+
"data-testid": "manageeventconfiguration-formtype-select",
|
|
412
|
+
children: [
|
|
413
|
+
/* @__PURE__ */ t(p, { value: "", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Select") }) }),
|
|
414
|
+
z == null ? void 0 : z.map((n) => /* @__PURE__ */ t(p, { value: n.id, children: /* @__PURE__ */ t(c, { variant: "body2", children: l(n.name) }) }, n.id))
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
)
|
|
418
|
+
}
|
|
419
|
+
) })
|
|
420
|
+
] })
|
|
421
|
+
}
|
|
422
|
+
),
|
|
423
|
+
m === "TIMMER_BASED" && /* @__PURE__ */ t(
|
|
424
|
+
h,
|
|
425
|
+
{
|
|
426
|
+
item: !0,
|
|
427
|
+
size: { xs: 12, sm: 6 },
|
|
428
|
+
"data-testid": "manageeventconfiguration-triggerwhen-field",
|
|
429
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
430
|
+
/* @__PURE__ */ r(c, { variant: "body2", children: [
|
|
431
|
+
l("Trigger When"),
|
|
432
|
+
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
|
|
433
|
+
] }),
|
|
434
|
+
/* @__PURE__ */ r(x, { className: "w-full", children: [
|
|
435
|
+
/* @__PURE__ */ t(
|
|
436
|
+
Y,
|
|
437
|
+
{
|
|
438
|
+
name: "trigerWhen",
|
|
439
|
+
control: C,
|
|
440
|
+
defaultValue: "",
|
|
441
|
+
className: "w-full",
|
|
442
|
+
render: ({ field: e }) => /* @__PURE__ */ r(
|
|
443
|
+
B,
|
|
444
|
+
{
|
|
445
|
+
className: "w-full",
|
|
446
|
+
...e,
|
|
447
|
+
value: e.value,
|
|
448
|
+
error: s.trigerWhen,
|
|
449
|
+
size: "small",
|
|
450
|
+
"data-testid": "manageeventconfiguration-triggerwhen-select",
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ t(p, { value: "", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Select") }) }),
|
|
453
|
+
/* @__PURE__ */ t(p, { value: "IMMEDIATELY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Immediately") }) }),
|
|
454
|
+
/* @__PURE__ */ t(p, { value: "AFTER", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("After") }) }),
|
|
455
|
+
/* @__PURE__ */ t(p, { value: "MONTHLY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Monthly") }) }),
|
|
456
|
+
/* @__PURE__ */ t(p, { value: "WEEKLY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Weekly") }) }),
|
|
457
|
+
/* @__PURE__ */ t(p, { value: "DAILY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Daily") }) }),
|
|
458
|
+
/* @__PURE__ */ t(p, { value: "HOURLY", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Hourly") }) }),
|
|
459
|
+
/* @__PURE__ */ t(p, { value: "MINUTE", children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Minutely") }) })
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
}
|
|
464
|
+
),
|
|
465
|
+
(s == null ? void 0 : s.trigerWhen) && /* @__PURE__ */ t(
|
|
466
|
+
"p",
|
|
467
|
+
{
|
|
468
|
+
className: "error-helper-manage-event",
|
|
469
|
+
"data-testid": "custom-error-message",
|
|
470
|
+
children: (ye = s == null ? void 0 : s.trigerWhen) == null ? void 0 : ye.message
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
] })
|
|
474
|
+
] })
|
|
475
|
+
}
|
|
476
|
+
),
|
|
477
|
+
m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "WEEKLY") && /* @__PURE__ */ t(
|
|
478
|
+
h,
|
|
479
|
+
{
|
|
480
|
+
item: !0,
|
|
481
|
+
size: { xs: 12, sm: 6 },
|
|
482
|
+
"data-testid": "manageeventconfiguration-day-field",
|
|
483
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
484
|
+
/* @__PURE__ */ r(c, { variant: "body2", children: [
|
|
485
|
+
l("day"),
|
|
486
|
+
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
|
|
487
|
+
] }),
|
|
488
|
+
/* @__PURE__ */ t(
|
|
489
|
+
_,
|
|
490
|
+
{
|
|
491
|
+
control: C,
|
|
492
|
+
id: "day",
|
|
493
|
+
name: "day",
|
|
494
|
+
errors: s,
|
|
495
|
+
type: "number",
|
|
496
|
+
label: "",
|
|
497
|
+
size: "small",
|
|
498
|
+
dataTestId: "manageeventconfiguration-day-textfield"
|
|
499
|
+
}
|
|
500
|
+
)
|
|
501
|
+
] })
|
|
502
|
+
}
|
|
503
|
+
),
|
|
504
|
+
m === "TIMMER_BASED" && (f === "AFTER" || f === "MONTHLY" || f === "DAILY" || f === "WEEKLY") && /* @__PURE__ */ t(
|
|
505
|
+
h,
|
|
506
|
+
{
|
|
507
|
+
item: !0,
|
|
508
|
+
size: { xs: 12, sm: 6 },
|
|
509
|
+
"data-testid": "manageeventconfiguration-hour-field",
|
|
510
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
511
|
+
/* @__PURE__ */ r(c, { variant: "body2", children: [
|
|
512
|
+
l("Hour"),
|
|
513
|
+
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
|
|
514
|
+
] }),
|
|
515
|
+
/* @__PURE__ */ t(
|
|
516
|
+
_,
|
|
517
|
+
{
|
|
518
|
+
control: C,
|
|
519
|
+
id: "hour",
|
|
520
|
+
name: "hour",
|
|
521
|
+
type: "number",
|
|
522
|
+
errors: s,
|
|
523
|
+
label: "",
|
|
524
|
+
size: "small",
|
|
525
|
+
dataTestId: "manageeventconfiguration-hour-textfield"
|
|
526
|
+
}
|
|
527
|
+
)
|
|
528
|
+
] })
|
|
529
|
+
}
|
|
530
|
+
),
|
|
531
|
+
m === "TIMMER_BASED" && f && f !== "IMMEDIATELY" && /* @__PURE__ */ t(
|
|
532
|
+
h,
|
|
533
|
+
{
|
|
534
|
+
item: !0,
|
|
535
|
+
size: { xs: 12, sm: 6 },
|
|
536
|
+
"data-testid": "manageeventconfiguration-minute-field",
|
|
537
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
538
|
+
/* @__PURE__ */ t(c, { variant: "body2", children: l("Minute") }),
|
|
539
|
+
/* @__PURE__ */ t(
|
|
540
|
+
_,
|
|
541
|
+
{
|
|
542
|
+
control: C,
|
|
543
|
+
id: "minute",
|
|
544
|
+
name: "minute",
|
|
545
|
+
errors: s,
|
|
546
|
+
type: "number",
|
|
547
|
+
label: "",
|
|
548
|
+
size: "small",
|
|
549
|
+
dataTestId: "manageeventconfiguration-minute-textfield"
|
|
550
|
+
}
|
|
551
|
+
)
|
|
552
|
+
] })
|
|
553
|
+
}
|
|
554
|
+
),
|
|
555
|
+
m === "RECURSION" && /* @__PURE__ */ t(h, { item: !0, size: { xs: 12, sm: 6 }, children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
556
|
+
/* @__PURE__ */ r(c, { variant: "body2", children: [
|
|
557
|
+
l("Recursion Interval (in Minutes)"),
|
|
558
|
+
/* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" })
|
|
559
|
+
] }),
|
|
560
|
+
/* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
|
|
561
|
+
_,
|
|
562
|
+
{
|
|
563
|
+
type: "number",
|
|
564
|
+
control: C,
|
|
565
|
+
id: "recursionInterval",
|
|
566
|
+
name: "recursionInterval",
|
|
567
|
+
errors: s,
|
|
568
|
+
label: "",
|
|
569
|
+
size: "small",
|
|
570
|
+
dataTestId: "manageeventconfiguration-recursionInterval-textfield"
|
|
571
|
+
}
|
|
572
|
+
) })
|
|
573
|
+
] }) }),
|
|
574
|
+
(m === "TIMMER_BASED" || m === "RECURSION") && /* @__PURE__ */ t(h, { item: !0, size: { xs: 12, sm: 6 }, children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
575
|
+
/* @__PURE__ */ t(c, { variant: "body2", children: l("Reports") }),
|
|
576
|
+
/* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
|
|
577
|
+
mt,
|
|
578
|
+
{
|
|
579
|
+
id: "reportUUID",
|
|
580
|
+
name: "reportUUID",
|
|
581
|
+
displayName: "name",
|
|
582
|
+
optionValue: "uuid",
|
|
583
|
+
multiple: !0,
|
|
584
|
+
control: C,
|
|
585
|
+
options: Pe
|
|
586
|
+
}
|
|
587
|
+
) })
|
|
588
|
+
] }) }),
|
|
589
|
+
m === "MANUAL" && /* @__PURE__ */ t(
|
|
590
|
+
h,
|
|
591
|
+
{
|
|
592
|
+
item: !0,
|
|
593
|
+
size: { xs: 12, sm: 6 },
|
|
594
|
+
"data-testid": "manageeventconfiguration-event-field",
|
|
595
|
+
children: /* @__PURE__ */ r(T, { variant: "outlined", className: "w-full", children: [
|
|
596
|
+
/* @__PURE__ */ t(c, { variant: "body2", children: l("Event") }),
|
|
597
|
+
/* @__PURE__ */ r(x, { className: "w-full", children: [
|
|
598
|
+
/* @__PURE__ */ t(
|
|
599
|
+
Y,
|
|
600
|
+
{
|
|
601
|
+
name: "eventTypeDetailCode",
|
|
602
|
+
control: C,
|
|
603
|
+
className: "w-full",
|
|
604
|
+
render: ({ field: e }) => /* @__PURE__ */ r(
|
|
605
|
+
B,
|
|
606
|
+
{
|
|
607
|
+
className: "w-full",
|
|
608
|
+
...e,
|
|
609
|
+
value: e.value,
|
|
610
|
+
error: s.eventTypeDetailCode,
|
|
611
|
+
size: "small",
|
|
612
|
+
"data-testid": "manageeventconfiguration-eventtype-detail-select",
|
|
613
|
+
children: [
|
|
614
|
+
/* @__PURE__ */ t(p, { value: "", children: l("None") }),
|
|
615
|
+
ne && Object.entries(ne).map(([n, i]) => /* @__PURE__ */ t(p, { value: n, children: i }, n))
|
|
616
|
+
]
|
|
617
|
+
}
|
|
618
|
+
)
|
|
619
|
+
}
|
|
620
|
+
),
|
|
621
|
+
(s == null ? void 0 : s.eventTypeDetailCode) && /* @__PURE__ */ t(
|
|
622
|
+
"p",
|
|
623
|
+
{
|
|
624
|
+
className: "error-helper-manage-event",
|
|
625
|
+
"data-testid": "manageeventconfiguration-eventtype-detail-error",
|
|
626
|
+
children: (be = s == null ? void 0 : s.eventTypeDetailCode) == null ? void 0 : be.message
|
|
627
|
+
}
|
|
628
|
+
)
|
|
629
|
+
] })
|
|
630
|
+
] })
|
|
631
|
+
}
|
|
632
|
+
)
|
|
633
|
+
] }),
|
|
634
|
+
/* @__PURE__ */ t(G, { className: "m-[20px_3px]" }),
|
|
635
|
+
/* @__PURE__ */ r(
|
|
636
|
+
h,
|
|
637
|
+
{
|
|
638
|
+
container: !0,
|
|
639
|
+
spacing: 5,
|
|
640
|
+
justifyContent: "space-between",
|
|
641
|
+
alignItems: "center",
|
|
642
|
+
"data-testid": "manageeventconfiguration-add-configuration",
|
|
643
|
+
children: [
|
|
644
|
+
/* @__PURE__ */ t(h, { item: !0, children: /* @__PURE__ */ t(c, { variant: "body2", children: l("Add Configuration") }) }),
|
|
645
|
+
/* @__PURE__ */ t(h, { item: !0, children: /* @__PURE__ */ t(
|
|
646
|
+
W,
|
|
647
|
+
{
|
|
648
|
+
size: "small",
|
|
649
|
+
variant: "contained",
|
|
650
|
+
onClick: Qe,
|
|
651
|
+
"data-testid": "manageeventconfiguration-add-button",
|
|
652
|
+
children: l("Add")
|
|
653
|
+
}
|
|
654
|
+
) })
|
|
655
|
+
]
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
/* @__PURE__ */ t(h, { container: !0, className: "w-full mt-5", children: /* @__PURE__ */ t(h, { item: !0, className: "w-full", children: /* @__PURE__ */ t(
|
|
659
|
+
pt,
|
|
660
|
+
{
|
|
661
|
+
component: vt,
|
|
662
|
+
className: "w-full",
|
|
663
|
+
"data-testid": "manageeventconfiguration-table-container",
|
|
664
|
+
children: /* @__PURE__ */ r(yt, { sx: { minWidth: 800 }, children: [
|
|
665
|
+
/* @__PURE__ */ t(bt, { children: /* @__PURE__ */ r(
|
|
666
|
+
Te,
|
|
667
|
+
{
|
|
668
|
+
sx: {
|
|
669
|
+
backgroundColor: (e) => e.palette.mode === "dark" ? e.palette.custom.tableHeader : "#f5f5f5"
|
|
670
|
+
},
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ t(
|
|
673
|
+
A,
|
|
674
|
+
{
|
|
675
|
+
className: "border border-gray-300 align-top text-[13px]",
|
|
676
|
+
"data-testid": "manageeventconfiguration-table-header-query",
|
|
677
|
+
children: l("Query")
|
|
678
|
+
}
|
|
679
|
+
),
|
|
680
|
+
/* @__PURE__ */ t(
|
|
681
|
+
A,
|
|
682
|
+
{
|
|
683
|
+
className: "border border-gray-300 align-top text-[13px]",
|
|
684
|
+
"data-testid": "manageeventconfiguration-table-header-condition",
|
|
685
|
+
children: l("Condition")
|
|
686
|
+
}
|
|
687
|
+
),
|
|
688
|
+
/* @__PURE__ */ t(
|
|
689
|
+
A,
|
|
690
|
+
{
|
|
691
|
+
className: "border border-gray-300 align-top text-[13px]",
|
|
692
|
+
"data-testid": "manageeventconfiguration-table-header-action",
|
|
693
|
+
children: l("Actions")
|
|
694
|
+
}
|
|
695
|
+
)
|
|
696
|
+
]
|
|
697
|
+
}
|
|
698
|
+
) }),
|
|
699
|
+
/* @__PURE__ */ t(Ct, { children: v == null ? void 0 : v.map((e, n) => {
|
|
700
|
+
var i;
|
|
701
|
+
return /* @__PURE__ */ r(
|
|
702
|
+
Te,
|
|
703
|
+
{
|
|
704
|
+
sx: {
|
|
705
|
+
backgroundColor: (a) => {
|
|
706
|
+
const o = a.palette.mode === "dark";
|
|
707
|
+
return n % 2 === 0 ? o ? a.palette.background.paper : "#fff" : o ? "#1C2128" : "#f9f9f9";
|
|
708
|
+
},
|
|
709
|
+
// Adding a hover state that works in both modes
|
|
710
|
+
"&:hover": {
|
|
711
|
+
backgroundColor: (a) => a.palette.mode === "dark" ? "#21262D" : "#f0f0f0"
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
"data-testid": `manageeventconfiguration-table-row-${n}`,
|
|
715
|
+
children: [
|
|
716
|
+
/* @__PURE__ */ t(
|
|
717
|
+
A,
|
|
718
|
+
{
|
|
719
|
+
className: "border border-gray-300 align-top",
|
|
720
|
+
style: { lineHeight: Be },
|
|
721
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-query`,
|
|
722
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col items-start min-w-[300px]", children: [
|
|
723
|
+
/* @__PURE__ */ t(
|
|
724
|
+
T,
|
|
725
|
+
{
|
|
726
|
+
variant: "outlined",
|
|
727
|
+
className: "w-full",
|
|
728
|
+
children: /* @__PURE__ */ t(x, { className: "w-full", children: /* @__PURE__ */ t(
|
|
729
|
+
Ce,
|
|
730
|
+
{
|
|
731
|
+
required: !0,
|
|
732
|
+
control: C,
|
|
733
|
+
id: `notificationConfigDetails.${n}.query`,
|
|
734
|
+
name: `notificationConfigDetails.${n}.query`,
|
|
735
|
+
errors: s,
|
|
736
|
+
value: e.query,
|
|
737
|
+
onChange: (a) => {
|
|
738
|
+
P(
|
|
739
|
+
`notificationConfigDetails.${n}.query`,
|
|
740
|
+
a.target.value
|
|
741
|
+
), Je(n, a.target.value);
|
|
742
|
+
const o = `notificationConfigDetails.${n}.query`;
|
|
743
|
+
me(o) === "" ? V(o, {
|
|
744
|
+
type: "manual",
|
|
745
|
+
message: "Query Required"
|
|
746
|
+
}) : K(o);
|
|
747
|
+
},
|
|
748
|
+
onBlur: () => {
|
|
749
|
+
const a = `notificationConfigDetails.${n}.query`;
|
|
750
|
+
me(a) === "" ? V(a, {
|
|
751
|
+
type: "manual",
|
|
752
|
+
message: "Query Required"
|
|
753
|
+
}) : K(a), ge(e);
|
|
754
|
+
},
|
|
755
|
+
label: "",
|
|
756
|
+
minRows: 5,
|
|
757
|
+
maxRows: 20,
|
|
758
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-query-textarea`
|
|
759
|
+
}
|
|
760
|
+
) })
|
|
761
|
+
}
|
|
762
|
+
),
|
|
763
|
+
/* @__PURE__ */ t(
|
|
764
|
+
"td",
|
|
765
|
+
{
|
|
766
|
+
style: {
|
|
767
|
+
whiteSpace: "normal",
|
|
768
|
+
width: "100%",
|
|
769
|
+
overflowWrap: "break-word"
|
|
770
|
+
},
|
|
771
|
+
children: /* @__PURE__ */ t("b", { children: e == null ? void 0 : e.implicitParam })
|
|
772
|
+
}
|
|
773
|
+
)
|
|
774
|
+
] })
|
|
775
|
+
}
|
|
776
|
+
),
|
|
777
|
+
/* @__PURE__ */ t(
|
|
778
|
+
A,
|
|
779
|
+
{
|
|
780
|
+
className: "border border-gray-300 align-top",
|
|
781
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-condition`,
|
|
782
|
+
children: /* @__PURE__ */ t(
|
|
783
|
+
"div",
|
|
784
|
+
{
|
|
785
|
+
style: {
|
|
786
|
+
display: "flex",
|
|
787
|
+
flexDirection: "column",
|
|
788
|
+
alignItems: "flex-start",
|
|
789
|
+
width: "100%"
|
|
790
|
+
},
|
|
791
|
+
children: ((i = e == null ? void 0 : e.conditions) == null ? void 0 : i.length) > 0 ? e == null ? void 0 : e.conditions.map(
|
|
792
|
+
(a, o) => /* @__PURE__ */ r(
|
|
793
|
+
"div",
|
|
794
|
+
{
|
|
795
|
+
style: { width: "100%" },
|
|
796
|
+
children: [
|
|
797
|
+
/* @__PURE__ */ r(
|
|
798
|
+
"div",
|
|
799
|
+
{
|
|
800
|
+
style: {
|
|
801
|
+
display: "flex",
|
|
802
|
+
alignItems: "center",
|
|
803
|
+
width: "100%"
|
|
804
|
+
},
|
|
805
|
+
"data-testid": "manageeventconfiguration-condition-rows",
|
|
806
|
+
children: [
|
|
807
|
+
/* @__PURE__ */ t(
|
|
808
|
+
c,
|
|
809
|
+
{
|
|
810
|
+
className: "mr-1",
|
|
811
|
+
variant: "body2",
|
|
812
|
+
children: (a == null ? void 0 : a.condition) || "No condition specified"
|
|
813
|
+
}
|
|
814
|
+
),
|
|
815
|
+
/* @__PURE__ */ t(
|
|
816
|
+
$,
|
|
817
|
+
{
|
|
818
|
+
className: "bg-[#cecfd0] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[#11B666] transition-all",
|
|
819
|
+
icon: Mt,
|
|
820
|
+
onClick: () => J(
|
|
821
|
+
e,
|
|
822
|
+
n,
|
|
823
|
+
a,
|
|
824
|
+
o
|
|
825
|
+
),
|
|
826
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-condition-edit-${o}`
|
|
827
|
+
}
|
|
828
|
+
),
|
|
829
|
+
/* @__PURE__ */ t(
|
|
830
|
+
$,
|
|
831
|
+
{
|
|
832
|
+
icon: xe,
|
|
833
|
+
className: "bg-[#cecfd0] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[var(--color-error)] transition-all",
|
|
834
|
+
onClick: () => Ke(
|
|
835
|
+
n,
|
|
836
|
+
o
|
|
837
|
+
),
|
|
838
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-condition-delete-${o}`
|
|
839
|
+
}
|
|
840
|
+
),
|
|
841
|
+
o === (e == null ? void 0 : e.conditions.length) - 1 && /* @__PURE__ */ t(
|
|
842
|
+
$,
|
|
843
|
+
{
|
|
844
|
+
icon: Ie,
|
|
845
|
+
onClick: () => J(e, n),
|
|
846
|
+
className: "bg-[#cecfd0] text-gray-600 rounded-full p-[10px] w-[14px] h-[14px] mx-1 cursor-pointer hover:bg-gray-300 hover:text-[var(--color-primary)] transition-all",
|
|
847
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-condition-add`
|
|
848
|
+
}
|
|
849
|
+
)
|
|
850
|
+
]
|
|
851
|
+
}
|
|
852
|
+
),
|
|
853
|
+
o < (e == null ? void 0 : e.conditions.length) - 1 && /* @__PURE__ */ t(G, { className: "w-full m-[10px_0px]" })
|
|
854
|
+
]
|
|
855
|
+
},
|
|
856
|
+
o + 1
|
|
857
|
+
)
|
|
858
|
+
) : /* @__PURE__ */ r(
|
|
859
|
+
"div",
|
|
860
|
+
{
|
|
861
|
+
className: "flex flex-row items-center justify-between w-full mt-2 sm:mt-0 text-[14px]",
|
|
862
|
+
children: [
|
|
863
|
+
/* @__PURE__ */ t("span", { className: "mr-3 flex-1", children: l("No Condition Added") }),
|
|
864
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ t(
|
|
865
|
+
$,
|
|
866
|
+
{
|
|
867
|
+
icon: Ie,
|
|
868
|
+
onClick: () => J(e, n),
|
|
869
|
+
className: "bg-gray-200 text-gray-600 rounded-full p-2 w-[16px] h-[16px] cursor-pointer hover:bg-gray-300 hover:text-[var(--color-primary)] transition-all",
|
|
870
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-condition-add-empty`
|
|
871
|
+
}
|
|
872
|
+
) })
|
|
873
|
+
]
|
|
874
|
+
}
|
|
875
|
+
)
|
|
876
|
+
}
|
|
877
|
+
)
|
|
878
|
+
}
|
|
879
|
+
),
|
|
880
|
+
/* @__PURE__ */ t(
|
|
881
|
+
A,
|
|
882
|
+
{
|
|
883
|
+
className: "border border-gray-300 align-top",
|
|
884
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-action`,
|
|
885
|
+
children: /* @__PURE__ */ t(
|
|
886
|
+
"div",
|
|
887
|
+
{
|
|
888
|
+
style: {
|
|
889
|
+
display: "flex",
|
|
890
|
+
flexDirection: "column",
|
|
891
|
+
alignItems: "flex-start"
|
|
892
|
+
},
|
|
893
|
+
children: /* @__PURE__ */ t(
|
|
894
|
+
W,
|
|
895
|
+
{
|
|
896
|
+
onClick: () => {
|
|
897
|
+
Ve(n);
|
|
898
|
+
const a = `notificationConfigDetails.${n}.query`;
|
|
899
|
+
K(a);
|
|
900
|
+
},
|
|
901
|
+
size: "small",
|
|
902
|
+
"aria-label": "delete",
|
|
903
|
+
"data-testid": `manageeventconfiguration-table-row-${n}-action-delete`,
|
|
904
|
+
children: /* @__PURE__ */ t(
|
|
905
|
+
$,
|
|
906
|
+
{
|
|
907
|
+
icon: xe,
|
|
908
|
+
className: "text-[19px] text-[var(--color-error)]"
|
|
909
|
+
}
|
|
910
|
+
)
|
|
911
|
+
}
|
|
912
|
+
)
|
|
913
|
+
}
|
|
914
|
+
)
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
n + 1
|
|
920
|
+
);
|
|
921
|
+
}) })
|
|
922
|
+
] })
|
|
923
|
+
}
|
|
924
|
+
) }) })
|
|
925
|
+
] }),
|
|
926
|
+
/* @__PURE__ */ t(G, { className: "m-[8px_0px]" }),
|
|
927
|
+
/* @__PURE__ */ r(
|
|
928
|
+
Tt,
|
|
929
|
+
{
|
|
930
|
+
className: "flex flex-col sm:flex-row justify-end gap-2",
|
|
931
|
+
"data-testid": "manageeventconfiguration-cardactions",
|
|
932
|
+
children: [
|
|
933
|
+
/* @__PURE__ */ t(
|
|
934
|
+
W,
|
|
935
|
+
{
|
|
936
|
+
variant: "contained",
|
|
937
|
+
color: "secondary",
|
|
938
|
+
type: "button",
|
|
939
|
+
size: "small",
|
|
940
|
+
className: "w-full sm:w-auto",
|
|
941
|
+
onClick: () => {
|
|
942
|
+
Q("button_click", {
|
|
943
|
+
button_name: "manageeventconfiguration-back-button",
|
|
944
|
+
button_type: "cancel",
|
|
945
|
+
button_id: "manageeventconfiguration-back-button"
|
|
946
|
+
}), te("/ui/medplat/notification/all");
|
|
947
|
+
},
|
|
948
|
+
"data-testid": "manageeventconfiguration-back-button",
|
|
949
|
+
children: l("Cancel")
|
|
950
|
+
}
|
|
951
|
+
),
|
|
952
|
+
/* @__PURE__ */ t(
|
|
953
|
+
W,
|
|
954
|
+
{
|
|
955
|
+
size: "small",
|
|
956
|
+
variant: "contained",
|
|
957
|
+
type: "submit",
|
|
958
|
+
color: "primary",
|
|
959
|
+
className: "w-full sm:w-auto m-0",
|
|
960
|
+
"data-testid": "manageeventconfiguration-save-button",
|
|
961
|
+
children: l(`${O ? "Update" : "Save"}`)
|
|
962
|
+
}
|
|
963
|
+
)
|
|
964
|
+
]
|
|
965
|
+
}
|
|
966
|
+
)
|
|
967
|
+
]
|
|
968
|
+
}
|
|
969
|
+
) }),
|
|
970
|
+
/* @__PURE__ */ t(we, { children: /* @__PURE__ */ t(
|
|
971
|
+
Dt,
|
|
972
|
+
{
|
|
973
|
+
selectedConfig: H,
|
|
974
|
+
notificationtypeMap: ae,
|
|
975
|
+
selectedCondition: Ae,
|
|
976
|
+
newCondition: D,
|
|
977
|
+
handleTypeConfigurationDelete: Xe,
|
|
978
|
+
handleTypeConfigurationEdit: Ze,
|
|
979
|
+
addTypeConfig: he,
|
|
980
|
+
setNewConditionData: tt,
|
|
981
|
+
typeConfigurationData: U,
|
|
982
|
+
setNewTypeData: nt,
|
|
983
|
+
overlayOpen: oe,
|
|
984
|
+
handleOverlayState: ue,
|
|
985
|
+
"data-testid": "manageeventconfiguration-conditionconfig"
|
|
986
|
+
}
|
|
987
|
+
) }),
|
|
988
|
+
/* @__PURE__ */ t(we, { children: (R == null ? void 0 : R.type) === "MOBILE" ? /* @__PURE__ */ t(
|
|
989
|
+
Rt,
|
|
990
|
+
{
|
|
991
|
+
type: R,
|
|
992
|
+
open: de,
|
|
993
|
+
notificationtypeMap: ae,
|
|
994
|
+
handleClick: pe,
|
|
995
|
+
handleClose: () => {
|
|
996
|
+
j((e) => !e), q({});
|
|
997
|
+
},
|
|
998
|
+
"data-testid": "manageeventconfiguration-mobiletypeeventconfigmodal"
|
|
999
|
+
}
|
|
1000
|
+
) : /* @__PURE__ */ t(
|
|
1001
|
+
qt,
|
|
1002
|
+
{
|
|
1003
|
+
type: R,
|
|
1004
|
+
open: de,
|
|
1005
|
+
handleClick: pe,
|
|
1006
|
+
handleClose: () => {
|
|
1007
|
+
j((e) => !e), q({});
|
|
1008
|
+
},
|
|
1009
|
+
"data-testid": "manageeventconfiguration-othertypeeventconfigmodal"
|
|
1010
|
+
}
|
|
1011
|
+
) })
|
|
1012
|
+
] });
|
|
1013
|
+
}
|
|
1014
|
+
export {
|
|
1015
|
+
Jt as default
|
|
1016
|
+
};
|
|
1017
|
+
//# sourceMappingURL=ManageEventConfiguration-BRXh51fc.js.map
|