@bahmni/appointments-app 0.0.1-dev.338 → 0.0.1-dev.340

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,20 +1,20 @@
1
- import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
- import { H as V, A as O, u as C, s as P, w as B, B as h, y as G, z as L, X as x, D as U, F as H, C as q, J as F, G as k, U as w, I as $ } from "./index-BijQdYmK.js";
1
+ import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
+ import { $ as V, p as P, u as C, F as O, q as B, B as h, r as x, s as L, W as G, P as U, t as F, y as q, J as H, z as $, D as W, U as k, I as w } from "./index-BDBSFoaD.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
- import { useQueryClient as j, useQuery as K } from "@tanstack/react-query";
5
- const Q = V(
6
- O,
4
+ import { useQueryClient as Q, useQuery as j } from "@tanstack/react-query";
5
+ const J = V(
6
+ P,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
- ), W = ({
9
+ ), K = ({
10
10
  serviceName: e,
11
11
  isDeleting: a,
12
12
  onConfirm: t,
13
13
  onCancel: s
14
14
  }) => {
15
- const { t: i } = C();
16
- return /* @__PURE__ */ n(
17
- P,
15
+ const { t: n } = C();
16
+ return /* @__PURE__ */ i(
17
+ O,
18
18
  {
19
19
  id: "delete-service-modal",
20
20
  testId: "delete-service-modal-test-id",
@@ -23,11 +23,11 @@ const Q = V(
23
23
  danger: !0,
24
24
  onRequestClose: s,
25
25
  onRequestSubmit: t,
26
- primaryButtonText: i("ADMIN_ALL_SERVICES_DELETE_BUTTON_LABEL"),
27
- secondaryButtonText: i("ADMIN_ALL_SERVICES_DELETE_CANCEL"),
26
+ primaryButtonText: n("ADMIN_ALL_SERVICES_DELETE_BUTTON_LABEL"),
27
+ secondaryButtonText: n("ADMIN_ALL_SERVICES_DELETE_CANCEL"),
28
28
  primaryButtonDisabled: a,
29
- modalHeading: i("ADMIN_ALL_SERVICES_DELETE_MODAL_TITLE"),
30
- children: i("ADMIN_ALL_SERVICES_DELETE_CONFIRM_BODY", { serviceName: e })
29
+ modalHeading: n("ADMIN_ALL_SERVICES_DELETE_MODAL_TITLE"),
30
+ children: n("ADMIN_ALL_SERVICES_DELETE_CONFIRM_BODY", { serviceName: e })
31
31
  }
32
32
  );
33
33
  }, u = [
@@ -36,15 +36,15 @@ const Q = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
39
- ], Z = "app:appointments:manageServices", J = "app:appointments:adminTab", X = "index-module_page__Gsfbu", Y = "index-module_noPrivilegeContainer__Pu5WZ", z = "index-module_table__GAPmb", d = {
40
- page: X,
41
- noPrivilegeContainer: Y,
42
- table: z
39
+ ], Y = "app:appointments:manageServices", Z = "app:appointments:adminTab", z = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
+ page: z,
41
+ noPrivilegeContainer: X,
42
+ table: ee
43
43
  };
44
- function ee(e) {
44
+ function te(e) {
45
45
  return e.filter((a) => !u.includes(a));
46
46
  }
47
- function te(e, a) {
47
+ function ae(e, a) {
48
48
  return [
49
49
  ...e.map((t) => ({
50
50
  key: t,
@@ -58,7 +58,7 @@ function te(e, a) {
58
58
  }
59
59
  ];
60
60
  }
61
- function ae(e, a) {
61
+ function ie(e, a) {
62
62
  return e.map((t) => ({
63
63
  id: t.uuid,
64
64
  name: t.name,
@@ -69,34 +69,34 @@ function ae(e, a) {
69
69
  attributes: Object.fromEntries(
70
70
  a.map((s) => [
71
71
  s,
72
- t.attributes?.find((i) => i.attributeType === s)?.value ?? null
72
+ t.attributes?.find((n) => n.attributeType === s)?.value ?? null
73
73
  ])
74
74
  )
75
75
  }));
76
76
  }
77
- const le = () => {
78
- const { t: e } = C(), a = j(), { addNotification: t } = h(), { userPrivileges: s } = G(), { appointmentsConfig: i } = Q(), [E, c] = I(null), [b, p] = I(!1), l = i?.serviceTableFields ?? [
77
+ const oe = () => {
78
+ const { t: e } = C(), a = Q(), { addNotification: t } = h(), { userPrivileges: s } = x(), { appointmentsConfig: n } = J(), [E, c] = I(null), [M, p] = I(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
- ], m = L(s, J), M = L(
80
+ ], m = L(s, Z), b = L(
81
81
  s,
82
- Z
82
+ Y
83
83
  ), S = _(
84
- () => ee(l),
84
+ () => te(l),
85
85
  [l]
86
- ), { data: A, isLoading: D, isError: v } = K({
86
+ ), { data: A, isLoading: v, isError: D } = j({
87
87
  queryKey: ["allAppointmentServices"],
88
- queryFn: x,
88
+ queryFn: G,
89
89
  enabled: m
90
90
  }), R = _(
91
- () => te(l, e),
91
+ () => ae(l, e),
92
92
  [l]
93
93
  ), N = _(
94
- () => ae(A ?? [], S),
94
+ () => ie(A ?? [], S),
95
95
  [A, S]
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
99
- await $(E.id), t({
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",
@@ -111,26 +111,26 @@ const le = () => {
111
111
  } finally {
112
112
  p(!1);
113
113
  }
114
- }, T = (r, o) => o === "actions" ? /* @__PURE__ */ n(
115
- k,
114
+ }, T = (r, o) => o === "actions" ? /* @__PURE__ */ i(
115
+ W,
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: !M,
122
+ disabled: !b,
123
123
  onClick: () => c(r),
124
- children: /* @__PURE__ */ n(w, {})
124
+ children: /* @__PURE__ */ i(k, {})
125
125
  }
126
126
  ) : u.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", f = [
127
127
  { id: "home", label: e("BREADCRUMB_HOME"), href: U },
128
128
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
129
129
  ];
130
- return /* @__PURE__ */ n(
131
- H,
130
+ return /* @__PURE__ */ i(
131
+ F,
132
132
  {
133
- header: /* @__PURE__ */ n(F, { breadcrumbItems: f }),
133
+ header: /* @__PURE__ */ i(H, { breadcrumbItems: f, userMenu: /* @__PURE__ */ i($, {}) }),
134
134
  main: m ? /* @__PURE__ */ y(
135
135
  "div",
136
136
  {
@@ -139,7 +139,7 @@ const le = () => {
139
139
  "aria-label": "all-appointment-service-page-aria-label",
140
140
  className: d.page,
141
141
  children: [
142
- /* @__PURE__ */ n(
142
+ /* @__PURE__ */ i(
143
143
  q,
144
144
  {
145
145
  id: "all-services",
@@ -147,25 +147,25 @@ const le = () => {
147
147
  headers: R,
148
148
  rows: N,
149
149
  ariaLabel: "all-services-table",
150
- loading: D,
151
- errorStateMessage: v ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
150
+ loading: v,
151
+ errorStateMessage: D ? 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
- E && /* @__PURE__ */ n(
158
- W,
157
+ E && /* @__PURE__ */ i(
158
+ K,
159
159
  {
160
160
  serviceName: E.name,
161
- isDeleting: b,
161
+ isDeleting: M,
162
162
  onConfirm: g,
163
163
  onCancel: () => c(null)
164
164
  }
165
165
  )
166
166
  ]
167
167
  }
168
- ) : /* @__PURE__ */ n(
168
+ ) : /* @__PURE__ */ i(
169
169
  "div",
170
170
  {
171
171
  id: "all-appointment-service-no-view-privilege",
@@ -179,5 +179,5 @@ const le = () => {
179
179
  );
180
180
  };
181
181
  export {
182
- le as default
182
+ oe as default
183
183
  };