@gen-epix/ui-client-casedb 4.0.2 → 4.2.0

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.
Files changed (69) hide show
  1. package/dist/_chunks/AddCasesToEventDialog.js +98 -98
  2. package/dist/_chunks/AddCasesToEventDialog.js.map +1 -1
  3. package/dist/_chunks/CaseContentForm.js +10 -10
  4. package/dist/_chunks/CaseDbDownloadUtil.js +1 -1
  5. package/dist/_chunks/CaseDbDownloadUtil.js.map +1 -1
  6. package/dist/_chunks/CaseInfoDialog.js +222 -222
  7. package/dist/_chunks/CaseInfoDialog.js.map +1 -1
  8. package/dist/_chunks/CaseSetInfoDialog.js +222 -222
  9. package/dist/_chunks/CaseSetInfoDialog.js.map +1 -1
  10. package/dist/_chunks/CasesAlreadyInCaseSetWarning.js.map +1 -1
  11. package/dist/_chunks/Dashboard.js +296 -295
  12. package/dist/_chunks/Dashboard.js.map +1 -1
  13. package/dist/_chunks/FindSimilarCasesDialog.js +81 -81
  14. package/dist/_chunks/FindSimilarCasesDialog.js.map +1 -1
  15. package/dist/_chunks/HomePageTrends.js.map +1 -1
  16. package/dist/_chunks/LegendaItem.js.map +1 -1
  17. package/dist/_chunks/LineListWidget.js +46 -45
  18. package/dist/_chunks/LineListWidget.js.map +1 -1
  19. package/dist/_chunks/PanelSeparator.js +3 -3
  20. package/dist/_chunks/PanelSeparator.js.map +1 -1
  21. package/dist/_chunks/Upload.js +422 -418
  22. package/dist/_chunks/Upload.js.map +1 -1
  23. package/dist/_chunks/UploadUtil.js +44 -40
  24. package/dist/_chunks/UploadUtil.js.map +1 -1
  25. package/dist/_chunks/chunk-BV7QT456.js +1 -1
  26. package/dist/_chunks/chunk-BV7QT456.js.map +1 -1
  27. package/dist/_chunks/cloneDeep.js +1 -1
  28. package/dist/_chunks/cloneDeep.js.map +1 -1
  29. package/dist/_chunks/dashboardStore.js.map +1 -1
  30. package/dist/_chunks/esm.js +3 -3
  31. package/dist/_chunks/esm.js.map +1 -1
  32. package/dist/_chunks/index.module.js +1 -1
  33. package/dist/_chunks/index.module.js.map +1 -1
  34. package/dist/_chunks/react.js +1 -1
  35. package/dist/_chunks/react.js.map +1 -1
  36. package/dist/_chunks/shallow.js +2 -2
  37. package/dist/_chunks/shallow.js.map +1 -1
  38. package/dist/_chunks/vanilla.js +1 -1
  39. package/dist/_chunks/vanilla.js.map +1 -1
  40. package/dist/_chunks/yup.js +24 -24
  41. package/dist/_chunks/yup.js.map +1 -1
  42. package/dist/classes/services/EventBusService/EventBusService.d.ts +9 -2
  43. package/dist/classes/services/EventBusService/index.js.map +1 -1
  44. package/dist/components/form/fields/ArrangementEditor/index.js +30 -30
  45. package/dist/components/ui/CreateEventDialog/index.js +40 -40
  46. package/dist/components/ui/CreateEventDialog/index.js.map +1 -1
  47. package/dist/components/ui/MapWidget/index.js.map +1 -1
  48. package/dist/components/ui/RemoveCasesFromEventDialog/index.js.map +1 -1
  49. package/dist/components/ui/SequenceDownloadDialog/index.js +57 -44
  50. package/dist/components/ui/SequenceDownloadDialog/index.js.map +1 -1
  51. package/dist/components/ui/TreeWidget/index.js +8 -2
  52. package/dist/components/ui/TreeWidget/index.js.map +1 -1
  53. package/dist/locale/en.json +0 -11
  54. package/dist/locale/nl.json +0 -11
  55. package/dist/models/config.d.ts +2 -0
  56. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +59 -59
  57. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js.map +1 -1
  58. package/dist/utils/UploadUtil/UploadUtil.d.ts +1 -0
  59. package/package.json +68 -75
  60. package/dist/_chunks/index.esm.js +0 -1465
  61. package/dist/_chunks/index.esm.js.map +0 -1
  62. package/dist/components/ui/FileSelector/FileSelector.d.ts +0 -7
  63. package/dist/components/ui/FileSelector/index.d.ts +0 -1
  64. package/dist/components/ui/FileSelector/index.js +0 -206
  65. package/dist/components/ui/FileSelector/index.js.map +0 -1
  66. package/dist/utils/FileUtil/FileUtil.d.ts +0 -5
  67. package/dist/utils/FileUtil/index.d.ts +0 -1
  68. package/dist/utils/FileUtil/index.js +0 -15
  69. package/dist/utils/FileUtil/index.js.map +0 -1
@@ -6,121 +6,121 @@ import { CaseSetUtil as a } from "../utils/CaseSetUtil/index.js";
6
6
  import { t as o } from "./react.js";
7
7
  import { t as s } from "./dashboardStore.js";
8
8
  import { t as c } from "./shallow.js";
9
- import { o as l } from "./index.esm.js";
10
- import { t as u } from "./yup.js";
11
- import { useDataCollectionOptionsQuery as d, useDataCollectionsMapQuery as f, useDataCollectionsQuery as p } from "../dataHooks/useDataCollectionsQuery/index.js";
12
- import { t as m } from "./CaseContentForm.js";
13
- import { useCaseRightsQuery as h } from "../dataHooks/useCaseRightsQuery/index.js";
14
- import { n as g, r as _, t as ee } from "./DataCollectionAccessInfo.js";
9
+ import { t as l } from "./yup.js";
10
+ import { useDataCollectionOptionsQuery as u, useDataCollectionsMapQuery as d, useDataCollectionsQuery as f } from "../dataHooks/useDataCollectionsQuery/index.js";
11
+ import { t as p } from "./CaseContentForm.js";
12
+ import { useCaseRightsQuery as m } from "../dataHooks/useCaseRightsQuery/index.js";
13
+ import { n as h, r as g, t as _ } from "./DataCollectionAccessInfo.js";
15
14
  import { useCaseSetCategoryMapQuery as v } from "../dataHooks/useCaseSetCategoriesQuery/index.js";
16
15
  import { useCaseSetStatusMapQuery as y } from "../dataHooks/useCaseSetStatusesQuery/index.js";
17
16
  import "../components/ui/CaseContentForm/index.js";
18
- import { array as b, object as te, string as ne } from "yup";
19
- import { t as x } from "i18next";
20
- import { CaseDbCaseApi as S, CaseDbColType as C, CaseDbEtlStatus as w, CaseDbUploadAction as re } from "@gen-epix/api-casedb";
21
- import { QueryClientService as T } from "@gen-epix/ui-client-common/classes/services/QueryClientService";
22
- import { FORM_FIELD_DEFINITION_TYPE as E } from "@gen-epix/ui-core-form/models/form";
23
- import { NotificationService as D } from "@gen-epix/ui-client-common/classes/services/NotificationService";
24
- import { Box as O, Link as k, Table as A, TableBody as j, TableCell as M, TableHead as N, TableRow as P, Typography as F } from "@mui/material";
25
- import { use as I, useCallback as L, useEffect as ie, useId as ae, useMemo as R, useRef as oe, useState as z } from "react";
26
- import { useTranslation as B } from "react-i18next";
27
- import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
28
- import { ResponseHandler as W } from "@gen-epix/ui-client-common/components/ui/ResponseHandler";
29
- import { useItemQuery as se } from "@gen-epix/ui-client-common/hooks/useItemQuery";
30
- import { useArray as G } from "@gen-epix/ui-core/hooks/useArray";
31
- import { GenericForm as ce } from "@gen-epix/ui-core-form/components/helpers/GenericForm";
32
- import { useQueryMemo as K } from "@gen-epix/ui-client-common/hooks/useQueryMemo";
33
- import { Confirmation as le } from "@gen-epix/ui-core-components/components/Confirmation";
34
- import ue from "@mui/icons-material/Edit";
35
- import { withDialog as q } from "@gen-epix/ui-core-components/hoc/withDialog";
36
- import { TestIdUtil as J } from "@gen-epix/ui-core/utils/TestIdUtil";
37
- import de from "@mui/icons-material/Save";
38
- import { FormUtil as fe } from "@gen-epix/ui-core-form/utils/FormUtil";
39
- import { GenericErrorMessage as Y } from "@gen-epix/ui-client-common/components/ui/GenericErrorMessage";
40
- import pe from "@mui/icons-material/Delete";
41
- import { EpiContactDetailsDialog as X } from "@gen-epix/ui-client-common/components/epi/EpiContactDetailsDialog";
42
- import me from "@mui/icons-material/Share";
17
+ import { array as b, object as x, string as ee } from "yup";
18
+ import { t as S } from "i18next";
19
+ import { CaseDbCaseApi as C, CaseDbColType as w, CaseDbEtlStatus as T, CaseDbUploadAction as E } from "@gen-epix/api-casedb";
20
+ import { QueryClientService as D } from "@gen-epix/ui-client-common/classes/services/QueryClientService";
21
+ import { FORM_FIELD_DEFINITION_TYPE as O } from "@gen-epix/ui-core-form/models/form";
22
+ import { NotificationService as k } from "@gen-epix/ui-client-common/classes/services/NotificationService";
23
+ import { Box as A, Link as j, Table as M, TableBody as N, TableCell as P, TableHead as F, TableRow as I, Typography as L } from "@mui/material";
24
+ import { use as R, useCallback as z, useEffect as te, useId as ne, useMemo as B, useRef as re, useState as V } from "react";
25
+ import { useTranslation as H } from "react-i18next";
26
+ import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
27
+ import { ResponseHandler as K } from "@gen-epix/ui-client-common/components/ui/ResponseHandler";
28
+ import { useItemQuery as ie } from "@gen-epix/ui-client-common/hooks/useItemQuery";
29
+ import { useArray as q } from "@gen-epix/ui-core/hooks/useArray";
30
+ import { useForm as J } from "react-hook-form";
31
+ import { GenericForm as ae } from "@gen-epix/ui-core-form/components/helpers/GenericForm";
32
+ import { useQueryMemo as oe } from "@gen-epix/ui-client-common/hooks/useQueryMemo";
33
+ import { Confirmation as se } from "@gen-epix/ui-core-components/components/Confirmation";
34
+ import ce from "@mui/icons-material/Edit";
35
+ import { withDialog as Y } from "@gen-epix/ui-core-components/hoc/withDialog";
36
+ import { TestIdUtil as X } from "@gen-epix/ui-core/utils/TestIdUtil";
37
+ import le from "@mui/icons-material/Save";
38
+ import { FormUtil as ue } from "@gen-epix/ui-core-form/utils/FormUtil";
39
+ import { GenericErrorMessage as de } from "@gen-epix/ui-client-common/components/ui/GenericErrorMessage";
40
+ import { EpiContactDetailsDialog as fe } from "@gen-epix/ui-client-common/components/epi/EpiContactDetailsDialog";
41
+ import pe from "@mui/icons-material/Share";
42
+ import me from "@mui/icons-material/Delete";
43
43
  import he from "@mui/icons-material/ArrowLeft";
44
44
  import { Spinner as ge } from "@gen-epix/ui-core-components/components/Spinner";
45
45
  import { useDeleteMutation as _e } from "@gen-epix/ui-client-common/hooks/useDeleteMutation";
46
46
  import { NavLink as ve } from "@gen-epix/ui-client-common/components/ui/NavLink";
47
47
  //#region src/components/ui/CaseInfoDialog/CaseCaseSetInfo.tsx
48
48
  var ye = ({ caseDbCase: e, ...t }) => {
49
- let r = v(), i = y(), { t: o } = B(), s = {
49
+ let r = v(), i = y(), { t: o } = H(), s = {
50
50
  invert: !1,
51
51
  key: "case_id",
52
52
  members: [e.id],
53
53
  type: "UUID_SET"
54
- }, { data: c, error: l, isLoading: u } = K({
55
- queryFn: async ({ signal: e }) => (await S.getInstance().caseSetMembersPostQuery(s, null, null, { signal: e })).data,
56
- queryKey: T.getInstance().getGenericKey(n.CASE_SET_MEMBERS, s)
54
+ }, { data: c, error: l, isLoading: u } = oe({
55
+ queryFn: async ({ signal: e }) => (await C.getInstance().caseSetMembersPostQuery(s, null, null, { signal: e })).data,
56
+ queryKey: D.getInstance().getGenericKey(n.CASE_SET_MEMBERS, s)
57
57
  }), d = {
58
58
  invert: !1,
59
59
  key: "id",
60
60
  members: c?.map((e) => e.case_set_id) ?? [],
61
61
  type: "UUID_SET"
62
- }, { data: f, error: p, isLoading: m } = K({
62
+ }, { data: f, error: p, isLoading: m } = oe({
63
63
  enabled: d.members.length > 0,
64
- queryFn: async ({ signal: e }) => (await S.getInstance().caseSetsPostQuery(d, null, null, { signal: e })).data,
65
- queryKey: T.getInstance().getGenericKey(n.CASE_SETS, d)
66
- }), h = G([r, i]);
67
- return /* @__PURE__ */ U(O, {
64
+ queryFn: async ({ signal: e }) => (await C.getInstance().caseSetsPostQuery(d, null, null, { signal: e })).data,
65
+ queryKey: D.getInstance().getGenericKey(n.CASE_SETS, d)
66
+ }), h = q([r, i]);
67
+ return /* @__PURE__ */ G(A, {
68
68
  ...t,
69
- children: [/* @__PURE__ */ H(F, {
69
+ children: [/* @__PURE__ */ W(L, {
70
70
  variant: "h6",
71
71
  children: o`Events`
72
- }), /* @__PURE__ */ U(W, {
72
+ }), /* @__PURE__ */ G(K, {
73
73
  error: l || p,
74
74
  inlineSpinner: !0,
75
75
  isLoading: u || m,
76
76
  loadables: h,
77
77
  shouldHideActionButtons: !0,
78
- children: [f?.length > 0 && /* @__PURE__ */ U(A, {
78
+ children: [f?.length > 0 && /* @__PURE__ */ G(M, {
79
79
  size: "small",
80
- children: [/* @__PURE__ */ H(N, { children: /* @__PURE__ */ U(P, { children: [
81
- /* @__PURE__ */ H(M, {
80
+ children: [/* @__PURE__ */ W(F, { children: /* @__PURE__ */ G(I, { children: [
81
+ /* @__PURE__ */ W(P, {
82
82
  sx: { width: "calc(100% * 1/3)" },
83
83
  children: o`Name`
84
84
  }),
85
- /* @__PURE__ */ H(M, {
85
+ /* @__PURE__ */ W(P, {
86
86
  sx: { width: "calc(100% * 1/3)" },
87
87
  children: o`Category`
88
88
  }),
89
- /* @__PURE__ */ H(M, {
89
+ /* @__PURE__ */ W(P, {
90
90
  sx: { width: "calc(100% * 1/3)" },
91
91
  children: o`Status`
92
92
  })
93
- ] }) }), /* @__PURE__ */ H(j, { children: f?.map((e) => /* @__PURE__ */ U(P, { children: [
94
- /* @__PURE__ */ H(M, { children: /* @__PURE__ */ H(ve, {
93
+ ] }) }), /* @__PURE__ */ W(N, { children: f?.map((e) => /* @__PURE__ */ G(I, { children: [
94
+ /* @__PURE__ */ W(P, { children: /* @__PURE__ */ W(ve, {
95
95
  activeAsText: !0,
96
96
  to: a.createCaseSetLink(e),
97
97
  children: e.name
98
98
  }) }),
99
- /* @__PURE__ */ H(M, { children: r.map.get(e.case_set_category_id)?.name ?? o`Unknown` }),
100
- /* @__PURE__ */ H(M, { children: i.map.get(e.case_set_status_id)?.name ?? o`Unknown` })
99
+ /* @__PURE__ */ W(P, { children: r.map.get(e.case_set_category_id)?.name ?? o`Unknown` }),
100
+ /* @__PURE__ */ W(P, { children: i.map.get(e.case_set_status_id)?.name ?? o`Unknown` })
101
101
  ] }, e.id)) })]
102
- }), (!f || f?.length === 0) && /* @__PURE__ */ H(O, {
102
+ }), (!f || f?.length === 0) && /* @__PURE__ */ W(A, {
103
103
  sx: { fontStyle: "italic" },
104
104
  children: o`None`
105
105
  })]
106
106
  })]
107
107
  });
108
108
  }, be = ({ caseDbCase: e, caseRights: t, formId: r, onFinish: i, onIsSavingChange: a, ...l }) => {
109
- let u = I(s), d = o(u, (e) => e.completeCaseType), f = o(u, c((e) => e.mutateCachedCase)), [p, h] = z(!1), g = R(() => {
109
+ let u = R(s), d = o(u, (e) => e.completeCaseType), f = o(u, c((e) => e.mutateCachedCase)), [m, h] = V(!1), g = B(() => {
110
110
  let e = [];
111
111
  return t.read_col_ids.forEach((n) => {
112
112
  t.write_col_ids.includes(n) && e.push(n);
113
113
  }), e;
114
- }, [t]), _ = L((t, r) => {
114
+ }, [t]), _ = z((t, r) => {
115
115
  h(!0), a(!0), (async () => {
116
- let o = T.getInstance().getQueryKeyDependencies([n.CASES], !0), s = D.getInstance().showNotification({
116
+ let o = D.getInstance().getQueryKeyDependencies([n.CASES], !0), s = k.getInstance().showNotification({
117
117
  isLoading: !0,
118
- message: x("Saving case data"),
118
+ message: S("Saving case data"),
119
119
  severity: "info"
120
120
  });
121
121
  try {
122
- await T.getInstance().cancelQueries(o);
123
- let n = (await S.getInstance().uploadCases({
122
+ await D.getInstance().cancelQueries(o);
123
+ let n = (await C.getInstance().uploadCases({
124
124
  case_batch: { cases: [{ case: {
125
125
  case_type_id: d.id,
126
126
  content: r,
@@ -128,14 +128,14 @@ var ye = ({ caseDbCase: e, ...t }) => {
128
128
  id: t
129
129
  } }] },
130
130
  case_type_id: d.id,
131
- on_exists: re.UPDATE
131
+ on_exists: E.UPDATE
132
132
  })).data;
133
- if (n.status !== w.SKIPPED && n.status !== w.SUCCESS && n.status !== w.UPDATED) throw Error("Case upload failed");
134
- f(e.id, e), D.getInstance().fulfillNotification(s, x("Successfully saved case data."), "success");
133
+ if (n.status !== T.SKIPPED && n.status !== T.SUCCESS && n.status !== T.UPDATED) throw Error("Case upload failed");
134
+ f(e.id, e), k.getInstance().fulfillNotification(s, S("Successfully saved case data."), "success");
135
135
  } catch {
136
- D.getInstance().fulfillNotification(s, x("Could not save case data."), "error");
136
+ k.getInstance().fulfillNotification(s, S("Could not save case data."), "error");
137
137
  } finally {
138
- await T.getInstance().invalidateQueryKeys(o), h(!1), a(!1), i();
138
+ await D.getInstance().invalidateQueryKeys(o), h(!1), a(!1), i();
139
139
  }
140
140
  })();
141
141
  }, [
@@ -145,15 +145,15 @@ var ye = ({ caseDbCase: e, ...t }) => {
145
145
  i,
146
146
  a
147
147
  ]);
148
- return /* @__PURE__ */ U(O, {
148
+ return /* @__PURE__ */ G(A, {
149
149
  ...l,
150
- children: [/* @__PURE__ */ H(F, {
150
+ children: [/* @__PURE__ */ W(L, {
151
151
  variant: "h6",
152
- children: x`Content`
153
- }), /* @__PURE__ */ U(O, { children: [p && /* @__PURE__ */ H(ge, {
152
+ children: S`Content`
153
+ }), /* @__PURE__ */ G(A, { children: [m && /* @__PURE__ */ W(ge, {
154
154
  inline: !0,
155
- label: x`Saving case data`
156
- }), !p && /* @__PURE__ */ H(m, {
155
+ label: S`Saving case data`
156
+ }), !m && /* @__PURE__ */ W(p, {
157
157
  caseContent: e.content,
158
158
  caseId: e.id,
159
159
  completeCaseType: d,
@@ -163,261 +163,261 @@ var ye = ({ caseDbCase: e, ...t }) => {
163
163
  })] })]
164
164
  });
165
165
  }, xe = ({ caseDbCase: e, ...t }) => {
166
- let { t: n } = B(), r = f(), i = G([r]);
167
- return /* @__PURE__ */ U(O, {
166
+ let { t: n } = H(), r = d(), i = q([r]);
167
+ return /* @__PURE__ */ G(A, {
168
168
  ...t,
169
169
  children: [
170
- /* @__PURE__ */ H(F, {
170
+ /* @__PURE__ */ W(L, {
171
171
  variant: "h6",
172
172
  children: n`Read-only content`
173
173
  }),
174
- !e && /* @__PURE__ */ H(Y, { error: /* @__PURE__ */ Error("Case could not be found") }),
175
- /* @__PURE__ */ H(W, {
174
+ !e && /* @__PURE__ */ W(de, { error: /* @__PURE__ */ Error("Case could not be found") }),
175
+ /* @__PURE__ */ W(K, {
176
176
  inlineSpinner: !0,
177
177
  loadables: i,
178
178
  shouldHideActionButtons: !0,
179
- children: e && /* @__PURE__ */ U(A, {
179
+ children: e && /* @__PURE__ */ G(M, {
180
180
  size: "small",
181
- children: [/* @__PURE__ */ H(N, { children: /* @__PURE__ */ U(P, { children: [/* @__PURE__ */ H(M, {
181
+ children: [/* @__PURE__ */ W(F, { children: /* @__PURE__ */ G(I, { children: [/* @__PURE__ */ W(P, {
182
182
  sx: { width: "calc(100% * 1/3)" },
183
183
  children: n`Column`
184
- }), /* @__PURE__ */ H(M, {
184
+ }), /* @__PURE__ */ W(P, {
185
185
  sx: { width: "calc(100% * 2/3)" },
186
186
  children: n`Value`
187
- })] }) }), /* @__PURE__ */ H(j, { children: /* @__PURE__ */ U(P, { children: [/* @__PURE__ */ H(M, { children: n`Case id` }), /* @__PURE__ */ H(M, { children: e.id })] }) })]
187
+ })] }) }), /* @__PURE__ */ W(N, { children: /* @__PURE__ */ G(I, { children: [/* @__PURE__ */ W(P, { children: n`Case id` }), /* @__PURE__ */ W(P, { children: e.id })] }) })]
188
188
  })
189
189
  })
190
190
  ]
191
191
  });
192
192
  }, Se = ({ caseDbCase: e, ...n }) => {
193
- let { t: i } = B(), a = oe(null), c = I(s), l = o(c, (e) => e.completeCaseType), u = R(() => t.getCols(l), [l]), d = L((e, t) => {
193
+ let { t: i } = H(), a = re(null), c = R(s), l = o(c, (e) => e.completeCaseType), u = B(() => t.getCols(l), [l]), d = z((e, t) => {
194
194
  a.current.open({
195
195
  organizationId: e,
196
196
  organizationName: t
197
197
  });
198
198
  }, []);
199
- return /* @__PURE__ */ U(O, {
199
+ return /* @__PURE__ */ G(A, {
200
200
  ...n,
201
201
  children: [
202
- /* @__PURE__ */ H(F, {
202
+ /* @__PURE__ */ W(L, {
203
203
  variant: "h6",
204
204
  children: i`Content`
205
205
  }),
206
- !e && /* @__PURE__ */ H(Y, { error: /* @__PURE__ */ Error("Case could not be found") }),
207
- e && /* @__PURE__ */ U(A, {
206
+ !e && /* @__PURE__ */ W(de, { error: /* @__PURE__ */ Error("Case could not be found") }),
207
+ e && /* @__PURE__ */ G(M, {
208
208
  size: "small",
209
- children: [/* @__PURE__ */ H(N, { children: /* @__PURE__ */ U(P, { children: [/* @__PURE__ */ H(M, {
209
+ children: [/* @__PURE__ */ W(F, { children: /* @__PURE__ */ G(I, { children: [/* @__PURE__ */ W(P, {
210
210
  sx: { width: "calc(100% / 3)" },
211
211
  children: i`Column`
212
- }), /* @__PURE__ */ H(M, {
212
+ }), /* @__PURE__ */ W(P, {
213
213
  sx: { width: "calc(100% / 3 * 2)" },
214
214
  children: i`Value`
215
- })] }) }), /* @__PURE__ */ H(j, { children: u.map((t) => {
215
+ })] }) }), /* @__PURE__ */ W(N, { children: u.map((t) => {
216
216
  let n = l.ref_cols[t.ref_col_id], i = r.getRowValue(e.content, t, l);
217
- return /* @__PURE__ */ U(P, { children: [/* @__PURE__ */ H(M, {
217
+ return /* @__PURE__ */ G(I, { children: [/* @__PURE__ */ W(P, {
218
218
  sx: { width: "calc(100% / 3)" },
219
219
  children: t.label
220
- }), /* @__PURE__ */ U(M, {
220
+ }), /* @__PURE__ */ G(P, {
221
221
  sx: { width: "calc(100% / 3 * 2)" },
222
- children: [n.col_type === C.ORGANIZATION && !i.isMissing && /* @__PURE__ */ H(k, {
222
+ children: [n.col_type === w.ORGANIZATION && !i.isMissing && /* @__PURE__ */ W(j, {
223
223
  color: "primary",
224
224
  onClick: () => {
225
225
  d(e.content[t.id], i.long);
226
226
  },
227
227
  sx: { cursor: "pointer" },
228
228
  children: i.long
229
- }), n.col_type !== C.ORGANIZATION && /* @__PURE__ */ H(V, { children: i.long })]
229
+ }), n.col_type !== w.ORGANIZATION && /* @__PURE__ */ W(U, { children: i.long })]
230
230
  })] }, t.id);
231
231
  }) })]
232
232
  }),
233
- /* @__PURE__ */ H(X, { ref: a })
233
+ /* @__PURE__ */ W(fe, { ref: a })
234
234
  ]
235
235
  });
236
236
  }, Ce = ({ ...e }) => {
237
- let { t } = B();
238
- return /* @__PURE__ */ U(O, {
237
+ let { t } = H();
238
+ return /* @__PURE__ */ G(A, {
239
239
  ...e,
240
- children: [/* @__PURE__ */ H(F, {
240
+ children: [/* @__PURE__ */ W(L, {
241
241
  variant: "h6",
242
242
  children: t`Shared in`
243
- }), /* @__PURE__ */ H(ee, {})]
243
+ }), /* @__PURE__ */ W(_, {})]
244
244
  });
245
245
  }, we = /* @__PURE__ */ e(i(), 1), Te = ({ caseDbCase: e, formId: t, onFinish: r, onIsSavingChange: i, ...a }) => {
246
- let { t: o } = B(), [s, c] = z(!1), d = g(), f = R(() => te().shape({ dataCollectionIds: b().of(ne().uuid4()).required() }), []), p = R(() => [{
247
- definition: E.AUTOCOMPLETE,
246
+ let { t: o } = H(), [s, c] = V(!1), u = h(), d = B(() => x().shape({ dataCollectionIds: b().of(ee().uuid4()).required() }), []), f = B(() => [{
247
+ definition: O.AUTOCOMPLETE,
248
248
  label: o`Data collections`,
249
249
  multiple: !0,
250
250
  name: "dataCollectionIds",
251
- options: d?.itemDataCollectionOptions?.[0] ?? []
252
- }], [o, d]), m = R(() => ({ dataCollectionIds: d?.rights?.[0]?.shared_in_data_collection_ids ?? [] }), [d]), h = R(() => fe.createFormValues(p, m), [p, m]), _ = l({
253
- resolver: u(f),
254
- values: h
255
- }), { handleSubmit: ee } = _, v = L(({ dataCollectionIds: t }) => {
251
+ options: u?.itemDataCollectionOptions?.[0] ?? []
252
+ }], [o, u]), p = B(() => ({ dataCollectionIds: u?.rights?.[0]?.shared_in_data_collection_ids ?? [] }), [u]), m = B(() => ue.createFormValues(f, p), [f, p]), g = J({
253
+ resolver: l(d),
254
+ values: m
255
+ }), { handleSubmit: _ } = g, v = z(({ dataCollectionIds: t }) => {
256
256
  (async () => {
257
257
  c(!0), i(!0);
258
- let a = T.getInstance().getQueryKeyDependencies([n.CASE_DATA_COLLECTION_LINKS], !0), s = D.getInstance().showNotification({
258
+ let a = D.getInstance().getQueryKeyDependencies([n.CASE_DATA_COLLECTION_LINKS], !0), s = k.getInstance().showNotification({
259
259
  isLoading: !0,
260
260
  message: o("Saving case data collections"),
261
261
  severity: "info"
262
262
  });
263
263
  try {
264
- await T.getInstance().cancelQueries(a);
265
- let n = d?.rights?.[0], r = (0, we.default)(t, n.shared_in_data_collection_ids), i = (0, we.default)(n.shared_in_data_collection_ids, t);
266
- r.length > 0 && await S.getInstance().caseDataCollectionLinksPostSome(r.map((t) => ({
264
+ await D.getInstance().cancelQueries(a);
265
+ let n = u?.rights?.[0], r = (0, we.default)(t, n.shared_in_data_collection_ids), i = (0, we.default)(n.shared_in_data_collection_ids, t);
266
+ r.length > 0 && await C.getInstance().caseDataCollectionLinksPostSome(r.map((t) => ({
267
267
  case_id: e.id,
268
268
  data_collection_id: t
269
- }))), i.length > 0 && await S.getInstance().caseDataCollectionLinksDeleteSome(d.itemDataCollectionLinks[0]?.filter((e) => i.includes(e.data_collection_id)).map((e) => e.id).join(",")), D.getInstance().fulfillNotification(s, o("Successfully saved case data collections."), "success");
269
+ }))), i.length > 0 && await C.getInstance().caseDataCollectionLinksDeleteSome(u.itemDataCollectionLinks[0]?.filter((e) => i.includes(e.data_collection_id)).map((e) => e.id).join(",")), k.getInstance().fulfillNotification(s, o("Successfully saved case data collections."), "success");
270
270
  } catch {
271
- D.getInstance().fulfillNotification(s, o("Could not save case data collections."), "error");
271
+ k.getInstance().fulfillNotification(s, o("Could not save case data collections."), "error");
272
272
  } finally {
273
- await T.getInstance().invalidateQueryKeys(a), c(!1), i(!1), r();
273
+ await D.getInstance().invalidateQueryKeys(a), c(!1), i(!1), r();
274
274
  }
275
275
  })();
276
276
  }, [
277
- d,
277
+ u,
278
278
  e.id,
279
279
  r,
280
280
  i,
281
281
  o
282
282
  ]);
283
- return s ? /* @__PURE__ */ H(ge, {
283
+ return s ? /* @__PURE__ */ W(ge, {
284
284
  inline: !0,
285
285
  label: o`Saving case data collections`
286
- }) : /* @__PURE__ */ U(O, {
286
+ }) : /* @__PURE__ */ G(A, {
287
287
  ...a,
288
- children: [/* @__PURE__ */ H(F, {
288
+ children: [/* @__PURE__ */ W(L, {
289
289
  variant: "h6",
290
290
  children: o`Data collections`
291
- }), /* @__PURE__ */ H(ce, {
292
- formFieldDefinitions: p,
291
+ }), /* @__PURE__ */ W(ae, {
292
+ formFieldDefinitions: f,
293
293
  formId: t,
294
- formMethods: _,
295
- onSubmit: ee(v),
296
- schema: f
294
+ formMethods: g,
295
+ onSubmit: _(v),
296
+ schema: d
297
297
  })]
298
298
  });
299
299
  }, Ee = /* @__PURE__ */ function(e) {
300
300
  return e.EDIT = "EDIT", e.INFO = "INFO", e.SHARING = "SHARING", e;
301
- }({}), Z = q(({ onActionsChange: e, onClose: t, onTitleChange: r, openProps: i }) => {
302
- let { t: a } = B(), l = R(() => [i.caseId], [i.caseId]), u = p(), m = f(), g = d(), ee = I(s), v = o(ee, c((e) => e.fetchData)), [y, b] = z(i.initialTab ?? "INFO"), [te, ne] = z(!1), [x, C] = z(!1), [w, re] = z(!1), E = oe(null), D = ae(), O = ae(), k = L(async () => {
303
- ne(!1), C(!1), re(!0), b("INFO"), await v(), re(!1);
304
- }, [v]), A = L(async () => {
305
- await k(), t();
306
- }, [t, k]), j = L(() => {
301
+ }({}), Z = Y(({ onActionsChange: e, onClose: t, onTitleChange: r, openProps: i }) => {
302
+ let { t: a } = H(), l = B(() => [i.caseId], [i.caseId]), p = f(), h = d(), _ = u(), v = R(s), y = o(v, c((e) => e.fetchData)), [b, x] = V(i.initialTab ?? "INFO"), [ee, S] = V(!1), [w, T] = V(!1), [E, O] = V(!1), k = re(null), A = ne(), j = ne(), M = z(async () => {
303
+ S(!1), T(!1), O(!0), x("INFO"), await y(), O(!1);
304
+ }, [y]), N = z(async () => {
305
+ await M(), t();
306
+ }, [t, M]), P = z(() => {
307
307
  t();
308
- }, [t]), { isMutating: M, mutate: N } = _e({
309
- associationQueryKeys: T.getInstance().getQueryKeyDependencies([n.CASES], !0),
308
+ }, [t]), { isMutating: F, mutate: I } = _e({
309
+ associationQueryKeys: D.getInstance().getQueryKeyDependencies([n.CASES], !0),
310
310
  getErrorNotificationMessage: (e) => a("Unable to remove case: {{id}}.", { id: e.id }),
311
311
  getProgressNotificationMessage: (e) => a("Deleting case: {{id}}...", { id: e.id }),
312
312
  getSuccessNotificationMessage: (e) => a("Case: {{id}}, has been removed.", { id: e.id }),
313
- onError: j,
314
- onSuccess: A,
315
- queryFn: async (e) => await S.getInstance().casesDeleteOne(e.id),
316
- resourceQueryKey: T.getInstance().getGenericKey(n.CASES)
317
- }), P = h(l, i.caseTypeId, !M && !w), ce = G([
318
- P,
319
- u,
320
- m,
321
- g
322
- ]), { data: q, error: fe, isLoading: Y } = se({
313
+ onError: P,
314
+ onSuccess: N,
315
+ queryFn: async (e) => await C.getInstance().casesDeleteOne(e.id),
316
+ resourceQueryKey: D.getInstance().getGenericKey(n.CASES)
317
+ }), J = m(l, i.caseTypeId, !F && !E), ae = q([
318
+ J,
319
+ p,
320
+ h,
321
+ _
322
+ ]), { data: Y, error: ue, isLoading: de } = ie({
323
323
  baseQueryKey: n.CASES_LAZY,
324
324
  itemId: i.caseId,
325
325
  useQueryOptions: {
326
- enabled: !M && !w,
327
- queryFn: async ({ signal: e }) => (await S.getInstance().casesGetOne(i.caseId, { signal: e })).data
326
+ enabled: !F && !E,
327
+ queryFn: async ({ signal: e }) => (await C.getInstance().casesGetOne(i.caseId, { signal: e })).data
328
328
  }
329
- }), X = R(() => ({
329
+ }), fe = B(() => ({
330
330
  invert: !1,
331
331
  key: "case_id",
332
- members: [q?.id],
332
+ members: [Y?.id],
333
333
  type: "UUID_SET"
334
- }), [q?.id]), { data: ve, error: we, isLoading: Ee } = K({
335
- enabled: !!q,
336
- queryFn: async ({ signal: e }) => (await S.getInstance().caseDataCollectionLinksPostQuery(X, null, null, { signal: e })).data,
337
- queryKey: T.getInstance().getGenericKey(n.CASE_DATA_COLLECTION_LINKS, X)
338
- }), Z = R(() => !!P.data && P.data.some((e) => e.is_full_access || e.write_col_ids.length), [P.data]), Q = R(() => !!P.data && P.data.some((e) => e.is_full_access || e.remove_data_collection_ids.length || e.add_data_collection_ids.length), [P.data]), De = L(() => !!P.data && P.data.some((e) => e.is_full_access || e.can_delete), [P]), Oe = L(() => {
339
- b("EDIT");
340
- }, []), ke = L(() => {
341
- b("SHARING");
342
- }, []), Ae = L(() => {
343
- b("INFO");
344
- }, []), je = L((e) => {
345
- ne(e);
346
- }, []), Me = L((e) => {
347
- C(e);
348
- }, []), Ne = L(() => {
349
- E.current.open();
350
- }, []), Pe = L(() => {
351
- N(q);
352
- }, [q, N]), $ = te || x;
353
- ie(() => {
354
- r(y === "EDIT" ? a`Case information - Edit` : y === "SHARING" ? a`Case information - Share` : a`Case information`);
334
+ }), [Y?.id]), { data: ve, error: we, isLoading: Ee } = oe({
335
+ enabled: !!Y,
336
+ queryFn: async ({ signal: e }) => (await C.getInstance().caseDataCollectionLinksPostQuery(fe, null, null, { signal: e })).data,
337
+ queryKey: D.getInstance().getGenericKey(n.CASE_DATA_COLLECTION_LINKS, fe)
338
+ }), Z = B(() => !!J.data && J.data.some((e) => e.is_full_access || e.write_col_ids.length), [J.data]), Q = B(() => !!J.data && J.data.some((e) => e.is_full_access || e.remove_data_collection_ids.length || e.add_data_collection_ids.length), [J.data]), De = z(() => !!J.data && J.data.some((e) => e.is_full_access || e.can_delete), [J]), Oe = z(() => {
339
+ x("EDIT");
340
+ }, []), ke = z(() => {
341
+ x("SHARING");
342
+ }, []), Ae = z(() => {
343
+ x("INFO");
344
+ }, []), je = z((e) => {
345
+ S(e);
346
+ }, []), Me = z((e) => {
347
+ T(e);
348
+ }, []), Ne = z(() => {
349
+ k.current.open();
350
+ }, []), Pe = z(() => {
351
+ I(Y);
352
+ }, [Y, I]), $ = ee || w;
353
+ te(() => {
354
+ r(b === "EDIT" ? a`Case information - Edit` : b === "SHARING" ? a`Case information - Share` : a`Case information`);
355
355
  }, [
356
- y,
356
+ b,
357
357
  r,
358
358
  a
359
- ]), ie(() => {
359
+ ]), te(() => {
360
360
  let t = [];
361
- (y === "EDIT" || y === "SHARING") && t.push({
362
- ...J.createAttributes("CaseInfoDialog-goBackButton"),
361
+ (b === "EDIT" || b === "SHARING") && t.push({
362
+ ...X.createAttributes("CaseInfoDialog-goBackButton"),
363
363
  color: "primary",
364
364
  disabled: $,
365
365
  label: a`Go back`,
366
366
  onClick: Ae,
367
- startIcon: /* @__PURE__ */ H(he, {}),
367
+ startIcon: /* @__PURE__ */ W(he, {}),
368
368
  variant: "outlined"
369
- }), y === "EDIT" && Z ? t.push({
370
- ...J.createAttributes("CaseInfoDialog-saveButton"),
369
+ }), b === "EDIT" && Z ? t.push({
370
+ ...X.createAttributes("CaseInfoDialog-saveButton"),
371
371
  color: "secondary",
372
372
  disabled: $,
373
- form: D,
373
+ form: A,
374
374
  label: a`Save`,
375
- startIcon: /* @__PURE__ */ H(de, {}),
375
+ startIcon: /* @__PURE__ */ W(le, {}),
376
376
  type: "submit",
377
377
  variant: "contained"
378
- }) : y === "SHARING" && Q ? t.push({
379
- ...J.createAttributes("CaseInfoDialog-saveButton"),
378
+ }) : b === "SHARING" && Q ? t.push({
379
+ ...X.createAttributes("CaseInfoDialog-saveButton"),
380
380
  color: "secondary",
381
381
  disabled: $,
382
- form: O,
382
+ form: j,
383
383
  label: a`Save`,
384
- startIcon: /* @__PURE__ */ H(de, {}),
384
+ startIcon: /* @__PURE__ */ W(le, {}),
385
385
  type: "submit",
386
386
  variant: "contained"
387
- }) : y === "INFO" && (t.push({
388
- ...J.createAttributes("CaseSetInfoDialog-deleteButton"),
387
+ }) : b === "INFO" && (t.push({
388
+ ...X.createAttributes("CaseSetInfoDialog-deleteButton"),
389
389
  color: "primary",
390
390
  disabled: !De(),
391
391
  label: a`Delete`,
392
392
  onClick: Ne,
393
- startIcon: /* @__PURE__ */ H(pe, {}),
393
+ startIcon: /* @__PURE__ */ W(me, {}),
394
394
  variant: "outlined"
395
395
  }), t.push({
396
- ...J.createAttributes("CaseInfoDialog-editDataCollectionsButton"),
396
+ ...X.createAttributes("CaseInfoDialog-editDataCollectionsButton"),
397
397
  color: "primary",
398
398
  disabled: !Q,
399
399
  label: a`Share`,
400
400
  onClick: ke,
401
- startIcon: /* @__PURE__ */ H(me, {}),
401
+ startIcon: /* @__PURE__ */ W(pe, {}),
402
402
  variant: "outlined"
403
403
  }), t.push({
404
- ...J.createAttributes("CaseInfoDialog-editCaseContentButton"),
404
+ ...X.createAttributes("CaseInfoDialog-editCaseContentButton"),
405
405
  color: "primary",
406
406
  disabled: !Z,
407
407
  label: a`Edit`,
408
408
  onClick: Oe,
409
- startIcon: /* @__PURE__ */ H(ue, {}),
409
+ startIcon: /* @__PURE__ */ W(ce, {}),
410
410
  variant: "outlined"
411
411
  })), e(t);
412
412
  }, [
413
413
  e,
414
414
  Oe,
415
415
  a,
416
- y,
416
+ b,
417
417
  Ae,
418
418
  ke,
419
- D,
420
- O,
419
+ A,
420
+ j,
421
421
  t,
422
422
  $,
423
423
  Q,
@@ -425,77 +425,77 @@ var ye = ({ caseDbCase: e, ...t }) => {
425
425
  De,
426
426
  Z
427
427
  ]);
428
- let Fe = R(() => ({
429
- createdInDataCollection: q ? m.map.get(q.created_in_data_collection_id) : void 0,
428
+ let Fe = B(() => ({
429
+ createdInDataCollection: Y ? h.map.get(Y.created_in_data_collection_id) : void 0,
430
430
  itemDataCollectionLinks: [ve],
431
- rights: P.data,
432
- userDataCollectionOptions: g.options,
433
- userDataCollections: u.data,
434
- userDataCollectionsMap: m.map
431
+ rights: J.data,
432
+ userDataCollectionOptions: _.options,
433
+ userDataCollections: p.data,
434
+ userDataCollectionsMap: h.map
435
435
  }), [
436
- u.data,
437
- m.map,
438
- g.options,
436
+ p.data,
437
+ h.map,
438
+ _.options,
439
439
  ve,
440
- P.data,
441
- q
440
+ J.data,
441
+ Y
442
442
  ]);
443
- return w ? /* @__PURE__ */ H(ge, {
443
+ return E ? /* @__PURE__ */ W(ge, {
444
444
  inline: !0,
445
445
  label: a`Refreshing data`
446
- }) : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(W, {
447
- error: fe || we,
446
+ }) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(K, {
447
+ error: ue || we,
448
448
  inlineSpinner: !0,
449
- isLoading: Y || Ee,
450
- loadables: ce,
449
+ isLoading: de || Ee,
450
+ loadables: ae,
451
451
  shouldHideActionButtons: !0,
452
- children: /* @__PURE__ */ U(_, {
452
+ children: /* @__PURE__ */ G(g, {
453
453
  caseAbac: Fe,
454
454
  children: [
455
- /* @__PURE__ */ H(xe, {
456
- caseDbCase: q,
455
+ /* @__PURE__ */ W(xe, {
456
+ caseDbCase: Y,
457
457
  sx: { marginBottom: 2 }
458
458
  }),
459
- y === "INFO" && /* @__PURE__ */ U(V, { children: [
460
- /* @__PURE__ */ H(Ce, { sx: { marginBottom: 2 } }),
461
- /* @__PURE__ */ H(ye, {
462
- caseDbCase: q,
459
+ b === "INFO" && /* @__PURE__ */ G(U, { children: [
460
+ /* @__PURE__ */ W(Ce, { sx: { marginBottom: 2 } }),
461
+ /* @__PURE__ */ W(ye, {
462
+ caseDbCase: Y,
463
463
  sx: { marginBottom: 2 }
464
464
  }),
465
- /* @__PURE__ */ H(Se, {
466
- caseDbCase: q,
465
+ /* @__PURE__ */ W(Se, {
466
+ caseDbCase: Y,
467
467
  sx: { marginBottom: 2 }
468
468
  })
469
469
  ] }),
470
- y === "EDIT" && Z && /* @__PURE__ */ H(be, {
471
- caseDbCase: q,
472
- caseRights: P.data?.[0],
473
- formId: D,
474
- onFinish: k,
470
+ b === "EDIT" && Z && /* @__PURE__ */ W(be, {
471
+ caseDbCase: Y,
472
+ caseRights: J.data?.[0],
473
+ formId: A,
474
+ onFinish: M,
475
475
  onIsSavingChange: je
476
476
  }),
477
- y === "EDIT" && !Z && /* @__PURE__ */ H(F, {
477
+ b === "EDIT" && !Z && /* @__PURE__ */ W(L, {
478
478
  variant: "body1",
479
479
  children: a`You do not have permissions to edit this case.`
480
480
  }),
481
- y === "SHARING" && Q && /* @__PURE__ */ H(Te, {
482
- caseDbCase: q,
483
- formId: O,
484
- onFinish: k,
481
+ b === "SHARING" && Q && /* @__PURE__ */ W(Te, {
482
+ caseDbCase: Y,
483
+ formId: j,
484
+ onFinish: M,
485
485
  onIsSavingChange: Me
486
486
  }),
487
- y === "SHARING" && !Q && /* @__PURE__ */ H(F, {
487
+ b === "SHARING" && !Q && /* @__PURE__ */ W(L, {
488
488
  variant: "body1",
489
489
  children: a`You do not have permissions to share this case.`
490
490
  })
491
491
  ]
492
492
  })
493
- }), /* @__PURE__ */ H(le, {
493
+ }), /* @__PURE__ */ W(se, {
494
494
  body: a`Are you sure you want to delete the case?`,
495
495
  cancelLabel: a`Cancel`,
496
496
  confirmLabel: a`Delete`,
497
497
  onConfirm: Pe,
498
- ref: E,
498
+ ref: k,
499
499
  title: a`Delete case?`
500
500
  })] });
501
501
  }, {