@bahmni/appointments-app 0.0.1-dev.270 → 0.0.1-dev.272
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-DEvlbfDU-DBvYfKLo.js → DocumentsTable-CBd3EBSh-C3cdWHf5.js} +74 -73
- package/dist/{FormsTable-DBD0f2fD-Dy5P9UHL.js → FormsTable-DMJEteY7-DW_3wjLN.js} +66 -65
- package/dist/{LNWAZHJI-BpC73qZO.js → LNWAZHJI-DRzT_bsO.js} +7 -7
- package/dist/{MWZ6AO7Z-DOSG3gOY.js → MWZ6AO7Z-DBHLDqXq.js} +7 -7
- package/dist/{Observations-D6WZol9t-eMKYB_YW.js → Observations-CKw5OQxh-9qkJdVBD.js} +64 -63
- package/dist/{YPM2AS64-DxYKUPn5.js → YPM2AS64-CJzl5blR.js} +1 -1
- package/dist/{index-DnqR3ObO.js → index-3Loy8tQq.js} +145 -144
- package/dist/{index-DVLxloPw.js → index-B2wrexoQ.js} +32 -31
- package/dist/{index-U58J_2Iy.js → index-Btq8SR5P.js} +37912 -39807
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { useState as
|
|
4
|
-
|
|
1
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { P as g, U as S, V as B, W as P, Z as X, $ as ee, _ as te, a0 as ie, D as ae, a1 as ne, a as K, a2 as f, a3 as le, a4 as re, a5 as se, a6 as M, a7 as O, a8 as V, a9 as F, aa as C, ab as Y, ac as x, x as oe, h as de, B as k, ad as ce, E as me, ae as Ae, af as Ie, ag as ue, H as _e, I as Te } from "./index-Btq8SR5P.js";
|
|
3
|
+
import { useState as U, useMemo as N, useEffect as $, useRef as Le, useCallback as E } from "react";
|
|
4
|
+
import { useQuery as D, useQueryClient as ve } from "@tanstack/react-query";
|
|
5
|
+
const Ne = "Available for appointments", q = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", w = "Appointment Location", be = () => {
|
|
5
6
|
try {
|
|
6
7
|
return X().uuid;
|
|
7
8
|
} catch {
|
|
@@ -10,10 +11,10 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
10
11
|
}, G = (e) => ({
|
|
11
12
|
id: "",
|
|
12
13
|
text: e
|
|
13
|
-
}),
|
|
14
|
+
}), De = (e) => ({
|
|
14
15
|
display: e,
|
|
15
16
|
uuid: ""
|
|
16
|
-
}),
|
|
17
|
+
}), ye = (e, a) => {
|
|
17
18
|
const n = e.map((t) => ({
|
|
18
19
|
id: t.uuid,
|
|
19
20
|
text: t.name,
|
|
@@ -24,7 +25,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
24
25
|
text: a,
|
|
25
26
|
isSelectAll: !0
|
|
26
27
|
}), n;
|
|
27
|
-
},
|
|
28
|
+
}, Me = (e, a) => {
|
|
28
29
|
const n = e.map((t) => ({
|
|
29
30
|
id: t.uuid,
|
|
30
31
|
text: t.person?.display,
|
|
@@ -35,7 +36,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
35
36
|
text: a,
|
|
36
37
|
isSelectAll: !0
|
|
37
38
|
}), n;
|
|
38
|
-
},
|
|
39
|
+
}, Ee = (e, a) => ({
|
|
39
40
|
locationUuid: e.locationUuid,
|
|
40
41
|
startDate: g(e.startDate, a, !1, P).formattedResult,
|
|
41
42
|
startTime: B(
|
|
@@ -43,15 +44,15 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
43
44
|
),
|
|
44
45
|
endDate: g(e.endDate, a, !1, P).formattedResult,
|
|
45
46
|
endTime: B(`${e.endTime} ${e.endTimePeriod}`)
|
|
46
|
-
}),
|
|
47
|
+
}), Ue = (e, a) => {
|
|
47
48
|
const n = {}, t = a("ADMIN_UNAVAILABILITY_FORM_REQUIRED");
|
|
48
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()) {
|
|
49
|
-
const
|
|
50
|
+
const o = S(
|
|
50
51
|
`${e.startTime} ${e.startTimePeriod}`
|
|
51
52
|
), c = S(
|
|
52
53
|
`${e.endTime} ${e.endTimePeriod}`
|
|
53
54
|
);
|
|
54
|
-
|
|
55
|
+
o !== null && c !== null && c <= o && (n.dateTime = a("ADMIN_UNAVAILABILITY_DATETIME_ERROR_MESSAGE"));
|
|
55
56
|
}
|
|
56
57
|
return n;
|
|
57
58
|
}, ge = (e, a) => ({
|
|
@@ -62,7 +63,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
62
63
|
appointmentServiceName: e.service?.name ?? a("ADMIN_UNAVAILABILITY_ALL"),
|
|
63
64
|
providerName: e.provider?.name ?? a("ADMIN_UNAVAILABILITY_ALL")
|
|
64
65
|
}), H = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), fe = (e, a) => {
|
|
65
|
-
const n =
|
|
66
|
+
const n = Ee(
|
|
66
67
|
{
|
|
67
68
|
locationUuid: e.locationUuid,
|
|
68
69
|
startDate: e.startDate,
|
|
@@ -73,31 +74,31 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
73
74
|
endTimePeriod: e.endTimePeriod
|
|
74
75
|
},
|
|
75
76
|
a
|
|
76
|
-
), t = H(e.selectedServiceItems),
|
|
77
|
+
), t = H(e.selectedServiceItems), o = H(e.selectedProviderItems), A = t.length === e.filteredServicesCount || t.length === 0 ? [void 0] : t, m = o.length === e.availableProvidersCount || o.length === 0 ? [void 0] : o;
|
|
77
78
|
return A.flatMap(
|
|
78
|
-
(
|
|
79
|
+
(l) => m.map((s) => ({
|
|
79
80
|
...n,
|
|
80
|
-
appointmentServiceUuid:
|
|
81
|
-
providerUuid:
|
|
81
|
+
appointmentServiceUuid: l,
|
|
82
|
+
providerUuid: s
|
|
82
83
|
}))
|
|
83
84
|
);
|
|
84
|
-
},
|
|
85
|
+
}, Re = (e) => !e.entry || e.entry.length === 0 ? [] : e.entry.map((a) => ({
|
|
85
86
|
uuid: a.resource?.id ?? "",
|
|
86
87
|
display: a.resource?.name ?? "",
|
|
87
88
|
childLocations: []
|
|
88
|
-
})),
|
|
89
|
+
})), he = () => {
|
|
89
90
|
const {
|
|
90
91
|
data: e,
|
|
91
92
|
isLoading: a,
|
|
92
93
|
isError: n
|
|
93
|
-
} =
|
|
94
|
+
} = D({
|
|
94
95
|
queryKey: ["currentUser"],
|
|
95
96
|
queryFn: ee
|
|
96
97
|
}), {
|
|
97
98
|
data: t = [],
|
|
98
|
-
isLoading:
|
|
99
|
+
isLoading: o,
|
|
99
100
|
isError: c
|
|
100
|
-
} =
|
|
101
|
+
} = D({
|
|
101
102
|
queryKey: ["providerLoginLocations", e?.uuid],
|
|
102
103
|
queryFn: async () => {
|
|
103
104
|
const I = await te(
|
|
@@ -107,7 +108,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
107
108
|
const u = await ie(
|
|
108
109
|
w
|
|
109
110
|
);
|
|
110
|
-
return
|
|
111
|
+
return Re(u);
|
|
111
112
|
}
|
|
112
113
|
return I.filter(
|
|
113
114
|
(u) => u.tags?.some((v) => v.display === w)
|
|
@@ -118,32 +119,32 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
118
119
|
data: A = [],
|
|
119
120
|
isLoading: L,
|
|
120
121
|
isError: m
|
|
121
|
-
} =
|
|
122
|
+
} = D({
|
|
122
123
|
queryKey: ["appointmentServices"],
|
|
123
124
|
queryFn: ae
|
|
124
125
|
}), {
|
|
125
|
-
data:
|
|
126
|
-
isLoading:
|
|
126
|
+
data: l = [],
|
|
127
|
+
isLoading: s,
|
|
127
128
|
isError: _
|
|
128
|
-
} =
|
|
129
|
+
} = D({
|
|
129
130
|
queryKey: ["providers"],
|
|
130
131
|
queryFn: ne
|
|
131
132
|
});
|
|
132
133
|
return {
|
|
133
134
|
loginLocations: t,
|
|
134
135
|
services: A,
|
|
135
|
-
providers:
|
|
136
|
-
isLoading: a ||
|
|
136
|
+
providers: l,
|
|
137
|
+
isLoading: a || o || L || s,
|
|
137
138
|
isError: n || c || m || _
|
|
138
139
|
};
|
|
139
|
-
}, Se = "
|
|
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 = {
|
|
140
141
|
formContent: Se,
|
|
141
142
|
formField: Be,
|
|
142
143
|
loading: Pe,
|
|
143
144
|
error: Oe,
|
|
144
145
|
grid: Ve,
|
|
145
|
-
column:
|
|
146
|
-
dateTimeColumn:
|
|
146
|
+
column: Fe,
|
|
147
|
+
dateTimeColumn: Ce,
|
|
147
148
|
datePicker: Ye,
|
|
148
149
|
timePicker: xe
|
|
149
150
|
}, ke = ({
|
|
@@ -151,8 +152,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
151
152
|
formDataRef: a,
|
|
152
153
|
onClearErrors: n
|
|
153
154
|
}) => {
|
|
154
|
-
const { t } = K(), { loginLocations:
|
|
155
|
-
locationUuid:
|
|
155
|
+
const { t } = K(), { loginLocations: o, services: c, providers: A, isLoading: L, isError: m } = he(), [l, s] = U({
|
|
156
|
+
locationUuid: be(),
|
|
156
157
|
selectedServiceItems: [],
|
|
157
158
|
selectedProviderItems: [],
|
|
158
159
|
startDate: null,
|
|
@@ -162,27 +163,27 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
162
163
|
endTime: "",
|
|
163
164
|
endTimePeriod: "AM"
|
|
164
165
|
}), _ = N(
|
|
165
|
-
() => c.filter((i) => i.location?.uuid ===
|
|
166
|
-
[c,
|
|
166
|
+
() => c.filter((i) => i.location?.uuid === l.locationUuid),
|
|
167
|
+
[c, l.locationUuid]
|
|
167
168
|
), I = N(
|
|
168
169
|
() => A.filter(
|
|
169
170
|
(i) => i.attributes?.some(
|
|
170
|
-
(
|
|
171
|
+
(y) => y.attributeType?.display === Ne && y.value
|
|
171
172
|
)
|
|
172
173
|
),
|
|
173
174
|
[A]
|
|
174
175
|
), u = N(
|
|
175
|
-
() => f(!1, !1,
|
|
176
|
+
() => f(!1, !1, o, De, {
|
|
176
177
|
loading: "",
|
|
177
178
|
error: "",
|
|
178
179
|
empty: t("ADMIN_UNAVAILABILITY_FORM_NO_LOCATIONS")
|
|
179
180
|
}),
|
|
180
|
-
[
|
|
181
|
+
[o]
|
|
181
182
|
), v = N(
|
|
182
183
|
() => f(
|
|
183
184
|
!1,
|
|
184
185
|
!1,
|
|
185
|
-
|
|
186
|
+
ye(
|
|
186
187
|
_,
|
|
187
188
|
t("ADMIN_UNAVAILABILITY_FORM_ALL_SERVICES")
|
|
188
189
|
),
|
|
@@ -194,11 +195,11 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
194
195
|
}
|
|
195
196
|
),
|
|
196
197
|
[_]
|
|
197
|
-
),
|
|
198
|
+
), b = N(
|
|
198
199
|
() => f(
|
|
199
200
|
!1,
|
|
200
201
|
!1,
|
|
201
|
-
|
|
202
|
+
Me(
|
|
202
203
|
I,
|
|
203
204
|
t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
|
|
204
205
|
),
|
|
@@ -212,32 +213,32 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
212
213
|
[I]
|
|
213
214
|
);
|
|
214
215
|
return $(() => {
|
|
215
|
-
_.length > 0 &&
|
|
216
|
+
_.length > 0 && s((i) => ({
|
|
216
217
|
...i,
|
|
217
218
|
selectedServiceItems: v
|
|
218
219
|
}));
|
|
219
220
|
}, [v]), $(() => {
|
|
220
|
-
I.length > 0 &&
|
|
221
|
+
I.length > 0 && s((i) => ({
|
|
221
222
|
...i,
|
|
222
|
-
selectedProviderItems:
|
|
223
|
+
selectedProviderItems: b
|
|
223
224
|
}));
|
|
224
|
-
}, [
|
|
225
|
-
...
|
|
225
|
+
}, [b]), a.current = {
|
|
226
|
+
...l,
|
|
226
227
|
filteredServicesCount: _.length,
|
|
227
228
|
availableProvidersCount: I.length
|
|
228
|
-
}, L ? /* @__PURE__ */
|
|
229
|
+
}, L ? /* @__PURE__ */ r(
|
|
229
230
|
"div",
|
|
230
231
|
{
|
|
231
232
|
"data-testid": "unavailability-form-skeleton",
|
|
232
|
-
className:
|
|
233
|
-
children: /* @__PURE__ */
|
|
233
|
+
className: d.formContent,
|
|
234
|
+
children: /* @__PURE__ */ r(le, { type: "multi", className: d.loading })
|
|
234
235
|
}
|
|
235
|
-
) : m ? /* @__PURE__ */
|
|
236
|
+
) : m ? /* @__PURE__ */ r(
|
|
236
237
|
"div",
|
|
237
238
|
{
|
|
238
239
|
id: "unavailability-form-error",
|
|
239
240
|
"data-testid": "unavailability-form-error",
|
|
240
|
-
className:
|
|
241
|
+
className: d.error,
|
|
241
242
|
children: t("ADMIN_UNAVAILABILITY_FORM_LOAD_ERROR_MESSAGE")
|
|
242
243
|
}
|
|
243
244
|
) : /* @__PURE__ */ p(
|
|
@@ -246,10 +247,10 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
246
247
|
id: "unavailability-form-content",
|
|
247
248
|
"data-testid": "unavailability-form-content-test-id",
|
|
248
249
|
"aria-label": "unavailability-form-content-aria-label",
|
|
249
|
-
className:
|
|
250
|
+
className: d.formContent,
|
|
250
251
|
children: [
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
|
|
252
|
+
/* @__PURE__ */ r("div", { className: d.formField, children: /* @__PURE__ */ r(
|
|
253
|
+
re,
|
|
253
254
|
{
|
|
254
255
|
id: "location-dropdown",
|
|
255
256
|
"data-testid": "location-dropdown",
|
|
@@ -257,12 +258,12 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
257
258
|
titleText: t("ADMIN_UNAVAILABILITY_FORM_LOCATION_LABEL"),
|
|
258
259
|
items: u,
|
|
259
260
|
itemToString: (i) => i?.display ?? "",
|
|
260
|
-
selectedItem:
|
|
261
|
-
(i) => i.uuid ===
|
|
261
|
+
selectedItem: l.locationUuid ? o.find(
|
|
262
|
+
(i) => i.uuid === l.locationUuid
|
|
262
263
|
) ?? null : null,
|
|
263
264
|
onChange: (i) => {
|
|
264
|
-
n(["location"]),
|
|
265
|
-
...
|
|
265
|
+
n(["location"]), s({
|
|
266
|
+
...l,
|
|
266
267
|
locationUuid: i.selectedItem?.uuid ?? "",
|
|
267
268
|
selectedServiceItems: []
|
|
268
269
|
});
|
|
@@ -272,15 +273,15 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
272
273
|
}
|
|
273
274
|
) }),
|
|
274
275
|
/* @__PURE__ */ p(
|
|
275
|
-
|
|
276
|
+
se,
|
|
276
277
|
{
|
|
277
278
|
id: "unavailability-form-grid",
|
|
278
279
|
"data-testid": "unavailability-form-grid-test-id",
|
|
279
280
|
"aria-label": "unavailability-form-grid-aria-label",
|
|
280
|
-
className:
|
|
281
|
+
className: d.grid,
|
|
281
282
|
children: [
|
|
282
283
|
/* @__PURE__ */ p(
|
|
283
|
-
|
|
284
|
+
M,
|
|
284
285
|
{
|
|
285
286
|
id: "unavailability-form-start-date-time",
|
|
286
287
|
"data-testid": "unavailability-form-start-date-time-test-id",
|
|
@@ -288,23 +289,23 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
288
289
|
sm: 2,
|
|
289
290
|
md: 4,
|
|
290
291
|
lg: 8,
|
|
291
|
-
className: `${
|
|
292
|
+
className: `${d.column} ${d.dateTimeColumn}`,
|
|
292
293
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ r(
|
|
294
295
|
O,
|
|
295
296
|
{
|
|
296
297
|
datePickerType: "single",
|
|
297
298
|
minDate: V(),
|
|
298
|
-
value:
|
|
299
|
+
value: l.startDate ?? void 0,
|
|
299
300
|
onChange: (i) => {
|
|
300
|
-
i[0] && (n(["startDate", "dateTime"]),
|
|
301
|
-
...
|
|
301
|
+
i[0] && (n(["startDate", "dateTime"]), s({
|
|
302
|
+
...l,
|
|
302
303
|
startDate: i[0]
|
|
303
304
|
}));
|
|
304
305
|
},
|
|
305
|
-
className:
|
|
306
|
-
children: /* @__PURE__ */
|
|
307
|
-
|
|
306
|
+
className: d.datePicker,
|
|
307
|
+
children: /* @__PURE__ */ r(
|
|
308
|
+
F,
|
|
308
309
|
{
|
|
309
310
|
id: "start-date",
|
|
310
311
|
"data-testid": "start-date-input",
|
|
@@ -316,36 +317,36 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
316
317
|
)
|
|
317
318
|
}
|
|
318
319
|
),
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
|
|
320
|
+
/* @__PURE__ */ r(
|
|
321
|
+
C,
|
|
321
322
|
{
|
|
322
323
|
id: "start-time",
|
|
323
324
|
"data-testid": "start-time-input",
|
|
324
325
|
labelText: t("ADMIN_UNAVAILABILITY_FORM_START_TIME_LABEL"),
|
|
325
326
|
onChange: (i) => {
|
|
326
|
-
n(["startTime", "dateTime"]),
|
|
327
|
+
n(["startTime", "dateTime"]), s({ ...l, startTime: i.target.value });
|
|
327
328
|
},
|
|
328
329
|
invalid: !!e.startTime,
|
|
329
330
|
invalidText: e.startTime,
|
|
330
331
|
placeholder: "hh:mm",
|
|
331
332
|
pattern: "(1[012]|[0-9]):[0-5][0-9]",
|
|
332
333
|
use24HourFormat: !1,
|
|
333
|
-
className:
|
|
334
|
+
className: d.timePicker,
|
|
334
335
|
children: /* @__PURE__ */ p(
|
|
335
336
|
Y,
|
|
336
337
|
{
|
|
337
338
|
id: "start-time-period",
|
|
338
339
|
"data-testid": "start-time-period-select",
|
|
339
340
|
onChange: (i) => {
|
|
340
|
-
n(["dateTime"]),
|
|
341
|
-
...
|
|
341
|
+
n(["dateTime"]), s({
|
|
342
|
+
...l,
|
|
342
343
|
startTimePeriod: i.target.value
|
|
343
344
|
});
|
|
344
345
|
},
|
|
345
|
-
value:
|
|
346
|
+
value: l.startTimePeriod,
|
|
346
347
|
children: [
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ r("option", { value: "AM", children: t("ADMIN_UNAVAILABILITY_AM") }),
|
|
349
|
+
/* @__PURE__ */ r("option", { value: "PM", children: t("ADMIN_UNAVAILABILITY_PM") })
|
|
349
350
|
]
|
|
350
351
|
}
|
|
351
352
|
)
|
|
@@ -355,7 +356,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
355
356
|
}
|
|
356
357
|
),
|
|
357
358
|
/* @__PURE__ */ p(
|
|
358
|
-
|
|
359
|
+
M,
|
|
359
360
|
{
|
|
360
361
|
id: "unavailability-form-end-date-time",
|
|
361
362
|
"data-testid": "unavailability-form-end-date-time-test-id",
|
|
@@ -363,23 +364,23 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
363
364
|
sm: 2,
|
|
364
365
|
md: 4,
|
|
365
366
|
lg: 8,
|
|
366
|
-
className: `${
|
|
367
|
+
className: `${d.column} ${d.dateTimeColumn}`,
|
|
367
368
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ r(
|
|
369
370
|
O,
|
|
370
371
|
{
|
|
371
372
|
datePickerType: "single",
|
|
372
|
-
minDate:
|
|
373
|
-
value:
|
|
373
|
+
minDate: l.startDate ?? V(),
|
|
374
|
+
value: l.endDate ?? void 0,
|
|
374
375
|
onChange: (i) => {
|
|
375
|
-
i[0] && (n(["endDate", "dateTime"]),
|
|
376
|
-
...
|
|
376
|
+
i[0] && (n(["endDate", "dateTime"]), s({
|
|
377
|
+
...l,
|
|
377
378
|
endDate: i[0]
|
|
378
379
|
}));
|
|
379
380
|
},
|
|
380
|
-
className:
|
|
381
|
-
children: /* @__PURE__ */
|
|
382
|
-
|
|
381
|
+
className: d.datePicker,
|
|
382
|
+
children: /* @__PURE__ */ r(
|
|
383
|
+
F,
|
|
383
384
|
{
|
|
384
385
|
id: "end-date",
|
|
385
386
|
"data-testid": "end-date-input",
|
|
@@ -391,36 +392,36 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
391
392
|
)
|
|
392
393
|
}
|
|
393
394
|
),
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
|
|
395
|
+
/* @__PURE__ */ r(
|
|
396
|
+
C,
|
|
396
397
|
{
|
|
397
398
|
id: "end-time",
|
|
398
399
|
"data-testid": "end-time-input",
|
|
399
400
|
labelText: t("ADMIN_UNAVAILABILITY_FORM_END_TIME_LABEL"),
|
|
400
401
|
onChange: (i) => {
|
|
401
|
-
n(["endTime", "dateTime"]),
|
|
402
|
+
n(["endTime", "dateTime"]), s({ ...l, endTime: i.target.value });
|
|
402
403
|
},
|
|
403
404
|
invalid: !!(e.endTime ?? e.dateTime),
|
|
404
405
|
invalidText: e.dateTime ?? e.endTime,
|
|
405
406
|
placeholder: "hh:mm",
|
|
406
407
|
pattern: "(1[012]|[0-9]):[0-5][0-9]",
|
|
407
408
|
use24HourFormat: !1,
|
|
408
|
-
className:
|
|
409
|
+
className: d.timePicker,
|
|
409
410
|
children: /* @__PURE__ */ p(
|
|
410
411
|
Y,
|
|
411
412
|
{
|
|
412
413
|
id: "end-time-period",
|
|
413
414
|
"data-testid": "end-time-period-select",
|
|
414
415
|
onChange: (i) => {
|
|
415
|
-
n(["dateTime"]),
|
|
416
|
-
...
|
|
416
|
+
n(["dateTime"]), s({
|
|
417
|
+
...l,
|
|
417
418
|
endTimePeriod: i.target.value
|
|
418
419
|
});
|
|
419
420
|
},
|
|
420
|
-
value:
|
|
421
|
+
value: l.endTimePeriod,
|
|
421
422
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ r("option", { value: "AM", children: t("ADMIN_UNAVAILABILITY_AM") }),
|
|
424
|
+
/* @__PURE__ */ r("option", { value: "PM", children: t("ADMIN_UNAVAILABILITY_PM") })
|
|
424
425
|
]
|
|
425
426
|
}
|
|
426
427
|
)
|
|
@@ -429,8 +430,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
429
430
|
]
|
|
430
431
|
}
|
|
431
432
|
),
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
|
|
433
|
+
/* @__PURE__ */ r(
|
|
434
|
+
M,
|
|
434
435
|
{
|
|
435
436
|
id: "unavailability-form-service",
|
|
436
437
|
"data-testid": "unavailability-form-service-test-id",
|
|
@@ -438,8 +439,8 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
438
439
|
sm: 2,
|
|
439
440
|
md: 4,
|
|
440
441
|
lg: 8,
|
|
441
|
-
className:
|
|
442
|
-
children: /* @__PURE__ */
|
|
442
|
+
className: d.column,
|
|
443
|
+
children: /* @__PURE__ */ r(
|
|
443
444
|
x,
|
|
444
445
|
{
|
|
445
446
|
id: "service-multiselect",
|
|
@@ -448,17 +449,17 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
448
449
|
placeholder: t("ADMIN_UNAVAILABILITY_FORM_SERVICE_LABEL"),
|
|
449
450
|
items: v,
|
|
450
451
|
itemToString: (i) => i?.text ?? "",
|
|
451
|
-
selectedItems:
|
|
452
|
-
onChange: (i) =>
|
|
453
|
-
...
|
|
452
|
+
selectedItems: l.selectedServiceItems,
|
|
453
|
+
onChange: (i) => s({
|
|
454
|
+
...l,
|
|
454
455
|
selectedServiceItems: i.selectedItems
|
|
455
456
|
})
|
|
456
457
|
}
|
|
457
458
|
)
|
|
458
459
|
}
|
|
459
460
|
),
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
|
|
461
|
+
/* @__PURE__ */ r(
|
|
462
|
+
M,
|
|
462
463
|
{
|
|
463
464
|
id: "unavailability-form-provider",
|
|
464
465
|
"data-testid": "unavailability-form-provider-test-id",
|
|
@@ -466,19 +467,19 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
466
467
|
sm: 2,
|
|
467
468
|
md: 4,
|
|
468
469
|
lg: 8,
|
|
469
|
-
className:
|
|
470
|
-
children: /* @__PURE__ */
|
|
470
|
+
className: d.column,
|
|
471
|
+
children: /* @__PURE__ */ r(
|
|
471
472
|
x,
|
|
472
473
|
{
|
|
473
474
|
id: "provider-multiselect",
|
|
474
475
|
"data-testid": "provider-multiselect",
|
|
475
476
|
titleText: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
|
|
476
477
|
placeholder: t("ADMIN_UNAVAILABILITY_FORM_PROVIDER_LABEL"),
|
|
477
|
-
items:
|
|
478
|
+
items: b,
|
|
478
479
|
itemToString: (i) => i?.text ?? "",
|
|
479
|
-
selectedItems:
|
|
480
|
-
onChange: (i) =>
|
|
481
|
-
...
|
|
480
|
+
selectedItems: l.selectedProviderItems,
|
|
481
|
+
onChange: (i) => s({
|
|
482
|
+
...l,
|
|
482
483
|
selectedProviderItems: i.selectedItems
|
|
483
484
|
})
|
|
484
485
|
}
|
|
@@ -491,18 +492,18 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
491
492
|
]
|
|
492
493
|
}
|
|
493
494
|
);
|
|
494
|
-
}, $e = "
|
|
495
|
+
}, $e = "index-module_page__s2h2y", qe = {
|
|
495
496
|
page: $e
|
|
496
|
-
},
|
|
497
|
-
const { t: e } = K(), a =
|
|
497
|
+
}, Qe = () => {
|
|
498
|
+
const { t: e } = K(), a = ve(), { userPrivileges: n } = oe(), { addNotification: t } = de(), [o, c] = U(!1), [A, L] = U(!1), m = Le(null), [l, s] = U({}), _ = k(
|
|
498
499
|
n,
|
|
499
500
|
q
|
|
500
501
|
), I = k(n, [
|
|
501
502
|
pe,
|
|
502
503
|
q
|
|
503
|
-
]), { data: u, isLoading: v, isError:
|
|
504
|
+
]), { data: u, isLoading: v, isError: b } = D({
|
|
504
505
|
queryKey: ["appointmentUnavailabilities"],
|
|
505
|
-
queryFn:
|
|
506
|
+
queryFn: ce,
|
|
506
507
|
enabled: _
|
|
507
508
|
}), i = [
|
|
508
509
|
{ id: "home", label: e("BREADCRUMB_HOME"), href: me },
|
|
@@ -512,7 +513,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
512
513
|
href: "/appointments"
|
|
513
514
|
},
|
|
514
515
|
{ id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
|
|
515
|
-
],
|
|
516
|
+
], y = N(() => [
|
|
516
517
|
{ key: "startDateTime", header: e("ADMIN_UNAVAILABILITY_COLUMN_START") },
|
|
517
518
|
{ key: "endDateTime", header: e("ADMIN_UNAVAILABILITY_COLUMN_END") },
|
|
518
519
|
{
|
|
@@ -527,7 +528,7 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
527
528
|
key: "providerName",
|
|
528
529
|
header: e("ADMIN_UNAVAILABILITY_COLUMN_PROVIDER")
|
|
529
530
|
}
|
|
530
|
-
], [e]),
|
|
531
|
+
], [e]), Q = N(() => u ? u.map((T) => ge(T, e)) : [], [u, e]), R = E(
|
|
531
532
|
async (T) => {
|
|
532
533
|
L(!0);
|
|
533
534
|
try {
|
|
@@ -550,47 +551,47 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
550
551
|
}
|
|
551
552
|
},
|
|
552
553
|
[t, a, e]
|
|
553
|
-
),
|
|
554
|
+
), j = E(async () => {
|
|
554
555
|
if (!m.current) return;
|
|
555
|
-
const T =
|
|
556
|
-
|
|
557
|
-
}, [e,
|
|
556
|
+
const T = Ue(m.current, e);
|
|
557
|
+
s(T), !(Object.keys(T).length > 0) && await R(fe(m.current, e));
|
|
558
|
+
}, [e, R]), W = E(
|
|
558
559
|
(T) => {
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
return T.forEach((Z) => delete
|
|
560
|
+
s((J) => {
|
|
561
|
+
const h = { ...J };
|
|
562
|
+
return T.forEach((Z) => delete h[Z]), h;
|
|
562
563
|
});
|
|
563
564
|
},
|
|
564
565
|
[]
|
|
565
|
-
),
|
|
566
|
-
c(!1), m.current = null,
|
|
566
|
+
), z = E(() => {
|
|
567
|
+
c(!1), m.current = null, s({});
|
|
567
568
|
}, []);
|
|
568
|
-
return /* @__PURE__ */
|
|
569
|
+
return /* @__PURE__ */ r(
|
|
569
570
|
Ie,
|
|
570
571
|
{
|
|
571
|
-
headerWSideNav: /* @__PURE__ */
|
|
572
|
+
headerWSideNav: /* @__PURE__ */ r(Te, { breadcrumbItems: i }),
|
|
572
573
|
hasSideNav: !1,
|
|
573
|
-
mainDisplay: /* @__PURE__ */
|
|
574
|
+
mainDisplay: /* @__PURE__ */ r(
|
|
574
575
|
"div",
|
|
575
576
|
{
|
|
576
577
|
id: "appointment-unavailability-page",
|
|
577
578
|
"data-testid": "appointment-unavailability-page-test-id",
|
|
578
579
|
"aria-label": "appointment-unavailability-page-aria-label",
|
|
579
580
|
className: qe.page,
|
|
580
|
-
children: /* @__PURE__ */
|
|
581
|
+
children: /* @__PURE__ */ r(
|
|
581
582
|
_e,
|
|
582
583
|
{
|
|
583
584
|
id: "appointment-unavailability-actions-table",
|
|
584
585
|
"data-testid": "appointment-unavailability-actions-table-test-id",
|
|
585
586
|
"aria-label": "appointment-unavailability-actions-table-aria-label",
|
|
586
587
|
title: e("ADMIN_UNAVAILABILITY_TITLE"),
|
|
587
|
-
headers:
|
|
588
|
-
rows:
|
|
588
|
+
headers: y,
|
|
589
|
+
rows: Q,
|
|
589
590
|
ariaLabel: "unavailability-table",
|
|
590
591
|
loading: v,
|
|
591
|
-
errorStateMessage:
|
|
592
|
+
errorStateMessage: b ? e("ADMIN_UNAVAILABILITY_ERROR_MESSAGE") : null,
|
|
592
593
|
emptyStateMessage: e("ADMIN_UNAVAILABILITY_EMPTY_MESSAGE"),
|
|
593
|
-
actionButton: !
|
|
594
|
+
actionButton: !o && I ? {
|
|
594
595
|
label: e("ADMIN_UNAVAILABILITY_ADD_BUTTON"),
|
|
595
596
|
onClick: () => c(!0),
|
|
596
597
|
props: { id: "add-unavailability-btn", kind: "primary" }
|
|
@@ -599,32 +600,32 @@ const Ne = "Available for appointments", q = "Get Appointment Unavailability", p
|
|
|
599
600
|
)
|
|
600
601
|
}
|
|
601
602
|
),
|
|
602
|
-
actionArea:
|
|
603
|
+
actionArea: o && /* @__PURE__ */ r(
|
|
603
604
|
ue,
|
|
604
605
|
{
|
|
605
606
|
"data-testid": "appointment-unavailability-form-panel-test-id",
|
|
606
607
|
"aria-label": "appointment-unavailability-form-panel-aria-label",
|
|
607
608
|
title: e("ADMIN_UNAVAILABILITY_FORM_TITLE"),
|
|
608
609
|
primaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_ADD"),
|
|
609
|
-
onPrimaryButtonClick:
|
|
610
|
+
onPrimaryButtonClick: j,
|
|
610
611
|
isPrimaryButtonDisabled: A,
|
|
611
612
|
secondaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_CANCEL"),
|
|
612
|
-
onSecondaryButtonClick:
|
|
613
|
+
onSecondaryButtonClick: z,
|
|
613
614
|
isSecondaryButtonDisabled: A,
|
|
614
|
-
content: /* @__PURE__ */
|
|
615
|
+
content: /* @__PURE__ */ r(
|
|
615
616
|
ke,
|
|
616
617
|
{
|
|
617
|
-
errors:
|
|
618
|
+
errors: l,
|
|
618
619
|
formDataRef: m,
|
|
619
|
-
onClearErrors:
|
|
620
|
+
onClearErrors: W
|
|
620
621
|
}
|
|
621
622
|
)
|
|
622
623
|
}
|
|
623
624
|
),
|
|
624
|
-
isActionAreaVisible:
|
|
625
|
+
isActionAreaVisible: o
|
|
625
626
|
}
|
|
626
627
|
);
|
|
627
628
|
};
|
|
628
629
|
export {
|
|
629
|
-
|
|
630
|
+
Qe as default
|
|
630
631
|
};
|