@bahmni/appointments-app 0.0.1-dev.369 → 0.0.1-dev.370

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 p } from "react/jsx-runtime";
2
- import { _ as f, a0 as B, a1 as O, a2 as V, a3 as Z, a4 as ee, a5 as te, a6 as ie, q as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as E, ad as F, ae as C, af as Y, ag as k, ah as x, ai as $, X as oe, G as de, t as H, aj as ce, x as me, ak as Ae, al as Ie, am as ue, I as _e, Q as Te, J as Le } from "./index-CZd7_ZdO.js";
3
- import { useState as g, useMemo as N, useEffect as h, useRef as ve, useCallback as U } from "react";
4
- import { useQuery as M, useQueryClient as Ne } from "@tanstack/react-query";
2
+ import { _ as f, a0 as B, a1 as O, a2 as V, a3 as Z, a4 as ee, a5 as te, a6 as ie, x as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as E, ad as F, ae as C, af as Y, ag as k, ah as x, ai as H, X as oe, G as de, t as $, aj as ce, I as me, ak as Ae, al as Ie, am as ue, K as _e, M as Te, P as Le } from "./index-BHD0UBPk.js";
3
+ import { useState as g, useMemo as N, useEffect as S, useRef as ve, useCallback as U } from "react";
4
+ import { useQuery as y, useQueryClient as Ne } from "@tanstack/react-query";
5
5
  const be = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", De = () => {
6
6
  try {
7
7
  return Z().uuid;
@@ -11,10 +11,10 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
11
11
  }, w = (e) => ({
12
12
  id: "",
13
13
  text: e
14
- }), ye = (e) => ({
14
+ }), Me = (e) => ({
15
15
  display: e,
16
16
  uuid: ""
17
- }), Me = (e, a) => {
17
+ }), ye = (e, a) => {
18
18
  const n = e.map((t) => ({
19
19
  id: t.uuid,
20
20
  text: t.name,
@@ -82,23 +82,23 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
82
82
  providerUuid: s
83
83
  }))
84
84
  );
85
- }, he = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
85
+ }, Se = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
86
86
  uuid: a.resource?.id ?? "",
87
87
  display: a.resource?.name ?? "",
88
88
  childLocations: []
89
- })), Se = () => {
89
+ })), he = () => {
90
90
  const {
91
91
  data: e,
92
92
  isLoading: a,
93
93
  isError: n
94
- } = M({
94
+ } = y({
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
+ } = y({
102
102
  queryKey: ["providerLoginLocations", e?.uuid],
103
103
  queryFn: async () => {
104
104
  const I = await te(
@@ -108,7 +108,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
108
108
  const u = await ie(
109
109
  G
110
110
  );
111
- return he(u);
111
+ return Se(u);
112
112
  }
113
113
  return I.filter(
114
114
  (u) => u.tags?.some((v) => v.display === G)
@@ -119,14 +119,14 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
119
119
  data: A = [],
120
120
  isLoading: L,
121
121
  isError: m
122
- } = M({
122
+ } = y({
123
123
  queryKey: ["appointmentServices"],
124
124
  queryFn: ae
125
125
  }), {
126
126
  data: l = [],
127
127
  isLoading: s,
128
128
  isError: _
129
- } = M({
129
+ } = y({
130
130
  queryKey: ["providers"],
131
131
  queryFn: ne
132
132
  });
@@ -147,12 +147,12 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
147
147
  dateTimeColumn: Ye,
148
148
  datePicker: ke,
149
149
  timePicker: xe
150
- }, $e = ({
150
+ }, He = ({
151
151
  errors: e,
152
152
  formDataRef: a,
153
153
  onClearErrors: n
154
154
  }) => {
155
- const { t } = Q(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = Se(), [l, s] = g({
155
+ const { t } = Q(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = he(), [l, s] = g({
156
156
  locationUuid: "",
157
157
  selectedServiceItems: [],
158
158
  selectedProviderItems: [],
@@ -173,7 +173,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
173
173
  ),
174
174
  [A]
175
175
  ), u = N(
176
- () => R(!1, !1, o, ye, {
176
+ () => R(!1, !1, o, Me, {
177
177
  loading: "",
178
178
  error: "",
179
179
  empty: t("ADMIN_UNAVAILABILITY_FORM_NO_LOCATIONS")
@@ -183,7 +183,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
183
183
  () => R(
184
184
  !1,
185
185
  !1,
186
- Me(
186
+ ye(
187
187
  _,
188
188
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
189
189
  ),
@@ -212,21 +212,21 @@ const be = "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 = De(), b = o.some(
218
- (y) => y.uuid === i
218
+ (M) => M.uuid === i
219
219
  );
220
- s((y) => ({
221
- ...y,
220
+ s((M) => ({
221
+ ...M,
222
222
  locationUuid: b ? 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: D
@@ -450,7 +450,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
450
450
  lg: 8,
451
451
  className: d.column,
452
452
  children: /* @__PURE__ */ r(
453
- $,
453
+ H,
454
454
  {
455
455
  id: "service-multiselect",
456
456
  "data-testid": "service-multiselect",
@@ -478,7 +478,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
478
478
  lg: 8,
479
479
  className: d.column,
480
480
  children: /* @__PURE__ */ r(
481
- $,
481
+ H,
482
482
  {
483
483
  id: "provider-multiselect",
484
484
  "data-testid": "provider-multiselect",
@@ -501,16 +501,16 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
501
501
  ]
502
502
  }
503
503
  );
504
- }, He = "index-module_page__s2h2y", qe = {
505
- page: He
504
+ }, $e = "index-module_page__s2h2y", qe = {
505
+ page: $e
506
506
  }, je = () => {
507
- const { t: e } = Q(), a = Ne(), { userPrivileges: n } = oe(), { addNotification: t } = de(), [o, c] = g(!1), [A, L] = g(!1), m = ve(null), [l, s] = g({}), _ = H(
507
+ const { t: e } = Q(), a = Ne(), { userPrivileges: n } = oe(), { addNotification: t } = de(), [o, c] = g(!1), [A, L] = g(!1), m = ve(null), [l, s] = g({}), _ = $(
508
508
  n,
509
509
  q
510
- ), I = H(n, [
510
+ ), I = $(n, [
511
511
  pe,
512
512
  q
513
- ]), { data: u, isLoading: v, isError: D } = M({
513
+ ]), { data: u, isLoading: v, isError: D } = y({
514
514
  queryKey: ["appointmentUnavailabilities"],
515
515
  queryFn: ce,
516
516
  enabled: _
@@ -537,7 +537,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
537
537
  key: "providerName",
538
538
  header: e("ADMIN_UNAVAILABILITY_COLUMN_PROVIDER")
539
539
  }
540
- ], [e]), y = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), S = U(
540
+ ], [e]), M = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), h = U(
541
541
  async (T) => {
542
542
  L(!0);
543
543
  try {
@@ -563,8 +563,8 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
563
563
  ), j = U(async () => {
564
564
  if (!m.current) return;
565
565
  const T = ge(m.current, e);
566
- s(T), !(Object.keys(T).length > 0) && await S(Re(m.current, e));
567
- }, [e, S]), W = U(
566
+ s(T), !(Object.keys(T).length > 0) && await h(Re(m.current, e));
567
+ }, [e, h]), W = U(
568
568
  (T) => {
569
569
  s((z) => {
570
570
  const P = { ...z };
@@ -595,7 +595,7 @@ const be = "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: b,
598
- rows: y,
598
+ rows: M,
599
599
  ariaLabel: "unavailability-table",
600
600
  loading: v,
601
601
  errorStateMessage: D ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
@@ -622,7 +622,7 @@ const be = "Available for appointments", q = "Get Appointment Unavailability", p
622
622
  onSecondaryButtonClick: X,
623
623
  isSecondaryButtonDisabled: A,
624
624
  content: /* @__PURE__ */ r(
625
- $e,
625
+ He,
626
626
  {
627
627
  errors: l,
628
628
  formDataRef: m,
@@ -1,9 +1,9 @@
1
1
  import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
- import { P as V, A as P, u as C, F as O, o as G, G as h, X as B, t as L, q as x, x as U, B as q, I as F, Q as H, J as Q, K as $, U as j, N as k } from "./index-CZd7_ZdO.js";
2
+ import { B as V, A as O, u as C, F as P, q as B, G, X as h, t as L, x, I as U, J as q, K as F, M as H, P as j, R as k, U as K, Z as Q } from "./index-BHD0UBPk.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
- import { useQueryClient as K, useQuery as w } from "@tanstack/react-query";
4
+ import { useQueryClient as $, useQuery as w } from "@tanstack/react-query";
5
5
  const W = V(
6
- P,
6
+ O,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
9
  ), Y = ({
@@ -14,7 +14,7 @@ const W = V(
14
14
  }) => {
15
15
  const { t: n } = C();
16
16
  return /* @__PURE__ */ a(
17
- O,
17
+ P,
18
18
  {
19
19
  id: "delete-service-modal",
20
20
  testId: "delete-service-modal-test-id",
@@ -36,7 +36,7 @@ const W = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
39
- ], X = "app:appointments:manageServices", Z = "app:appointments:adminTab", z = "index-module_page__Gsfbu", J = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
39
+ ], Z = "app:appointments:manageServices", X = "app:appointments:adminTab", z = "index-module_page__Gsfbu", J = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
40
  page: z,
41
41
  noPrivilegeContainer: J,
42
42
  table: ee
@@ -49,7 +49,7 @@ function ie(e, i) {
49
49
  ...e.map((t) => ({
50
50
  key: t,
51
51
  header: i(
52
- `ADMIN_ALL_SERVICES_COLUMN_${G(t)}`
52
+ `ADMIN_ALL_SERVICES_COLUMN_${B(t)}`
53
53
  )
54
54
  })),
55
55
  {
@@ -75,28 +75,28 @@ function ae(e, i) {
75
75
  }));
76
76
  }
77
77
  const oe = () => {
78
- const { t: e } = C(), i = K(), { addNotification: t } = h(), { userPrivileges: s } = B(), { appointmentsConfig: n } = W(), [E, c] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
78
+ const { t: e } = C(), i = $(), { addNotification: t } = G(), { userPrivileges: s } = h(), { appointmentsConfig: n } = W(), [E, c] = I(null), [M, p] = I(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
- ], m = L(s, Z), M = L(
80
+ ], S = L(s, X), b = L(
81
81
  s,
82
- X
83
- ), S = _(
82
+ Z
83
+ ), m = _(
84
84
  () => te(l),
85
85
  [l]
86
- ), { data: A, isLoading: v, isError: D } = w({
86
+ ), { data: A, isLoading: v, isError: R } = w({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: x,
89
- enabled: m
90
- }), N = _(
89
+ enabled: S
90
+ }), D = _(
91
91
  () => ie(l, e),
92
92
  [l]
93
- ), R = _(
94
- () => ae(A ?? [], S),
95
- [A, S]
93
+ ), N = _(
94
+ () => ae(A ?? [], m),
95
+ [A, m]
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
99
- await k(E.id), t({
99
+ await Q(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",
@@ -112,16 +112,16 @@ const oe = () => {
112
112
  p(!1);
113
113
  }
114
114
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ a(
115
- $,
115
+ k,
116
116
  {
117
117
  id: `delete-service-${r.id}-btn`,
118
118
  testId: `delete-service-${r.id}-btn-test-id`,
119
119
  "aria-label": `delete-service-${r.id}-btn-aria-label`,
120
120
  kind: "ghost",
121
121
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
122
- disabled: !M,
122
+ disabled: !b,
123
123
  onClick: () => c(r),
124
- children: /* @__PURE__ */ a(j, {})
124
+ children: /* @__PURE__ */ a(K, {})
125
125
  }
126
126
  ) : u.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", f = [
127
127
  { id: "home", label: e("BREADCRUMB_HOME"), href: U },
@@ -130,8 +130,8 @@ const oe = () => {
130
130
  return /* @__PURE__ */ a(
131
131
  q,
132
132
  {
133
- header: /* @__PURE__ */ a(H, { breadcrumbItems: f, userMenu: /* @__PURE__ */ a(Q, {}) }),
134
- main: m ? /* @__PURE__ */ y(
133
+ header: /* @__PURE__ */ a(H, { breadcrumbItems: f, userMenu: /* @__PURE__ */ a(j, {}) }),
134
+ main: S ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
137
137
  id: "all-appointment-service-page",
@@ -144,11 +144,11 @@ const oe = () => {
144
144
  {
145
145
  id: "all-services",
146
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
147
- headers: N,
148
- rows: R,
147
+ headers: D,
148
+ rows: N,
149
149
  ariaLabel: "all-services-table",
150
150
  loading: v,
151
- errorStateMessage: D ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
151
+ errorStateMessage: R ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
152
152
  emptyStateMessage: e("ADMIN_ALL_SERVICES_EMPTY_MESSAGE"),
153
153
  renderCell: T,
154
154
  className: d.table
@@ -158,7 +158,7 @@ const oe = () => {
158
158
  Y,
159
159
  {
160
160
  serviceName: E.name,
161
- isDeleting: b,
161
+ isDeleting: M,
162
162
  onConfirm: g,
163
163
  onCancel: () => c(null)
164
164
  }