@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.
@@ -1,11 +1,11 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { E as o, F as a, L as s, M as N } from "./index-D408E2pe.js";
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: N,
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 { $ as ee, a0 as te, a1 as se, a2 as K, u as ae, a3 as ne, a4 as re, E as ie, T as oe, a5 as ue, a6 as de, a7 as U, X as V, a8 as le } from "./index-D408E2pe.js";
3
- import { useState as l, useRef as C, useEffect as k, useMemo as ce, useCallback as me } from "react";
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 G = Symbol.for("constructDateFrom");
5
+ const k = Symbol.for("constructDateFrom");
6
6
  function y(e, t) {
7
- return typeof e == "function" ? e(t) : e && typeof e == "object" && G in e ? e[G](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
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", Ie = () => {
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, p] = l(null), [b, f] = l(!1), [O, g] = l(!1), [F, M] = l(1), T = C(1), s = (c) => {
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 = C(0), [n, j] = l(null), B = C(null), { data: N, isLoading: X, isFetching: L, isError: z } = Ee({
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
- }), I = (c, H, m, D, h, W) => {
51
+ }), p = (c, G, m, h, D, $) => {
52
52
  o.current += 1, j({
53
53
  action: c,
54
- params: H,
54
+ params: G,
55
55
  alwaysReplace: m,
56
- defaultFirstIndex: D,
57
- defaultLastIndex: h,
58
- emptyMessageKey: W,
56
+ defaultFirstIndex: h,
57
+ defaultLastIndex: D,
58
+ emptyMessageKey: $,
59
59
  requestId: o.current
60
60
  });
61
- }, A = Le(e.startDate, e.startTime), Q = () => {
62
- I(
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
- I(
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
- I(
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 || I(
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
- }, J = () => {
125
+ }, W = () => {
126
126
  L || (t({
127
127
  startDate: null,
128
128
  startTime: "",
129
129
  username: "",
130
130
  patientId: ""
131
- }), I("init", { defaultView: !0 }, !0, 0, 0, q));
131
+ }), p("init", { defaultView: !0 }, !0, 0, 0, q));
132
132
  };
133
- return k(() => {
134
- Q();
135
- }, []), k(() => {
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), D = m.length === K;
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), p(null), a(m[0].auditLogId), u(m[m.length - 1].auditLogId), c)
141
- g(!1), f(D), s(1);
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(D), s(T.current + 1);
143
+ g(!0), f(h), s(T.current + 1);
144
144
  else {
145
145
  f(!0);
146
- const h = Math.max(1, T.current - 1);
147
- g(h > 1), s(h);
146
+ const D = Math.max(1, T.current - 1);
147
+ g(D > 1), s(D);
148
148
  }
149
149
  else
150
- n.alwaysReplace && _([]), p(n.emptyMessageKey), a(n.defaultFirstIndex), u(n.defaultLastIndex), c ? (f(!1), g(!1), s(1)) : n.action === "next" ? f(!1) : g(!1);
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: X || L,
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: J
167
+ reset: W
168
168
  };
169
- }, pe = "AuditLog-module_page__-FKzd", Ne = "AuditLog-module_filters__DA4tQ", Ae = "AuditLog-module_filterRow__x6DqE", P = {
170
- page: pe,
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: p,
183
+ hasPrevious: I,
184
184
  currentPageNumber: b,
185
185
  next: f,
186
186
  prev: O,
187
187
  runReport: g,
188
188
  reset: F
189
- } = Ie(), M = ce(
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: P.page,
231
+ className: U.page,
232
232
  children: [
233
- /* @__PURE__ */ S(oe, { className: P.filters, "aria-label": e("FILTERS_HEADER_LABEL"), children: [
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: P.filterRow, children: [
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
- U,
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
- U,
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
- U,
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
- V,
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
- V,
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: p,
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 n, jsxs as d } from "react/jsx-runtime";
2
- import { u as A, z as M, N as R, O, P as h, Q as P, S as g, E as V, T as D, V as f, X as x, Z as b } from "./index-D408E2pe.js";
3
- import { useState as E, useMemo as y } from "react";
4
- import { useQuery as L, useMutation as X } from "@tanstack/react-query";
5
- const v = "CsvExport-module_tile__yBrLM", B = "CsvExport-module_title__epZnI", H = "CsvExport-module_form__w-cN-", U = "CsvExport-module_search__G82i7", r = {
6
- tile: v,
7
- title: B,
8
- form: H,
9
- search: U
10
- }, z = 300, S = 2, _ = 5e3, G = "custom:(uuid,setMembers:(uuid))", q = () => {
11
- const { t } = A(), { addNotification: i } = M(), [p, C] = E(""), [s, c] = E(
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
- ), a = R(p.trim(), z), { data: l = [] } = L({
14
- queryKey: ["csvExportConceptSearch", a],
15
- queryFn: () => O(a),
16
- enabled: a.length >= S && a !== s?.name,
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) => a.length >= S ? e : void 0
19
- }), T = y(
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 = X({
25
- mutationFn: async (e) => (await P(e.uuid, G)).setMembers?.length ? g(e.name) : null,
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
- i({
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
- h(e, `${m}.zip`), i({
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
- i({
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
- i({
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__ */ n(V, { breadcrumbLabel: t("BREADCRUMB_CSV_EXPORT"), children: /* @__PURE__ */ d(
69
- D,
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: r.tile,
74
+ className: i.tile,
75
75
  children: [
76
- /* @__PURE__ */ n("h2", { className: r.title, children: t("ADMIN_CSV_EXPORT_TITLE") }),
77
- /* @__PURE__ */ d("form", { className: r.form, onSubmit: N, noValidate: !0, children: [
78
- /* @__PURE__ */ n("div", { className: r.search, children: /* @__PURE__ */ n(
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__ */ n(
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__ */ n(
107
- b,
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
- q as CsvExport
121
+ Q as CsvExport
122
122
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as a, jsxs as e } from "react/jsx-runtime";
2
- import { u as d, E as o } from "./index-D408E2pe.js";
2
+ import { u as d, G as o } from "./index-Grpo3EV8.js";
3
3
  const t = "CsvUpload-module_page__AxMNv", i = {
4
4
  page: t
5
5
  }, n = () => {