@bahmni/appointments-app 0.0.1-dev.195 → 0.0.1-dev.197
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-CeadVs9A-DSrtdrxm.js → DocumentsTable-CR9lBUHD-VlWoXezd.js} +1 -1
- package/dist/{FormsTable-BOY-EyPE-B8DOoGyT.js → FormsTable-szi7kPyc-CFSdvvpm.js} +48 -48
- package/dist/{LNWAZHJI-BCxVKFdq.js → LNWAZHJI-C37c-i9_.js} +2 -2
- package/dist/{MWZ6AO7Z-CtdFB9mI.js → MWZ6AO7Z-D16kS6Xe.js} +2 -2
- package/dist/{Observations-BrQeD7aG-Zazkt_Ma.js → Observations-BYTVkUwc-D4aoevDr.js} +11 -11
- package/dist/{YPM2AS64-BuPQnfdo.js → YPM2AS64-VJ7W3jTq.js} +138 -138
- package/dist/{index-CxMx6dqh.js → index-BSilwxTF.js} +23968 -23926
- package/dist/index-Bc0_00fe.js +182 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/locale_en.json +10 -0
- package/dist/locales/locale_es.json +10 -0
- package/dist/pages/admin/allServices/components/DeleteServiceModal.d.ts +10 -0
- package/dist/pages/admin/allServices/components/DeleteServiceModal.d.ts.map +1 -0
- package/dist/pages/admin/allServices/constants.d.ts +2 -0
- package/dist/pages/admin/allServices/constants.d.ts.map +1 -1
- package/dist/pages/admin/allServices/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-DE_bLhMX.js +0 -94
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { s as V, t as h, u as C, y as O, v as P, c as B, Q as G, M as U, B as L, a as q, F as x, D as F, _ as Q, H as k, L as H, O as $, P as j, R as K } from "./index-BSilwxTF.js";
|
|
3
|
+
import { useState as I, useMemo as _ } from "react";
|
|
4
|
+
const w = V(
|
|
5
|
+
h,
|
|
6
|
+
"useAppointmentsConfig",
|
|
7
|
+
"AppointmentsConfigProvider"
|
|
8
|
+
), W = ({
|
|
9
|
+
serviceName: e,
|
|
10
|
+
isDeleting: a,
|
|
11
|
+
onConfirm: t,
|
|
12
|
+
onCancel: s
|
|
13
|
+
}) => {
|
|
14
|
+
const { t: i } = C();
|
|
15
|
+
return /* @__PURE__ */ n(
|
|
16
|
+
O,
|
|
17
|
+
{
|
|
18
|
+
id: "delete-service-modal",
|
|
19
|
+
testId: "delete-service-modal-test-id",
|
|
20
|
+
"aria-label": "delete-service-modal-aria-label",
|
|
21
|
+
open: !0,
|
|
22
|
+
danger: !0,
|
|
23
|
+
onRequestClose: s,
|
|
24
|
+
onRequestSubmit: t,
|
|
25
|
+
primaryButtonText: i("ADMIN_ALL_SERVICES_DELETE_BUTTON_LABEL"),
|
|
26
|
+
secondaryButtonText: i("ADMIN_ALL_SERVICES_DELETE_CANCEL"),
|
|
27
|
+
primaryButtonDisabled: a,
|
|
28
|
+
modalHeading: i("ADMIN_ALL_SERVICES_DELETE_MODAL_TITLE"),
|
|
29
|
+
children: i("ADMIN_ALL_SERVICES_DELETE_CONFIRM_BODY", { serviceName: e })
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}, p = [
|
|
33
|
+
"name",
|
|
34
|
+
"location",
|
|
35
|
+
"speciality",
|
|
36
|
+
"durationMins",
|
|
37
|
+
"description"
|
|
38
|
+
], Y = "app:appointments:manageServices", z = "app:appointments:adminTab", J = "_page_10v94_1", X = "_noPrivilegeContainer_10v94_1", Z = "_table_10v94_18", d = {
|
|
39
|
+
page: J,
|
|
40
|
+
noPrivilegeContainer: X,
|
|
41
|
+
table: Z
|
|
42
|
+
};
|
|
43
|
+
function ee(e) {
|
|
44
|
+
return e.filter((a) => !p.includes(a));
|
|
45
|
+
}
|
|
46
|
+
function te(e, a) {
|
|
47
|
+
return [
|
|
48
|
+
...e.map((t) => ({
|
|
49
|
+
key: t,
|
|
50
|
+
header: a(
|
|
51
|
+
`ADMIN_ALL_SERVICES_COLUMN_${P(t)}`
|
|
52
|
+
)
|
|
53
|
+
})),
|
|
54
|
+
{
|
|
55
|
+
key: "actions",
|
|
56
|
+
header: a("ADMIN_ALL_SERVICES_COLUMN_ACTIONS")
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
function ae(e, a) {
|
|
61
|
+
return e.map((t) => ({
|
|
62
|
+
id: t.uuid,
|
|
63
|
+
name: t.name,
|
|
64
|
+
location: t.location?.name ?? null,
|
|
65
|
+
speciality: t.speciality?.name ?? null,
|
|
66
|
+
durationMins: t.durationMins,
|
|
67
|
+
description: t.description,
|
|
68
|
+
attributes: Object.fromEntries(
|
|
69
|
+
a.map((s) => [
|
|
70
|
+
s,
|
|
71
|
+
t.attributes?.find((i) => i.attributeType === s)?.value ?? null
|
|
72
|
+
])
|
|
73
|
+
)
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
const re = () => {
|
|
77
|
+
const { t: e } = C(), a = B(), { addNotification: t } = G(), { userPrivileges: s } = U(), { appointmentsConfig: i } = w(), [E, c] = I(null), [v, S] = I(!1), l = i?.serviceTableFields ?? [
|
|
78
|
+
...p
|
|
79
|
+
], u = L(s, z), M = L(
|
|
80
|
+
s,
|
|
81
|
+
Y
|
|
82
|
+
), m = _(
|
|
83
|
+
() => ee(l),
|
|
84
|
+
[l]
|
|
85
|
+
), { data: A, isLoading: D, isError: R } = q({
|
|
86
|
+
queryKey: ["allAppointmentServices"],
|
|
87
|
+
queryFn: K,
|
|
88
|
+
enabled: u
|
|
89
|
+
}), b = _(
|
|
90
|
+
() => te(l, e),
|
|
91
|
+
[l]
|
|
92
|
+
), g = _(
|
|
93
|
+
() => ae(A ?? [], m),
|
|
94
|
+
[A, m]
|
|
95
|
+
), N = async () => {
|
|
96
|
+
S(!0);
|
|
97
|
+
try {
|
|
98
|
+
await j(E.id), t({
|
|
99
|
+
title: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_TITLE"),
|
|
100
|
+
message: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_MESSAGE"),
|
|
101
|
+
type: "success",
|
|
102
|
+
timeout: 5e3
|
|
103
|
+
}), c(null), a.invalidateQueries({ queryKey: ["allAppointmentServices"] });
|
|
104
|
+
} catch {
|
|
105
|
+
t({
|
|
106
|
+
title: e("ADMIN_ALL_SERVICES_DELETE_ERROR_TITLE"),
|
|
107
|
+
message: e("ADMIN_ALL_SERVICES_DELETE_ERROR_MESSAGE"),
|
|
108
|
+
type: "error"
|
|
109
|
+
});
|
|
110
|
+
} finally {
|
|
111
|
+
S(!1);
|
|
112
|
+
}
|
|
113
|
+
}, T = (r, o) => o === "actions" ? /* @__PURE__ */ n(
|
|
114
|
+
H,
|
|
115
|
+
{
|
|
116
|
+
id: `delete-service-${r.id}-btn`,
|
|
117
|
+
testId: `delete-service-${r.id}-btn-test-id`,
|
|
118
|
+
"aria-label": `delete-service-${r.id}-btn-aria-label`,
|
|
119
|
+
kind: "ghost",
|
|
120
|
+
label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
|
|
121
|
+
disabled: !M,
|
|
122
|
+
onClick: () => c(r),
|
|
123
|
+
children: /* @__PURE__ */ n($, {})
|
|
124
|
+
}
|
|
125
|
+
) : p.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", y = [
|
|
126
|
+
{ id: "home", label: e("BREADCRUMB_HOME"), href: x },
|
|
127
|
+
{ id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
|
|
128
|
+
];
|
|
129
|
+
return /* @__PURE__ */ n(
|
|
130
|
+
F,
|
|
131
|
+
{
|
|
132
|
+
header: /* @__PURE__ */ n(k, { breadcrumbItems: y }),
|
|
133
|
+
main: u ? /* @__PURE__ */ f(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
id: "all-appointment-service-page",
|
|
137
|
+
"data-testid": "all-appointment-service-page-test-id",
|
|
138
|
+
"aria-label": "all-appointment-service-page-aria-label",
|
|
139
|
+
className: d.page,
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ n(
|
|
142
|
+
Q,
|
|
143
|
+
{
|
|
144
|
+
id: "all-services",
|
|
145
|
+
title: e("ADMIN_ALL_SERVICES_TITLE"),
|
|
146
|
+
headers: b,
|
|
147
|
+
rows: g,
|
|
148
|
+
ariaLabel: "all-services-table",
|
|
149
|
+
loading: D,
|
|
150
|
+
errorStateMessage: R ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
|
|
151
|
+
emptyStateMessage: e("ADMIN_ALL_SERVICES_EMPTY_MESSAGE"),
|
|
152
|
+
renderCell: T,
|
|
153
|
+
className: d.table
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
E && /* @__PURE__ */ n(
|
|
157
|
+
W,
|
|
158
|
+
{
|
|
159
|
+
serviceName: E.name,
|
|
160
|
+
isDeleting: v,
|
|
161
|
+
onConfirm: N,
|
|
162
|
+
onCancel: () => c(null)
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
) : /* @__PURE__ */ n(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
id: "all-appointment-service-no-view-privilege",
|
|
171
|
+
"data-testid": "all-appointment-service-no-view-privilege-test-id",
|
|
172
|
+
"aria-label": "all-appointment-service-no-view-privilege-aria-label",
|
|
173
|
+
className: d.noPrivilegeContainer,
|
|
174
|
+
children: e("ADMIN_ALL_SERVICES_ERROR_MESSAGE_NO_VIEW_PRIVILEGE")
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
export {
|
|
181
|
+
re as default
|
|
182
|
+
};
|