@bahmni/admin-app 0.0.1-dev.451 → 0.0.1-dev.452
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/{AdminDashboard-CYVM_EiQ.js → AdminDashboard-4L5vxprA.js} +2 -2
- package/dist/{AuditLog-iZ1rzQJi.js → AuditLog-DnSXSTJ_.js} +46 -46
- package/dist/{CsvExport-BmvkLPfn.js → CsvExport-OtNzuu0e.js} +33 -33
- package/dist/{CsvUpload-DDAAxlOP.js → CsvUpload-CAF80PsH.js} +1 -1
- package/dist/DocumentsTable-DH1dnlXy-hDxq_tz2.js +439 -0
- package/dist/{FormsTable-BkZ7CAhs-DDzwQf_5.js → FormsTable-B8Zxjboo-Cerow-cD.js} +83 -83
- package/dist/{LNWAZHJI-31a14RWE.js → LNWAZHJI-DVbBzE5X.js} +7 -7
- package/dist/{MWZ6AO7Z-bMqYgWjk.js → MWZ6AO7Z-CYl-OPQp.js} +9 -9
- package/dist/{Observations-ByaPCQhx-BxI4Sxh_.js → Observations-BzjjSeWg-tAqFoqhr.js} +41 -41
- package/dist/{YPM2AS64-CniKvC2e.js → YPM2AS64-CLLOAMRV.js} +1 -1
- package/dist/{index-D408E2pe.js → index-Grpo3EV8.js} +64760 -73314
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/DocumentsTable-cTYcbFbC-B13N7Kaf.js +0 -227
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { G as o, L as a, O as s, P as t } from "./index-Grpo3EV8.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@tanstack/react-query";
|
|
5
5
|
const i = () => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(
|
|
6
6
|
a,
|
|
7
7
|
{
|
|
8
|
-
extensionPointId:
|
|
8
|
+
extensionPointId: t,
|
|
9
9
|
appName: s,
|
|
10
10
|
loadingLabelKey: "ADMIN_LOADING_MODULES",
|
|
11
11
|
errorMessageKey: "ADMIN_ERROR_FETCH_CONFIG",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useState as l, useRef as
|
|
2
|
+
import { a7 as ee, a8 as te, a9 as se, aa as K, u as ae, ab as ne, ac as re, G as ie, a3 as oe, ad as ue, ae as de, af as C, a5 as H, ag as le } from "./index-Grpo3EV8.js";
|
|
3
|
+
import { useState as l, useRef as P, useEffect as V, useMemo as ce, useCallback as me } from "react";
|
|
4
4
|
import { useQuery as Ee } from "@tanstack/react-query";
|
|
5
|
-
const
|
|
5
|
+
const k = Symbol.for("constructDateFrom");
|
|
6
6
|
function y(e, t) {
|
|
7
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" &&
|
|
7
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && k in e ? e[k](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
8
8
|
}
|
|
9
9
|
function w(e, t) {
|
|
10
10
|
return y(e, e);
|
|
@@ -32,15 +32,15 @@ const Le = (e, t) => {
|
|
|
32
32
|
}
|
|
33
33
|
if (!Number.isNaN(r.getTime()))
|
|
34
34
|
return r.toISOString();
|
|
35
|
-
}, q = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND", Te = "MATCHING_EVENTS_NOT_FOUND",
|
|
35
|
+
}, q = "NO_EVENTS_FOUND", Y = "NO_MORE_EVENTS_FOUND", Te = "MATCHING_EVENTS_NOT_FOUND", pe = () => {
|
|
36
36
|
const [e, t] = l({
|
|
37
37
|
startDate: ee(),
|
|
38
38
|
startTime: "00:00",
|
|
39
39
|
username: "",
|
|
40
40
|
patientId: ""
|
|
41
|
-
}), [r, a] = l(0), [i, u] = l(0), [E, _] = l([]), [R,
|
|
41
|
+
}), [r, a] = l(0), [i, u] = l(0), [E, _] = l([]), [R, I] = l(null), [b, f] = l(!1), [O, g] = l(!1), [F, M] = l(1), T = P(1), s = (c) => {
|
|
42
42
|
T.current = c, M(c);
|
|
43
|
-
}, o =
|
|
43
|
+
}, o = P(0), [n, j] = l(null), B = P(null), { data: N, isLoading: Q, isFetching: L, isError: z } = Ee({
|
|
44
44
|
queryKey: ["auditLogs", n?.requestId],
|
|
45
45
|
queryFn: () => te(n.params),
|
|
46
46
|
enabled: !!n,
|
|
@@ -48,18 +48,18 @@ const Le = (e, t) => {
|
|
|
48
48
|
// (and audit logs must always be fetched fresh). Drop entries as soon as
|
|
49
49
|
// they become inactive instead of retaining them for the default gcTime.
|
|
50
50
|
gcTime: 0
|
|
51
|
-
}),
|
|
51
|
+
}), p = (c, G, m, h, D, $) => {
|
|
52
52
|
o.current += 1, j({
|
|
53
53
|
action: c,
|
|
54
|
-
params:
|
|
54
|
+
params: G,
|
|
55
55
|
alwaysReplace: m,
|
|
56
|
-
defaultFirstIndex:
|
|
57
|
-
defaultLastIndex:
|
|
58
|
-
emptyMessageKey:
|
|
56
|
+
defaultFirstIndex: h,
|
|
57
|
+
defaultLastIndex: D,
|
|
58
|
+
emptyMessageKey: $,
|
|
59
59
|
requestId: o.current
|
|
60
60
|
});
|
|
61
|
-
}, A = Le(e.startDate, e.startTime),
|
|
62
|
-
|
|
61
|
+
}, A = Le(e.startDate, e.startTime), X = () => {
|
|
62
|
+
p(
|
|
63
63
|
"init",
|
|
64
64
|
{ startFrom: A, defaultView: !0 },
|
|
65
65
|
!0,
|
|
@@ -73,7 +73,7 @@ const Le = (e, t) => {
|
|
|
73
73
|
x();
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
p(
|
|
77
77
|
"next",
|
|
78
78
|
{
|
|
79
79
|
lastAuditLogId: i,
|
|
@@ -88,13 +88,13 @@ const Le = (e, t) => {
|
|
|
88
88
|
Y
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, J = () => {
|
|
92
92
|
if (!L) {
|
|
93
93
|
if (!v()) {
|
|
94
94
|
x();
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
p(
|
|
98
98
|
"prev",
|
|
99
99
|
{
|
|
100
100
|
lastAuditLogId: r,
|
|
@@ -109,7 +109,7 @@ const Le = (e, t) => {
|
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
}, x = () => {
|
|
112
|
-
L ||
|
|
112
|
+
L || p(
|
|
113
113
|
"runReport",
|
|
114
114
|
{
|
|
115
115
|
defaultView: !0,
|
|
@@ -122,37 +122,37 @@ const Le = (e, t) => {
|
|
|
122
122
|
0,
|
|
123
123
|
Te
|
|
124
124
|
);
|
|
125
|
-
},
|
|
125
|
+
}, W = () => {
|
|
126
126
|
L || (t({
|
|
127
127
|
startDate: null,
|
|
128
128
|
startTime: "",
|
|
129
129
|
username: "",
|
|
130
130
|
patientId: ""
|
|
131
|
-
}),
|
|
131
|
+
}), p("init", { defaultView: !0 }, !0, 0, 0, q));
|
|
132
132
|
};
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
}, []),
|
|
133
|
+
return V(() => {
|
|
134
|
+
X();
|
|
135
|
+
}, []), V(() => {
|
|
136
136
|
if (!n || N === void 0 || B.current === n.requestId) return;
|
|
137
137
|
B.current = n.requestId;
|
|
138
|
-
const c = !!n.params.defaultView, m = (c ? N : [...N].reverse()).map(se),
|
|
138
|
+
const c = !!n.params.defaultView, m = (c ? N : [...N].reverse()).map(se), h = m.length === K;
|
|
139
139
|
if (m.length)
|
|
140
|
-
if (_(m),
|
|
141
|
-
g(!1), f(
|
|
140
|
+
if (_(m), I(null), a(m[0].auditLogId), u(m[m.length - 1].auditLogId), c)
|
|
141
|
+
g(!1), f(h), s(1);
|
|
142
142
|
else if (n.action === "next")
|
|
143
|
-
g(!0), f(
|
|
143
|
+
g(!0), f(h), s(T.current + 1);
|
|
144
144
|
else {
|
|
145
145
|
f(!0);
|
|
146
|
-
const
|
|
147
|
-
g(
|
|
146
|
+
const D = Math.max(1, T.current - 1);
|
|
147
|
+
g(D > 1), s(D);
|
|
148
148
|
}
|
|
149
149
|
else
|
|
150
|
-
n.alwaysReplace && _([]),
|
|
150
|
+
n.alwaysReplace && _([]), I(n.emptyMessageKey), a(n.defaultFirstIndex), u(n.defaultLastIndex), c ? (f(!1), g(!1), s(1)) : n.action === "next" ? f(!1) : g(!1);
|
|
151
151
|
}, [N, n]), {
|
|
152
152
|
filters: e,
|
|
153
153
|
setFilters: t,
|
|
154
154
|
logs: E,
|
|
155
|
-
isLoading:
|
|
155
|
+
isLoading: Q || L,
|
|
156
156
|
isFetching: L,
|
|
157
157
|
isError: z,
|
|
158
158
|
emptyMessageKey: R,
|
|
@@ -162,12 +162,12 @@ const Le = (e, t) => {
|
|
|
162
162
|
hasPrevious: O,
|
|
163
163
|
currentPageNumber: F,
|
|
164
164
|
next: Z,
|
|
165
|
-
prev:
|
|
165
|
+
prev: J,
|
|
166
166
|
runReport: x,
|
|
167
|
-
reset:
|
|
167
|
+
reset: W
|
|
168
168
|
};
|
|
169
|
-
},
|
|
170
|
-
page:
|
|
169
|
+
}, Ie = "AuditLog-module_page__-FKzd", Ne = "AuditLog-module_filters__DA4tQ", Ae = "AuditLog-module_filterRow__x6DqE", U = {
|
|
170
|
+
page: Ie,
|
|
171
171
|
filters: Ne,
|
|
172
172
|
filterRow: Ae
|
|
173
173
|
}, be = () => {
|
|
@@ -180,13 +180,13 @@ const Le = (e, t) => {
|
|
|
180
180
|
isError: E,
|
|
181
181
|
emptyMessageKey: _,
|
|
182
182
|
hasNext: R,
|
|
183
|
-
hasPrevious:
|
|
183
|
+
hasPrevious: I,
|
|
184
184
|
currentPageNumber: b,
|
|
185
185
|
next: f,
|
|
186
186
|
prev: O,
|
|
187
187
|
runReport: g,
|
|
188
188
|
reset: F
|
|
189
|
-
} =
|
|
189
|
+
} = pe(), M = ce(
|
|
190
190
|
() => [
|
|
191
191
|
{ key: "auditLogId", header: e("EVENT_ID") },
|
|
192
192
|
{ key: "dateCreated", header: e("CREATED_AT") },
|
|
@@ -228,11 +228,11 @@ const Le = (e, t) => {
|
|
|
228
228
|
id: "admin-audit-log-page",
|
|
229
229
|
"data-testid": "admin-audit-log-page-test-id",
|
|
230
230
|
"aria-label": "admin-audit-log-page-aria-label",
|
|
231
|
-
className:
|
|
231
|
+
className: U.page,
|
|
232
232
|
children: [
|
|
233
|
-
/* @__PURE__ */ S(oe, { className:
|
|
233
|
+
/* @__PURE__ */ S(oe, { className: U.filters, "aria-label": e("FILTERS_HEADER_LABEL"), children: [
|
|
234
234
|
/* @__PURE__ */ d("h2", { children: e("FILTERS_HEADER_LABEL") }),
|
|
235
|
-
/* @__PURE__ */ S("div", { className:
|
|
235
|
+
/* @__PURE__ */ S("div", { className: U.filterRow, children: [
|
|
236
236
|
/* @__PURE__ */ d(
|
|
237
237
|
ue,
|
|
238
238
|
{
|
|
@@ -256,7 +256,7 @@ const Le = (e, t) => {
|
|
|
256
256
|
t.startDate?.getTime() ?? "empty"
|
|
257
257
|
),
|
|
258
258
|
/* @__PURE__ */ d(
|
|
259
|
-
|
|
259
|
+
C,
|
|
260
260
|
{
|
|
261
261
|
id: "audit-log-start-time",
|
|
262
262
|
type: "time",
|
|
@@ -270,7 +270,7 @@ const Le = (e, t) => {
|
|
|
270
270
|
}
|
|
271
271
|
),
|
|
272
272
|
/* @__PURE__ */ d(
|
|
273
|
-
|
|
273
|
+
C,
|
|
274
274
|
{
|
|
275
275
|
id: "audit-log-username",
|
|
276
276
|
labelText: e("USERNAME_FILTER_LABEL"),
|
|
@@ -284,7 +284,7 @@ const Le = (e, t) => {
|
|
|
284
284
|
}
|
|
285
285
|
),
|
|
286
286
|
/* @__PURE__ */ d(
|
|
287
|
-
|
|
287
|
+
C,
|
|
288
288
|
{
|
|
289
289
|
id: "audit-log-patient-id",
|
|
290
290
|
labelText: e("PATIENT_ID_FILTER_LABEL"),
|
|
@@ -298,7 +298,7 @@ const Le = (e, t) => {
|
|
|
298
298
|
}
|
|
299
299
|
),
|
|
300
300
|
/* @__PURE__ */ d(
|
|
301
|
-
|
|
301
|
+
H,
|
|
302
302
|
{
|
|
303
303
|
kind: "tertiary",
|
|
304
304
|
onClick: F,
|
|
@@ -308,7 +308,7 @@ const Le = (e, t) => {
|
|
|
308
308
|
}
|
|
309
309
|
),
|
|
310
310
|
/* @__PURE__ */ d(
|
|
311
|
-
|
|
311
|
+
H,
|
|
312
312
|
{
|
|
313
313
|
kind: "primary",
|
|
314
314
|
onClick: g,
|
|
@@ -336,7 +336,7 @@ const Le = (e, t) => {
|
|
|
336
336
|
pageSize: K,
|
|
337
337
|
startPage: b,
|
|
338
338
|
hasNext: R,
|
|
339
|
-
hasPrevious:
|
|
339
|
+
hasPrevious: I,
|
|
340
340
|
disabled: u,
|
|
341
341
|
previousLabel: e("AUDIT_LOG_PREV_BUTTON_LABEL"),
|
|
342
342
|
nextLabel: e("AUDIT_LOG_NEXT_BUTTON_LABEL"),
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { u as A, z as M,
|
|
3
|
-
import { useState as E, useMemo as
|
|
4
|
-
import { useQuery as L, useMutation as
|
|
5
|
-
const
|
|
6
|
-
tile:
|
|
7
|
-
title:
|
|
8
|
-
form:
|
|
9
|
-
search:
|
|
10
|
-
},
|
|
11
|
-
const { t } = A(), { addNotification:
|
|
1
|
+
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { u as A, z as M, V as R, _ as h, a0 as O, a1 as P, a2 as g, G as D, a3 as V, a4 as f, a5 as x, a6 as y } from "./index-Grpo3EV8.js";
|
|
3
|
+
import { useState as E, useMemo as b } from "react";
|
|
4
|
+
import { useQuery as L, useMutation as v } from "@tanstack/react-query";
|
|
5
|
+
const X = "CsvExport-module_tile__yBrLM", z = "CsvExport-module_title__epZnI", B = "CsvExport-module_form__w-cN-", G = "CsvExport-module_search__G82i7", i = {
|
|
6
|
+
tile: X,
|
|
7
|
+
title: z,
|
|
8
|
+
form: B,
|
|
9
|
+
search: G
|
|
10
|
+
}, U = 300, S = 2, _ = 5e3, H = "custom:(uuid,setMembers:(uuid))", Q = () => {
|
|
11
|
+
const { t } = A(), { addNotification: r } = M(), [p, C] = E(""), [s, c] = E(
|
|
12
12
|
null
|
|
13
|
-
),
|
|
14
|
-
queryKey: ["csvExportConceptSearch",
|
|
15
|
-
queryFn: () =>
|
|
16
|
-
enabled:
|
|
13
|
+
), n = R(p.trim(), U), { data: l = [] } = L({
|
|
14
|
+
queryKey: ["csvExportConceptSearch", n],
|
|
15
|
+
queryFn: () => h(n),
|
|
16
|
+
enabled: n.length >= S && n !== s?.name,
|
|
17
17
|
// Keep prior options visible while the next term loads, but not once the input is too short to search
|
|
18
|
-
placeholderData: (e) =>
|
|
19
|
-
}), T =
|
|
18
|
+
placeholderData: (e) => n.length >= S ? e : void 0
|
|
19
|
+
}), T = b(
|
|
20
20
|
() => l.flatMap(
|
|
21
21
|
(e) => e.name?.name ? [{ uuid: e.uuid, name: e.name.name }] : []
|
|
22
22
|
),
|
|
23
23
|
[l]
|
|
24
|
-
), o =
|
|
25
|
-
mutationFn: async (e) => (await P(e.uuid,
|
|
24
|
+
), o = v({
|
|
25
|
+
mutationFn: async (e) => (await P(e.uuid, H)).setMembers?.length ? g(e.name) : null,
|
|
26
26
|
onSuccess: (e, u) => {
|
|
27
27
|
const m = u.name;
|
|
28
28
|
if (!e || e.size === 0) {
|
|
29
|
-
|
|
29
|
+
r({
|
|
30
30
|
type: "error",
|
|
31
31
|
title: t("ADMIN_CSV_EXPORT_NO_DATA_TITLE"),
|
|
32
32
|
message: t("ADMIN_CSV_EXPORT_NO_DATA_MESSAGE"),
|
|
@@ -34,7 +34,7 @@ const v = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H
|
|
|
34
34
|
});
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
O(e, `${m}.zip`), r({
|
|
38
38
|
type: "success",
|
|
39
39
|
title: t("ADMIN_CSV_EXPORT_SUCCESS_TITLE"),
|
|
40
40
|
message: t("ADMIN_CSV_EXPORT_SUCCESS_MESSAGE", { conceptName: m }),
|
|
@@ -42,7 +42,7 @@ const v = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H
|
|
|
42
42
|
});
|
|
43
43
|
},
|
|
44
44
|
onError: (e) => {
|
|
45
|
-
|
|
45
|
+
r({
|
|
46
46
|
type: "error",
|
|
47
47
|
title: t("ADMIN_CSV_EXPORT_ERROR_TITLE"),
|
|
48
48
|
message: e.message,
|
|
@@ -54,7 +54,7 @@ const v = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H
|
|
|
54
54
|
}, N = (e) => {
|
|
55
55
|
if (e.preventDefault(), !o.isPending) {
|
|
56
56
|
if (!s) {
|
|
57
|
-
|
|
57
|
+
r({
|
|
58
58
|
type: "error",
|
|
59
59
|
title: t("ADMIN_CSV_EXPORT_SELECT_CONCEPT_TITLE"),
|
|
60
60
|
message: t("ADMIN_CSV_EXPORT_SELECT_CONCEPT_MESSAGE"),
|
|
@@ -65,17 +65,17 @@ const v = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H
|
|
|
65
65
|
o.mutate(s);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
|
|
68
|
+
return /* @__PURE__ */ a(D, { breadcrumbLabel: t("BREADCRUMB_CSV_EXPORT"), children: /* @__PURE__ */ d(
|
|
69
|
+
V,
|
|
70
70
|
{
|
|
71
71
|
id: "admin-csv-export-page",
|
|
72
72
|
"data-testid": "admin-csv-export-page-test-id",
|
|
73
73
|
"aria-label": "CSV Export Page",
|
|
74
|
-
className:
|
|
74
|
+
className: i.tile,
|
|
75
75
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */ d("form", { className:
|
|
78
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ a("h2", { className: i.title, children: t("ADMIN_CSV_EXPORT_TITLE") }),
|
|
77
|
+
/* @__PURE__ */ d("form", { className: i.form, onSubmit: N, noValidate: !0, children: [
|
|
78
|
+
/* @__PURE__ */ a("div", { className: i.search, children: /* @__PURE__ */ a(
|
|
79
79
|
f,
|
|
80
80
|
{
|
|
81
81
|
id: "csv-export-concept-search",
|
|
@@ -95,7 +95,7 @@ const v = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H
|
|
|
95
95
|
size: "md"
|
|
96
96
|
}
|
|
97
97
|
) }),
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ a(
|
|
99
99
|
x,
|
|
100
100
|
{
|
|
101
101
|
type: "submit",
|
|
@@ -103,8 +103,8 @@ const v = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H
|
|
|
103
103
|
size: "md",
|
|
104
104
|
testId: "csv-export-button-test-id",
|
|
105
105
|
disabled: o.isPending,
|
|
106
|
-
children: o.isPending ? /* @__PURE__ */
|
|
107
|
-
|
|
106
|
+
children: o.isPending ? /* @__PURE__ */ a(
|
|
107
|
+
y,
|
|
108
108
|
{
|
|
109
109
|
description: t("ADMIN_CSV_EXPORT_IN_PROGRESS"),
|
|
110
110
|
testId: "csv-export-loading-test-id"
|
|
@@ -118,5 +118,5 @@ const v = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H
|
|
|
118
118
|
) });
|
|
119
119
|
};
|
|
120
120
|
export {
|
|
121
|
-
|
|
121
|
+
Q as CsvExport
|
|
122
122
|
};
|