@bahmni/reports-app 0.0.1-dev.445 → 0.0.1-dev.446
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-BX6swgtN-7pSc1cvy.js → DocumentsTable-CSCabXWL-CUuwTLrS.js} +9 -9
- package/dist/{FormsTable-9ylMl24e-DTByxRFe.js → FormsTable-CxEQWZt3-DKUMPJhi.js} +78 -78
- package/dist/{LNWAZHJI-B9CcOCsD.js → LNWAZHJI-iqeoU8eU.js} +2 -2
- package/dist/{MWZ6AO7Z-CITF51qp.js → MWZ6AO7Z-ksiOXeos.js} +2 -2
- package/dist/Observations-CAedz2J9-CFDvAn9A.js +246 -0
- package/dist/{ReportsPage-B9qbmidX.js → ReportsPage-Dl4FxMg3.js} +29 -29
- package/dist/{YPM2AS64-C3mxeOxI.js → YPM2AS64-C3c3Qqql.js} +1 -1
- package/dist/{index-BJ2mligI.js → index-D5pNB7D2.js} +43361 -43955
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/Observations-Dci35cGN-DdsFHKDz.js +0 -246
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as a, jsxs as m, Fragment as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as a, jsxs as m, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { H as W, I as se, J as oe, L as ie, M as le, N as de, O as Re, P as ce, Q as Y, u as C, z as X, S as N, T as F, X as M, Z as _e, _ as Te, a0 as pe, a1 as x, k as ue, a2 as me, a3 as Ee, a4 as q, a5 as Se, a6 as U, a7 as fe, a8 as Oe, a9 as ge, aa as Pe, ab as $, ac as Ae, ad as j, ae as he, af as De } from "./index-D5pNB7D2.js";
|
|
3
3
|
import Le, { useCallback as K, useState as A, useEffect as V, useMemo as y } from "react";
|
|
4
4
|
import { useQuery as J } from "@tanstack/react-query";
|
|
5
|
-
import { useLocation as
|
|
5
|
+
import { useLocation as be, useNavigate as Ce } from "react-router-dom";
|
|
6
6
|
const ye = "http://json-schema.org/draft-07/schema#", Ne = "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
7
|
$schema: ye,
|
|
8
8
|
title: Ne,
|
|
@@ -20,14 +20,14 @@ const ye = "http://json-schema.org/draft-07/schema#", Ne = "Reports App Configur
|
|
|
20
20
|
"TODAY",
|
|
21
21
|
"THIS_MONTH",
|
|
22
22
|
"LAST_7_DAYS"
|
|
23
|
-
],
|
|
23
|
+
], He = {
|
|
24
24
|
TODAY: "REPORTS_PRESET_TODAY",
|
|
25
25
|
THIS_MONTH: "REPORTS_PRESET_THIS_MONTH",
|
|
26
26
|
LAST_7_DAYS: "REPORTS_PRESET_LAST_7_DAYS"
|
|
27
27
|
}, Q = {
|
|
28
28
|
reportsConfig: ["reportsConfig"],
|
|
29
29
|
reportsAppConfig: ["reportsAppConfig"]
|
|
30
|
-
},
|
|
30
|
+
}, Ye = () => J({
|
|
31
31
|
queryKey: Q.reportsAppConfig,
|
|
32
32
|
queryFn: async () => {
|
|
33
33
|
try {
|
|
@@ -39,10 +39,10 @@ const ye = "http://json-schema.org/draft-07/schema#", Ne = "Reports App Configur
|
|
|
39
39
|
return {};
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
}), xe = "http://json-schema.org/draft-07/schema#",
|
|
42
|
+
}), xe = "http://json-schema.org/draft-07/schema#", qe = "Reports Configuration", Ue = "object", $e = { type: "object", required: ["name", "type"], properties: { name: { type: "string", description: "Display name of the report" }, type: { type: "string", description: "Report generator type" }, requiredPrivilege: { type: "string", description: "Privilege required to view/run this report" }, config: { type: "object", properties: { dateRangeRequired: { type: "boolean", description: "Whether this report requires a date range (defaults to true)" }, paperSize: { type: "string", description: "Paper size for PDF generation (e.g., A4)" }, macroTemplatePath: { type: "string", description: "Path to macro template for custom Excel reports" } }, additionalProperties: !0 } } }, je = {
|
|
43
43
|
$schema: xe,
|
|
44
|
-
title:
|
|
45
|
-
type:
|
|
44
|
+
title: qe,
|
|
45
|
+
type: Ue,
|
|
46
46
|
additionalProperties: $e
|
|
47
47
|
}, ke = () => J({
|
|
48
48
|
queryKey: Q.reportsConfig,
|
|
@@ -68,9 +68,9 @@ function We(e, t, s) {
|
|
|
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
|
+
), b = (e) => e.config?.dateRangeRequired !== !1, Ve = (e) => ({
|
|
72
|
+
dateRangeReports: e.filter(b),
|
|
73
|
+
noDateRangeReports: e.filter((t) => !b(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) => {
|
|
@@ -119,9 +119,9 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
119
119
|
t.config?.paperSize ?? _
|
|
120
120
|
), u = window.open(R, "_blank");
|
|
121
121
|
return u ? (u.opener = null, ce({
|
|
122
|
-
eventType:
|
|
122
|
+
eventType: Y.RUN_REPORT.eventType,
|
|
123
123
|
messageParams: { reportName: t.name },
|
|
124
|
-
module:
|
|
124
|
+
module: Y.RUN_REPORT.module
|
|
125
125
|
}), !0) : !1;
|
|
126
126
|
} catch (R) {
|
|
127
127
|
return console.error("Error running report:", R), !1;
|
|
@@ -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 } = C(), { addNotification: n } = X(), { runReport: _ } = tt(), [R, u] = A({}), [f, p] = A({}), [g, i] = A(null);
|
|
133
133
|
V(() => {
|
|
134
134
|
u({}), p({});
|
|
135
135
|
}, [t.version]);
|
|
@@ -155,7 +155,7 @@ 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: b(o),
|
|
159
159
|
format: l.format,
|
|
160
160
|
startDate: l.startDate,
|
|
161
161
|
endDate: l.endDate
|
|
@@ -218,7 +218,7 @@ 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 } = C(), {
|
|
222
222
|
rowFilters: _,
|
|
223
223
|
errors: R,
|
|
224
224
|
isRunning: u,
|
|
@@ -228,7 +228,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
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(b);
|
|
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(
|
|
@@ -238,7 +238,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
238
238
|
children: n("REPORTS_NAME_HEADER")
|
|
239
239
|
}
|
|
240
240
|
),
|
|
241
|
-
i && /* @__PURE__ */ m(
|
|
241
|
+
i && /* @__PURE__ */ m(H, { children: [
|
|
242
242
|
/* @__PURE__ */ a("th", { className: E.dateColumn, children: n("REPORTS_START_DATE_LABEL") }),
|
|
243
243
|
/* @__PURE__ */ a("th", { className: E.dateColumn, children: n("REPORTS_END_DATE_LABEL") })
|
|
244
244
|
] }),
|
|
@@ -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), h =
|
|
249
|
+
const O = _(r.id), S = R(r.id), h = b(r), o = u(r.id);
|
|
250
250
|
return /* @__PURE__ */ m("tr", { children: [
|
|
251
251
|
/* @__PURE__ */ a(
|
|
252
252
|
"td",
|
|
@@ -255,7 +255,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
255
255
|
children: r.name
|
|
256
256
|
}
|
|
257
257
|
),
|
|
258
|
-
i && /* @__PURE__ */ m(
|
|
258
|
+
i && /* @__PURE__ */ m(H, { children: [
|
|
259
259
|
/* @__PURE__ */ a("td", { children: h && /* @__PURE__ */ a(
|
|
260
260
|
N,
|
|
261
261
|
{
|
|
@@ -371,7 +371,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
371
371
|
onReset: p,
|
|
372
372
|
onApply: g
|
|
373
373
|
}) => {
|
|
374
|
-
const { t: i } =
|
|
374
|
+
const { t: i } = C();
|
|
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: [
|
|
@@ -382,7 +382,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
382
382
|
titleText: i("REPORTS_SELECT_DATE_RANGE"),
|
|
383
383
|
label: "",
|
|
384
384
|
items: we,
|
|
385
|
-
itemToString: (r) => r ? i(
|
|
385
|
+
itemToString: (r) => r ? i(He[r]) : "",
|
|
386
386
|
selectedItem: d,
|
|
387
387
|
onChange: ({ selectedItem: r }) => {
|
|
388
388
|
if (f(r ?? null), !r) return;
|
|
@@ -451,11 +451,11 @@ 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 } = C(), { userPrivileges: t, isLoading: s } = ue(), { addNotification: d } = X(), {
|
|
455
455
|
data: n,
|
|
456
456
|
isLoading: _,
|
|
457
457
|
error: R
|
|
458
|
-
} = ke(), { data: u } =
|
|
458
|
+
} = ke(), { data: u } = Ye();
|
|
459
459
|
V(() => {
|
|
460
460
|
R && d({
|
|
461
461
|
title: e("REPORTS_ERROR_TITLE"),
|
|
@@ -523,7 +523,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
523
523
|
),
|
|
524
524
|
/* @__PURE__ */ m(Ee, { align: "start", children: [
|
|
525
525
|
/* @__PURE__ */ a(
|
|
526
|
-
|
|
526
|
+
q,
|
|
527
527
|
{
|
|
528
528
|
title: e("REPORTS_DATE_RANGE_SECTION_TITLE"),
|
|
529
529
|
testId: "reports-date-range-section",
|
|
@@ -540,7 +540,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
540
540
|
}
|
|
541
541
|
),
|
|
542
542
|
/* @__PURE__ */ a(
|
|
543
|
-
|
|
543
|
+
q,
|
|
544
544
|
{
|
|
545
545
|
title: e("REPORTS_NO_DATE_RANGE_SECTION_TITLE"),
|
|
546
546
|
testId: "reports-no-date-range-section",
|
|
@@ -564,16 +564,16 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
564
564
|
page: gt,
|
|
565
565
|
panel: Pt
|
|
566
566
|
}, z = 1, At = 0, yt = () => {
|
|
567
|
-
const { t: e } =
|
|
567
|
+
const { t: e } = C(), t = be(), s = Ce(), d = y(
|
|
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 ===
|
|
573
|
+
), n = t.pathname === U ? z : At, _ = K(
|
|
574
574
|
({ selectedIndex: R }) => {
|
|
575
575
|
s(
|
|
576
|
-
R === z ?
|
|
576
|
+
R === z ? U : fe
|
|
577
577
|
);
|
|
578
578
|
},
|
|
579
579
|
[s]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aj as we, ak as z, al as xt, am as B, ah as q, ai as y, an as Ro, ao as ye, ap as R, aq as _, ar as k, as as N, at as A, au as bs, av as ir, aw as $e, ax as U, ay as Hn, az as Vn, aA as dt, aB as D, aC as xs, aD as cn, aE as Be, aF as ws, aG as qt, aH as zt, aI as $s, aJ as Cs, aK as $n, aL as Ss, aM as Nr, aN as Bt, aO as zo, aP as ks, aQ as Es, aR as j, aS as Ur, aT as Ms, aU as Ds, aV as sr, aW as As, aX as Ts, aY as zn, aZ as Fs, a_ as Is, a$ as Z, b0 as Ps, b1 as Ls } from "./index-
|
|
1
|
+
import { aj as we, ak as z, al as xt, am as B, ah as q, ai as y, an as Ro, ao as ye, ap as R, aq as _, ar as k, as as N, at as A, au as bs, av as ir, aw as $e, ax as U, ay as Hn, az as Vn, aA as dt, aB as D, aC as xs, aD as cn, aE as Be, aF as ws, aG as qt, aH as zt, aI as $s, aJ as Cs, aK as $n, aL as Ss, aM as Nr, aN as Bt, aO as zo, aP as ks, aQ as Es, aR as j, aS as Ur, aT as Ms, aU as Ds, aV as sr, aW as As, aX as Ts, aY as zn, aZ as Fs, a_ as Is, a$ as Z, b0 as Ps, b1 as Ls } from "./index-D5pNB7D2.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|