@bahmni/appointments-app 0.0.1-dev.310 → 0.0.1-dev.311
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-CaUlpFeN-tP3Ae1Oq.js → DocumentsTable-C8zEI_he-2KD5F8_m.js} +33 -33
- package/dist/FormsTable-DARy4z7A-DjNAyXxz.js +234 -0
- package/dist/{LNWAZHJI-GlIhJZrA.js → LNWAZHJI-BQE7vbvB.js} +2 -2
- package/dist/{MWZ6AO7Z-CApsd_-m.js → MWZ6AO7Z-Ca0fvOMO.js} +2 -2
- package/dist/{Observations-BIksHFko-BwXwvrEO.js → Observations-B7DE4zkT-ILw7iMaR.js} +60 -60
- package/dist/{YPM2AS64-BLWysMFu.js → YPM2AS64-Ctp63X6-.js} +1 -1
- package/dist/{index-Cx_n4bX4.js → index-CQHGL6-x.js} +65068 -62155
- package/dist/{index-oGx1tICP.js → index-DTJk38NK.js} +18 -18
- package/dist/{index-BqA0gDZR.js → index-X-cC4Hdr.js} +46 -46
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-DQSl0827-Dd7VMHeO.js +0 -234
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as y } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { j as V, k as P, u as C, P as O, o as h, n as B, p as x, q as L, s as G, w as U, F as q, y as F, J as H, B as j, U as k, K as w } from "./index-CQHGL6-x.js";
|
|
3
3
|
import { useState as I, useMemo as _ } from "react";
|
|
4
|
-
import { useQueryClient as K, useQuery as
|
|
5
|
-
const
|
|
4
|
+
import { useQueryClient as K, useQuery as $ } from "@tanstack/react-query";
|
|
5
|
+
const Q = V(
|
|
6
6
|
P,
|
|
7
7
|
"useAppointmentsConfig",
|
|
8
8
|
"AppointmentsConfigProvider"
|
|
9
|
-
),
|
|
9
|
+
), W = ({
|
|
10
10
|
serviceName: e,
|
|
11
11
|
isDeleting: i,
|
|
12
12
|
onConfirm: t,
|
|
@@ -36,7 +36,7 @@ const J = V(
|
|
|
36
36
|
"speciality",
|
|
37
37
|
"durationMins",
|
|
38
38
|
"description"
|
|
39
|
-
],
|
|
39
|
+
], J = "app:appointments:manageServices", Y = "app:appointments:adminTab", Z = "index-module_page__Gsfbu", z = "index-module_noPrivilegeContainer__Pu5WZ", X = "index-module_table__GAPmb", d = {
|
|
40
40
|
page: Z,
|
|
41
41
|
noPrivilegeContainer: z,
|
|
42
42
|
table: X
|
|
@@ -75,17 +75,17 @@ function ie(e, i) {
|
|
|
75
75
|
}));
|
|
76
76
|
}
|
|
77
77
|
const le = () => {
|
|
78
|
-
const { t: e } = C(), i = K(), { addNotification: t } = B(), { userPrivileges: s } =
|
|
78
|
+
const { t: e } = C(), i = K(), { addNotification: t } = B(), { userPrivileges: s } = x(), { appointmentsConfig: a } = Q(), [E, c] = I(null), [b, p] = I(!1), l = a?.serviceTableFields ?? [
|
|
79
79
|
...u
|
|
80
|
-
], m = L(s, Y),
|
|
80
|
+
], m = L(s, Y), M = L(
|
|
81
81
|
s,
|
|
82
|
-
|
|
82
|
+
J
|
|
83
83
|
), S = _(
|
|
84
84
|
() => ee(l),
|
|
85
85
|
[l]
|
|
86
|
-
), { data: A, isLoading: v, isError: D } =
|
|
86
|
+
), { data: A, isLoading: v, isError: D } = $({
|
|
87
87
|
queryKey: ["allAppointmentServices"],
|
|
88
|
-
queryFn:
|
|
88
|
+
queryFn: G,
|
|
89
89
|
enabled: m
|
|
90
90
|
}), N = _(
|
|
91
91
|
() => te(l, e),
|
|
@@ -96,7 +96,7 @@ const le = () => {
|
|
|
96
96
|
), g = async () => {
|
|
97
97
|
p(!0);
|
|
98
98
|
try {
|
|
99
|
-
await
|
|
99
|
+
await w(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 le = () => {
|
|
|
112
112
|
p(!1);
|
|
113
113
|
}
|
|
114
114
|
}, T = (r, o) => o === "actions" ? /* @__PURE__ */ n(
|
|
115
|
-
|
|
115
|
+
j,
|
|
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: !
|
|
122
|
+
disabled: !M,
|
|
123
123
|
onClick: () => c(r),
|
|
124
|
-
children: /* @__PURE__ */ n(
|
|
124
|
+
children: /* @__PURE__ */ n(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,7 +130,7 @@ const le = () => {
|
|
|
130
130
|
return /* @__PURE__ */ n(
|
|
131
131
|
q,
|
|
132
132
|
{
|
|
133
|
-
header: /* @__PURE__ */ n(
|
|
133
|
+
header: /* @__PURE__ */ n(H, { 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
|
+
F,
|
|
144
144
|
{
|
|
145
145
|
id: "all-services",
|
|
146
146
|
title: e("ADMIN_ALL_SERVICES_TITLE"),
|
|
@@ -155,10 +155,10 @@ const le = () => {
|
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
157
|
E && /* @__PURE__ */ n(
|
|
158
|
-
|
|
158
|
+
W,
|
|
159
159
|
{
|
|
160
160
|
serviceName: E.name,
|
|
161
|
-
isDeleting:
|
|
161
|
+
isDeleting: b,
|
|
162
162
|
onConfirm: g,
|
|
163
163
|
onCancel: () => c(null)
|
|
164
164
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useState as g, useMemo as N, useEffect as
|
|
2
|
+
import { Q as f, R as B, T as O, V, X as z, Y as ee, Z as te, a0 as ie, s 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 k, ab as x, ac as $, p as oe, n as de, q as H, ad as ce, w as me, ae as Ae, af as Ie, ag as ue, y as _e, J as Te } from "./index-CQHGL6-x.js";
|
|
3
|
+
import { useState as g, useMemo as N, useEffect as h, useRef as Le, useCallback as U } from "react";
|
|
4
4
|
import { useQuery as M, useQueryClient as ve } from "@tanstack/react-query";
|
|
5
5
|
const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", be = () => {
|
|
6
6
|
try {
|
|
@@ -11,10 +11,10 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
11
11
|
}, G = (e) => ({
|
|
12
12
|
id: "",
|
|
13
13
|
text: e
|
|
14
|
-
}),
|
|
14
|
+
}), ye = (e) => ({
|
|
15
15
|
display: e,
|
|
16
16
|
uuid: ""
|
|
17
|
-
}),
|
|
17
|
+
}), De = (e, a) => {
|
|
18
18
|
const n = e.map((t) => ({
|
|
19
19
|
id: t.uuid,
|
|
20
20
|
text: t.name,
|
|
@@ -47,9 +47,9 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
47
47
|
}), Ue = (e, a) => {
|
|
48
48
|
const n = {}, t = a("ADMIN_UNAVAILABILITY_FORM_REQUIRED");
|
|
49
49
|
if (e.locationUuid || (n.location = t), e.startDate || (n.startDate = t), e.startTime || (n.startTime = t), e.endDate || (n.endDate = t), e.endTime || (n.endTime = t), e.startDate && e.startTime && e.endDate && e.endTime && e.startDate.toDateString() === e.endDate.toDateString()) {
|
|
50
|
-
const o =
|
|
50
|
+
const o = B(
|
|
51
51
|
`${e.startTime} ${e.startTimePeriod}`
|
|
52
|
-
), c =
|
|
52
|
+
), c = B(
|
|
53
53
|
`${e.endTime} ${e.endTimePeriod}`
|
|
54
54
|
);
|
|
55
55
|
o !== null && c !== null && c <= o && (n.dateTime = a("ADMIN_UNAVAILABILITY_DATETIME_ERROR_MESSAGE"));
|
|
@@ -86,7 +86,7 @@ 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
|
-
})),
|
|
89
|
+
})), he = () => {
|
|
90
90
|
const {
|
|
91
91
|
data: e,
|
|
92
92
|
isLoading: a,
|
|
@@ -137,22 +137,22 @@ 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
|
-
},
|
|
141
|
-
formContent:
|
|
142
|
-
formField:
|
|
143
|
-
loading:
|
|
140
|
+
}, Se = "UnavailabilityForm-module_formContent__WmNHR", Pe = "UnavailabilityForm-module_formField__8he7o", Be = "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", ke = "UnavailabilityForm-module_timePicker__DHNpK", d = {
|
|
141
|
+
formContent: Se,
|
|
142
|
+
formField: Pe,
|
|
143
|
+
loading: Be,
|
|
144
144
|
error: Oe,
|
|
145
145
|
grid: Ve,
|
|
146
146
|
column: Fe,
|
|
147
147
|
dateTimeColumn: Ce,
|
|
148
148
|
datePicker: Ye,
|
|
149
|
-
timePicker:
|
|
150
|
-
},
|
|
149
|
+
timePicker: ke
|
|
150
|
+
}, xe = ({
|
|
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 } =
|
|
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 Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
173
173
|
),
|
|
174
174
|
[A]
|
|
175
175
|
), u = N(
|
|
176
|
-
() => R(!1, !1, o,
|
|
176
|
+
() => R(!1, !1, o, ye, {
|
|
177
177
|
loading: "",
|
|
178
178
|
error: "",
|
|
179
179
|
empty: t("ADMIN_UNAVAILABILITY_FORM_NO_LOCATIONS")
|
|
@@ -183,7 +183,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
183
183
|
() => R(
|
|
184
184
|
!1,
|
|
185
185
|
!1,
|
|
186
|
-
|
|
186
|
+
De(
|
|
187
187
|
_,
|
|
188
188
|
t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
|
|
189
189
|
),
|
|
@@ -195,7 +195,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
197
|
[_]
|
|
198
|
-
),
|
|
198
|
+
), y = N(
|
|
199
199
|
() => R(
|
|
200
200
|
!1,
|
|
201
201
|
!1,
|
|
@@ -212,26 +212,26 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
212
212
|
),
|
|
213
213
|
[I]
|
|
214
214
|
);
|
|
215
|
-
return
|
|
215
|
+
return h(() => {
|
|
216
216
|
if (o.length === 0) return;
|
|
217
217
|
const i = be(), p = o.some(
|
|
218
|
-
(
|
|
218
|
+
(D) => D.uuid === i
|
|
219
219
|
);
|
|
220
|
-
s((
|
|
221
|
-
...
|
|
220
|
+
s((D) => ({
|
|
221
|
+
...D,
|
|
222
222
|
locationUuid: p ? i : ""
|
|
223
223
|
}));
|
|
224
|
-
}, [o]),
|
|
224
|
+
}, [o]), h(() => {
|
|
225
225
|
_.length > 0 && s((i) => ({
|
|
226
226
|
...i,
|
|
227
227
|
selectedServiceItems: v
|
|
228
228
|
}));
|
|
229
|
-
}, [v]),
|
|
229
|
+
}, [v]), h(() => {
|
|
230
230
|
I.length > 0 && s((i) => ({
|
|
231
231
|
...i,
|
|
232
|
-
selectedProviderItems:
|
|
232
|
+
selectedProviderItems: y
|
|
233
233
|
}));
|
|
234
|
-
}, [
|
|
234
|
+
}, [y]), a.current = {
|
|
235
235
|
...l,
|
|
236
236
|
filteredServicesCount: _.length,
|
|
237
237
|
availableProvidersCount: I.length
|
|
@@ -327,7 +327,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
327
327
|
}
|
|
328
328
|
),
|
|
329
329
|
/* @__PURE__ */ r(
|
|
330
|
-
|
|
330
|
+
k,
|
|
331
331
|
{
|
|
332
332
|
id: "start-time",
|
|
333
333
|
"data-testid": "start-time-input",
|
|
@@ -342,7 +342,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
342
342
|
use24HourFormat: !1,
|
|
343
343
|
className: d.timePicker,
|
|
344
344
|
children: /* @__PURE__ */ b(
|
|
345
|
-
|
|
345
|
+
x,
|
|
346
346
|
{
|
|
347
347
|
id: "start-time-period",
|
|
348
348
|
"data-testid": "start-time-period-select",
|
|
@@ -402,7 +402,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
402
402
|
}
|
|
403
403
|
),
|
|
404
404
|
/* @__PURE__ */ r(
|
|
405
|
-
|
|
405
|
+
k,
|
|
406
406
|
{
|
|
407
407
|
id: "end-time",
|
|
408
408
|
"data-testid": "end-time-input",
|
|
@@ -417,7 +417,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
417
417
|
use24HourFormat: !1,
|
|
418
418
|
className: d.timePicker,
|
|
419
419
|
children: /* @__PURE__ */ b(
|
|
420
|
-
|
|
420
|
+
x,
|
|
421
421
|
{
|
|
422
422
|
id: "end-time-period",
|
|
423
423
|
"data-testid": "end-time-period-select",
|
|
@@ -450,7 +450,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
450
450
|
lg: 8,
|
|
451
451
|
className: d.column,
|
|
452
452
|
children: /* @__PURE__ */ r(
|
|
453
|
-
|
|
453
|
+
$,
|
|
454
454
|
{
|
|
455
455
|
id: "service-multiselect",
|
|
456
456
|
"data-testid": "service-multiselect",
|
|
@@ -478,13 +478,13 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
478
478
|
lg: 8,
|
|
479
479
|
className: d.column,
|
|
480
480
|
children: /* @__PURE__ */ r(
|
|
481
|
-
|
|
481
|
+
$,
|
|
482
482
|
{
|
|
483
483
|
id: "provider-multiselect",
|
|
484
484
|
"data-testid": "provider-multiselect",
|
|
485
485
|
titleText: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
|
|
486
486
|
placeholder: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
|
|
487
|
-
items:
|
|
487
|
+
items: y,
|
|
488
488
|
itemToString: (i) => i?.text ?? "",
|
|
489
489
|
selectedItems: l.selectedProviderItems,
|
|
490
490
|
onChange: (i) => s({
|
|
@@ -501,16 +501,16 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
501
501
|
]
|
|
502
502
|
}
|
|
503
503
|
);
|
|
504
|
-
},
|
|
505
|
-
page:
|
|
504
|
+
}, $e = "index-module_page__s2h2y", He = {
|
|
505
|
+
page: $e
|
|
506
506
|
}, Qe = () => {
|
|
507
|
-
const { t: e } = Q(), a = ve(), { userPrivileges: n } = oe(), { addNotification: t } = de(), [o, c] = g(!1), [A, L] = g(!1), m = Le(null), [l, s] = g({}), _ =
|
|
507
|
+
const { t: e } = Q(), a = ve(), { userPrivileges: n } = oe(), { addNotification: t } = de(), [o, c] = g(!1), [A, L] = g(!1), m = Le(null), [l, s] = g({}), _ = H(
|
|
508
508
|
n,
|
|
509
509
|
q
|
|
510
|
-
), I =
|
|
510
|
+
), I = H(n, [
|
|
511
511
|
pe,
|
|
512
512
|
q
|
|
513
|
-
]), { data: u, isLoading: v, isError:
|
|
513
|
+
]), { data: u, isLoading: v, isError: y } = M({
|
|
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]),
|
|
540
|
+
], [e]), D = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), S = U(
|
|
541
541
|
async (T) => {
|
|
542
542
|
L(!0);
|
|
543
543
|
try {
|
|
@@ -563,12 +563,12 @@ 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
|
|
567
|
-
}, [e,
|
|
566
|
+
s(T), !(Object.keys(T).length > 0) && await S(fe(m.current, e));
|
|
567
|
+
}, [e, S]), J = U(
|
|
568
568
|
(T) => {
|
|
569
569
|
s((X) => {
|
|
570
|
-
const
|
|
571
|
-
return T.forEach((Z) => delete
|
|
570
|
+
const P = { ...X };
|
|
571
|
+
return T.forEach((Z) => delete P[Z]), P;
|
|
572
572
|
});
|
|
573
573
|
},
|
|
574
574
|
[]
|
|
@@ -586,7 +586,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
586
586
|
id: "appointment-unavailability-page",
|
|
587
587
|
"data-testid": "appointment-unavailability-page-test-id",
|
|
588
588
|
"aria-label": "appointment-unavailability-page-aria-label",
|
|
589
|
-
className:
|
|
589
|
+
className: He.page,
|
|
590
590
|
children: /* @__PURE__ */ r(
|
|
591
591
|
_e,
|
|
592
592
|
{
|
|
@@ -595,10 +595,10 @@ 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:
|
|
598
|
+
rows: D,
|
|
599
599
|
ariaLabel: "unavailability-table",
|
|
600
600
|
loading: v,
|
|
601
|
-
errorStateMessage:
|
|
601
|
+
errorStateMessage: y ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
|
|
602
602
|
emptyStateMessage: e("ADMIN_UNAVAILABILITY_EMPTY_MESSAGE"),
|
|
603
603
|
actionButton: !o && I ? {
|
|
604
604
|
label: e("ADMIN_UNAVAILABILITY_ADD_BUTTON"),
|
|
@@ -622,7 +622,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
622
622
|
onSecondaryButtonClick: W,
|
|
623
623
|
isSecondaryButtonDisabled: A,
|
|
624
624
|
content: /* @__PURE__ */ r(
|
|
625
|
-
|
|
625
|
+
xe,
|
|
626
626
|
{
|
|
627
627
|
errors: l,
|
|
628
628
|
formDataRef: m,
|