@bahmni/appointments-app 0.0.1-dev.377 → 0.0.1-dev.379
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/App.d.ts.map +1 -1
- package/dist/{DocumentsTable-DltqOolY-D_7o42_B.js → DocumentsTable-DuAtZsGl-DsjGnVzF.js} +26 -26
- package/dist/{FormsTable-0kw7u2Y0-BmMpsOq4.js → FormsTable-BIZOc0WF-BqE9UIXn.js} +68 -68
- package/dist/{LNWAZHJI-z-XZbovb.js → LNWAZHJI-CppTuwVz.js} +2 -2
- package/dist/{MWZ6AO7Z-DWlUkEHd.js → MWZ6AO7Z-CFOccMuM.js} +2 -2
- package/dist/{Observations-BoGO_vsc-D1T0iF03.js → Observations-D7R3v4qe-CAMmnofm.js} +58 -58
- package/dist/{YPM2AS64-Dw55EsK8.js → YPM2AS64-DLOIgci-.js} +1 -1
- package/dist/{index-BY_f8YCQ.js → index-1RaQ0WZ_.js} +35 -35
- package/dist/{index-B_aaBzFi.js → index-BG3eE42n.js} +20 -20
- package/dist/{index-BwEjPsd2.js → index-BQrlKDpC.js} +38370 -37869
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +5 -0
- package/dist/locales/locale_es.json +5 -0
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { g as q,
|
|
1
|
+
import { jsxs as N, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { g as q, I as H, u as S, n as w, o as G, h as M, q as k, r as x, N as Q, t as z, G as j, H as P, v as A, M as J, C as W, w as Y, y as X, z as Z, A as ee } from "./index-BQrlKDpC.js";
|
|
3
3
|
import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as se, useEffect as _, useMemo as g } from "react";
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
7
|
-
let
|
|
8
|
-
|
|
5
|
+
const C = (a, n, d, l, b, r) => {
|
|
6
|
+
const t = J(a, n, b), s = t.value, o = W(s);
|
|
7
|
+
let i = s;
|
|
8
|
+
o === "Image" && (i = /* @__PURE__ */ u(
|
|
9
9
|
X,
|
|
10
10
|
{
|
|
11
11
|
imageSrc: s,
|
|
@@ -13,22 +13,22 @@ const D = (a, n, d, l, b, r) => {
|
|
|
13
13
|
id: `${s}-img`,
|
|
14
14
|
hideThumbnail: r
|
|
15
15
|
}
|
|
16
|
-
)),
|
|
16
|
+
)), o === "Video" && (i = /* @__PURE__ */ u(
|
|
17
17
|
Z,
|
|
18
18
|
{
|
|
19
19
|
id: `${s}-video`,
|
|
20
20
|
videoSrc: s,
|
|
21
21
|
hideThumbnail: r
|
|
22
22
|
}
|
|
23
|
-
)),
|
|
23
|
+
)), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
|
|
24
24
|
const m = b("OBSERVATIONS_RECORDED_BY", {
|
|
25
25
|
provider: t.provider
|
|
26
26
|
}), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
|
|
27
27
|
return /* @__PURE__ */ u(
|
|
28
|
-
|
|
28
|
+
Y,
|
|
29
29
|
{
|
|
30
30
|
header: t.header,
|
|
31
|
-
value:
|
|
31
|
+
value: i,
|
|
32
32
|
info: m,
|
|
33
33
|
id: c,
|
|
34
34
|
testId: c,
|
|
@@ -43,9 +43,9 @@ const D = (a, n, d, l, b, r) => {
|
|
|
43
43
|
id: `grouped-obs-${a.display}-${l}`,
|
|
44
44
|
open: d,
|
|
45
45
|
children: a.members?.map(
|
|
46
|
-
(s,
|
|
46
|
+
(s, o) => C(
|
|
47
47
|
s,
|
|
48
|
-
|
|
48
|
+
o,
|
|
49
49
|
b,
|
|
50
50
|
r,
|
|
51
51
|
n,
|
|
@@ -54,23 +54,23 @@ const D = (a, n, d, l, b, r) => {
|
|
|
54
54
|
)
|
|
55
55
|
},
|
|
56
56
|
`grouped-obs-${a.id}`
|
|
57
|
-
),
|
|
57
|
+
), oe = ({
|
|
58
58
|
groupedData: a,
|
|
59
59
|
title: n = "",
|
|
60
60
|
hideThumbnail: d
|
|
61
61
|
}) => {
|
|
62
|
-
const { t: l } =
|
|
63
|
-
const
|
|
64
|
-
return /* @__PURE__ */
|
|
62
|
+
const { t: l } = S(), b = (r, t, s) => {
|
|
63
|
+
const o = P(r.encounterDetails, l);
|
|
64
|
+
return /* @__PURE__ */ N(
|
|
65
65
|
A,
|
|
66
66
|
{
|
|
67
|
-
title:
|
|
67
|
+
title: o,
|
|
68
68
|
id: `encounter-${r.encounterId}`,
|
|
69
69
|
open: t,
|
|
70
70
|
children: [
|
|
71
71
|
r.observations.map(
|
|
72
|
-
(
|
|
73
|
-
|
|
72
|
+
(i, m) => C(
|
|
73
|
+
i,
|
|
74
74
|
m,
|
|
75
75
|
s,
|
|
76
76
|
n,
|
|
@@ -79,8 +79,8 @@ const D = (a, n, d, l, b, r) => {
|
|
|
79
79
|
)
|
|
80
80
|
),
|
|
81
81
|
r.groupedObservations.map(
|
|
82
|
-
(
|
|
83
|
-
|
|
82
|
+
(i, m) => re(
|
|
83
|
+
i,
|
|
84
84
|
l,
|
|
85
85
|
t,
|
|
86
86
|
m,
|
|
@@ -105,67 +105,67 @@ const D = (a, n, d, l, b, r) => {
|
|
|
105
105
|
)
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
|
-
},
|
|
109
|
-
observations:
|
|
108
|
+
}, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", $ = {
|
|
109
|
+
observations: ie,
|
|
110
110
|
title: ne
|
|
111
111
|
}, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
|
|
112
112
|
const n = a, {
|
|
113
113
|
conceptNames: d = [],
|
|
114
114
|
conceptUuid: l = [],
|
|
115
115
|
hideThumbnail: b = !1
|
|
116
|
-
} = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } =
|
|
116
|
+
} = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } = H(), { t: o } = S(), i = ae({
|
|
117
117
|
queries: d.map((e) => ({
|
|
118
118
|
queryKey: de(e),
|
|
119
|
-
queryFn: () =>
|
|
119
|
+
queryFn: () => w(e),
|
|
120
120
|
enabled: !!e
|
|
121
121
|
}))
|
|
122
122
|
});
|
|
123
123
|
_(() => {
|
|
124
|
-
|
|
124
|
+
i.forEach((e, h) => {
|
|
125
125
|
if (e.isError && !r.current.has(h)) {
|
|
126
|
-
const
|
|
126
|
+
const K = d[h];
|
|
127
127
|
s({
|
|
128
|
-
title:
|
|
129
|
-
message:
|
|
128
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
129
|
+
message: o("ERROR_FETCHING_CONCEPT", { conceptName: K }),
|
|
130
130
|
type: "error"
|
|
131
131
|
}), r.current.add(h);
|
|
132
132
|
} else e.isError || r.current.delete(h);
|
|
133
133
|
});
|
|
134
|
-
}, [
|
|
135
|
-
const m = g(() =>
|
|
134
|
+
}, [i, d]);
|
|
135
|
+
const m = g(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = g(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = g(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
|
|
136
136
|
data: c,
|
|
137
|
-
isLoading:
|
|
138
|
-
isError:
|
|
139
|
-
refetch:
|
|
137
|
+
isLoading: D,
|
|
138
|
+
isError: R,
|
|
139
|
+
refetch: T
|
|
140
140
|
} = te({
|
|
141
141
|
queryKey: le(t, p),
|
|
142
|
-
queryFn: () =>
|
|
142
|
+
queryFn: () => G(t, p),
|
|
143
143
|
enabled: !!t && p.length > 0 && y
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
M(
|
|
146
146
|
(e) => {
|
|
147
147
|
e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
|
|
148
148
|
(h) => p.includes(h)
|
|
149
|
-
) &&
|
|
149
|
+
) && T();
|
|
150
150
|
},
|
|
151
|
-
[t,
|
|
151
|
+
[t, T]
|
|
152
152
|
), _(() => {
|
|
153
|
-
|
|
154
|
-
title:
|
|
155
|
-
message:
|
|
153
|
+
R && s({
|
|
154
|
+
title: o("ERROR_DEFAULT_TITLE"),
|
|
155
|
+
message: o("ERROR_FETCHING_OBSERVATIONS"),
|
|
156
156
|
type: "error"
|
|
157
157
|
});
|
|
158
|
-
}, [
|
|
159
|
-
const
|
|
158
|
+
}, [R]);
|
|
159
|
+
const f = g(() => {
|
|
160
160
|
if (!c) return [];
|
|
161
|
-
const e =
|
|
162
|
-
return
|
|
163
|
-
}, [c]),
|
|
161
|
+
const e = k(c), h = x(e);
|
|
162
|
+
return Q(h);
|
|
163
|
+
}, [c]), F = [
|
|
164
164
|
{ key: "name", header: "name" },
|
|
165
165
|
{ key: "value", header: "value" },
|
|
166
166
|
{ key: "form", header: "form" }
|
|
167
|
-
],
|
|
168
|
-
return /* @__PURE__ */
|
|
167
|
+
], I = D || !y, O = R && y, L = (!c || c.entry?.length === 0 || p.length === 0) && y, U = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, V = L ? o("NO_OBSERVATIONS_FOUND") : void 0, B = f.length > 0 && !I && !O, E = n.titleTranslationKey, v = E ? o(E) : "";
|
|
168
|
+
return /* @__PURE__ */ N(
|
|
169
169
|
"div",
|
|
170
170
|
{
|
|
171
171
|
id: "observations",
|
|
@@ -174,7 +174,7 @@ const D = (a, n, d, l, b, r) => {
|
|
|
174
174
|
className: $.observations,
|
|
175
175
|
children: [
|
|
176
176
|
/* @__PURE__ */ u(
|
|
177
|
-
|
|
177
|
+
z,
|
|
178
178
|
{
|
|
179
179
|
id: "observations-title",
|
|
180
180
|
testId: E ? `observations-title-${v}` : "observations-title",
|
|
@@ -183,22 +183,22 @@ const D = (a, n, d, l, b, r) => {
|
|
|
183
183
|
children: /* @__PURE__ */ u("p", { children: v })
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
B ? /* @__PURE__ */ u(
|
|
187
|
+
oe,
|
|
188
188
|
{
|
|
189
|
-
groupedData:
|
|
189
|
+
groupedData: f,
|
|
190
190
|
title: v,
|
|
191
191
|
hideThumbnail: b
|
|
192
192
|
}
|
|
193
193
|
) : /* @__PURE__ */ u(
|
|
194
|
-
|
|
194
|
+
j,
|
|
195
195
|
{
|
|
196
|
-
headers:
|
|
196
|
+
headers: F,
|
|
197
197
|
rows: [],
|
|
198
|
-
ariaLabel:
|
|
199
|
-
loading:
|
|
200
|
-
errorStateMessage:
|
|
201
|
-
emptyStateMessage:
|
|
198
|
+
ariaLabel: o("OBSERVATIONS"),
|
|
199
|
+
loading: I,
|
|
200
|
+
errorStateMessage: U,
|
|
201
|
+
emptyStateMessage: V,
|
|
202
202
|
dataTestId: "observations-table"
|
|
203
203
|
}
|
|
204
204
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aq as we, ar as z, as as xt, at as B, ao as q, ap as y, au as Ro, av as ye, aw as R, ax as _, ay as k, az as N, aA as A, aB as bs, aC as ir, aD as $e, aE as U, aF as Hn, aG as Vn, aH as dt, aI as D, aJ as xs, aK as cn, aL as Be, aM as ws, aN as qt, aO as zt, aP as $s, aQ as Cs, aR as $n, aS as Ss, aT as Nr, aU as Bt, aV as zo, aW as ks, aX as Es, aY as j, aZ as Ur, a_ as Ms, a$ as Ds, b0 as sr, b1 as As, b2 as Ts, b3 as zn, b4 as Fs, b5 as Is, b6 as Z, b7 as Ps, b8 as Ls } from "./index-
|
|
1
|
+
import { aq as we, ar as z, as as xt, at as B, ao as q, ap as y, au as Ro, av as ye, aw as R, ax as _, ay as k, az as N, aA as A, aB as bs, aC as ir, aD as $e, aE as U, aF as Hn, aG as Vn, aH as dt, aI as D, aJ as xs, aK as cn, aL as Be, aM as ws, aN as qt, aO as zt, aP as $s, aQ as Cs, aR as $n, aS as Ss, aT as Nr, aU as Bt, aV as zo, aW as ks, aX as Es, aY as j, aZ as Ur, a_ as Ms, a$ as Ds, b0 as sr, b1 as As, b2 as Ts, b3 as zn, b4 as Fs, b5 as Is, b6 as Z, b7 as Ps, b8 as Ls } from "./index-BQrlKDpC.js";
|
|
2
2
|
var Os = (e) => e != null, qs = (e) => e.filter(Os);
|
|
3
3
|
function _s(e) {
|
|
4
4
|
return (...t) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { $ as f, a0 as P, a1 as O, a2 as V, a3 as
|
|
3
|
-
import { useState as g, useMemo as N, useEffect as
|
|
2
|
+
import { $ as f, a0 as P, a1 as O, a2 as V, a3 as Z, a4 as ee, a5 as te, a6 as ie, P as ae, a7 as ne, u as Q, a8 as R, a9 as le, aa as re, ab as se, ac as U, ad as C, ae as F, af as Y, ag as k, ah as x, ai as $, J as oe, I as de, K as q, aj as ce, Q as me, ak as Ae, al as Ie, am as ue, T as _e, U as Te, X as Le } from "./index-BQrlKDpC.js";
|
|
3
|
+
import { useState as g, useMemo as N, useEffect as h, useRef as ve, useCallback as E } from "react";
|
|
4
4
|
import { useQuery as D, useQueryClient as Ne } from "@tanstack/react-query";
|
|
5
5
|
const be = "Available for appointments", w = "Get Appointment Unavailability", pe = "Add Appointment Unavailability", G = "Appointment Location", Me = () => {
|
|
6
6
|
try {
|
|
7
|
-
return
|
|
7
|
+
return Z().uuid;
|
|
8
8
|
} catch {
|
|
9
9
|
return "";
|
|
10
10
|
}
|
|
@@ -25,7 +25,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
25
25
|
text: a,
|
|
26
26
|
isSelectAll: !0
|
|
27
27
|
}), n;
|
|
28
|
-
},
|
|
28
|
+
}, Ue = (e, a) => {
|
|
29
29
|
const n = e.map((t) => ({
|
|
30
30
|
id: t.uuid,
|
|
31
31
|
text: t.person?.display,
|
|
@@ -36,7 +36,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
36
36
|
text: a,
|
|
37
37
|
isSelectAll: !0
|
|
38
38
|
}), n;
|
|
39
|
-
},
|
|
39
|
+
}, Ee = (e, a) => ({
|
|
40
40
|
locationUuid: e.locationUuid,
|
|
41
41
|
startDate: f(e.startDate, a, !1, V).formattedResult,
|
|
42
42
|
startTime: O(
|
|
@@ -63,7 +63,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
63
63
|
appointmentServiceName: e.service?.name ?? a("ADMIN_UNAVAILABILITY_ALL"),
|
|
64
64
|
providerName: e.provider?.name ?? a("ADMIN_UNAVAILABILITY_ALL")
|
|
65
65
|
}), K = (e) => e.filter((a) => !a.isSelectAll).map((a) => a.id), Re = (e, a) => {
|
|
66
|
-
const n =
|
|
66
|
+
const n = Ee(
|
|
67
67
|
{
|
|
68
68
|
locationUuid: e.locationUuid,
|
|
69
69
|
startDate: e.startDate,
|
|
@@ -82,11 +82,11 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
82
82
|
providerUuid: s
|
|
83
83
|
}))
|
|
84
84
|
);
|
|
85
|
-
},
|
|
85
|
+
}, he = (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
|
-
})),
|
|
89
|
+
})), Se = () => {
|
|
90
90
|
const {
|
|
91
91
|
data: e,
|
|
92
92
|
isLoading: a,
|
|
@@ -108,7 +108,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
108
108
|
const u = await ie(
|
|
109
109
|
G
|
|
110
110
|
);
|
|
111
|
-
return
|
|
111
|
+
return he(u);
|
|
112
112
|
}
|
|
113
113
|
return I.filter(
|
|
114
114
|
(u) => u.tags?.some((v) => v.display === G)
|
|
@@ -137,13 +137,13 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
137
137
|
isLoading: a || o || L || s,
|
|
138
138
|
isError: n || c || m || _
|
|
139
139
|
};
|
|
140
|
-
}, Be = "UnavailabilityForm-module_formContent__WmNHR", Pe = "UnavailabilityForm-module_formField__8he7o", Oe = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm",
|
|
140
|
+
}, Be = "UnavailabilityForm-module_formContent__WmNHR", Pe = "UnavailabilityForm-module_formField__8he7o", Oe = "UnavailabilityForm-module_loading__IDEY6", Ve = "UnavailabilityForm-module_error__jDeOm", Ce = "UnavailabilityForm-module_grid__t6NKR", Fe = "UnavailabilityForm-module_column__QFdnQ", Ye = "UnavailabilityForm-module_dateTimeColumn__6bi0F", ke = "UnavailabilityForm-module_datePicker__6HgbO", xe = "UnavailabilityForm-module_timePicker__DHNpK", d = {
|
|
141
141
|
formContent: Be,
|
|
142
142
|
formField: Pe,
|
|
143
143
|
loading: Oe,
|
|
144
144
|
error: Ve,
|
|
145
|
-
grid:
|
|
146
|
-
column:
|
|
145
|
+
grid: Ce,
|
|
146
|
+
column: Fe,
|
|
147
147
|
dateTimeColumn: Ye,
|
|
148
148
|
datePicker: ke,
|
|
149
149
|
timePicker: xe
|
|
@@ -152,7 +152,7 @@ const be = "Available for appointments", w = "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 } =
|
|
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: [],
|
|
@@ -199,7 +199,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
199
199
|
() => R(
|
|
200
200
|
!1,
|
|
201
201
|
!1,
|
|
202
|
-
|
|
202
|
+
Ue(
|
|
203
203
|
I,
|
|
204
204
|
t("ADMIN_UNAVAILABILITY_FORM_ALL_PROVIDERS")
|
|
205
205
|
),
|
|
@@ -212,7 +212,7 @@ const be = "Available for appointments", w = "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 = Me(), b = o.some(
|
|
218
218
|
(y) => y.uuid === i
|
|
@@ -221,12 +221,12 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
221
221
|
...y,
|
|
222
222
|
locationUuid: b ? 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
232
|
selectedProviderItems: M
|
|
@@ -290,7 +290,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
290
290
|
className: d.grid,
|
|
291
291
|
children: [
|
|
292
292
|
/* @__PURE__ */ p(
|
|
293
|
-
|
|
293
|
+
U,
|
|
294
294
|
{
|
|
295
295
|
id: "unavailability-form-start-date-time",
|
|
296
296
|
"data-testid": "unavailability-form-start-date-time-test-id",
|
|
@@ -301,10 +301,10 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
301
301
|
className: `${d.column} ${d.dateTimeColumn}`,
|
|
302
302
|
children: [
|
|
303
303
|
/* @__PURE__ */ r(
|
|
304
|
-
|
|
304
|
+
C,
|
|
305
305
|
{
|
|
306
306
|
datePickerType: "single",
|
|
307
|
-
minDate:
|
|
307
|
+
minDate: F(),
|
|
308
308
|
value: l.startDate ?? void 0,
|
|
309
309
|
onChange: (i) => {
|
|
310
310
|
i[0] && (n(["startDate", "dateTime"]), s({
|
|
@@ -365,7 +365,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
365
365
|
}
|
|
366
366
|
),
|
|
367
367
|
/* @__PURE__ */ p(
|
|
368
|
-
|
|
368
|
+
U,
|
|
369
369
|
{
|
|
370
370
|
id: "unavailability-form-end-date-time",
|
|
371
371
|
"data-testid": "unavailability-form-end-date-time-test-id",
|
|
@@ -376,10 +376,10 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
376
376
|
className: `${d.column} ${d.dateTimeColumn}`,
|
|
377
377
|
children: [
|
|
378
378
|
/* @__PURE__ */ r(
|
|
379
|
-
|
|
379
|
+
C,
|
|
380
380
|
{
|
|
381
381
|
datePickerType: "single",
|
|
382
|
-
minDate: l.startDate ??
|
|
382
|
+
minDate: l.startDate ?? F(),
|
|
383
383
|
value: l.endDate ?? void 0,
|
|
384
384
|
onChange: (i) => {
|
|
385
385
|
i[0] && (n(["endDate", "dateTime"]), s({
|
|
@@ -440,7 +440,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
440
440
|
}
|
|
441
441
|
),
|
|
442
442
|
/* @__PURE__ */ r(
|
|
443
|
-
|
|
443
|
+
U,
|
|
444
444
|
{
|
|
445
445
|
id: "unavailability-form-service",
|
|
446
446
|
"data-testid": "unavailability-form-service-test-id",
|
|
@@ -468,7 +468,7 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
468
468
|
}
|
|
469
469
|
),
|
|
470
470
|
/* @__PURE__ */ r(
|
|
471
|
-
|
|
471
|
+
U,
|
|
472
472
|
{
|
|
473
473
|
id: "unavailability-form-provider",
|
|
474
474
|
"data-testid": "unavailability-form-provider-test-id",
|
|
@@ -537,7 +537,7 @@ const be = "Available for appointments", w = "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]),
|
|
540
|
+
], [e]), y = N(() => u ? u.map((T) => fe(T, e)) : [], [u, e]), S = E(
|
|
541
541
|
async (T) => {
|
|
542
542
|
L(!0);
|
|
543
543
|
try {
|
|
@@ -560,19 +560,19 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
560
560
|
}
|
|
561
561
|
},
|
|
562
562
|
[t, a, e]
|
|
563
|
-
), j =
|
|
563
|
+
), j = E(async () => {
|
|
564
564
|
if (!m.current) return;
|
|
565
565
|
const T = ge(m.current, e);
|
|
566
|
-
s(T), !(Object.keys(T).length > 0) && await
|
|
567
|
-
}, [e,
|
|
566
|
+
s(T), !(Object.keys(T).length > 0) && await S(Re(m.current, e));
|
|
567
|
+
}, [e, S]), z = E(
|
|
568
568
|
(T) => {
|
|
569
|
-
s((
|
|
570
|
-
const B = { ...
|
|
571
|
-
return T.forEach((
|
|
569
|
+
s((W) => {
|
|
570
|
+
const B = { ...W };
|
|
571
|
+
return T.forEach((X) => delete B[X]), B;
|
|
572
572
|
});
|
|
573
573
|
},
|
|
574
574
|
[]
|
|
575
|
-
),
|
|
575
|
+
), J = E(() => {
|
|
576
576
|
c(!1), m.current = null, s({});
|
|
577
577
|
}, []);
|
|
578
578
|
return /* @__PURE__ */ r(
|
|
@@ -619,14 +619,14 @@ const be = "Available for appointments", w = "Get Appointment Unavailability", p
|
|
|
619
619
|
onPrimaryButtonClick: j,
|
|
620
620
|
isPrimaryButtonDisabled: A,
|
|
621
621
|
secondaryButtonText: e("ADMIN_UNAVAILABILITY_FORM_CANCEL"),
|
|
622
|
-
onSecondaryButtonClick:
|
|
622
|
+
onSecondaryButtonClick: J,
|
|
623
623
|
isSecondaryButtonDisabled: A,
|
|
624
624
|
content: /* @__PURE__ */ r(
|
|
625
625
|
$e,
|
|
626
626
|
{
|
|
627
627
|
errors: l,
|
|
628
628
|
formDataRef: m,
|
|
629
|
-
onClearErrors:
|
|
629
|
+
onClearErrors: z
|
|
630
630
|
}
|
|
631
631
|
)
|
|
632
632
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as i, jsxs as y } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { R as V, D as P, u as C, F as O, E as h, I as B, J as G, K as L, P as x, Q as U, S as F, T as q, U as k, X as K, Y as Q, Z as $, _ as j } from "./index-BQrlKDpC.js";
|
|
3
3
|
import { useState as I, useMemo as _ } from "react";
|
|
4
|
-
import { useQueryClient as
|
|
4
|
+
import { useQueryClient as w, useQuery as H } from "@tanstack/react-query";
|
|
5
5
|
const W = V(
|
|
6
|
-
|
|
6
|
+
P,
|
|
7
7
|
"useAppointmentsConfig",
|
|
8
8
|
"AppointmentsConfigProvider"
|
|
9
|
-
),
|
|
9
|
+
), Y = ({
|
|
10
10
|
serviceName: e,
|
|
11
11
|
isDeleting: a,
|
|
12
12
|
onConfirm: t,
|
|
@@ -14,7 +14,7 @@ const W = V(
|
|
|
14
14
|
}) => {
|
|
15
15
|
const { t: n } = C();
|
|
16
16
|
return /* @__PURE__ */ i(
|
|
17
|
-
|
|
17
|
+
O,
|
|
18
18
|
{
|
|
19
19
|
id: "delete-service-modal",
|
|
20
20
|
testId: "delete-service-modal-test-id",
|
|
@@ -36,9 +36,9 @@ const W = V(
|
|
|
36
36
|
"speciality",
|
|
37
37
|
"durationMins",
|
|
38
38
|
"description"
|
|
39
|
-
],
|
|
39
|
+
], z = "app:appointments:manageServices", J = "app:appointments:adminTab", Z = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
|
|
40
40
|
page: Z,
|
|
41
|
-
noPrivilegeContainer:
|
|
41
|
+
noPrivilegeContainer: X,
|
|
42
42
|
table: ee
|
|
43
43
|
};
|
|
44
44
|
function te(e) {
|
|
@@ -75,19 +75,19 @@ function ie(e, a) {
|
|
|
75
75
|
}));
|
|
76
76
|
}
|
|
77
77
|
const oe = () => {
|
|
78
|
-
const { t: e } = C(), a =
|
|
78
|
+
const { t: e } = C(), a = w(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = W(), [E, c] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
|
|
79
79
|
...u
|
|
80
|
-
], S = L(s,
|
|
80
|
+
], S = L(s, J), M = L(
|
|
81
81
|
s,
|
|
82
|
-
|
|
82
|
+
z
|
|
83
83
|
), m = _(
|
|
84
84
|
() => te(l),
|
|
85
85
|
[l]
|
|
86
|
-
), { data: A, isLoading:
|
|
86
|
+
), { data: A, isLoading: R, isError: v } = H({
|
|
87
87
|
queryKey: ["allAppointmentServices"],
|
|
88
88
|
queryFn: x,
|
|
89
89
|
enabled: S
|
|
90
|
-
}),
|
|
90
|
+
}), D = _(
|
|
91
91
|
() => ae(l, e),
|
|
92
92
|
[l]
|
|
93
93
|
), N = _(
|
|
@@ -96,7 +96,7 @@ const oe = () => {
|
|
|
96
96
|
), g = async () => {
|
|
97
97
|
p(!0);
|
|
98
98
|
try {
|
|
99
|
-
await
|
|
99
|
+
await j(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,7 +112,7 @@ const oe = () => {
|
|
|
112
112
|
p(!1);
|
|
113
113
|
}
|
|
114
114
|
}, T = (r, o) => o === "actions" ? /* @__PURE__ */ i(
|
|
115
|
-
|
|
115
|
+
Q,
|
|
116
116
|
{
|
|
117
117
|
id: `delete-service-${r.id}-btn`,
|
|
118
118
|
testId: `delete-service-${r.id}-btn-test-id`,
|
|
@@ -121,7 +121,7 @@ const oe = () => {
|
|
|
121
121
|
label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
|
|
122
122
|
disabled: !M,
|
|
123
123
|
onClick: () => c(r),
|
|
124
|
-
children: /* @__PURE__ */ i(
|
|
124
|
+
children: /* @__PURE__ */ i($, {})
|
|
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 oe = () => {
|
|
|
130
130
|
return /* @__PURE__ */ i(
|
|
131
131
|
F,
|
|
132
132
|
{
|
|
133
|
-
header: /* @__PURE__ */ i(
|
|
133
|
+
header: /* @__PURE__ */ i(k, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i(K, {}) }),
|
|
134
134
|
main: S ? /* @__PURE__ */ y(
|
|
135
135
|
"div",
|
|
136
136
|
{
|
|
@@ -144,18 +144,18 @@ const oe = () => {
|
|
|
144
144
|
{
|
|
145
145
|
id: "all-services",
|
|
146
146
|
title: e("ADMIN_ALL_SERVICES_TITLE"),
|
|
147
|
-
headers:
|
|
147
|
+
headers: D,
|
|
148
148
|
rows: N,
|
|
149
149
|
ariaLabel: "all-services-table",
|
|
150
|
-
loading:
|
|
151
|
-
errorStateMessage:
|
|
150
|
+
loading: R,
|
|
151
|
+
errorStateMessage: v ? 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
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
157
|
E && /* @__PURE__ */ i(
|
|
158
|
-
|
|
158
|
+
Y,
|
|
159
159
|
{
|
|
160
160
|
serviceName: E.name,
|
|
161
161
|
isDeleting: b,
|