@argusoft/medplat-core 1.0.15 → 1.0.17
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/{ChangePasswordModalCore-CTGy8Ttf.js → ChangePasswordModalCore-ClND1mel.js} +67 -62
- package/dist/ChangePasswordModalCore-ClND1mel.js.map +1 -0
- package/dist/EventConfigurations-D8juDb29.js +449 -0
- package/dist/EventConfigurations-D8juDb29.js.map +1 -0
- package/dist/{ImmunizationConfigurationBase-DZ8EqXlF.js → ImmunizationConfigurationBase-VqVvVR57.js} +2095 -1872
- package/dist/ImmunizationConfigurationBase-VqVvVR57.js.map +1 -0
- package/dist/{ManageNotification-EQgnOO0U.js → ManageNotification-BUAvg5Ge.js} +1737 -1645
- package/dist/{ManageNotification-EQgnOO0U.js.map → ManageNotification-BUAvg5Ge.js.map} +1 -1
- package/dist/{ManageUser-C9uMe9av.js → ManageUser-eBS0yC5k.js} +80 -83
- package/dist/{ManageUser-C9uMe9av.js.map → ManageUser-eBS0yC5k.js.map} +1 -1
- package/dist/{NotificationList-BZwvgsf6.js → NotificationList-CUZSWp2J.js} +2 -2
- package/dist/{NotificationList-BZwvgsf6.js.map → NotificationList-CUZSWp2J.js.map} +1 -1
- package/dist/OtherTypeEventConfigModal-dXt2qDg_.js.map +1 -1
- package/dist/QueryManagement-DGHV_-d5.js +1012 -0
- package/dist/QueryManagement-DGHV_-d5.js.map +1 -0
- package/dist/{UserList-BH6OpZvq.js → UserList-BAeAFeXZ.js} +2 -2
- package/dist/{UserList-BH6OpZvq.js.map → UserList-BAeAFeXZ.js.map} +1 -1
- package/dist/{UserListSkeleton-cglK2SaU.js → UserListSkeleton-DhIJ5X3y.js} +10 -7
- package/dist/UserListSkeleton-DhIJ5X3y.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +56 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/ChangePasswordModalCore-CTGy8Ttf.js.map +0 -1
- package/dist/EventConfigurations-DZvSJ5EZ.js +0 -395
- package/dist/EventConfigurations-DZvSJ5EZ.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-DZ8EqXlF.js.map +0 -1
- package/dist/QueryManagement-BpIRH8hI.js +0 -685
- package/dist/QueryManagement-BpIRH8hI.js.map +0 -1
- package/dist/UserListSkeleton-cglK2SaU.js.map +0 -1
|
@@ -1,685 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as r, useEffect as z, useMemo as Ke } from "react";
|
|
3
|
-
import { Box as g, Card as Pe, Typography as x, Accordion as se, AccordionSummary as re, AccordionDetails as le, TextField as je, Button as b } from "@mui/material";
|
|
4
|
-
import O from "@/common/services/util/GeneralUtil";
|
|
5
|
-
import { api as $ } from "@/common/interceptors/AxiosInterceptor";
|
|
6
|
-
import { execute as $e, downloadExcel as Ue } from "@/common/services/GlobalApis";
|
|
7
|
-
import { getAssignedFeatures as Je } from "@/utils/feature.js";
|
|
8
|
-
import { useSelector as j } from "react-redux";
|
|
9
|
-
import ie from "@/views/custom-components/CustomTextField";
|
|
10
|
-
import { useForm as We } from "react-hook-form";
|
|
11
|
-
import Ye from "@/hooks/useTrackEvent";
|
|
12
|
-
import Ge from "@/views/custom-components/CustomConfirmationModal";
|
|
13
|
-
import { showToast as i } from "@/common/toaster/toaster";
|
|
14
|
-
import { Link as ce } from "react-router-dom";
|
|
15
|
-
import Ve from "dayjs";
|
|
16
|
-
import { useTranslateProvider as Xe } from "@/common/languageTranslator/TranslationContext";
|
|
17
|
-
import de from "prop-types";
|
|
18
|
-
import { getUseSkeleton as fe } from "@/store/reducers/SkeletonReducer";
|
|
19
|
-
import { Grid as K } from "@mui/system";
|
|
20
|
-
import Ze from "@/views/custom-components/CustomTextArea";
|
|
21
|
-
import P from "@/views/custom-components/CustomizedTable/CustomizedTableV2";
|
|
22
|
-
import { faChevronDown as me } from "@fortawesome/free-solid-svg-icons";
|
|
23
|
-
import { FontAwesomeIcon as ue } from "@fortawesome/react-fontawesome";
|
|
24
|
-
import et from "lodash/debounce";
|
|
25
|
-
import './QueryManagement.css';const tt = (d) => $.post("resource/getdatawithtimeout", d), at = (d) => $.post("querymanagement/retrieve", d, {
|
|
26
|
-
headers: { "Content-Type": "application/json" },
|
|
27
|
-
transformRequest: [(o) => o]
|
|
28
|
-
}), nt = (d) => $.post("querymanagement/execute", d, {
|
|
29
|
-
headers: { "Content-Type": "application/json" },
|
|
30
|
-
transformRequest: [(o) => o]
|
|
31
|
-
}), he = ({ children: d, loading: o }) => !j(fe) || !o ? d : /* @__PURE__ */ s("div", { className: "flex flex-col space-y-4 h-[100vh] pt-3 relative w-full", children: [
|
|
32
|
-
/* @__PURE__ */ s("div", { className: " flex flex-row space-x-2 overflow-auto", children: [
|
|
33
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[100%] h-[50px] " }),
|
|
34
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[100%] h-[50px] mx-[10px]" })
|
|
35
|
-
] }),
|
|
36
|
-
/* @__PURE__ */ s("div", { className: " flex flex-col flex-1 ", children: [
|
|
37
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse h-[10rem] w-full rounded-md mb-2" }),
|
|
38
|
-
/* @__PURE__ */ s("div", { className: "flex h-40 space-x-6", children: [
|
|
39
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-60 h-[40px]" }),
|
|
40
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[130px] h-[40px]" }),
|
|
41
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[130px] h-[40px]" }),
|
|
42
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[130px] h-[40px]" }),
|
|
43
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[130px] h-[40px]" }),
|
|
44
|
-
/* @__PURE__ */ t("div", { className: "bg-gray-300 animate-pulse rounded-sm w-[130px] h-[40px]" })
|
|
45
|
-
] })
|
|
46
|
-
] })
|
|
47
|
-
] });
|
|
48
|
-
he.propTypes = {
|
|
49
|
-
children: de.any,
|
|
50
|
-
loading: de.any
|
|
51
|
-
};
|
|
52
|
-
const pe = { pagination: !1 }, ye = { tableStyle: { maxHeight: 180 } }, ot = {
|
|
53
|
-
pagination: !1,
|
|
54
|
-
paginationType: "virtual-scroll"
|
|
55
|
-
}, st = { tableStyle: { maxHeight: "60vh" } }, Lt = () => {
|
|
56
|
-
const d = j(fe), [o, U] = r({}), A = async (e, a = null) => {
|
|
57
|
-
let n;
|
|
58
|
-
return a === "index" ? n = "SELECT * FROM pg_indexes WHERE tablename = '" + e.tablename + "' limit 100" : a === "ddl" ? n = `WITH table_columns AS (
|
|
59
|
-
SELECT
|
|
60
|
-
c.relname AS table_name,
|
|
61
|
-
a.attname AS column_name,
|
|
62
|
-
pg_catalog.format_type(a.atttypid, a.atttypmod) AS column_type,
|
|
63
|
-
CASE
|
|
64
|
-
WHEN a.attnotnull THEN 'not null'
|
|
65
|
-
ELSE 'null'
|
|
66
|
-
END AS column_constraint
|
|
67
|
-
FROM
|
|
68
|
-
pg_class c
|
|
69
|
-
JOIN pg_attribute a ON a.attrelid = c.oid
|
|
70
|
-
JOIN pg_type t ON a.atttypid = t.oid
|
|
71
|
-
WHERE
|
|
72
|
-
c.relname = '${e.tablename}'
|
|
73
|
-
AND a.attnum > 0 -- Exclude system columns
|
|
74
|
-
ORDER BY a.attnum
|
|
75
|
-
),
|
|
76
|
-
table_indexes AS (
|
|
77
|
-
SELECT
|
|
78
|
-
t.relname AS table_name,
|
|
79
|
-
i.relname AS index_name,
|
|
80
|
-
pg_catalog.pg_get_indexdef(ix.indexrelid) AS index_def
|
|
81
|
-
FROM
|
|
82
|
-
pg_class t
|
|
83
|
-
JOIN pg_index ix ON t.oid = ix.indrelid
|
|
84
|
-
JOIN pg_class i ON i.oid = ix.indexrelid
|
|
85
|
-
WHERE
|
|
86
|
-
t.relname = '${e.tablename}'
|
|
87
|
-
)
|
|
88
|
-
SELECT
|
|
89
|
-
'CREATE TABLE ' || tc.table_name || E'
|
|
90
|
-
(
|
|
91
|
-
' ||
|
|
92
|
-
array_to_string(
|
|
93
|
-
array_agg(
|
|
94
|
-
DISTINCT ' ' || tc.column_name || ' ' || tc.column_type || ' ' || tc.column_constraint
|
|
95
|
-
),
|
|
96
|
-
E',
|
|
97
|
-
'
|
|
98
|
-
) || E'
|
|
99
|
-
);
|
|
100
|
-
' ||
|
|
101
|
-
COALESCE(
|
|
102
|
-
string_agg(
|
|
103
|
-
DISTINCT ti.index_def,
|
|
104
|
-
E'
|
|
105
|
-
'
|
|
106
|
-
),
|
|
107
|
-
''
|
|
108
|
-
) AS ddl
|
|
109
|
-
FROM
|
|
110
|
-
table_columns tc
|
|
111
|
-
LEFT JOIN table_indexes ti ON tc.table_name = ti.table_name
|
|
112
|
-
GROUP BY
|
|
113
|
-
tc.table_name;
|
|
114
|
-
` : n = `select * from ${e.tablename} limit 100`, w(n), f(n), {};
|
|
115
|
-
}, ge = async (e) => {
|
|
116
|
-
w(e.query), k(0);
|
|
117
|
-
}, [J, xe] = r(null), [p, w] = r(""), [v, S] = r(0), be = [
|
|
118
|
-
{ field: "Sr. No.", label: "#", align: "left" },
|
|
119
|
-
{ field: "size_pretty", label: "Size", align: "left" },
|
|
120
|
-
{
|
|
121
|
-
field: "tablename",
|
|
122
|
-
label: "Table Name",
|
|
123
|
-
align: "left",
|
|
124
|
-
onClick: A
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
field: "Action",
|
|
128
|
-
label: "Action",
|
|
129
|
-
align: "left",
|
|
130
|
-
render: (e) => /* @__PURE__ */ t(
|
|
131
|
-
b,
|
|
132
|
-
{
|
|
133
|
-
variant: "contained",
|
|
134
|
-
color: "primary",
|
|
135
|
-
size: "small",
|
|
136
|
-
className: "text-[0.75rem]",
|
|
137
|
-
onClick: () => A(e, "index"),
|
|
138
|
-
children: l("Index")
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
field: "DDL",
|
|
144
|
-
label: "DDL",
|
|
145
|
-
align: "left",
|
|
146
|
-
render: (e) => /* @__PURE__ */ t(
|
|
147
|
-
b,
|
|
148
|
-
{
|
|
149
|
-
variant: "contained",
|
|
150
|
-
color: "primary",
|
|
151
|
-
size: "small",
|
|
152
|
-
className: "text-[0.75rem]",
|
|
153
|
-
onClick: () => A(e, "ddl"),
|
|
154
|
-
children: l("DDL")
|
|
155
|
-
}
|
|
156
|
-
)
|
|
157
|
-
}
|
|
158
|
-
], we = [
|
|
159
|
-
{ field: "Sr. No.", label: "#", align: "left" },
|
|
160
|
-
{
|
|
161
|
-
field: "query",
|
|
162
|
-
label: "Query",
|
|
163
|
-
align: "left",
|
|
164
|
-
onClick: ge
|
|
165
|
-
},
|
|
166
|
-
{ field: "created_on", label: "Executed On", align: "left" }
|
|
167
|
-
], [ve, Ne] = r([]), [I, D] = r([]), [_e, Ce] = r(!1), { user: Q } = j((e) => e.Authenticate), [T, Se] = r([]), [Te, W] = r([]), [Y, Ee] = r([]), [De, ke] = r([]), G = I.length || null, N = "select pid,query,wait_event_type,state_change,cast (now()-state_change as TEXT) as Since from pg_stat_activity where state = 'active' order by state_change", V = `select pg_terminate_backend( ${J} )`, R = "select cast(pid as text) as pid, cast(usename as text) as usename, cast(pg_blocking_pids(pid) as text) as blocked_by, datname as Database_Name,cast(query as text) as blocked_query from pg_stat_activity where cardinality(pg_blocking_pids(pid)) > 0", { translate: l } = Xe(), [X, F] = r(!1), [Z, k] = r(0), [Le, u] = r(!1), [qe, H] = r(!1), [ee, L] = r(!0), {
|
|
168
|
-
control: M,
|
|
169
|
-
setValue: te,
|
|
170
|
-
getValues: E,
|
|
171
|
-
formState: { errors: Oe }
|
|
172
|
-
} = We({
|
|
173
|
-
mode: "onChange",
|
|
174
|
-
defaultValues: {
|
|
175
|
-
excelFileName: ""
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
z(() => {
|
|
179
|
-
W(T);
|
|
180
|
-
}, [T]), z(() => {
|
|
181
|
-
if (p) {
|
|
182
|
-
if ((p == null ? void 0 : p.length) > 0) {
|
|
183
|
-
L(!1), te("query", p);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
L(!0);
|
|
187
|
-
}
|
|
188
|
-
}, [p]);
|
|
189
|
-
const ae = Ye(), f = async (e, a = []) => {
|
|
190
|
-
try {
|
|
191
|
-
if (!e) {
|
|
192
|
-
i({ message: "Query can not be empty", type: "error" });
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
u(!0);
|
|
196
|
-
const { data: n } = await at(e).catch((m) => {
|
|
197
|
-
D([]), console.error(m), u(!1), i({ message: `${m.response.data.message}`, type: "error" });
|
|
198
|
-
});
|
|
199
|
-
if (n && !n.length) {
|
|
200
|
-
k(0), D([]), i({ message: "No data found", type: "info" }), u(!1);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
if (n != null && n.length && (k(0), e !== N && i({
|
|
204
|
-
message: "Query Executed Successfully",
|
|
205
|
-
type: "success"
|
|
206
|
-
})), e === N)
|
|
207
|
-
a = [
|
|
208
|
-
{
|
|
209
|
-
label: "KILL PROCESS",
|
|
210
|
-
icon: /* @__PURE__ */ t(
|
|
211
|
-
b,
|
|
212
|
-
{
|
|
213
|
-
variant: "contained",
|
|
214
|
-
color: "error",
|
|
215
|
-
className: "text-[0.75rem]",
|
|
216
|
-
children: l("Kill Process")
|
|
217
|
-
}
|
|
218
|
-
),
|
|
219
|
-
onClick: Qe
|
|
220
|
-
}
|
|
221
|
-
];
|
|
222
|
-
else if (e === V) {
|
|
223
|
-
n != null && n.length && i({ message: "Terminated Successfully", type: "success" }), D([]);
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
D(
|
|
227
|
-
n.map((m, _) => ({ index: _ + 1, ...m }))
|
|
228
|
-
);
|
|
229
|
-
const c = Object.keys(n[0]);
|
|
230
|
-
(a.length || e === N) && c.push("Actions");
|
|
231
|
-
const y = c.map((m) => ({
|
|
232
|
-
field: m,
|
|
233
|
-
label: m,
|
|
234
|
-
align: "left"
|
|
235
|
-
}));
|
|
236
|
-
ke(a), Ne([
|
|
237
|
-
{ field: "index", label: "#", align: "left" },
|
|
238
|
-
...y
|
|
239
|
-
]), q(), u(!1);
|
|
240
|
-
} catch (n) {
|
|
241
|
-
u(!1), console.error(n);
|
|
242
|
-
}
|
|
243
|
-
}, ne = async (e) => {
|
|
244
|
-
try {
|
|
245
|
-
if (!e) {
|
|
246
|
-
i({ message: "Query can not be empty", type: "error" });
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
const { data: a } = await nt(e).catch((n) => {
|
|
250
|
-
console.error(n), i({ message: `${n.response.data.message}`, type: "error" });
|
|
251
|
-
});
|
|
252
|
-
a.length || i({ message: "No data found", type: "info" }), a.length && i({ message: "Query updated successfully", type: "success" });
|
|
253
|
-
} catch (a) {
|
|
254
|
-
console.error(a);
|
|
255
|
-
}
|
|
256
|
-
}, Ae = async () => {
|
|
257
|
-
const e = "d91d249f-c8e1-4397-a84d-6ce6eb33eb48", a = E("query"), n = E("excelFileName");
|
|
258
|
-
if (!a) {
|
|
259
|
-
i({ message: "Query can not be empty", type: "info" });
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
try {
|
|
263
|
-
u(!0);
|
|
264
|
-
const y = await Ue(e, {
|
|
265
|
-
paramObj: { query: a }
|
|
266
|
-
}).catch(
|
|
267
|
-
(h) => (console.error(h), i({
|
|
268
|
-
message: "Operation Unsuccessful, Something went wrong",
|
|
269
|
-
type: "error"
|
|
270
|
-
}), null)
|
|
271
|
-
);
|
|
272
|
-
if (!y) {
|
|
273
|
-
u(!1);
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
const m = new Blob([y.data], {
|
|
277
|
-
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
278
|
-
}), _ = `${n || "rename"}_${(/* @__PURE__ */ new Date()).getTime()}.xlsx`;
|
|
279
|
-
if (navigator.msSaveBlob) {
|
|
280
|
-
const h = new Blob([y.data], { type: "" }), B = (h.size / 1024).toFixed(2);
|
|
281
|
-
return ae("file_download", {
|
|
282
|
-
file_type: "xlsx",
|
|
283
|
-
file_name: _,
|
|
284
|
-
file_size: `${B} KB`,
|
|
285
|
-
download_status: "success"
|
|
286
|
-
}), navigator.msSaveBlob(h, _);
|
|
287
|
-
} else {
|
|
288
|
-
const h = URL.createObjectURL(m), B = (m.size / 1024).toFixed(2), C = document.createElement("a");
|
|
289
|
-
C.href = h, C.download = _, C.style.display = "none", document.body.appendChild(C), C.click(), ae("file_download", {
|
|
290
|
-
file_type: "xlsx",
|
|
291
|
-
file_name: _,
|
|
292
|
-
file_size: `${B} KB`,
|
|
293
|
-
download_status: "success"
|
|
294
|
-
}), URL.revokeObjectURL(h), C.remove();
|
|
295
|
-
}
|
|
296
|
-
u(!1);
|
|
297
|
-
} catch (c) {
|
|
298
|
-
console.error(c), u(!1), i({ type: "error", message: "Something went wrong!" });
|
|
299
|
-
}
|
|
300
|
-
}, Ie = async () => {
|
|
301
|
-
try {
|
|
302
|
-
Ce(!0), w(R), await f(R);
|
|
303
|
-
} catch (e) {
|
|
304
|
-
console.error(e);
|
|
305
|
-
}
|
|
306
|
-
}, Qe = async (e) => {
|
|
307
|
-
S(3), xe(e.pid);
|
|
308
|
-
}, Re = async () => {
|
|
309
|
-
try {
|
|
310
|
-
await f(V);
|
|
311
|
-
let e;
|
|
312
|
-
_e === !0 ? e = R : e = N, await f(e);
|
|
313
|
-
} catch (e) {
|
|
314
|
-
console.error(e);
|
|
315
|
-
}
|
|
316
|
-
}, Fe = async () => {
|
|
317
|
-
try {
|
|
318
|
-
w(N), await f(N);
|
|
319
|
-
} catch (e) {
|
|
320
|
-
console.error(e);
|
|
321
|
-
}
|
|
322
|
-
}, q = async () => {
|
|
323
|
-
try {
|
|
324
|
-
const e = E("queryHistorySearchKey"), { data: a } = await $e({
|
|
325
|
-
code: "retrieve_limited_query_history",
|
|
326
|
-
parameters: {
|
|
327
|
-
userId: Q == null ? void 0 : Q.id,
|
|
328
|
-
limit: 100,
|
|
329
|
-
searchKey: e
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
Ee(
|
|
333
|
-
a.result.map((n, c) => ({
|
|
334
|
-
index: c + 1,
|
|
335
|
-
...n,
|
|
336
|
-
created_on: Ve(n.created_on).format("DD-MM-YYYY h:mm:ss A")
|
|
337
|
-
}))
|
|
338
|
-
);
|
|
339
|
-
} catch (e) {
|
|
340
|
-
console.error(e);
|
|
341
|
-
}
|
|
342
|
-
}, He = async () => {
|
|
343
|
-
try {
|
|
344
|
-
F((a) => !a);
|
|
345
|
-
const { data: e } = await Je("techo.querymanagement");
|
|
346
|
-
e && U(JSON.parse(e)), q(), F((a) => !a);
|
|
347
|
-
} catch {
|
|
348
|
-
F(!1);
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
z(() => {
|
|
352
|
-
He();
|
|
353
|
-
}, []);
|
|
354
|
-
const Me = async () => {
|
|
355
|
-
try {
|
|
356
|
-
H(!0);
|
|
357
|
-
const { data: e } = await tt({
|
|
358
|
-
code: "retrieve_all_tables"
|
|
359
|
-
});
|
|
360
|
-
Se(
|
|
361
|
-
e.result.map((a, n) => ({
|
|
362
|
-
index: n + 1,
|
|
363
|
-
...a
|
|
364
|
-
}))
|
|
365
|
-
), H(!1);
|
|
366
|
-
} catch (e) {
|
|
367
|
-
console.error(e), H(!1);
|
|
368
|
-
}
|
|
369
|
-
}, Be = (e) => {
|
|
370
|
-
const a = e.target.value;
|
|
371
|
-
ze(a);
|
|
372
|
-
}, ze = Ke(
|
|
373
|
-
() => et((e) => {
|
|
374
|
-
const a = e.toLowerCase(), n = T.filter(
|
|
375
|
-
(c) => {
|
|
376
|
-
var y;
|
|
377
|
-
return (y = c == null ? void 0 : c.tablename) == null ? void 0 : y.toLowerCase().includes(a);
|
|
378
|
-
}
|
|
379
|
-
);
|
|
380
|
-
W(n);
|
|
381
|
-
}, 300),
|
|
382
|
-
// debounce time in ms
|
|
383
|
-
[T]
|
|
384
|
-
), oe = (e, a) => {
|
|
385
|
-
k(a ? e : !1);
|
|
386
|
-
};
|
|
387
|
-
return O.isTecho && !X && !(o != null && o["view.manage.querymanagement.retrieve"]) ? /* @__PURE__ */ t(g, { className: "flex justify-center items-center w-full h-[80vh]", children: /* @__PURE__ */ t(
|
|
388
|
-
Pe,
|
|
389
|
-
{
|
|
390
|
-
className: "h-80 w-150 flex justify-center items-center",
|
|
391
|
-
children: /* @__PURE__ */ t(x, { variant: "h5", className: "text-customBlue", children: "You dont have permission to view Query Management" })
|
|
392
|
-
}
|
|
393
|
-
) }) : /* @__PURE__ */ s(he, { loading: X, children: [
|
|
394
|
-
Le && d && /* @__PURE__ */ t("div", { className: "loader-overlay", children: /* @__PURE__ */ t("div", { className: "loader-spinner" }) }),
|
|
395
|
-
/* @__PURE__ */ s(g, { minHeight: "80vh", className: "flex flex-col mt-5", children: [
|
|
396
|
-
/* @__PURE__ */ s(
|
|
397
|
-
g,
|
|
398
|
-
{
|
|
399
|
-
className: "flex flex-col md:flex-row md:space-x-2 space-y-2 md:space-y-0",
|
|
400
|
-
children: [
|
|
401
|
-
/* @__PURE__ */ t(K, { className: "w-full md:w-1/2", children: /* @__PURE__ */ s(
|
|
402
|
-
se,
|
|
403
|
-
{
|
|
404
|
-
expanded: Z === 1,
|
|
405
|
-
onChange: (e, a) => {
|
|
406
|
-
a && !T.length && Me(), oe(1, a);
|
|
407
|
-
},
|
|
408
|
-
"data-testid": "table-list-accordion",
|
|
409
|
-
className: "accordion",
|
|
410
|
-
children: [
|
|
411
|
-
/* @__PURE__ */ t(
|
|
412
|
-
re,
|
|
413
|
-
{
|
|
414
|
-
expandIcon: /* @__PURE__ */ t(ue, { icon: me }),
|
|
415
|
-
"data-testid": "table-list-accordion-title",
|
|
416
|
-
sx: {
|
|
417
|
-
"&.Mui-expanded": {
|
|
418
|
-
minHeight: "unset",
|
|
419
|
-
paddingBottom: "2px",
|
|
420
|
-
"& .MuiAccordionSummary-content": {
|
|
421
|
-
marginBottom: "2px"
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
children: /* @__PURE__ */ t(x, { children: l("All Table List") })
|
|
426
|
-
}
|
|
427
|
-
),
|
|
428
|
-
/* @__PURE__ */ s(
|
|
429
|
-
le,
|
|
430
|
-
{
|
|
431
|
-
className: "accordion-details mt-2.5",
|
|
432
|
-
sx: {
|
|
433
|
-
backgroundColor: "background.paper",
|
|
434
|
-
".Mui-expanded &": {
|
|
435
|
-
opacity: 1,
|
|
436
|
-
pointerEvents: "auto"
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
children: [
|
|
440
|
-
/* @__PURE__ */ t(
|
|
441
|
-
je,
|
|
442
|
-
{
|
|
443
|
-
id: "tableListSearchKey",
|
|
444
|
-
onChange: Be,
|
|
445
|
-
size: "small",
|
|
446
|
-
placeholder: "Search Table Name",
|
|
447
|
-
className: "w-[70%] mb-2"
|
|
448
|
-
}
|
|
449
|
-
),
|
|
450
|
-
/* @__PURE__ */ t(
|
|
451
|
-
P,
|
|
452
|
-
{
|
|
453
|
-
strip: !0,
|
|
454
|
-
isLoading: qe,
|
|
455
|
-
columns: be,
|
|
456
|
-
tableData: Te,
|
|
457
|
-
paginationConfig: pe,
|
|
458
|
-
dataTestId: "table-list-table-customized",
|
|
459
|
-
styleConfig: ye
|
|
460
|
-
}
|
|
461
|
-
)
|
|
462
|
-
]
|
|
463
|
-
}
|
|
464
|
-
)
|
|
465
|
-
]
|
|
466
|
-
}
|
|
467
|
-
) }),
|
|
468
|
-
/* @__PURE__ */ t(K, { className: "w-full md:w-1/2", children: /* @__PURE__ */ s(
|
|
469
|
-
se,
|
|
470
|
-
{
|
|
471
|
-
expanded: Z === 2,
|
|
472
|
-
onChange: (e, a) => {
|
|
473
|
-
a && !Y.length && q(), oe(2, a);
|
|
474
|
-
},
|
|
475
|
-
"data-testid": "query-history-accordion",
|
|
476
|
-
className: "accordion",
|
|
477
|
-
children: [
|
|
478
|
-
/* @__PURE__ */ t(
|
|
479
|
-
re,
|
|
480
|
-
{
|
|
481
|
-
expandIcon: /* @__PURE__ */ t(ue, { icon: me }),
|
|
482
|
-
"data-testid": "query-history-accordion-title",
|
|
483
|
-
sx: {
|
|
484
|
-
"&.Mui-expanded": {
|
|
485
|
-
minHeight: "unset",
|
|
486
|
-
paddingBottom: "2px",
|
|
487
|
-
"& .MuiAccordionSummary-content": {
|
|
488
|
-
marginBottom: "2px"
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
},
|
|
492
|
-
children: /* @__PURE__ */ t(x, { children: l("Query History") })
|
|
493
|
-
}
|
|
494
|
-
),
|
|
495
|
-
/* @__PURE__ */ s(
|
|
496
|
-
le,
|
|
497
|
-
{
|
|
498
|
-
className: "accordion-details mt-2.5",
|
|
499
|
-
sx: {
|
|
500
|
-
backgroundColor: "background.paper",
|
|
501
|
-
".Mui-expanded &": {
|
|
502
|
-
opacity: 1,
|
|
503
|
-
pointerEvents: "auto"
|
|
504
|
-
}
|
|
505
|
-
},
|
|
506
|
-
test: "work",
|
|
507
|
-
children: [
|
|
508
|
-
/* @__PURE__ */ s(g, { className: "flex items-center mb-2", children: [
|
|
509
|
-
/* @__PURE__ */ t(
|
|
510
|
-
ie,
|
|
511
|
-
{
|
|
512
|
-
id: "queryHistorySearchKey",
|
|
513
|
-
name: "queryHistorySearchKey",
|
|
514
|
-
control: M,
|
|
515
|
-
placeholder: "Search in History",
|
|
516
|
-
size: "small",
|
|
517
|
-
className: "w-auto mr-1"
|
|
518
|
-
}
|
|
519
|
-
),
|
|
520
|
-
/* @__PURE__ */ t(
|
|
521
|
-
b,
|
|
522
|
-
{
|
|
523
|
-
variant: "contained",
|
|
524
|
-
color: "primary",
|
|
525
|
-
onClick: q,
|
|
526
|
-
"data-testid": "query-history-accordion-submit",
|
|
527
|
-
sx: { ml: { xs: "10px", md: "0px" } },
|
|
528
|
-
children: l("Search")
|
|
529
|
-
}
|
|
530
|
-
)
|
|
531
|
-
] }),
|
|
532
|
-
/* @__PURE__ */ t(
|
|
533
|
-
P,
|
|
534
|
-
{
|
|
535
|
-
strip: !0,
|
|
536
|
-
columns: we,
|
|
537
|
-
tableData: Y,
|
|
538
|
-
paginationConfig: pe,
|
|
539
|
-
dataTestId: "query-history-table-customized",
|
|
540
|
-
styleConfig: ye
|
|
541
|
-
}
|
|
542
|
-
)
|
|
543
|
-
]
|
|
544
|
-
}
|
|
545
|
-
)
|
|
546
|
-
]
|
|
547
|
-
}
|
|
548
|
-
) })
|
|
549
|
-
]
|
|
550
|
-
}
|
|
551
|
-
),
|
|
552
|
-
/* @__PURE__ */ s(g, { className: "flex flex-col space-y-4", children: [
|
|
553
|
-
/* @__PURE__ */ t(
|
|
554
|
-
Ze,
|
|
555
|
-
{
|
|
556
|
-
control: M,
|
|
557
|
-
minRows: 5,
|
|
558
|
-
variant: "outlined",
|
|
559
|
-
placeholder: "Type your query here...",
|
|
560
|
-
id: "query",
|
|
561
|
-
name: "query",
|
|
562
|
-
className: "mt-5",
|
|
563
|
-
sx: { backgroundColor: "background.paper" },
|
|
564
|
-
errors: Oe,
|
|
565
|
-
margin: "normal",
|
|
566
|
-
dataTestId: "query-text-area",
|
|
567
|
-
onChange: (e) => {
|
|
568
|
-
var a, n;
|
|
569
|
-
if (te("query", e.target.value), ((n = (a = e == null ? void 0 : e.target) == null ? void 0 : a.value) == null ? void 0 : n.length) > 0) {
|
|
570
|
-
L(!1);
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
L(!0);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
),
|
|
577
|
-
/* @__PURE__ */ s(g, { className: "flex flex-col md:flex-row md:items-center mb-4 gap-3", children: [
|
|
578
|
-
/* @__PURE__ */ t(
|
|
579
|
-
ie,
|
|
580
|
-
{
|
|
581
|
-
id: "excelFileName",
|
|
582
|
-
name: "excelFileName",
|
|
583
|
-
className: "m-0 p-0",
|
|
584
|
-
control: M,
|
|
585
|
-
placeholder: "Enter File Name",
|
|
586
|
-
size: "small",
|
|
587
|
-
fullWidth: !1,
|
|
588
|
-
dataTestId: "enter-file-field"
|
|
589
|
-
}
|
|
590
|
-
),
|
|
591
|
-
(!O.isTecho || (o == null ? void 0 : o["view.manage.querymanagement.downloadExcel"])) && /* @__PURE__ */ t(
|
|
592
|
-
b,
|
|
593
|
-
{
|
|
594
|
-
variant: "contained",
|
|
595
|
-
color: "info",
|
|
596
|
-
onClick: Ae,
|
|
597
|
-
"data-testid": "download-excel-button",
|
|
598
|
-
children: l("Download Excel")
|
|
599
|
-
}
|
|
600
|
-
),
|
|
601
|
-
/* @__PURE__ */ s(g, { className: "m-1 flex", children: [
|
|
602
|
-
/* @__PURE__ */ t(ce, { onClick: () => Ie(), className: "m-1", children: /* @__PURE__ */ t(x, { variant: "body2", color: "info", children: l("Fetch Locked Queries") }) }),
|
|
603
|
-
/* @__PURE__ */ t(x, { variant: "body2", className: "m-1", children: "|" }),
|
|
604
|
-
/* @__PURE__ */ t(ce, { onClick: Fe, className: "m-1", children: /* @__PURE__ */ t(x, { variant: "body2", color: "info", children: l("Populate State Query") }) })
|
|
605
|
-
] }),
|
|
606
|
-
(!O.isTecho || (o == null ? void 0 : o["view.manage.querymanagement.retrieve"])) && /* @__PURE__ */ t(
|
|
607
|
-
b,
|
|
608
|
-
{
|
|
609
|
-
variant: "contained",
|
|
610
|
-
color: "success",
|
|
611
|
-
onClick: async () => {
|
|
612
|
-
const e = E("query");
|
|
613
|
-
if (w(e), e != null && e.toLowerCase().includes("where")) {
|
|
614
|
-
await f(e);
|
|
615
|
-
return;
|
|
616
|
-
}
|
|
617
|
-
S(1);
|
|
618
|
-
},
|
|
619
|
-
"data-testid": "retrieve-data-button",
|
|
620
|
-
disabled: ee,
|
|
621
|
-
children: l("Retrieve Data")
|
|
622
|
-
}
|
|
623
|
-
),
|
|
624
|
-
(!O.isTecho || (o == null ? void 0 : o["view.manage.querymanagement.execute"])) && /* @__PURE__ */ t(
|
|
625
|
-
b,
|
|
626
|
-
{
|
|
627
|
-
variant: "contained",
|
|
628
|
-
color: "secondary",
|
|
629
|
-
onClick: async () => {
|
|
630
|
-
const e = E("query");
|
|
631
|
-
if (w(e), e != null && e.toLowerCase().includes("where")) {
|
|
632
|
-
await ne(e);
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
S(2);
|
|
636
|
-
},
|
|
637
|
-
"data-testid": "execute-button",
|
|
638
|
-
disabled: ee,
|
|
639
|
-
children: l("Execute")
|
|
640
|
-
}
|
|
641
|
-
)
|
|
642
|
-
] }),
|
|
643
|
-
!!G && /* @__PURE__ */ s(x, { variant: "body2", children: [
|
|
644
|
-
l("Total rows fetched"),
|
|
645
|
-
" :",
|
|
646
|
-
" ",
|
|
647
|
-
/* @__PURE__ */ s("strong", { children: [
|
|
648
|
-
" ",
|
|
649
|
-
G
|
|
650
|
-
] }),
|
|
651
|
-
" "
|
|
652
|
-
] }),
|
|
653
|
-
!!I.length && /* @__PURE__ */ t(K, { className: "max-h-[80vh] overflow-x-auto mb-2", children: /* @__PURE__ */ t(
|
|
654
|
-
P,
|
|
655
|
-
{
|
|
656
|
-
className: "min-w-[500px]",
|
|
657
|
-
columns: ve,
|
|
658
|
-
actions: De,
|
|
659
|
-
tableData: I,
|
|
660
|
-
paginationConfig: ot,
|
|
661
|
-
dataTestId: "query-output-table-customized",
|
|
662
|
-
styleConfig: st
|
|
663
|
-
}
|
|
664
|
-
) }),
|
|
665
|
-
!!v && /* @__PURE__ */ t(
|
|
666
|
-
Ge,
|
|
667
|
-
{
|
|
668
|
-
description: v === 3 ? `Are you sure you want to kill process id ${J}` : "The query does not include where clause. Are you sure you want to proceed ?",
|
|
669
|
-
title: "CONFIRM ACTION",
|
|
670
|
-
open: v,
|
|
671
|
-
handleClick: async () => {
|
|
672
|
-
v === 1 && f(p), v === 2 && ne(p), v === 3 && Re(), S(0);
|
|
673
|
-
},
|
|
674
|
-
handleClose: () => S(0),
|
|
675
|
-
dataTestId: "modal"
|
|
676
|
-
}
|
|
677
|
-
)
|
|
678
|
-
] })
|
|
679
|
-
] })
|
|
680
|
-
] });
|
|
681
|
-
};
|
|
682
|
-
export {
|
|
683
|
-
Lt as default
|
|
684
|
-
};
|
|
685
|
-
//# sourceMappingURL=QueryManagement-BpIRH8hI.js.map
|