@bahmni/reports-app 0.0.1-dev.442 → 0.0.1-dev.443
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-v84RmXjK-CJUOaFDd.js → DocumentsTable-v6NhgJsj-C-WsRGMP.js} +6 -6
- package/dist/{FormsTable-nHUlMFve-Dul2m6vz.js → FormsTable-DiD-aWUg-B1FzloQ2.js} +32 -32
- package/dist/{LNWAZHJI-CVXqGBIt.js → LNWAZHJI-Cv5T9E1z.js} +2 -2
- package/dist/{MWZ6AO7Z-DN9gLVXO.js → MWZ6AO7Z-ChvL400g.js} +2 -2
- package/dist/{Observations-j0hpIS7w-BH3CQLuS.js → Observations-B2kwkXq0-3nADqmVs.js} +8 -8
- package/dist/{ReportsPage-hCNWLn72.js → ReportsPage-DtV5TlZJ.js} +57 -57
- package/dist/{YPM2AS64-BDsBU6j-.js → YPM2AS64-KQOcFjxF.js} +1 -1
- package/dist/{index-g9wj_kf9.js → index-Co6rXYJ2.js} +13964 -13951
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as d, jsxs as h, Fragment as
|
|
2
|
-
import { d as
|
|
1
|
+
import { jsx as d, jsxs as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { d as G, u as J, z as W, a as Y, J as X, h as Z, $ as ee, b as te } from "./index-Co6rXYJ2.js";
|
|
3
3
|
import { useQuery as ae } from "@tanstack/react-query";
|
|
4
4
|
import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
|
|
5
5
|
const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", de = "DocumentsTable-module_documentViewerContainer__F5m8D", re = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", r = {
|
|
@@ -38,7 +38,7 @@ const Te = [
|
|
|
38
38
|
null
|
|
39
39
|
), [$, O] = l(
|
|
40
40
|
/* @__PURE__ */ new Set()
|
|
41
|
-
), g =
|
|
41
|
+
), g = G(), { t: n } = J(), { addNotification: L } = W(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
|
|
42
42
|
U(e), w(!0);
|
|
43
43
|
}, []), H = _(() => {
|
|
44
44
|
w(!1), U(null), O(/* @__PURE__ */ new Set());
|
|
@@ -106,7 +106,7 @@ const Te = [
|
|
|
106
106
|
), T = p(
|
|
107
107
|
() => o ? B(o) : [],
|
|
108
108
|
[o]
|
|
109
|
-
),
|
|
109
|
+
), Q = _(
|
|
110
110
|
(e, t) => {
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "documentIdentifier":
|
|
@@ -137,7 +137,7 @@ const Te = [
|
|
|
137
137
|
},
|
|
138
138
|
[M, n]
|
|
139
139
|
);
|
|
140
|
-
return /* @__PURE__ */ h(
|
|
140
|
+
return /* @__PURE__ */ h(x, { children: [
|
|
141
141
|
/* @__PURE__ */ d("div", { "data-testid": "documents-table", children: /* @__PURE__ */ d(
|
|
142
142
|
ee,
|
|
143
143
|
{
|
|
@@ -148,7 +148,7 @@ const Te = [
|
|
|
148
148
|
errorStateMessage: y ? b?.message : null,
|
|
149
149
|
sortable: K,
|
|
150
150
|
emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
|
|
151
|
-
renderCell:
|
|
151
|
+
renderCell: Q,
|
|
152
152
|
className: r.documentsTableBody,
|
|
153
153
|
dataTestId: "documents-table",
|
|
154
154
|
pageSize: u,
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
-
import { u as ie, d as de, c as le, k as me, H as ue, o as ce, E as fe, Q as ye, w as Te, D as he, R as Ne, e as ge, h as pe, L as V, T as $, J as Oe, $ as K, W as be, q as
|
|
3
|
-
import { useQueryClient as
|
|
2
|
+
import { u as ie, d as de, c as le, k as me, H as ue, o as ce, E as fe, Q as ye, w as Te, D as he, R as Ne, e as ge, h as pe, L as V, T as $, J as Oe, $ as K, W as be, q as Ie, b as Ee, f as _e, g as Ae } from "./index-Co6rXYJ2.js";
|
|
3
|
+
import { useQueryClient as Re, useQuery as E } from "@tanstack/react-query";
|
|
4
4
|
import { useState as Q, useMemo as i, useCallback as d } from "react";
|
|
5
5
|
const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", ve = "FormsTable-module_customAccordianItem__isszs", N = {
|
|
6
6
|
formsTableBody: Le,
|
|
7
7
|
modalHeading: Ce,
|
|
8
8
|
customAccordianItem: ve
|
|
9
|
-
},
|
|
10
|
-
episodeOfCareUuids:
|
|
9
|
+
}, Be = "startConsultation", Me = ({
|
|
10
|
+
episodeOfCareUuids: _,
|
|
11
11
|
encounterUuids: l,
|
|
12
12
|
config: z,
|
|
13
13
|
disableActions: j = !1,
|
|
14
14
|
activeEncounterUuid: y = null
|
|
15
15
|
}) => {
|
|
16
|
-
const { t: o } = ie(), m = de(), [g,
|
|
16
|
+
const { t: o } = ie(), m = de(), [g, A] = Q(!1), [t, R] = Q(null), {
|
|
17
17
|
numberOfVisits: x,
|
|
18
18
|
hideThumbnail: G = !1,
|
|
19
19
|
forms: T
|
|
20
20
|
} = z ?? {}, J = le(
|
|
21
|
-
|
|
21
|
+
Ae.EDIT_OBSERVATIONS
|
|
22
22
|
), { userPrivileges: h } = me(), p = J && !j && !!y, L = ue(
|
|
23
|
-
|
|
23
|
+
_,
|
|
24
24
|
l
|
|
25
|
-
),
|
|
25
|
+
), P = Re(), {
|
|
26
26
|
data: C = [],
|
|
27
27
|
isLoading: v,
|
|
28
|
-
isError:
|
|
29
|
-
error:
|
|
28
|
+
isError: B,
|
|
29
|
+
error: W,
|
|
30
30
|
refetch: Y
|
|
31
|
-
} =
|
|
32
|
-
queryKey: ["forms", m,
|
|
31
|
+
} = E({
|
|
32
|
+
queryKey: ["forms", m, _],
|
|
33
33
|
queryFn: () => ce(m, void 0, x),
|
|
34
34
|
enabled: !!m && !L
|
|
35
|
-
}),
|
|
35
|
+
}), D = i(() => {
|
|
36
36
|
let e = C;
|
|
37
37
|
return l && l.length > 0 && (e = e.filter(
|
|
38
38
|
(r) => l.includes(r.encounterUuid)
|
|
39
39
|
)), Array.isArray(T) && T.length > 0 && (e = e.filter(
|
|
40
40
|
(r) => T.some((a) => a.toLowerCase() === r.formName.toLowerCase())
|
|
41
41
|
)), e;
|
|
42
|
-
}, [C, l, T]), { data:
|
|
42
|
+
}, [C, l, T]), { data: F = [] } = E({
|
|
43
43
|
queryKey: ["observationForms"],
|
|
44
44
|
queryFn: () => fe()
|
|
45
45
|
}), U = d(
|
|
46
46
|
(e) => {
|
|
47
|
-
const r =
|
|
47
|
+
const r = F.find(
|
|
48
48
|
(s) => s.name.toLowerCase() === e.toLowerCase()
|
|
49
49
|
);
|
|
50
50
|
if (!r?.privileges || r.privileges.length === 0) return !0;
|
|
@@ -54,7 +54,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
54
54
|
(s) => a.has(s.privilegeName) && s.editable
|
|
55
55
|
);
|
|
56
56
|
},
|
|
57
|
-
[
|
|
57
|
+
[F, h]
|
|
58
58
|
), u = d(
|
|
59
59
|
(e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
|
|
60
60
|
[y, U]
|
|
@@ -63,14 +63,14 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
63
63
|
isLoading: X,
|
|
64
64
|
isError: Z,
|
|
65
65
|
error: b
|
|
66
|
-
} =
|
|
66
|
+
} = E({
|
|
67
67
|
queryKey: ["formsEncounterFHIR", t?.encounterUuid],
|
|
68
68
|
queryFn: () => ye(t.encounterUuid),
|
|
69
69
|
enabled: !!t?.encounterUuid && g
|
|
70
70
|
});
|
|
71
71
|
Te(
|
|
72
72
|
(e) => {
|
|
73
|
-
e.patientUUID === m && (Y(),
|
|
73
|
+
e.patientUUID === m && (Y(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
|
|
74
74
|
},
|
|
75
75
|
[m]
|
|
76
76
|
);
|
|
@@ -96,7 +96,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
96
96
|
],
|
|
97
97
|
[]
|
|
98
98
|
), M = i(() => {
|
|
99
|
-
const e =
|
|
99
|
+
const e = D.reduce(
|
|
100
100
|
(r, a) => {
|
|
101
101
|
const s = a.formName;
|
|
102
102
|
r[s] ??= [];
|
|
@@ -120,13 +120,13 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
120
120
|
)
|
|
121
121
|
})
|
|
122
122
|
).sort((r, a) => r.formName.localeCompare(a.formName));
|
|
123
|
-
}, [
|
|
124
|
-
|
|
123
|
+
}, [D, o]), k = d((e) => {
|
|
124
|
+
R(e), A(!0);
|
|
125
125
|
}, []), w = d(() => {
|
|
126
|
-
|
|
127
|
-
}, []),
|
|
126
|
+
A(!1), R(null);
|
|
127
|
+
}, []), I = d((e) => {
|
|
128
128
|
globalThis.dispatchEvent(
|
|
129
|
-
new CustomEvent(
|
|
129
|
+
new CustomEvent(Be, {
|
|
130
130
|
detail: {
|
|
131
131
|
editOnly: "observationForms",
|
|
132
132
|
editTitle: "EDIT_OBSERVATION_FORM_TITLE",
|
|
@@ -151,7 +151,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
151
151
|
kind: "ghost",
|
|
152
152
|
size: "sm",
|
|
153
153
|
testId: `edit-form-${e.encounterUuid}`,
|
|
154
|
-
onClick: () =>
|
|
154
|
+
onClick: () => I(e),
|
|
155
155
|
children: /* @__PURE__ */ n($, {})
|
|
156
156
|
}
|
|
157
157
|
) : null;
|
|
@@ -159,17 +159,17 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
[k,
|
|
162
|
+
[k, I, u, o]
|
|
163
163
|
);
|
|
164
164
|
return /* @__PURE__ */ q(ne, { children: [
|
|
165
|
-
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: v ||
|
|
165
|
+
/* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: v || B || M.length === 0 || L ? /* @__PURE__ */ n(
|
|
166
166
|
K,
|
|
167
167
|
{
|
|
168
168
|
headers: oe,
|
|
169
169
|
ariaLabel: o("FORMS_HEADING"),
|
|
170
170
|
rows: [],
|
|
171
171
|
loading: v,
|
|
172
|
-
errorStateMessage:
|
|
172
|
+
errorStateMessage: B ? W?.message : void 0,
|
|
173
173
|
emptyStateMessage: o("FORMS_UNAVAILABLE"),
|
|
174
174
|
renderCell: H,
|
|
175
175
|
className: N.formsTableBody,
|
|
@@ -178,7 +178,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
178
178
|
) : /* @__PURE__ */ n(be, { align: "start", children: M.map((e, r) => {
|
|
179
179
|
const { formName: a, records: s } = e, f = ae(s);
|
|
180
180
|
return /* @__PURE__ */ n(
|
|
181
|
-
|
|
181
|
+
Ie,
|
|
182
182
|
{
|
|
183
183
|
title: a,
|
|
184
184
|
className: N.customAccordianItem,
|
|
@@ -204,7 +204,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
204
204
|
);
|
|
205
205
|
}) }) }),
|
|
206
206
|
g && t && /* @__PURE__ */ n(
|
|
207
|
-
|
|
207
|
+
Ee,
|
|
208
208
|
{
|
|
209
209
|
id: "modalIdForActionAreaLayout",
|
|
210
210
|
portalId: "main-display-area",
|
|
@@ -220,7 +220,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
220
220
|
size: "sm",
|
|
221
221
|
testId: `edit-form-modal-${t.encounterUuid}`,
|
|
222
222
|
onClick: () => {
|
|
223
|
-
w(),
|
|
223
|
+
w(), I(t);
|
|
224
224
|
},
|
|
225
225
|
children: /* @__PURE__ */ n($, {})
|
|
226
226
|
}
|
|
@@ -231,7 +231,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_mo
|
|
|
231
231
|
size: "md",
|
|
232
232
|
testId: "form-details-modal",
|
|
233
233
|
children: /* @__PURE__ */ n(
|
|
234
|
-
|
|
234
|
+
_e,
|
|
235
235
|
{
|
|
236
236
|
observations: ee,
|
|
237
237
|
isLoading: X,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-
|
|
2
|
-
import { ag as d, ah as f, ai as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-KQOcFjxF.js";
|
|
2
|
+
import { ag as d, ah as f, ai as e } from "./index-Co6rXYJ2.js";
|
|
3
3
|
var h = (a) => {
|
|
4
4
|
const [r, t] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-
|
|
2
|
-
import { ag as h, ah as v, ai as e } from "./index-
|
|
1
|
+
import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-KQOcFjxF.js";
|
|
2
|
+
import { ag as h, ah as v, ai as e } from "./index-Co6rXYJ2.js";
|
|
3
3
|
var C = (t) => {
|
|
4
4
|
const [r, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as S, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { d as H, z as x, u as V, t as M, H as j, n as G, r as J, w as X, p as P, i as Y, j as W, m as Z, l as ee, $ as ae, s as se, S as B, v as te, x as re, h as ie, y as oe, A as ne, B as de, X as le } from "./index-
|
|
2
|
+
import { d as H, z as x, u as V, t as M, H as j, n as G, r as J, w as X, p as P, i as Y, j as W, m as Z, l as ee, $ as ae, s as se, S as B, v as te, x as re, h as ie, y as oe, A as ne, B as de, X as le } from "./index-Co6rXYJ2.js";
|
|
3
3
|
import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as pe, useEffect as L, useMemo as g } from "react";
|
|
5
5
|
const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
|
|
@@ -7,7 +7,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
7
7
|
title: be,
|
|
8
8
|
wrapper: he,
|
|
9
9
|
secondary: ve
|
|
10
|
-
},
|
|
10
|
+
}, w = (s, l, o, d, c, t) => {
|
|
11
11
|
const r = te(s, l, c), e = r.value, p = re(e);
|
|
12
12
|
let i = e;
|
|
13
13
|
p === "Image" && (i = /* @__PURE__ */ n(
|
|
@@ -54,7 +54,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
54
54
|
id: `grouped-obs-${s.display}-${d}`,
|
|
55
55
|
open: o,
|
|
56
56
|
children: s.members?.map(
|
|
57
|
-
(e, p) =>
|
|
57
|
+
(e, p) => w(
|
|
58
58
|
e,
|
|
59
59
|
p,
|
|
60
60
|
c,
|
|
@@ -80,7 +80,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
80
80
|
open: r,
|
|
81
81
|
children: [
|
|
82
82
|
t.observations.map(
|
|
83
|
-
(i, m) =>
|
|
83
|
+
(i, m) => w(
|
|
84
84
|
i,
|
|
85
85
|
m,
|
|
86
86
|
e,
|
|
@@ -147,12 +147,12 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
147
147
|
type: "error"
|
|
148
148
|
}), p.current.add(0)) : !a && y && p.current.clear();
|
|
149
149
|
}, [b, m, u]);
|
|
150
|
-
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), f = e === "latest" || e === "latest-encounter",
|
|
150
|
+
const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), f = e === "latest" || e === "latest-encounter", F = j(
|
|
151
151
|
l,
|
|
152
152
|
o
|
|
153
153
|
), {
|
|
154
154
|
data: R,
|
|
155
|
-
isLoading:
|
|
155
|
+
isLoading: U,
|
|
156
156
|
isError: I,
|
|
157
157
|
refetch: N
|
|
158
158
|
} = ce({
|
|
@@ -171,7 +171,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
171
171
|
h,
|
|
172
172
|
o
|
|
173
173
|
),
|
|
174
|
-
enabled: !!i && h.length > 0 && v && !
|
|
174
|
+
enabled: !!i && h.length > 0 && v && !F
|
|
175
175
|
});
|
|
176
176
|
X(
|
|
177
177
|
(a) => {
|
|
@@ -197,7 +197,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
|
|
|
197
197
|
{ key: "name", header: "name" },
|
|
198
198
|
{ key: "value", header: "value" },
|
|
199
199
|
{ key: "form", header: "form" }
|
|
200
|
-
], A =
|
|
200
|
+
], A = U || !v, D = I && v, K = (!R || R.entry?.length === 0 || h.length === 0) && v, k = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, q = K ? u("NO_OBSERVATIONS_FOUND") : void 0, Q = $.length > 0 && !A && !D, E = d.titleTranslationKey, _ = E ? u(E) : "";
|
|
201
201
|
return /* @__PURE__ */ S(
|
|
202
202
|
"div",
|
|
203
203
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as a, jsxs as m, Fragment as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as a, jsxs as m, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { C as W, F as se, G as oe, I as ie, Y as le, K as de, M as Re, N as ce, O as H, u as b, z as X, P as N, U as F, V as M, Z as _e, _ as Te, a0 as pe, a1 as x, k as ue, a2 as me, a3 as Ee, a4 as U, a5 as Se, a6 as q, 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-Co6rXYJ2.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
5
|
import { useLocation as Ce, useNavigate as be } from "react-router-dom";
|
|
@@ -20,18 +20,18 @@ 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
|
+
], Ye = {
|
|
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
|
+
}, He = () => J({
|
|
31
31
|
queryKey: Q.reportsAppConfig,
|
|
32
32
|
queryFn: async () => {
|
|
33
33
|
try {
|
|
34
|
-
return await
|
|
34
|
+
return await W(
|
|
35
35
|
se,
|
|
36
36
|
Be
|
|
37
37
|
);
|
|
@@ -39,32 +39,32 @@ 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#", Ue = "Reports Configuration", qe = "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:
|
|
46
|
-
additionalProperties:
|
|
47
|
-
},
|
|
44
|
+
title: Ue,
|
|
45
|
+
type: qe,
|
|
46
|
+
additionalProperties: $e
|
|
47
|
+
}, ke = () => J({
|
|
48
48
|
queryKey: Q.reportsConfig,
|
|
49
|
-
queryFn: () =>
|
|
49
|
+
queryFn: () => W(oe, je),
|
|
50
50
|
retry: !1
|
|
51
|
-
}),
|
|
51
|
+
}), k = Symbol.for("constructDateFrom");
|
|
52
52
|
function Z(e, t) {
|
|
53
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" &&
|
|
53
|
+
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);
|
|
54
54
|
}
|
|
55
55
|
function ee(e, t) {
|
|
56
56
|
return Z(e, e);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
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 ze(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
|
|
67
|
-
return
|
|
66
|
+
function We(e, t, s) {
|
|
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)
|
|
@@ -77,9 +77,9 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
77
77
|
const t = /* @__PURE__ */ new Date();
|
|
78
78
|
switch (e) {
|
|
79
79
|
case "THIS_MONTH":
|
|
80
|
-
return [We(t), t];
|
|
81
|
-
case "LAST_7_DAYS":
|
|
82
80
|
return [ze(t), t];
|
|
81
|
+
case "LAST_7_DAYS":
|
|
82
|
+
return [We(t), t];
|
|
83
83
|
default:
|
|
84
84
|
return [new Date(t), new Date(t)];
|
|
85
85
|
}
|
|
@@ -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: H.RUN_REPORT.eventType,
|
|
123
123
|
messageParams: { reportName: t.name },
|
|
124
|
-
module:
|
|
124
|
+
module: H.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 } = b(), { addNotification: n } = X(), { runReport: _ } = tt(), [R, u] = A({}), [f, p] = A({}), [
|
|
132
|
+
const { t: d } = b(), { 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]);
|
|
@@ -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) => g === o,
|
|
145
145
|
updateRow: (o, l) => u((c) => ({
|
|
146
146
|
...c,
|
|
147
147
|
[o]: { ...r(o), ...l }
|
|
@@ -160,7 +160,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
160
160
|
startDate: l.startDate,
|
|
161
161
|
endDate: l.endDate
|
|
162
162
|
},
|
|
163
|
-
(T,
|
|
163
|
+
(T, P) => d(T, { defaultValue: T, ...P })
|
|
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((P) => ({
|
|
178
|
+
...P,
|
|
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 P = { ...T };
|
|
190
|
+
return delete P[o.id], P;
|
|
191
191
|
}), i(o.id), !_(
|
|
192
192
|
o,
|
|
193
193
|
l.format,
|
|
@@ -224,7 +224,7 @@ const Xe = (e, t) => t ? de(e, t) : !0, Ke = (e, t) => e.filter(
|
|
|
224
224
|
isRunning: u,
|
|
225
225
|
updateRow: f,
|
|
226
226
|
clearRowFieldError: p,
|
|
227
|
-
handleRunReport:
|
|
227
|
+
handleRunReport: g
|
|
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") });
|
|
@@ -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(Y, { 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
|
] }),
|
|
@@ -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(Y, { children: [
|
|
259
259
|
/* @__PURE__ */ a("td", { children: h && /* @__PURE__ */ a(
|
|
260
260
|
N,
|
|
261
261
|
{
|
|
@@ -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: () => g(r)
|
|
341
341
|
}
|
|
342
342
|
)
|
|
343
343
|
}
|
|
@@ -369,7 +369,7 @@ 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: g
|
|
373
373
|
}) => {
|
|
374
374
|
const { t: i } = b();
|
|
375
375
|
return /* @__PURE__ */ m("section", { className: L.filtersContainer, "data-testid": "reports-filters", 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(Ye[r]) : "",
|
|
386
386
|
selectedItem: d,
|
|
387
387
|
onChange: ({ selectedItem: r }) => {
|
|
388
388
|
if (f(r ?? null), !r) return;
|
|
@@ -442,10 +442,10 @@ 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: g, children: i("REPORTS_APPLY_BUTTON") })
|
|
446
446
|
] })
|
|
447
447
|
] });
|
|
448
|
-
},
|
|
448
|
+
}, G = {
|
|
449
449
|
startDate: null,
|
|
450
450
|
endDate: null,
|
|
451
451
|
format: null,
|
|
@@ -455,7 +455,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
455
455
|
data: n,
|
|
456
456
|
isLoading: _,
|
|
457
457
|
error: R
|
|
458
|
-
} =
|
|
458
|
+
} = ke(), { data: u } = He();
|
|
459
459
|
V(() => {
|
|
460
460
|
R && d({
|
|
461
461
|
title: e("REPORTS_ERROR_TITLE"),
|
|
@@ -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] = A(null), [
|
|
466
|
+
const [f, p] = A(null), [g, i] = A(null), [r, O] = A(null), [S, h] = A(null), [o, l] = A(G), c = y(() => n ? Ke(
|
|
467
467
|
et(n),
|
|
468
468
|
t
|
|
469
469
|
) : [], [n, t]), D = y(
|
|
470
470
|
() => Je(u?.config?.supportedFormats),
|
|
471
471
|
[u]
|
|
472
|
-
), T = u?.config?.paperSize, { dateRangeReports:
|
|
472
|
+
), T = u?.config?.paperSize, { dateRangeReports: P, noDateRangeReports: ae } = y(
|
|
473
473
|
() => Ve(c),
|
|
474
474
|
[c]
|
|
475
475
|
), re = () => {
|
|
476
476
|
l((v) => ({
|
|
477
477
|
startDate: f,
|
|
478
|
-
endDate:
|
|
478
|
+
endDate: g,
|
|
479
479
|
format: r,
|
|
480
480
|
version: v.version + 1
|
|
481
481
|
}));
|
|
482
482
|
}, ne = () => {
|
|
483
|
-
p(null), i(null), O(null), h(null), l((v) => ({ ...
|
|
483
|
+
p(null), i(null), O(null), h(null), l((v) => ({ ...G, version: v.version + 1 }));
|
|
484
484
|
};
|
|
485
485
|
return _ || s ? /* @__PURE__ */ a(
|
|
486
486
|
me,
|
|
@@ -509,7 +509,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
509
509
|
ft,
|
|
510
510
|
{
|
|
511
511
|
startDate: f,
|
|
512
|
-
endDate:
|
|
512
|
+
endDate: g,
|
|
513
513
|
format: r,
|
|
514
514
|
selectedPreset: S,
|
|
515
515
|
availableFormats: D,
|
|
@@ -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
|
+
U,
|
|
527
527
|
{
|
|
528
528
|
title: e("REPORTS_DATE_RANGE_SECTION_TITLE"),
|
|
529
529
|
testId: "reports-date-range-section",
|
|
@@ -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: P,
|
|
535
535
|
appliedFilters: o,
|
|
536
536
|
availableFormats: D,
|
|
537
537
|
defaultPaperSize: T
|
|
@@ -540,7 +540,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
540
540
|
}
|
|
541
541
|
),
|
|
542
542
|
/* @__PURE__ */ a(
|
|
543
|
-
|
|
543
|
+
U,
|
|
544
544
|
{
|
|
545
545
|
title: e("REPORTS_NO_DATE_RANGE_SECTION_TITLE"),
|
|
546
546
|
testId: "reports-no-date-range-section",
|
|
@@ -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
|
-
},
|
|
563
|
+
}, gt = "ReportsPage-module_page__ewRXe", Pt = "ReportsPage-module_panel__HFBCt", B = {
|
|
564
|
+
page: gt,
|
|
565
|
+
panel: Pt
|
|
566
|
+
}, z = 1, At = 0, yt = () => {
|
|
567
567
|
const { t: e } = b(), t = Ce(), s = be(), 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 === q ? z : At, _ = K(
|
|
574
574
|
({ selectedIndex: R }) => {
|
|
575
575
|
s(
|
|
576
|
-
R ===
|
|
576
|
+
R === z ? q : fe
|
|
577
577
|
);
|
|
578
578
|
},
|
|
579
579
|
[s]
|
|
@@ -603,16 +603,16 @@ 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(ge, { selectedIndex: n, onChange: _, children: [
|
|
607
607
|
/* @__PURE__ */ m(
|
|
608
|
-
|
|
608
|
+
Pe,
|
|
609
609
|
{
|
|
610
610
|
id: "reports-tab-list",
|
|
611
611
|
"data-testid": "reports-tab-list-test-id",
|
|
612
612
|
"aria-label": e("REPORTS_TAB_LIST_ARIA_LABEL"),
|
|
613
613
|
children: [
|
|
614
614
|
/* @__PURE__ */ a(
|
|
615
|
-
|
|
615
|
+
$,
|
|
616
616
|
{
|
|
617
617
|
id: "reports-tab",
|
|
618
618
|
"data-testid": "reports-tab-test-id",
|
|
@@ -621,7 +621,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
621
621
|
}
|
|
622
622
|
),
|
|
623
623
|
/* @__PURE__ */ a(
|
|
624
|
-
|
|
624
|
+
$,
|
|
625
625
|
{
|
|
626
626
|
id: "my-reports-tab",
|
|
627
627
|
"data-testid": "my-reports-tab-test-id",
|
|
@@ -634,7 +634,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
634
634
|
),
|
|
635
635
|
/* @__PURE__ */ m(Ae, { children: [
|
|
636
636
|
/* @__PURE__ */ a(
|
|
637
|
-
|
|
637
|
+
j,
|
|
638
638
|
{
|
|
639
639
|
id: "reports-tab-panel",
|
|
640
640
|
"data-testid": "reports-tab-panel-test-id",
|
|
@@ -644,7 +644,7 @@ const ct = "ReportList-module_reportList__tPpsJ", _t = "ReportList-module_fullWi
|
|
|
644
644
|
}
|
|
645
645
|
),
|
|
646
646
|
/* @__PURE__ */ a(
|
|
647
|
-
|
|
647
|
+
j,
|
|
648
648
|
{
|
|
649
649
|
id: "my-reports-tab-panel",
|
|
650
650
|
"data-testid": "my-reports-tab-panel-test-id",
|