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