@bahmni/appointments-app 0.0.1-dev.267 → 0.0.1-dev.268

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,19 +1,19 @@
1
1
  import { jsx as s, jsxs as p } from "react/jsx-runtime";
2
- import { T as g, S, U as B, V as P, a0 as Z, b, a1 as ee, a2 as te, a3 as ie, Q as ae, a4 as ne, u as K, a5 as U, a6 as re, a7 as se, a8 as le, a9 as y, aa as O, ab as V, ac as C, ad as F, ae as Y, af as x, g as de, q as oe, a as ce, z as k, s as me, ag as Ae, ah as Ie, ai as ue, t as _e, C as Te, aj as Le } from "./index-Dd5zlHOS.js";
3
- import { useState as h, useMemo as N, useEffect as $, useRef as ve, useCallback as E } from "react";
4
- const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", Me = () => {
2
+ import { U as g, V as S, Z as B, $ as P, a0 as X, b as M, a1 as ee, a2 as te, a3 as ie, P as ae, a4 as ne, a as K, a5 as f, a6 as re, a7 as se, a8 as le, a9 as E, aa as O, ab as V, ac as C, ad as F, ae as Y, af as x, f as de, B as oe, h as ce, D as k, E as me, ag as Ae, ah as Ie, ai as ue, H as _e, I as Te, aj as Le } from "./index-C5F6zTvl.js";
3
+ import { useState as h, useMemo as N, useEffect as $, useRef as ve, useCallback as y } from "react";
4
+ const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", De = () => {
5
5
  try {
6
- return Z().uuid;
6
+ return X().uuid;
7
7
  } catch {
8
8
  return "";
9
9
  }
10
- }, w = (e) => ({
10
+ }, G = (e) => ({
11
11
  id: "",
12
12
  text: e
13
- }), be = (e) => ({
13
+ }), Me = (e) => ({
14
14
  display: e,
15
15
  uuid: ""
16
- }), De = (e, a) => {
16
+ }), be = (e, a) => {
17
17
  const n = e.map((t) => ({
18
18
  id: t.uuid,
19
19
  text: t.name,
@@ -24,7 +24,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
24
24
  text: a,
25
25
  isSelectAll: !0
26
26
  }), n;
27
- }, ye = (e, a) => {
27
+ }, Ee = (e, a) => {
28
28
  const n = e.map((t) => ({
29
29
  id: t.uuid,
30
30
  text: t.person?.display,
@@ -35,7 +35,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
35
35
  text: a,
36
36
  isSelectAll: !0
37
37
  }), n;
38
- }, Ee = (e, a) => ({
38
+ }, ye = (e, a) => ({
39
39
  locationUuid: e.locationUuid,
40
40
  startDate: g(e.startDate, a, !1, P).formattedResult,
41
41
  startTime: B(
@@ -61,8 +61,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
61
61
  locationName: e.location.name,
62
62
  appointmentServiceName: e.service?.name ?? a("ADMIN_UNAVAILABILITY_ALL"),
63
63
  providerName: e.provider?.name ?? a("ADMIN_UNAVAILABILITY_ALL")
64
- }), H = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), Ue = (e, a) => {
65
- const n = Ee(
64
+ }), H = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), fe = (e, a) => {
65
+ const n = ye(
66
66
  {
67
67
  locationUuid: e.locationUuid,
68
68
  startDate: e.startDate,
@@ -81,7 +81,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
81
81
  providerUuid: l
82
82
  }))
83
83
  );
84
- }, fe = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
84
+ }, Ue = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
85
85
  uuid: a.resource?.id ?? "",
86
86
  display: a.resource?.name ?? "",
87
87
  childLocations: []
@@ -90,14 +90,14 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
90
90
  data: e,
91
91
  isLoading: a,
92
92
  isError: n
93
- } = b({
93
+ } = M({
94
94
  queryKey: ["currentUser"],
95
95
  queryFn: ee
96
96
  }), {
97
97
  data: t = [],
98
98
  isLoading: d,
99
99
  isError: c
100
- } = b({
100
+ } = M({
101
101
  queryKey: ["providerLoginLocations", e?.uuid],
102
102
  queryFn: async () => {
103
103
  const I = await te(
@@ -105,12 +105,12 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
105
105
  );
106
106
  if (I.length === 0) {
107
107
  const u = await ie(
108
- G
108
+ w
109
109
  );
110
- return fe(u);
110
+ return Ue(u);
111
111
  }
112
112
  return I.filter(
113
- (u) => u.tags?.some((v) => v.display === G)
113
+ (u) => u.tags?.some((v) => v.display === w)
114
114
  );
115
115
  },
116
116
  enabled: !!e?.uuid
@@ -118,14 +118,14 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
118
118
  data: A = [],
119
119
  isLoading: L,
120
120
  isError: m
121
- } = b({
121
+ } = M({
122
122
  queryKey: ["appointmentServices"],
123
123
  queryFn: ae
124
124
  }), {
125
125
  data: r = [],
126
126
  isLoading: l,
127
127
  isError: _
128
- } = b({
128
+ } = M({
129
129
  queryKey: ["providers"],
130
130
  queryFn: ne
131
131
  });
@@ -152,7 +152,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
152
152
  onClearErrors: n
153
153
  }) => {
154
154
  const { t } = K(), { loginLocations: d, services: c, providers: A, isLoading: L, isError: m } = Re(), [r, l] = h({
155
- locationUuid: Me(),
155
+ locationUuid: De(),
156
156
  selectedServiceItems: [],
157
157
  selectedProviderItems: [],
158
158
  startDate: null,
@@ -167,26 +167,26 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
167
167
  ), I = N(
168
168
  () => A.filter(
169
169
  (i) => i.attributes?.some(
170
- (D) => D.attributeType?.display === Ne && D.value
170
+ (b) => b.attributeType?.display === Ne && b.value
171
171
  )
172
172
  ),
173
173
  [A]
174
174
  ), u = N(
175
- () => U(!1, !1, d, be, {
175
+ () => f(!1, !1, d, Me, {
176
176
  loading: "",
177
177
  error: "",
178
178
  empty: t("ADMIN_UNAVAILABILITY_FORM_NO_LOCATIONS")
179
179
  }),
180
180
  [d]
181
181
  ), v = N(
182
- () => U(
182
+ () => f(
183
183
  !1,
184
184
  !1,
185
- De(
185
+ be(
186
186
  _,
187
187
  t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
188
188
  ),
189
- w,
189
+ G,
190
190
  {
191
191
  loading: "",
192
192
  error: "",
@@ -194,15 +194,15 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
194
194
  }
195
195
  ),
196
196
  [_]
197
- ), M = N(
198
- () => U(
197
+ ), D = N(
198
+ () => f(
199
199
  !1,
200
200
  !1,
201
- ye(
201
+ Ee(
202
202
  I,
203
203
  t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
204
204
  ),
205
- w,
205
+ G,
206
206
  {
207
207
  loading: "",
208
208
  error: "",
@@ -219,9 +219,9 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
219
219
  }, [v]), $(() => {
220
220
  I.length > 0 && l((i) => ({
221
221
  ...i,
222
- selectedProviderItems: M
222
+ selectedProviderItems: D
223
223
  }));
224
- }, [M]), a.current = {
224
+ }, [D]), a.current = {
225
225
  ...r,
226
226
  filteredServicesCount: _.length,
227
227
  availableProvidersCount: I.length
@@ -280,7 +280,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
280
280
  className: o.grid,
281
281
  children: [
282
282
  /* @__PURE__ */ p(
283
- y,
283
+ E,
284
284
  {
285
285
  id: "unavailability-form-start-date-time",
286
286
  "data-testid": "unavailability-form-start-date-time-test-id",
@@ -355,7 +355,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
355
355
  }
356
356
  ),
357
357
  /* @__PURE__ */ p(
358
- y,
358
+ E,
359
359
  {
360
360
  id: "unavailability-form-end-date-time",
361
361
  "data-testid": "unavailability-form-end-date-time-test-id",
@@ -430,7 +430,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
430
430
  }
431
431
  ),
432
432
  /* @__PURE__ */ s(
433
- y,
433
+ E,
434
434
  {
435
435
  id: "unavailability-form-service",
436
436
  "data-testid": "unavailability-form-service-test-id",
@@ -458,7 +458,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
458
458
  }
459
459
  ),
460
460
  /* @__PURE__ */ s(
461
- y,
461
+ E,
462
462
  {
463
463
  id: "unavailability-form-provider",
464
464
  "data-testid": "unavailability-form-provider-test-id",
@@ -474,7 +474,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
474
474
  "data-testid": "provider-multiselect",
475
475
  titleText: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
476
476
  placeholder: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
477
- items: M,
477
+ items: D,
478
478
  itemToString: (i) => i?.text ?? "",
479
479
  selectedItems: r.selectedProviderItems,
480
480
  onChange: (i) => l({
@@ -500,7 +500,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
500
500
  ), I = k(n, [
501
501
  pe,
502
502
  q
503
- ]), { data: u, isLoading: v, isError: M } = b({
503
+ ]), { data: u, isLoading: v, isError: D } = M({
504
504
  queryKey: ["appointmentUnavailabilities"],
505
505
  queryFn: Le,
506
506
  enabled: _
@@ -512,7 +512,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
512
512
  href: "/appointments"
513
513
  },
514
514
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
515
- ], D = N(() => [
515
+ ], b = N(() => [
516
516
  { key: "startDateTime", header: e("ADMIN_UNAVAILABILITY_COLUMN_START") },
517
517
  { key: "endDateTime", header: e("ADMIN_UNAVAILABILITY_COLUMN_END") },
518
518
  {
@@ -527,7 +527,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
527
527
  key: "providerName",
528
528
  header: e("ADMIN_UNAVAILABILITY_COLUMN_PROVIDER")
529
529
  }
530
- ], [e]), Q = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), f = E(
530
+ ], [e]), j = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), U = y(
531
531
  async (T) => {
532
532
  L(!0);
533
533
  try {
@@ -550,19 +550,19 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
550
550
  }
551
551
  },
552
552
  [t, a, e]
553
- ), j = E(async () => {
553
+ ), Q = y(async () => {
554
554
  if (!m.current) return;
555
555
  const T = he(m.current, e);
556
- l(T), !(Object.keys(T).length > 0) && await f(Ue(m.current, e));
557
- }, [e, f]), z = E(
556
+ l(T), !(Object.keys(T).length > 0) && await U(fe(m.current, e));
557
+ }, [e, U]), z = y(
558
558
  (T) => {
559
- l((J) => {
560
- const R = { ...J };
561
- return T.forEach((X) => delete R[X]), R;
559
+ l((W) => {
560
+ const R = { ...W };
561
+ return T.forEach((Z) => delete R[Z]), R;
562
562
  });
563
563
  },
564
564
  []
565
- ), W = E(() => {
565
+ ), J = y(() => {
566
566
  c(!1), m.current = null, l({});
567
567
  }, []);
568
568
  return /* @__PURE__ */ s(
@@ -584,11 +584,11 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
584
584
  "data-testid": "appointment-unavailability-actions-table-test-id",
585
585
  "aria-label": "appointment-unavailability-actions-table-aria-label",
586
586
  title: e("ADMIN_UNAVAILABILITY_TITLE"),
587
- headers: D,
588
- rows: Q,
587
+ headers: b,
588
+ rows: j,
589
589
  ariaLabel: "unavailability-table",
590
590
  loading: v,
591
- errorStateMessage: M ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
591
+ errorStateMessage: D ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
592
592
  emptyStateMessage: e("ADMIN_UNAVAILABILITY_EMPTY_MESSAGE"),
593
593
  actionButton: !d && I ? {
594
594
  label: e("ADMIN_UNAVAILABILITY_ADD_BUTTON"),
@@ -606,10 +606,10 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
606
606
  "aria-label": "appointment-unavailability-form-panel-aria-label",
607
607
  title: e("ADMIN_UNAVAILABILITY_FORM_TITLE"),
608
608
  primaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_ADD"),
609
- onPrimaryButtonClick: j,
609
+ onPrimaryButtonClick: Q,
610
610
  isPrimaryButtonDisabled: A,
611
611
  secondaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_CANCEL"),
612
- onSecondaryButtonClick: W,
612
+ onSecondaryButtonClick: J,
613
613
  isSecondaryButtonDisabled: A,
614
614
  content: /* @__PURE__ */ s(
615
615
  ke,