@bahmni/reports-app 0.0.1-dev.451 → 0.0.1-dev.453
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/DocumentsTable-DH1dnlXy-DfUj0szk.js +439 -0
- package/dist/{FormsTable-BkZ7CAhs-Cqrhpz7P.js → FormsTable-B8Zxjboo-DU4lTF-2.js} +83 -83
- package/dist/LNWAZHJI-CcAxytrw.js +33 -0
- package/dist/{MWZ6AO7Z-CXdOVb3B.js → MWZ6AO7Z-Dz-loqcC.js} +8 -8
- package/dist/{Observations-ByaPCQhx-DZASdS9R.js → Observations-BzjjSeWg-CH7fXiIg.js} +41 -41
- package/dist/{ReportsPage-DffRgxLr.js → ReportsPage-BsyTJvby.js} +59 -59
- package/dist/{YPM2AS64-CunR0NXB.js → YPM2AS64-BUHpI74M.js} +1 -1
- package/dist/{index-DNqWa5i8.js → index-B_1boRXC.js} +52121 -60675
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/DocumentsTable-cTYcbFbC-56WADgwd.js +0 -227
- package/dist/LNWAZHJI-DsdgvTTK.js +0 -33
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import Le, { useCallback as K, useState as
|
|
2
|
+
import { G as z, L as se, O as oe, P as ie, V as le, _ as de, a0 as Re, a1 as ce, a2 as Y, u as b, z as X, a3 as y, a4 as F, a5 as M, a6 as _e, a7 as Te, a8 as pe, a9 as x, Z as ue, aa as me, ab as Ee, ac as q, ad as Se, ae as U, af as fe, ag as Oe, ah as Pe, ai as ge, aj as $, ak as he, al as j, am as Ae, an as De } from "./index-B_1boRXC.js";
|
|
3
|
+
import Le, { useCallback as K, useState as h, useEffect as V, useMemo as N } from "react";
|
|
4
4
|
import { useQuery as J } from "@tanstack/react-query";
|
|
5
|
-
import { useLocation as
|
|
6
|
-
const
|
|
7
|
-
$schema:
|
|
8
|
-
title:
|
|
5
|
+
import { useLocation as Ce, useNavigate as be } from "react-router-dom";
|
|
6
|
+
const Ne = "http://json-schema.org/draft-07/schema#", ye = "Reports App Configuration", Fe = "object", ve = { config: { type: "object", properties: { supportedFormats: { type: "array", items: { type: "string" }, description: "List of supported report formats" }, paperSize: { type: "string", description: "Default paper size for generated reports (e.g., A4)" } }, additionalProperties: !0 } }, Ie = !0, Be = {
|
|
7
|
+
$schema: Ne,
|
|
8
|
+
title: ye,
|
|
9
9
|
type: Fe,
|
|
10
10
|
properties: ve,
|
|
11
11
|
additionalProperties: Ie
|
|
@@ -31,7 +31,7 @@ const ye = "http://json-schema.org/draft-07/schema#", Ne = "Reports App Configur
|
|
|
31
31
|
queryKey: Q.reportsAppConfig,
|
|
32
32
|
queryFn: async () => {
|
|
33
33
|
try {
|
|
34
|
-
return await
|
|
34
|
+
return await z(
|
|
35
35
|
se,
|
|
36
36
|
Be
|
|
37
37
|
);
|
|
@@ -46,7 +46,7 @@ const ye = "http://json-schema.org/draft-07/schema#", Ne = "Reports App Configur
|
|
|
46
46
|
additionalProperties: $e
|
|
47
47
|
}, ke = () => J({
|
|
48
48
|
queryKey: Q.reportsConfig,
|
|
49
|
-
queryFn: () =>
|
|
49
|
+
queryFn: () => z(oe, je),
|
|
50
50
|
retry: !1
|
|
51
51
|
}), k = Symbol.for("constructDateFrom");
|
|
52
52
|
function Z(e, t) {
|
|
@@ -59,27 +59,27 @@ function Ge(e, t, s) {
|
|
|
59
59
|
const d = ee(e);
|
|
60
60
|
return isNaN(t) ? Z(e, NaN) : (d.setDate(d.getDate() + t), d);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function We(e, t) {
|
|
63
63
|
const s = ee(e);
|
|
64
64
|
return s.setDate(1), s.setHours(0, 0, 0, 0), s;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ze(e, t, s) {
|
|
67
67
|
return Ge(e, -6);
|
|
68
68
|
}
|
|
69
69
|
const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
70
70
|
(s) => Xe(t, s.requiredPrivilege)
|
|
71
|
-
),
|
|
72
|
-
dateRangeReports: e.filter(
|
|
73
|
-
noDateRangeReports: e.filter((t) => !
|
|
71
|
+
), C = (e) => e.config?.dateRangeRequired !== !1, Ve = (e) => ({
|
|
72
|
+
dateRangeReports: e.filter(C),
|
|
73
|
+
noDateRangeReports: e.filter((t) => !C(t))
|
|
74
74
|
}), Je = (e) => !e || e.length === 0 ? ie : e.map(
|
|
75
75
|
(s) => s.toUpperCase()
|
|
76
76
|
).filter((s) => s in le), Qe = (e) => {
|
|
77
77
|
const t = /* @__PURE__ */ new Date();
|
|
78
78
|
switch (e) {
|
|
79
79
|
case "THIS_MONTH":
|
|
80
|
-
return [ze(t), t];
|
|
81
|
-
case "LAST_7_DAYS":
|
|
82
80
|
return [We(t), t];
|
|
81
|
+
case "LAST_7_DAYS":
|
|
82
|
+
return [ze(t), t];
|
|
83
83
|
default:
|
|
84
84
|
return [new Date(t), new Date(t)];
|
|
85
85
|
}
|
|
@@ -129,7 +129,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
129
129
|
},
|
|
130
130
|
[]
|
|
131
131
|
) }), at = (e, t, s) => {
|
|
132
|
-
const { t: d } =
|
|
132
|
+
const { t: d } = b(), { addNotification: n } = X(), { runReport: _ } = tt(), [R, u] = h({}), [f, p] = h({}), [P, i] = h(null);
|
|
133
133
|
V(() => {
|
|
134
134
|
u({}), p({});
|
|
135
135
|
}, [t.version]);
|
|
@@ -141,7 +141,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
141
141
|
return {
|
|
142
142
|
rowFilters: r,
|
|
143
143
|
errors: (o) => f[o],
|
|
144
|
-
isRunning: (o) =>
|
|
144
|
+
isRunning: (o) => P === o,
|
|
145
145
|
updateRow: (o, l) => u((c) => ({
|
|
146
146
|
...c,
|
|
147
147
|
[o]: { ...r(o), ...l }
|
|
@@ -155,12 +155,12 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
155
155
|
const l = r(o.id), c = Ze(
|
|
156
156
|
{
|
|
157
157
|
report: o,
|
|
158
|
-
requiresDateRange:
|
|
158
|
+
requiresDateRange: C(o),
|
|
159
159
|
format: l.format,
|
|
160
160
|
startDate: l.startDate,
|
|
161
161
|
endDate: l.endDate
|
|
162
162
|
},
|
|
163
|
-
(T,
|
|
163
|
+
(T, g) => d(T, { defaultValue: T, ...g })
|
|
164
164
|
);
|
|
165
165
|
if (c) {
|
|
166
166
|
if (n({
|
|
@@ -174,8 +174,8 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
174
174
|
}));
|
|
175
175
|
else if (c.field === "startDate" || c.field === "endDate") {
|
|
176
176
|
const T = !l.startDate && !l.endDate;
|
|
177
|
-
p((
|
|
178
|
-
...
|
|
177
|
+
p((g) => ({
|
|
178
|
+
...g,
|
|
179
179
|
[o.id]: {
|
|
180
180
|
startDate: c.field === "startDate" || T ? c.message : void 0,
|
|
181
181
|
endDate: c.field === "endDate" || T ? c.message : void 0
|
|
@@ -186,8 +186,8 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
186
186
|
}
|
|
187
187
|
if (p((T) => {
|
|
188
188
|
if (!(o.id in T)) return T;
|
|
189
|
-
const
|
|
190
|
-
return delete
|
|
189
|
+
const g = { ...T };
|
|
190
|
+
return delete g[o.id], g;
|
|
191
191
|
}), i(o.id), !_(
|
|
192
192
|
o,
|
|
193
193
|
l.format,
|
|
@@ -218,17 +218,17 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
218
218
|
emptyState: Rt
|
|
219
219
|
}, w = Le.memo(
|
|
220
220
|
({ reports: e, appliedFilters: t, availableFormats: s, defaultPaperSize: d }) => {
|
|
221
|
-
const { t: n } =
|
|
221
|
+
const { t: n } = b(), {
|
|
222
222
|
rowFilters: _,
|
|
223
223
|
errors: R,
|
|
224
224
|
isRunning: u,
|
|
225
225
|
updateRow: f,
|
|
226
226
|
clearRowFieldError: p,
|
|
227
|
-
handleRunReport:
|
|
227
|
+
handleRunReport: P
|
|
228
228
|
} = at(e, t, d);
|
|
229
229
|
if (e.length === 0)
|
|
230
230
|
return /* @__PURE__ */ a("div", { className: E.emptyState, "data-testid": "reports-table-empty", children: n("REPORTS_NO_REPORTS_IN_SECTION") });
|
|
231
|
-
const i = e.some(
|
|
231
|
+
const i = e.some(C);
|
|
232
232
|
return /* @__PURE__ */ a("div", { className: E.tableContainer, children: /* @__PURE__ */ m("table", { className: E.table, "data-testid": "reports-table", children: [
|
|
233
233
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
234
234
|
/* @__PURE__ */ a(
|
|
@@ -246,7 +246,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
246
246
|
/* @__PURE__ */ a("th", { className: E.actionsColumn, children: n("REPORTS_ACTIONS_HEADER") })
|
|
247
247
|
] }) }),
|
|
248
248
|
/* @__PURE__ */ a("tbody", { children: e.map((r) => {
|
|
249
|
-
const O = _(r.id), S = R(r.id),
|
|
249
|
+
const O = _(r.id), S = R(r.id), A = C(r), o = u(r.id);
|
|
250
250
|
return /* @__PURE__ */ m("tr", { children: [
|
|
251
251
|
/* @__PURE__ */ a(
|
|
252
252
|
"td",
|
|
@@ -256,8 +256,8 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
256
256
|
}
|
|
257
257
|
),
|
|
258
258
|
i && /* @__PURE__ */ m(H, { children: [
|
|
259
|
-
/* @__PURE__ */ a("td", { children:
|
|
260
|
-
|
|
259
|
+
/* @__PURE__ */ a("td", { children: A && /* @__PURE__ */ a(
|
|
260
|
+
y,
|
|
261
261
|
{
|
|
262
262
|
datePickerType: "single",
|
|
263
263
|
dateFormat: "d/m/Y",
|
|
@@ -280,8 +280,8 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
280
280
|
)
|
|
281
281
|
}
|
|
282
282
|
) }),
|
|
283
|
-
/* @__PURE__ */ a("td", { children:
|
|
284
|
-
|
|
283
|
+
/* @__PURE__ */ a("td", { children: A && /* @__PURE__ */ a(
|
|
284
|
+
y,
|
|
285
285
|
{
|
|
286
286
|
datePickerType: "single",
|
|
287
287
|
dateFormat: "d/m/Y",
|
|
@@ -337,7 +337,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
337
337
|
pe,
|
|
338
338
|
{
|
|
339
339
|
itemText: n("REPORTS_RUN_BUTTON_LABEL"),
|
|
340
|
-
onClick: () =>
|
|
340
|
+
onClick: () => P(r)
|
|
341
341
|
}
|
|
342
342
|
)
|
|
343
343
|
}
|
|
@@ -369,9 +369,9 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
369
369
|
onFormatChange: u,
|
|
370
370
|
onPresetChange: f,
|
|
371
371
|
onReset: p,
|
|
372
|
-
onApply:
|
|
372
|
+
onApply: P
|
|
373
373
|
}) => {
|
|
374
|
-
const { t: i } =
|
|
374
|
+
const { t: i } = b();
|
|
375
375
|
return /* @__PURE__ */ m("section", { className: L.filtersContainer, "data-testid": "reports-filters", children: [
|
|
376
376
|
/* @__PURE__ */ a("h2", { className: L.filtersTitle, children: i("REPORTS_FILTERS_LABEL") }),
|
|
377
377
|
/* @__PURE__ */ m("div", { className: L.filtersRow, children: [
|
|
@@ -392,7 +392,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
392
392
|
}
|
|
393
393
|
),
|
|
394
394
|
/* @__PURE__ */ a(
|
|
395
|
-
|
|
395
|
+
y,
|
|
396
396
|
{
|
|
397
397
|
datePickerType: "single",
|
|
398
398
|
dateFormat: "d/m/Y",
|
|
@@ -409,7 +409,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
409
409
|
}
|
|
410
410
|
),
|
|
411
411
|
/* @__PURE__ */ a(
|
|
412
|
-
|
|
412
|
+
y,
|
|
413
413
|
{
|
|
414
414
|
datePickerType: "single",
|
|
415
415
|
dateFormat: "d/m/Y",
|
|
@@ -442,7 +442,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
442
442
|
] }),
|
|
443
443
|
/* @__PURE__ */ m("div", { className: L.buttonsRow, children: [
|
|
444
444
|
/* @__PURE__ */ a(x, { kind: "tertiary", onClick: p, children: i("REPORTS_RESET_BUTTON") }),
|
|
445
|
-
/* @__PURE__ */ a(x, { kind: "primary", onClick:
|
|
445
|
+
/* @__PURE__ */ a(x, { kind: "primary", onClick: P, children: i("REPORTS_APPLY_BUTTON") })
|
|
446
446
|
] })
|
|
447
447
|
] });
|
|
448
448
|
}, G = {
|
|
@@ -451,7 +451,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
451
451
|
format: null,
|
|
452
452
|
version: 0
|
|
453
453
|
}, Ot = () => {
|
|
454
|
-
const { t: e } =
|
|
454
|
+
const { t: e } = b(), { userPrivileges: t, isLoading: s } = ue(), { addNotification: d } = X(), {
|
|
455
455
|
data: n,
|
|
456
456
|
isLoading: _,
|
|
457
457
|
error: R
|
|
@@ -463,24 +463,24 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
463
463
|
type: "error"
|
|
464
464
|
});
|
|
465
465
|
}, [R, d, e]);
|
|
466
|
-
const [f, p] =
|
|
466
|
+
const [f, p] = h(null), [P, i] = h(null), [r, O] = h(null), [S, A] = h(null), [o, l] = h(G), c = N(() => n ? Ke(
|
|
467
467
|
et(n),
|
|
468
468
|
t
|
|
469
|
-
) : [], [n, t]), D =
|
|
469
|
+
) : [], [n, t]), D = N(
|
|
470
470
|
() => Je(u?.config?.supportedFormats),
|
|
471
471
|
[u]
|
|
472
|
-
), T = u?.config?.paperSize, { dateRangeReports:
|
|
472
|
+
), T = u?.config?.paperSize, { dateRangeReports: g, noDateRangeReports: ae } = N(
|
|
473
473
|
() => Ve(c),
|
|
474
474
|
[c]
|
|
475
475
|
), re = () => {
|
|
476
476
|
l((v) => ({
|
|
477
477
|
startDate: f,
|
|
478
|
-
endDate:
|
|
478
|
+
endDate: P,
|
|
479
479
|
format: r,
|
|
480
480
|
version: v.version + 1
|
|
481
481
|
}));
|
|
482
482
|
}, ne = () => {
|
|
483
|
-
p(null), i(null), O(null),
|
|
483
|
+
p(null), i(null), O(null), A(null), l((v) => ({ ...G, version: v.version + 1 }));
|
|
484
484
|
};
|
|
485
485
|
return _ || s ? /* @__PURE__ */ a(
|
|
486
486
|
me,
|
|
@@ -509,14 +509,14 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
509
509
|
ft,
|
|
510
510
|
{
|
|
511
511
|
startDate: f,
|
|
512
|
-
endDate:
|
|
512
|
+
endDate: P,
|
|
513
513
|
format: r,
|
|
514
514
|
selectedPreset: S,
|
|
515
515
|
availableFormats: D,
|
|
516
516
|
onStartDateChange: p,
|
|
517
517
|
onEndDateChange: i,
|
|
518
518
|
onFormatChange: O,
|
|
519
|
-
onPresetChange:
|
|
519
|
+
onPresetChange: A,
|
|
520
520
|
onReset: ne,
|
|
521
521
|
onApply: re
|
|
522
522
|
}
|
|
@@ -531,7 +531,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
531
531
|
children: /* @__PURE__ */ a(
|
|
532
532
|
w,
|
|
533
533
|
{
|
|
534
|
-
reports:
|
|
534
|
+
reports: g,
|
|
535
535
|
appliedFilters: o,
|
|
536
536
|
availableFormats: D,
|
|
537
537
|
defaultPaperSize: T
|
|
@@ -560,20 +560,20 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
560
560
|
]
|
|
561
561
|
}
|
|
562
562
|
);
|
|
563
|
-
},
|
|
564
|
-
page:
|
|
565
|
-
panel:
|
|
566
|
-
},
|
|
567
|
-
const { t: e } =
|
|
563
|
+
}, Pt = "ReportsPage-module_page__ewRXe", gt = "ReportsPage-module_panel__HFBCt", B = {
|
|
564
|
+
page: Pt,
|
|
565
|
+
panel: gt
|
|
566
|
+
}, W = 1, ht = 0, Nt = () => {
|
|
567
|
+
const { t: e } = b(), t = Ce(), s = be(), d = N(
|
|
568
568
|
() => [
|
|
569
569
|
{ id: "home", label: e("REPORTS_HOME_LABEL"), href: Se },
|
|
570
570
|
{ id: "reports", label: e("REPORTS_LABEL"), isCurrentPage: !0 }
|
|
571
571
|
],
|
|
572
572
|
[e]
|
|
573
|
-
), n = t.pathname === U ?
|
|
573
|
+
), n = t.pathname === U ? W : ht, _ = K(
|
|
574
574
|
({ selectedIndex: R }) => {
|
|
575
575
|
s(
|
|
576
|
-
R ===
|
|
576
|
+
R === W ? U : fe
|
|
577
577
|
);
|
|
578
578
|
},
|
|
579
579
|
[s]
|
|
@@ -588,7 +588,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
588
588
|
"data-testid": "reports-page-header-test-id",
|
|
589
589
|
"aria-label": "Reports Page Header",
|
|
590
590
|
children: /* @__PURE__ */ a(
|
|
591
|
-
|
|
591
|
+
Ae,
|
|
592
592
|
{
|
|
593
593
|
breadcrumbItems: d,
|
|
594
594
|
userMenu: /* @__PURE__ */ a(De, {})
|
|
@@ -603,9 +603,9 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
603
603
|
"data-testid": "reports-page-test-id",
|
|
604
604
|
"aria-label": "Reports Page",
|
|
605
605
|
className: B.page,
|
|
606
|
-
children: /* @__PURE__ */ m(
|
|
606
|
+
children: /* @__PURE__ */ m(Pe, { selectedIndex: n, onChange: _, children: [
|
|
607
607
|
/* @__PURE__ */ m(
|
|
608
|
-
|
|
608
|
+
ge,
|
|
609
609
|
{
|
|
610
610
|
id: "reports-tab-list",
|
|
611
611
|
"data-testid": "reports-tab-list-test-id",
|
|
@@ -632,7 +632,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
632
632
|
]
|
|
633
633
|
}
|
|
634
634
|
),
|
|
635
|
-
/* @__PURE__ */ m(
|
|
635
|
+
/* @__PURE__ */ m(he, { children: [
|
|
636
636
|
/* @__PURE__ */ a(
|
|
637
637
|
j,
|
|
638
638
|
{
|
|
@@ -661,6 +661,6 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
661
661
|
);
|
|
662
662
|
};
|
|
663
663
|
export {
|
|
664
|
-
|
|
665
|
-
|
|
664
|
+
Nt as ReportsPage,
|
|
665
|
+
Nt as default
|
|
666
666
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ar as we, as as z, at as xt, au as B, ap as q, aq as y, av as Ro, aw as ye, ax as R, ay as _, az as k, aA as N, aB as A, aC as bs, aD as ir, aE as $e, aF as U, aG as Hn, aH as Vn, aI as dt, aJ as D, aK as xs, aL as cn, aM as Be, aN as ws, aO as qt, aP as zt, aQ as $s, aR as Cs, aS as $n, aT as Ss, aU as Nr, aV as Bt, aW as zo, aX as ks, aY as Es, aZ as j, a_ as Ur, a$ as Ms, b0 as Ds, b1 as sr, b2 as As, b3 as Ts, b4 as zn, b5 as Fs, b6 as Is, b7 as Z, b8 as Ps, b9 as Ls } from "./index-B_1boRXC.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|