@bahmni/appointments-app 0.0.1-dev.299 → 0.0.1-dev.302

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,7 +1,7 @@
1
1
  import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
- import { H as f, N as P, Q as O, T as V, U as Z, V as ee, W as te, a0 as ie, q as ae, a1 as ne, a as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as x, ab as k, ac as w, l as oe, h as de, p as $, ad as ce, r as me, ae as Ae, af as Ie, ag as ue, t as _e, x as Te } from "./index-fg5HS614.js";
3
- import { useState as g, useMemo as N, useEffect as h, useRef as Le, useCallback as U } from "react";
4
- import { useQuery as M, useQueryClient as ve } from "@tanstack/react-query";
2
+ import { H as f, L as P, M as O, S as V, N as Z, R as ee, V as te, a0 as ie, E as ae, a1 as ne, u as Q, a2 as R, a3 as le, a4 as re, a5 as se, a6 as E, a7 as F, a8 as C, a9 as Y, aa as x, ab as k, ac as w, p as oe, Y as de, s as $, ad as ce, v as me, ae as Ae, af as Ie, ag as ue, B as _e, x as Te } from "./index-CdyKXvT4.js";
3
+ import { useState as g, useMemo as N, useEffect as S, useRef as Le, useCallback as U } from "react";
4
+ import { useQuery as D, useQueryClient as ve } from "@tanstack/react-query";
5
5
  const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", be = () => {
6
6
  try {
7
7
  return Z().uuid;
@@ -14,7 +14,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
14
14
  }), ye = (e) => ({
15
15
  display: e,
16
16
  uuid: ""
17
- }), De = (e, a) => {
17
+ }), Me = (e, a) => {
18
18
  const n = e.map((t) => ({
19
19
  id: t.uuid,
20
20
  text: t.name,
@@ -25,7 +25,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
25
25
  text: a,
26
26
  isSelectAll: !0
27
27
  }), n;
28
- }, Me = (e, a) => {
28
+ }, De = (e, a) => {
29
29
  const n = e.map((t) => ({
30
30
  id: t.uuid,
31
31
  text: t.person?.display,
@@ -86,19 +86,19 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
86
86
  uuid: a.resource?.id ?? "",
87
87
  display: a.resource?.name ?? "",
88
88
  childLocations: []
89
- })), he = () => {
89
+ })), Se = () => {
90
90
  const {
91
91
  data: e,
92
92
  isLoading: a,
93
93
  isError: n
94
- } = M({
94
+ } = D({
95
95
  queryKey: ["currentUser"],
96
96
  queryFn: ee
97
97
  }), {
98
98
  data: t = [],
99
99
  isLoading: o,
100
100
  isError: c
101
- } = M({
101
+ } = D({
102
102
  queryKey: ["providerLoginLocations", e?.uuid],
103
103
  queryFn: async () => {
104
104
  const I = await te(
@@ -119,14 +119,14 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
119
119
  data: A = [],
120
120
  isLoading: L,
121
121
  isError: m
122
- } = M({
122
+ } = D({
123
123
  queryKey: ["appointmentServices"],
124
124
  queryFn: ae
125
125
  }), {
126
126
  data: l = [],
127
127
  isLoading: s,
128
128
  isError: _
129
- } = M({
129
+ } = D({
130
130
  queryKey: ["providers"],
131
131
  queryFn: ne
132
132
  });
@@ -137,8 +137,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
137
137
  isLoading: a || o || L || s,
138
138
  isError: n || c || m || _
139
139
  };
140
- }, Se = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Oe = "UnavailabilityForm-module_error__jDeOm", Ve = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ce = "UnavailabilityForm-module_dateTimeColumn__6bi0F", Ye = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
- formContent: Se,
140
+ }, he = "UnavailabilityForm-module_formContent__WmNHR", Be = "UnavailabilityForm-module_formField__8he7o", Pe = "UnavailabilityForm-module_loading__IDEY6", Oe = "UnavailabilityForm-module_error__jDeOm", Ve = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ce = "UnavailabilityForm-module_dateTimeColumn__6bi0F", Ye = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
141
+ formContent: he,
142
142
  formField: Be,
143
143
  loading: Pe,
144
144
  error: Oe,
@@ -152,7 +152,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
152
152
  formDataRef: a,
153
153
  onClearErrors: n
154
154
  }) => {
155
- const { t } = Q(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = he(), [l, s] = g({
155
+ const { t } = Q(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = Se(), [l, s] = g({
156
156
  locationUuid: "",
157
157
  selectedServiceItems: [],
158
158
  selectedProviderItems: [],
@@ -183,7 +183,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
183
183
  () => R(
184
184
  !1,
185
185
  !1,
186
- De(
186
+ Me(
187
187
  _,
188
188
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
189
189
  ),
@@ -199,7 +199,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
199
199
  () => R(
200
200
  !1,
201
201
  !1,
202
- Me(
202
+ De(
203
203
  I,
204
204
  t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
205
205
  ),
@@ -212,21 +212,21 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
212
212
  ),
213
213
  [I]
214
214
  );
215
- return h(() => {
215
+ return S(() => {
216
216
  if (o.length === 0) return;
217
217
  const i = be(), p = o.some(
218
- (D) => D.uuid === i
218
+ (M) => M.uuid === i
219
219
  );
220
- s((D) => ({
221
- ...D,
220
+ s((M) => ({
221
+ ...M,
222
222
  locationUuid: p ? i : ""
223
223
  }));
224
- }, [o]), h(() => {
224
+ }, [o]), S(() => {
225
225
  _.length > 0 && s((i) => ({
226
226
  ...i,
227
227
  selectedServiceItems: v
228
228
  }));
229
- }, [v]), h(() => {
229
+ }, [v]), S(() => {
230
230
  I.length > 0 && s((i) => ({
231
231
  ...i,
232
232
  selectedProviderItems: y
@@ -510,7 +510,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
510
510
  ), I = $(n, [
511
511
  pe,
512
512
  q
513
- ]), { data: u, isLoading: v, isError: y } = M({
513
+ ]), { data: u, isLoading: v, isError: y } = D({
514
514
  queryKey: ["appointmentUnavailabilities"],
515
515
  queryFn: ce,
516
516
  enabled: _
@@ -537,7 +537,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
537
537
  key: "providerName",
538
538
  header: e("ADMIN_UNAVAILABILITY_COLUMN_PROVIDER")
539
539
  }
540
- ], [e]), D = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), S = U(
540
+ ], [e]), M = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), h = U(
541
541
  async (T) => {
542
542
  L(!0);
543
543
  try {
@@ -563,8 +563,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
563
563
  ), j = U(async () => {
564
564
  if (!m.current) return;
565
565
  const T = Ue(m.current, e);
566
- s(T), !(Object.keys(T).length > 0) && await S(fe(m.current, e));
567
- }, [e, S]), W = U(
566
+ s(T), !(Object.keys(T).length > 0) && await h(fe(m.current, e));
567
+ }, [e, h]), W = U(
568
568
  (T) => {
569
569
  s((z) => {
570
570
  const B = { ...z };
@@ -595,7 +595,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
595
595
  "aria-label": "appointment-unavailability-actions-table-aria-label",
596
596
  title: e("ADMIN_UNAVAILABILITY_TITLE"),
597
597
  headers: p,
598
- rows: D,
598
+ rows: M,
599
599
  ariaLabel: "unavailability-table",
600
600
  loading: v,
601
601
  errorStateMessage: y ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
@@ -1,12 +1,12 @@
1
1
  import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
- import { o as V, g as h, a as C, i as O, $ as P, h as B, l as x, p as L, q as G, r as q, s as U, t as $, x as w, y as F, C as k, D as j } from "./index-fg5HS614.js";
3
- import { useState as I, useMemo as c } from "react";
4
- import { useQueryClient as H, useQuery as K } from "@tanstack/react-query";
5
- const Q = V(
6
- h,
2
+ import { k as V, l as O, u as C, I as P, $ as h, Y as B, p as x, s as L, E as G, v as U, w as q, B as w, x as $, z as k, C as F, D as Y } from "./index-CdyKXvT4.js";
3
+ import { useState as I, useMemo as _ } from "react";
4
+ import { useQueryClient as j, useQuery as H } from "@tanstack/react-query";
5
+ const K = V(
6
+ O,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
- ), W = ({
9
+ ), Q = ({
10
10
  serviceName: e,
11
11
  isDeleting: a,
12
12
  onConfirm: t,
@@ -14,7 +14,7 @@ const Q = V(
14
14
  }) => {
15
15
  const { t: i } = C();
16
16
  return /* @__PURE__ */ n(
17
- O,
17
+ P,
18
18
  {
19
19
  id: "delete-service-modal",
20
20
  testId: "delete-service-modal-test-id",
@@ -36,8 +36,8 @@ const Q = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
39
- ], Y = "app:appointments:manageServices", Z = "app:appointments:adminTab", z = "index-module_page__Gsfbu", J = "index-module_noPrivilegeContainer__Pu5WZ", X = "index-module_table__GAPmb", d = {
40
- page: z,
39
+ ], W = "app:appointments:manageServices", z = "app:appointments:adminTab", Z = "index-module_page__Gsfbu", J = "index-module_noPrivilegeContainer__Pu5WZ", X = "index-module_table__GAPmb", d = {
40
+ page: Z,
41
41
  noPrivilegeContainer: J,
42
42
  table: X
43
43
  };
@@ -49,7 +49,7 @@ function te(e, a) {
49
49
  ...e.map((t) => ({
50
50
  key: t,
51
51
  header: a(
52
- `ADMIN_ALL_SERVICES_COLUMN_${P(t)}`
52
+ `ADMIN_ALL_SERVICES_COLUMN_${h(t)}`
53
53
  )
54
54
  })),
55
55
  {
@@ -75,33 +75,33 @@ function ae(e, a) {
75
75
  }));
76
76
  }
77
77
  const le = () => {
78
- const { t: e } = C(), a = H(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: i } = Q(), [E, _] = I(null), [M, u] = I(!1), l = i?.serviceTableFields ?? [
78
+ const { t: e } = C(), a = j(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: i } = K(), [E, c] = I(null), [M, u] = I(!1), l = i?.serviceTableFields ?? [
79
79
  ...p
80
- ], m = L(s, Z), b = L(
80
+ ], m = L(s, z), b = L(
81
81
  s,
82
- Y
83
- ), S = c(
82
+ W
83
+ ), S = _(
84
84
  () => ee(l),
85
85
  [l]
86
- ), { data: A, isLoading: v, isError: D } = K({
86
+ ), { data: A, isLoading: v, isError: D } = H({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: G,
89
89
  enabled: m
90
- }), R = c(
90
+ }), R = _(
91
91
  () => te(l, e),
92
92
  [l]
93
- ), N = c(
93
+ ), N = _(
94
94
  () => ae(A ?? [], S),
95
95
  [A, S]
96
96
  ), g = async () => {
97
97
  u(!0);
98
98
  try {
99
- await j(E.id), t({
99
+ await Y(E.id), t({
100
100
  title: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_TITLE"),
101
101
  message: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_MESSAGE"),
102
102
  type: "success",
103
103
  timeout: 5e3
104
- }), _(null), a.invalidateQueries({ queryKey: ["allAppointmentServices"] });
104
+ }), c(null), a.invalidateQueries({ queryKey: ["allAppointmentServices"] });
105
105
  } catch {
106
106
  t({
107
107
  title: e("ADMIN_ALL_SERVICES_DELETE_ERROR_TITLE"),
@@ -112,7 +112,7 @@ const le = () => {
112
112
  u(!1);
113
113
  }
114
114
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ n(
115
- F,
115
+ k,
116
116
  {
117
117
  id: `delete-service-${r.id}-btn`,
118
118
  testId: `delete-service-${r.id}-btn-test-id`,
@@ -120,17 +120,17 @@ const le = () => {
120
120
  kind: "ghost",
121
121
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
122
122
  disabled: !b,
123
- onClick: () => _(r),
124
- children: /* @__PURE__ */ n(k, {})
123
+ onClick: () => c(r),
124
+ children: /* @__PURE__ */ n(F, {})
125
125
  }
126
126
  ) : p.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", f = [
127
- { id: "home", label: e("BREADCRUMB_HOME"), href: q },
127
+ { id: "home", label: e("BREADCRUMB_HOME"), href: U },
128
128
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
129
129
  ];
130
130
  return /* @__PURE__ */ n(
131
- U,
131
+ q,
132
132
  {
133
- header: /* @__PURE__ */ n(w, { breadcrumbItems: f }),
133
+ header: /* @__PURE__ */ n($, { breadcrumbItems: f }),
134
134
  main: m ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
@@ -140,7 +140,7 @@ const le = () => {
140
140
  className: d.page,
141
141
  children: [
142
142
  /* @__PURE__ */ n(
143
- $,
143
+ w,
144
144
  {
145
145
  id: "all-services",
146
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
@@ -155,12 +155,12 @@ const le = () => {
155
155
  }
156
156
  ),
157
157
  E && /* @__PURE__ */ n(
158
- W,
158
+ Q,
159
159
  {
160
160
  serviceName: E.name,
161
161
  isDeleting: M,
162
162
  onConfirm: g,
163
- onCancel: () => _(null)
163
+ onCancel: () => c(null)
164
164
  }
165
165
  )
166
166
  ]