@gen-epix/ui-client-casedb 4.1.0 → 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 (41) 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 +220 -220
  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 +295 -295
  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/PanelSeparator.js +3 -3
  14. package/dist/_chunks/PanelSeparator.js.map +1 -1
  15. package/dist/_chunks/Upload.js +318 -318
  16. package/dist/_chunks/Upload.js.map +1 -1
  17. package/dist/_chunks/chunk-BV7QT456.js +1 -1
  18. package/dist/_chunks/chunk-BV7QT456.js.map +1 -1
  19. package/dist/_chunks/cloneDeep.js +1 -1
  20. package/dist/_chunks/cloneDeep.js.map +1 -1
  21. package/dist/_chunks/esm.js +3 -3
  22. package/dist/_chunks/esm.js.map +1 -1
  23. package/dist/_chunks/index.module.js +1 -1
  24. package/dist/_chunks/index.module.js.map +1 -1
  25. package/dist/_chunks/react.js +1 -1
  26. package/dist/_chunks/react.js.map +1 -1
  27. package/dist/_chunks/shallow.js +2 -2
  28. package/dist/_chunks/shallow.js.map +1 -1
  29. package/dist/_chunks/vanilla.js +1 -1
  30. package/dist/_chunks/vanilla.js.map +1 -1
  31. package/dist/_chunks/yup.js +24 -24
  32. package/dist/_chunks/yup.js.map +1 -1
  33. package/dist/components/form/fields/ArrangementEditor/index.js +30 -30
  34. package/dist/components/ui/CreateEventDialog/index.js +40 -40
  35. package/dist/components/ui/CreateEventDialog/index.js.map +1 -1
  36. package/dist/components/ui/SequenceDownloadDialog/index.js +22 -22
  37. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +59 -59
  38. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js.map +1 -1
  39. package/package.json +68 -67
  40. package/dist/_chunks/index.esm.js +0 -1465
  41. package/dist/_chunks/index.esm.js.map +0 -1
@@ -3,383 +3,383 @@ import { t } from "./format.js";
3
3
  import { CASEDB_QUERY_KEY as n } from "../constants/query.js";
4
4
  import { CaseUtil as r, t as i } from "../utils/CaseUtil/index.js";
5
5
  import { CaseSetUtil as a } from "../utils/CaseSetUtil/index.js";
6
- import { o } from "./index.esm.js";
7
- import { t as s } from "./yup.js";
8
- import { useCaseTypeMapQuery as c, useCaseTypeOptionsQuery as l } from "../dataHooks/useCaseTypesQuery/index.js";
9
- import { useDataCollectionOptionsQuery as u, useDataCollectionsMapQuery as d, useDataCollectionsQuery as f } from "../dataHooks/useDataCollectionsQuery/index.js";
10
- import { n as p, r as m, t as h } from "./DataCollectionAccessInfo.js";
11
- import { useCaseSetRightsQuery as g } from "../dataHooks/useCaseSetRightsQuery/index.js";
12
- import { t as _ } from "./CreateEventDialogSuccessNotificationMessage.js";
13
- import { useCaseSetCategoryMapQuery as v, useCaseSetCategoryOptionsQuery as y } from "../dataHooks/useCaseSetCategoriesQuery/index.js";
14
- import { useCaseSetStatusMapQuery as b, useCaseSetStatusOptionsQuery as x } from "../dataHooks/useCaseSetStatusesQuery/index.js";
15
- import { array as S, boolean as C, object as w, string as T } from "yup";
16
- import { t as E } from "i18next";
17
- import { CaseDbCaseApi as D } from "@gen-epix/api-casedb";
18
- import { QueryClientService as O } from "@gen-epix/ui-client-common/classes/services/QueryClientService";
19
- import { FORM_FIELD_DEFINITION_TYPE as k } from "@gen-epix/ui-core-form/models/form";
20
- import { DATE_FORMAT as A } from "@gen-epix/ui-core/constants/date";
21
- import { NotificationService as j } from "@gen-epix/ui-client-common/classes/services/NotificationService";
22
- import { Box as M, Table as N, TableBody as ee, TableCell as P, TableHead as te, TableRow as F, Typography as I } from "@mui/material";
23
- import { useCallback as L, useEffect as R, useId as ne, useMemo as z, useRef as re, useState as B } from "react";
6
+ import { t as o } from "./yup.js";
7
+ import { useCaseTypeMapQuery as s, useCaseTypeOptionsQuery as c } from "../dataHooks/useCaseTypesQuery/index.js";
8
+ import { useDataCollectionOptionsQuery as l, useDataCollectionsMapQuery as u, useDataCollectionsQuery as d } from "../dataHooks/useDataCollectionsQuery/index.js";
9
+ import { n as f, r as p, t as m } from "./DataCollectionAccessInfo.js";
10
+ import { useCaseSetRightsQuery as h } from "../dataHooks/useCaseSetRightsQuery/index.js";
11
+ import { t as g } from "./CreateEventDialogSuccessNotificationMessage.js";
12
+ import { useCaseSetCategoryMapQuery as _, useCaseSetCategoryOptionsQuery as v } from "../dataHooks/useCaseSetCategoriesQuery/index.js";
13
+ import { useCaseSetStatusMapQuery as y, useCaseSetStatusOptionsQuery as b } from "../dataHooks/useCaseSetStatusesQuery/index.js";
14
+ import { array as x, boolean as S, object as C, string as w } from "yup";
15
+ import { t as T } from "i18next";
16
+ import { CaseDbCaseApi as E } from "@gen-epix/api-casedb";
17
+ import { QueryClientService as D } from "@gen-epix/ui-client-common/classes/services/QueryClientService";
18
+ import { FORM_FIELD_DEFINITION_TYPE as O } from "@gen-epix/ui-core-form/models/form";
19
+ import { DATE_FORMAT as k } from "@gen-epix/ui-core/constants/date";
20
+ import { NotificationService as A } from "@gen-epix/ui-client-common/classes/services/NotificationService";
21
+ import { Box as j, Table as M, TableBody as N, TableCell as P, TableHead as ee, TableRow as F, Typography as I } from "@mui/material";
22
+ import { useCallback as L, useEffect as R, useId as te, useMemo as z, useRef as ne, useState as B } from "react";
24
23
  import { useTranslation as V } from "react-i18next";
25
- import { Fragment as ie, jsx as H, jsxs as U } from "react/jsx-runtime";
26
- import { ResponseHandler as ae } from "@gen-epix/ui-client-common/components/ui/ResponseHandler";
27
- import { useItemQuery as oe } from "@gen-epix/ui-client-common/hooks/useItemQuery";
28
- import { useArray as se } from "@gen-epix/ui-core/hooks/useArray";
29
- import { GenericForm as W } from "@gen-epix/ui-core-form/components/helpers/GenericForm";
30
- import { useQueryMemo as ce } from "@gen-epix/ui-client-common/hooks/useQueryMemo";
31
- import { Confirmation as le } from "@gen-epix/ui-core-components/components/Confirmation";
32
- import ue from "@mui/icons-material/Edit";
33
- import { withDialog as de } from "@gen-epix/ui-core-components/hoc/withDialog";
34
- import { TestIdUtil as G } from "@gen-epix/ui-core/utils/TestIdUtil";
35
- import fe from "@mui/icons-material/Save";
36
- import { FormUtil as K } from "@gen-epix/ui-core-form/utils/FormUtil";
37
- import { RouterService as pe } from "@gen-epix/ui-client-common/classes/services/RouterService";
38
- import me from "@mui/icons-material/Share";
39
- import he from "@mui/icons-material/Delete";
40
- import ge from "@mui/icons-material/ArrowLeft";
41
- import { Spinner as q } from "@gen-epix/ui-core-components/components/Spinner";
42
- import { useDeleteMutation as _e } from "@gen-epix/ui-client-common/hooks/useDeleteMutation";
43
- import { RichTextEditorContent as J } from "@gen-epix/ui-core-form/components/fields/RichTextEditor";
44
- import { useEditMutation as Y } from "@gen-epix/ui-client-common/hooks/useEditMutation";
45
- import { SchemaUtil as X } from "@gen-epix/ui-core-form/utils/SchemaUtil";
24
+ import { Fragment as re, jsx as H, jsxs as U } from "react/jsx-runtime";
25
+ import { ResponseHandler as ie } from "@gen-epix/ui-client-common/components/ui/ResponseHandler";
26
+ import { useItemQuery as ae } from "@gen-epix/ui-client-common/hooks/useItemQuery";
27
+ import { useArray as oe } from "@gen-epix/ui-core/hooks/useArray";
28
+ import { useForm as W } from "react-hook-form";
29
+ import { GenericForm as G } from "@gen-epix/ui-core-form/components/helpers/GenericForm";
30
+ import { useQueryMemo as se } from "@gen-epix/ui-client-common/hooks/useQueryMemo";
31
+ import { Confirmation as ce } from "@gen-epix/ui-core-components/components/Confirmation";
32
+ import le from "@mui/icons-material/Edit";
33
+ import { withDialog as ue } from "@gen-epix/ui-core-components/hoc/withDialog";
34
+ import { TestIdUtil as K } from "@gen-epix/ui-core/utils/TestIdUtil";
35
+ import de from "@mui/icons-material/Save";
36
+ import { FormUtil as q } from "@gen-epix/ui-core-form/utils/FormUtil";
37
+ import { RouterService as fe } from "@gen-epix/ui-client-common/classes/services/RouterService";
38
+ import pe from "@mui/icons-material/Share";
39
+ import me from "@mui/icons-material/Delete";
40
+ import he from "@mui/icons-material/ArrowLeft";
41
+ import { Spinner as J } from "@gen-epix/ui-core-components/components/Spinner";
42
+ import { useDeleteMutation as ge } from "@gen-epix/ui-client-common/hooks/useDeleteMutation";
43
+ import { RichTextEditorContent as Y } from "@gen-epix/ui-core-form/components/fields/RichTextEditor";
44
+ import { useEditMutation as X } from "@gen-epix/ui-client-common/hooks/useEditMutation";
45
+ import { SchemaUtil as Z } from "@gen-epix/ui-core-form/utils/SchemaUtil";
46
46
  //#region src/components/ui/CaseSetInfoDialog/CaseSetDescription.tsx
47
- var ve = ({ caseSet: e, ...t }) => {
47
+ var _e = ({ caseSet: e, ...t }) => {
48
48
  let { t: n } = V();
49
- return /* @__PURE__ */ U(M, {
49
+ return /* @__PURE__ */ U(j, {
50
50
  ...t,
51
51
  children: [/* @__PURE__ */ H(I, {
52
52
  variant: "h6",
53
53
  children: n`Description`
54
- }), /* @__PURE__ */ U(M, { children: [e?.description && /* @__PURE__ */ H(J, { source: e?.description || "" }), !e?.description && /* @__PURE__ */ H(M, {
54
+ }), /* @__PURE__ */ U(j, { children: [e?.description && /* @__PURE__ */ H(Y, { source: e?.description || "" }), !e?.description && /* @__PURE__ */ H(j, {
55
55
  sx: { fontStyle: "italic" },
56
56
  children: n`None`
57
57
  })] })]
58
58
  });
59
- }, Z = /* @__PURE__ */ e(i(), 1), ye = ({ caseSet: e, caseTypeId: t, formId: i, onFinish: a, onIsSavingChange: c, ...l }) => {
60
- let { t: u } = V(), [d, f] = B(!1), m = z(() => w().shape({
61
- dataCollectionIds: S().of(T().uuid4()).required(),
62
- shouldApplySharingToCases: C().required()
63
- }), []), h = p(), g = L(({ dataCollectionIds: i, shouldApplySharingToCases: o }) => {
59
+ }, Q = /* @__PURE__ */ e(i(), 1), ve = ({ caseSet: e, caseTypeId: t, formId: i, onFinish: a, onIsSavingChange: s, ...c }) => {
60
+ let { t: l } = V(), [u, d] = B(!1), p = z(() => C().shape({
61
+ dataCollectionIds: x().of(w().uuid4()).required(),
62
+ shouldApplySharingToCases: S().required()
63
+ }), []), m = f(), h = L(({ dataCollectionIds: i, shouldApplySharingToCases: o }) => {
64
64
  (async () => {
65
- f(!0), c(!0);
66
- let s = O.getInstance().getQueryKeyDependencies([n.CASE_SET_DATA_COLLECTION_LINKS], !0), l = j.getInstance().showNotification({
65
+ d(!0), s(!0);
66
+ let c = D.getInstance().getQueryKeyDependencies([n.CASE_SET_DATA_COLLECTION_LINKS], !0), u = A.getInstance().showNotification({
67
67
  isLoading: !0,
68
- message: u("Saving case set data collections"),
68
+ message: l("Saving case set data collections"),
69
69
  severity: "info"
70
70
  });
71
71
  try {
72
- await O.getInstance().cancelQueries(s);
73
- let t = h?.rights?.[0], n = (0, Z.default)(i, t.shared_in_data_collection_ids), r = (0, Z.default)(t.shared_in_data_collection_ids, i);
74
- n.length > 0 && await D.getInstance().caseSetDataCollectionLinksPostSome(n.map((t) => ({
72
+ await D.getInstance().cancelQueries(c);
73
+ let t = m?.rights?.[0], n = (0, Q.default)(i, t.shared_in_data_collection_ids), r = (0, Q.default)(t.shared_in_data_collection_ids, i);
74
+ n.length > 0 && await E.getInstance().caseSetDataCollectionLinksPostSome(n.map((t) => ({
75
75
  case_set_id: e.id,
76
76
  data_collection_id: t
77
- }))), r.length > 0 && await D.getInstance().caseSetDataCollectionLinksDeleteSome(h.itemDataCollectionLinks[0]?.filter((e) => r.includes(e.data_collection_id)).map((e) => e.id).join(",")), j.getInstance().fulfillNotification(l, u("Successfully saved case set data collections."), "success");
77
+ }))), r.length > 0 && await E.getInstance().caseSetDataCollectionLinksDeleteSome(m.itemDataCollectionLinks[0]?.filter((e) => r.includes(e.data_collection_id)).map((e) => e.id).join(",")), A.getInstance().fulfillNotification(u, l("Successfully saved case set data collections."), "success");
78
78
  } catch {
79
- j.getInstance().fulfillNotification(l, u("Could not save case set data collections."), "error");
79
+ A.getInstance().fulfillNotification(u, l("Could not save case set data collections."), "error");
80
80
  } finally {
81
- await O.getInstance().invalidateQueryKeys(s), o && await r.applyDataCollectionLinks({
81
+ await D.getInstance().invalidateQueryKeys(c), o && await r.applyDataCollectionLinks({
82
82
  caseSetDataCollectionIds: i,
83
83
  caseSetId: e.id,
84
84
  caseTypeId: t
85
- }), f(!1), c(!1), a();
85
+ }), d(!1), s(!1), a();
86
86
  }
87
87
  })();
88
88
  }, [
89
- c,
90
- u,
91
- h?.rights,
92
- h.itemDataCollectionLinks,
89
+ s,
90
+ l,
91
+ m?.rights,
92
+ m.itemDataCollectionLinks,
93
93
  e.id,
94
94
  a,
95
95
  t
96
- ]), _ = z(() => [{
97
- definition: k.AUTOCOMPLETE,
98
- label: u`Data collections`,
96
+ ]), g = z(() => [{
97
+ definition: O.AUTOCOMPLETE,
98
+ label: l`Data collections`,
99
99
  multiple: !0,
100
100
  name: "dataCollectionIds",
101
- options: h?.itemDataCollectionOptions?.[0] ?? []
101
+ options: m?.itemDataCollectionOptions?.[0] ?? []
102
102
  }, {
103
- definition: k.BOOLEAN,
104
- label: u`Should the same sharing be applied to the cases in the event?`,
103
+ definition: O.BOOLEAN,
104
+ label: l`Should the same sharing be applied to the cases in the event?`,
105
105
  name: "shouldApplySharingToCases"
106
- }], [h, u]), v = z(() => ({
107
- dataCollectionIds: h?.rights?.[0]?.shared_in_data_collection_ids ?? [],
106
+ }], [m, l]), _ = z(() => ({
107
+ dataCollectionIds: m?.rights?.[0]?.shared_in_data_collection_ids ?? [],
108
108
  shouldApplySharingToCases: !0
109
- }), [h]), y = z(() => K.createFormValues(_, v), [_, v]), b = o({
110
- resolver: s(m),
111
- values: y
112
- }), { handleSubmit: x } = b;
113
- return d ? /* @__PURE__ */ H(q, {
109
+ }), [m]), v = z(() => q.createFormValues(g, _), [g, _]), y = W({
110
+ resolver: o(p),
111
+ values: v
112
+ }), { handleSubmit: b } = y;
113
+ return u ? /* @__PURE__ */ H(J, {
114
114
  inline: !0,
115
- label: u`Saving case set data collections`
116
- }) : /* @__PURE__ */ H(M, {
117
- ...l,
118
- children: /* @__PURE__ */ H(W, {
119
- formFieldDefinitions: _,
115
+ label: l`Saving case set data collections`
116
+ }) : /* @__PURE__ */ H(j, {
117
+ ...c,
118
+ children: /* @__PURE__ */ H(G, {
119
+ formFieldDefinitions: g,
120
120
  formId: i,
121
- formMethods: b,
122
- onSubmit: x(g),
123
- schema: m
121
+ formMethods: y,
122
+ onSubmit: b(h),
123
+ schema: p
124
124
  })
125
125
  });
126
- }, be = ({ ...e }) => {
126
+ }, ye = ({ ...e }) => {
127
127
  let { t } = V();
128
- return /* @__PURE__ */ U(M, {
128
+ return /* @__PURE__ */ U(j, {
129
129
  ...e,
130
130
  children: [/* @__PURE__ */ H(I, {
131
131
  variant: "h6",
132
132
  children: t`Shared in`
133
- }), /* @__PURE__ */ H(h, {})]
133
+ }), /* @__PURE__ */ H(m, {})]
134
134
  });
135
- }, xe = ({ caseSet: e, formId: t, onFinish: r, onIsSavingChange: i }) => {
136
- let a = l(), c = y(), u = x(), d = z(() => w().shape({
137
- case_set_category_id: T().uuid4().required(),
138
- case_set_status_id: T().uuid4().required(),
139
- case_type_id: T().uuid4().required(),
140
- code: X.code,
141
- description: X.description,
142
- name: X.name
143
- }), []), f = L(() => {
135
+ }, be = ({ caseSet: e, formId: t, onFinish: r, onIsSavingChange: i }) => {
136
+ let a = c(), s = v(), l = b(), u = z(() => C().shape({
137
+ case_set_category_id: w().uuid4().required(),
138
+ case_set_status_id: w().uuid4().required(),
139
+ case_type_id: w().uuid4().required(),
140
+ code: Z.code,
141
+ description: Z.description,
142
+ name: Z.name
143
+ }), []), d = L(() => {
144
144
  r();
145
- }, [r]), p = L(() => {
145
+ }, [r]), f = L(() => {
146
146
  r();
147
- }, [r]), m = z(() => [
147
+ }, [r]), p = z(() => [
148
148
  {
149
- definition: k.AUTOCOMPLETE,
149
+ definition: O.AUTOCOMPLETE,
150
150
  disabled: !!e,
151
- label: E`Case type`,
151
+ label: T`Case type`,
152
152
  loading: a.isLoading,
153
153
  name: "case_type_id",
154
154
  options: a.options
155
155
  },
156
156
  {
157
- definition: k.TEXTFIELD,
158
- label: E`Event name`,
157
+ definition: O.TEXTFIELD,
158
+ label: T`Event name`,
159
159
  name: "name"
160
160
  },
161
161
  {
162
- definition: k.TEXTFIELD,
163
- label: E`Code`,
162
+ definition: O.TEXTFIELD,
163
+ label: T`Code`,
164
164
  name: "code"
165
165
  },
166
166
  {
167
- definition: k.RICH_TEXT,
168
- label: E`Description`,
167
+ definition: O.RICH_TEXT,
168
+ label: T`Description`,
169
169
  name: "description"
170
170
  },
171
171
  {
172
- definition: k.AUTOCOMPLETE,
173
- label: E`Category`,
174
- loading: c.isLoading,
172
+ definition: O.AUTOCOMPLETE,
173
+ label: T`Category`,
174
+ loading: s.isLoading,
175
175
  name: "case_set_category_id",
176
- options: c.options
176
+ options: s.options
177
177
  },
178
178
  {
179
- definition: k.AUTOCOMPLETE,
180
- label: E`Status`,
181
- loading: u.isLoading,
179
+ definition: O.AUTOCOMPLETE,
180
+ label: T`Status`,
181
+ loading: l.isLoading,
182
182
  name: "case_set_status_id",
183
- options: u.options
183
+ options: l.options
184
184
  }
185
185
  ], [
186
186
  e,
187
- c.isLoading,
188
- c.options,
189
- u.isLoading,
190
- u.options,
187
+ s.isLoading,
188
+ s.options,
189
+ l.isLoading,
190
+ l.options,
191
191
  a.isLoading,
192
192
  a.options
193
- ]), { isMutating: h, mutate: g, setPreviousItem: v } = Y({
194
- getErrorNotificationMessage: (e) => E("Failed to edit event: {{name}}", { name: e.name }),
193
+ ]), { isMutating: m, mutate: h, setPreviousItem: _ } = X({
194
+ getErrorNotificationMessage: (e) => T("Failed to edit event: {{name}}", { name: e.name }),
195
195
  getIntermediateItem: (e, t) => ({
196
196
  ...t,
197
197
  ...e
198
198
  }),
199
- getProgressNotificationMessage: (e) => E("Saving event: {{name}}", { name: e.name }),
200
- getSuccessNotificationMessage: (e) => /* @__PURE__ */ H(_, { caseSet: e }),
201
- onError: p,
202
- onSuccess: f,
203
- queryFn: async (e, t) => (await D.getInstance().caseSetsPutOne(t.id, {
199
+ getProgressNotificationMessage: (e) => T("Saving event: {{name}}", { name: e.name }),
200
+ getSuccessNotificationMessage: (e) => /* @__PURE__ */ H(g, { caseSet: e }),
201
+ onError: f,
202
+ onSuccess: d,
203
+ queryFn: async (e, t) => (await E.getInstance().caseSetsPutOne(t.id, {
204
204
  ...t,
205
205
  ...e
206
206
  })).data,
207
- resourceQueryKey: O.getInstance().getGenericKey(n.CASE_SETS)
207
+ resourceQueryKey: D.getInstance().getGenericKey(n.CASE_SETS)
208
208
  });
209
209
  R(() => {
210
- i(h);
211
- }, [h, i]);
212
- let b = L((t) => {
213
- v(e), g(t);
210
+ i(m);
211
+ }, [m, i]);
212
+ let y = L((t) => {
213
+ _(e), h(t);
214
214
  }, [
215
215
  e,
216
- g,
217
- v
218
- ]), S = z(() => K.createFormValues(m, e), [m, e]), C = o({
219
- resolver: s(d),
220
- values: S
221
- }), { handleSubmit: A } = C;
222
- return h ? /* @__PURE__ */ H(q, {
216
+ h,
217
+ _
218
+ ]), x = z(() => q.createFormValues(p, e), [p, e]), S = W({
219
+ resolver: o(u),
220
+ values: x
221
+ }), { handleSubmit: k } = S;
222
+ return m ? /* @__PURE__ */ H(J, {
223
223
  inline: !0,
224
- label: E`Saving event data`
225
- }) : /* @__PURE__ */ H(W, {
226
- formFieldDefinitions: m,
224
+ label: T`Saving event data`
225
+ }) : /* @__PURE__ */ H(G, {
226
+ formFieldDefinitions: p,
227
227
  formId: t,
228
- formMethods: C,
229
- onSubmit: A(b),
230
- schema: d
228
+ formMethods: S,
229
+ onSubmit: k(y),
230
+ schema: u
231
231
  });
232
- }, Se = ({ caseSet: e, ...n }) => {
233
- let r = v(), i = b(), a = c(), { t: o } = V(), s = se([
232
+ }, xe = ({ caseSet: e, ...n }) => {
233
+ let r = _(), i = y(), a = s(), { t: o } = V(), c = oe([
234
234
  r,
235
235
  i,
236
236
  a
237
237
  ]);
238
- return /* @__PURE__ */ U(M, {
238
+ return /* @__PURE__ */ U(j, {
239
239
  ...n,
240
240
  children: [/* @__PURE__ */ H(I, {
241
241
  variant: "h6",
242
242
  children: o`Content`
243
- }), /* @__PURE__ */ H(ae, {
243
+ }), /* @__PURE__ */ H(ie, {
244
244
  inlineSpinner: !0,
245
- loadables: s,
245
+ loadables: c,
246
246
  shouldHideActionButtons: !0,
247
- children: /* @__PURE__ */ U(N, {
247
+ children: /* @__PURE__ */ U(M, {
248
248
  size: "small",
249
- children: [/* @__PURE__ */ H(te, { children: /* @__PURE__ */ U(F, { children: [/* @__PURE__ */ H(P, {
249
+ children: [/* @__PURE__ */ H(ee, { children: /* @__PURE__ */ U(F, { children: [/* @__PURE__ */ H(P, {
250
250
  sx: { width: "calc(100% * 1/3)" },
251
251
  children: o`Column`
252
252
  }), /* @__PURE__ */ H(P, {
253
253
  sx: { width: "calc(100% * 2/3)" },
254
254
  children: o`Value`
255
- })] }) }), /* @__PURE__ */ U(ee, { children: [
255
+ })] }) }), /* @__PURE__ */ U(N, { children: [
256
256
  /* @__PURE__ */ U(F, { children: [/* @__PURE__ */ H(P, { children: o`Name` }), /* @__PURE__ */ H(P, { children: e.name })] }),
257
257
  /* @__PURE__ */ U(F, { children: [/* @__PURE__ */ H(P, { children: o`Status` }), /* @__PURE__ */ H(P, { children: i.map.get(e.case_set_status_id)?.name })] }),
258
258
  /* @__PURE__ */ U(F, { children: [/* @__PURE__ */ H(P, { children: o`Category` }), /* @__PURE__ */ H(P, { children: r.map.get(e.case_set_category_id)?.name })] }),
259
259
  /* @__PURE__ */ U(F, { children: [/* @__PURE__ */ H(P, { children: o`Type` }), /* @__PURE__ */ H(P, { children: a.map.get(e.case_type_id)?.name })] }),
260
- /* @__PURE__ */ U(F, { children: [/* @__PURE__ */ H(P, { children: o`Created at` }), /* @__PURE__ */ H(P, { children: e.case_set_date ? t(e.case_set_date, A.DATE_TIME) : o`Unknown` })] })
260
+ /* @__PURE__ */ U(F, { children: [/* @__PURE__ */ H(P, { children: o`Created at` }), /* @__PURE__ */ H(P, { children: e.case_set_date ? t(e.case_set_date, k.DATE_TIME) : o`Unknown` })] })
261
261
  ] })]
262
262
  })
263
263
  })]
264
264
  });
265
- }, Q = de(({ onActionsChange: e, onClose: t, onPermalinkChange: r, onTitleChange: i, openProps: o, showNavigationButton: s }) => {
266
- let { t: c } = V(), l = z(() => [o.caseSetId], [o.caseSetId]), p = g(l), h = f(), _ = d(), v = u(), [y, b] = B(!1), [x, S] = B(!1), [C, w] = B(!1), [T, E] = B(!1), [k, A] = B(!1), j = re(null), M = ne(), N = ne(), ee = se([
267
- p,
268
- h,
265
+ }, Se = ue(({ onActionsChange: e, onClose: t, onPermalinkChange: r, onTitleChange: i, openProps: o, showNavigationButton: s }) => {
266
+ let { t: c } = V(), f = z(() => [o.caseSetId], [o.caseSetId]), m = h(f), g = d(), _ = u(), v = l(), [y, b] = B(!1), [x, S] = B(!1), [C, w] = B(!1), [T, O] = B(!1), [k, A] = B(!1), j = ne(null), M = te(), N = te(), P = oe([
267
+ m,
268
+ g,
269
269
  _,
270
270
  v
271
- ]), P = L(() => {
271
+ ]), ee = L(() => {
272
272
  t();
273
- }, [t]), te = L(() => {
273
+ }, [t]), F = L(() => {
274
274
  t();
275
- }, [t]), { isMutating: F, mutate: I } = _e({
276
- associationQueryKeys: O.getInstance().getQueryKeyDependencies([n.CASE_SETS], !0),
275
+ }, [t]), { isMutating: I, mutate: W } = ge({
276
+ associationQueryKeys: D.getInstance().getQueryKeyDependencies([n.CASE_SETS], !0),
277
277
  getErrorNotificationMessage: (e) => c("Unable to remove event: {{name}}.", { name: e.name }),
278
278
  getProgressNotificationMessage: (e) => c("Deleting event: {{name}}...", { name: e.name }),
279
279
  getSuccessNotificationMessage: (e) => c("Event: {{name}}, has been removed.", { name: e.name }),
280
- onError: te,
281
- onSuccess: P,
282
- queryFn: async (e) => await D.getInstance().caseSetsDeleteOne(e.id),
283
- resourceQueryKey: O.getInstance().getGenericKey(n.CASE_SETS)
284
- }), { data: W, error: de, isLoading: K } = oe({
280
+ onError: F,
281
+ onSuccess: ee,
282
+ queryFn: async (e) => await E.getInstance().caseSetsDeleteOne(e.id),
283
+ resourceQueryKey: D.getInstance().getGenericKey(n.CASE_SETS)
284
+ }), { data: G, error: ue, isLoading: q } = ae({
285
285
  baseQueryKey: n.CASE_SETS,
286
286
  itemId: o.caseSetId,
287
287
  useQueryOptions: {
288
- enabled: !F,
289
- queryFn: async ({ signal: e }) => (await D.getInstance().caseSetsGetOne(o.caseSetId, { signal: e })).data
288
+ enabled: !I,
289
+ queryFn: async ({ signal: e }) => (await E.getInstance().caseSetsGetOne(o.caseSetId, { signal: e })).data
290
290
  }
291
- }), J = z(() => ({
291
+ }), Y = z(() => ({
292
292
  invert: !1,
293
293
  key: "case_set_id",
294
- members: [W?.id],
294
+ members: [G?.id],
295
295
  type: "UUID_SET"
296
- }), [W?.id]), { data: Y, error: X, isLoading: Z } = ce({
297
- enabled: !!W && !F,
298
- queryFn: async ({ signal: e }) => (await D.getInstance().caseSetDataCollectionLinksPostQuery(J, null, null, { signal: e })).data,
299
- queryKey: O.getInstance().getGenericKey(n.CASE_SET_DATA_COLLECTION_LINKS, J)
300
- }), Q = z(() => !!p.data && p.data.some((e) => e.is_full_access || e.write_case_set), [p.data]), Ce = z(() => !!p.data && p.data.some((e) => e.is_full_access || e.remove_data_collection_ids.length || e.add_data_collection_ids.length), [p.data]), we = L(() => !!p.data && p.data.some((e) => e.is_full_access || e.can_delete), [p]), Te = L(() => {
296
+ }), [G?.id]), { data: X, error: Z, isLoading: Q } = se({
297
+ enabled: !!G && !I,
298
+ queryFn: async ({ signal: e }) => (await E.getInstance().caseSetDataCollectionLinksPostQuery(Y, null, null, { signal: e })).data,
299
+ queryKey: D.getInstance().getGenericKey(n.CASE_SET_DATA_COLLECTION_LINKS, Y)
300
+ }), Se = z(() => !!m.data && m.data.some((e) => e.is_full_access || e.write_case_set), [m.data]), Ce = z(() => !!m.data && m.data.some((e) => e.is_full_access || e.remove_data_collection_ids.length || e.add_data_collection_ids.length), [m.data]), we = L(() => !!m.data && m.data.some((e) => e.is_full_access || e.can_delete), [m]), Te = L(() => {
301
301
  b(!0);
302
302
  }, []), Ee = L(() => {
303
303
  S(!0);
304
304
  }, []), De = L(() => {
305
305
  b(!1), S(!1);
306
306
  }, []), Oe = L(() => {
307
- w(!1), E(!1), A(!0), b(!1), S(!1), A(!1);
307
+ w(!1), O(!1), A(!0), b(!1), S(!1), A(!1);
308
308
  }, []), ke = L((e) => {
309
309
  w(e);
310
310
  }, []), Ae = L((e) => {
311
- E(e);
311
+ O(e);
312
312
  }, []), je = L(() => {
313
313
  j.current.open();
314
314
  }, []), Me = L(() => {
315
- I(W);
316
- }, [W, I]), $ = C || T, Ne = L(async () => {
317
- await pe.getInstance().router.navigate(a.createCaseSetLink(W));
318
- }, [W]);
315
+ W(G);
316
+ }, [G, W]), $ = C || T, Ne = L(async () => {
317
+ await fe.getInstance().router.navigate(a.createCaseSetLink(G));
318
+ }, [G]);
319
319
  R(() => {
320
- W && r(a.createCaseSetLink(W, !0));
321
- }, [W, r]), R(() => {
322
- i(W ? y ? c("{{name}} - Edit", { name: W.name }) : x ? c("{{name}} - Share", { name: W.name }) : W?.name : c`Loading`);
320
+ G && r(a.createCaseSetLink(G, !0));
321
+ }, [G, r]), R(() => {
322
+ i(G ? y ? c("{{name}} - Edit", { name: G.name }) : x ? c("{{name}} - Share", { name: G.name }) : G?.name : c`Loading`);
323
323
  }, [
324
324
  x,
325
325
  y,
326
326
  i,
327
327
  c,
328
- W
328
+ G
329
329
  ]), R(() => {
330
330
  let t = [];
331
331
  (y || x) && t.push({
332
- ...G.createAttributes("CaseSetInfoDialog-goBackButton"),
332
+ ...K.createAttributes("CaseSetInfoDialog-goBackButton"),
333
333
  color: "primary",
334
334
  disabled: $,
335
335
  label: c`Go back`,
336
336
  onClick: De,
337
- startIcon: /* @__PURE__ */ H(ge, {}),
337
+ startIcon: /* @__PURE__ */ H(he, {}),
338
338
  variant: "outlined"
339
339
  }), y ? t.push({
340
- ...G.createAttributes("CaseSetInfoDialog-saveButton"),
340
+ ...K.createAttributes("CaseSetInfoDialog-saveButton"),
341
341
  color: "secondary",
342
342
  disabled: $,
343
343
  form: M,
344
344
  label: c`Save`,
345
- startIcon: /* @__PURE__ */ H(fe, {}),
345
+ startIcon: /* @__PURE__ */ H(de, {}),
346
346
  type: "submit",
347
347
  variant: "contained"
348
348
  }) : x ? t.push({
349
- ...G.createAttributes("CaseSetInfoDialog-saveButton"),
349
+ ...K.createAttributes("CaseSetInfoDialog-saveButton"),
350
350
  color: "secondary",
351
351
  disabled: $,
352
352
  form: N,
353
353
  label: c`Save`,
354
- startIcon: /* @__PURE__ */ H(fe, {}),
354
+ startIcon: /* @__PURE__ */ H(de, {}),
355
355
  type: "submit",
356
356
  variant: "contained"
357
357
  }) : (t.push({
358
- ...G.createAttributes("CaseSetInfoDialog-deleteButton"),
358
+ ...K.createAttributes("CaseSetInfoDialog-deleteButton"),
359
359
  color: "primary",
360
360
  disabled: !we(),
361
361
  label: c`Delete`,
362
362
  onClick: je,
363
- startIcon: /* @__PURE__ */ H(he, {}),
363
+ startIcon: /* @__PURE__ */ H(me, {}),
364
364
  variant: "outlined"
365
365
  }, {
366
- ...G.createAttributes("CaseSetInfoDialog-editDataCollectionsButton"),
366
+ ...K.createAttributes("CaseSetInfoDialog-editDataCollectionsButton"),
367
367
  color: "primary",
368
368
  disabled: !Ce,
369
369
  label: c`Share`,
370
370
  onClick: Ee,
371
- startIcon: /* @__PURE__ */ H(me, {}),
371
+ startIcon: /* @__PURE__ */ H(pe, {}),
372
372
  variant: "outlined"
373
373
  }, {
374
- ...G.createAttributes("CaseSetInfoDialog-editCaseContentButton"),
374
+ ...K.createAttributes("CaseSetInfoDialog-editCaseContentButton"),
375
375
  color: "primary",
376
- disabled: !Q,
376
+ disabled: !Se,
377
377
  label: c`Edit`,
378
378
  onClick: Te,
379
- startIcon: /* @__PURE__ */ H(ue, {}),
379
+ startIcon: /* @__PURE__ */ H(le, {}),
380
380
  variant: "outlined"
381
381
  }), s && t.push({
382
- ...G.createAttributes("CaseSetInfoDialog-goToEvent"),
382
+ ...K.createAttributes("CaseSetInfoDialog-goToEvent"),
383
383
  autoFocus: !0,
384
384
  color: "secondary",
385
385
  label: c`Go to event`,
@@ -392,7 +392,7 @@ var ve = ({ caseSet: e, ...t }) => {
392
392
  t,
393
393
  Ne,
394
394
  c,
395
- W,
395
+ G,
396
396
  y,
397
397
  x,
398
398
  De,
@@ -402,56 +402,56 @@ var ve = ({ caseSet: e, ...t }) => {
402
402
  Ee,
403
403
  Te,
404
404
  je,
405
- Q,
405
+ Se,
406
406
  Ce,
407
407
  we
408
408
  ]);
409
409
  let Pe = z(() => ({
410
- createdInDataCollection: W ? _.map.get(W?.created_in_data_collection_id) : void 0,
411
- itemDataCollectionLinks: [Y],
412
- rights: p.data,
410
+ createdInDataCollection: G ? _.map.get(G?.created_in_data_collection_id) : void 0,
411
+ itemDataCollectionLinks: [X],
412
+ rights: m.data,
413
413
  userDataCollectionOptions: v.options,
414
- userDataCollections: h.data,
414
+ userDataCollections: g.data,
415
415
  userDataCollectionsMap: _.map
416
416
  }), [
417
- W,
418
- Y,
419
- p.data,
417
+ G,
418
+ X,
419
+ m.data,
420
420
  v.options,
421
421
  _.map,
422
- h.data
422
+ g.data
423
423
  ]);
424
- return k || F ? /* @__PURE__ */ H(q, {
424
+ return k || I ? /* @__PURE__ */ H(J, {
425
425
  inline: !0,
426
426
  label: c`Refreshing data`
427
- }) : /* @__PURE__ */ U(ie, { children: [/* @__PURE__ */ H(ae, {
428
- error: de || X,
427
+ }) : /* @__PURE__ */ U(re, { children: [/* @__PURE__ */ H(ie, {
428
+ error: ue || Z,
429
429
  inlineSpinner: !0,
430
- isLoading: K || Z,
431
- loadables: ee,
430
+ isLoading: q || Q,
431
+ loadables: P,
432
432
  shouldHideActionButtons: !0,
433
- children: /* @__PURE__ */ U(m, {
433
+ children: /* @__PURE__ */ U(p, {
434
434
  caseAbac: Pe,
435
435
  children: [
436
- !y && !x && /* @__PURE__ */ U(ie, { children: [
437
- /* @__PURE__ */ H(Se, {
438
- caseSet: W,
436
+ !y && !x && /* @__PURE__ */ U(re, { children: [
437
+ /* @__PURE__ */ H(xe, {
438
+ caseSet: G,
439
439
  sx: { marginBottom: 2 }
440
440
  }),
441
- /* @__PURE__ */ H(be, { sx: { marginBottom: 2 } }),
442
- /* @__PURE__ */ H(ve, {
443
- caseSet: W,
441
+ /* @__PURE__ */ H(ye, { sx: { marginBottom: 2 } }),
442
+ /* @__PURE__ */ H(_e, {
443
+ caseSet: G,
444
444
  sx: { marginBottom: 2 }
445
445
  })
446
446
  ] }),
447
- y && /* @__PURE__ */ H(xe, {
448
- caseSet: W,
447
+ y && /* @__PURE__ */ H(be, {
448
+ caseSet: G,
449
449
  formId: M,
450
450
  onFinish: Oe,
451
451
  onIsSavingChange: ke
452
452
  }),
453
- x && /* @__PURE__ */ H(ye, {
454
- caseSet: W,
453
+ x && /* @__PURE__ */ H(ve, {
454
+ caseSet: G,
455
455
  caseTypeId: o.caseTypeId,
456
456
  formId: N,
457
457
  onFinish: Oe,
@@ -459,7 +459,7 @@ var ve = ({ caseSet: e, ...t }) => {
459
459
  })
460
460
  ]
461
461
  })
462
- }), /* @__PURE__ */ H(le, {
462
+ }), /* @__PURE__ */ H(ce, {
463
463
  body: c`Are you sure you want to delete the event?`,
464
464
  cancelLabel: c`Cancel`,
465
465
  confirmLabel: c`Delete`,
@@ -474,6 +474,6 @@ var ve = ({ caseSet: e, ...t }) => {
474
474
  titleVariant: "h2"
475
475
  });
476
476
  //#endregion
477
- export { Q as t };
477
+ export { Se as t };
478
478
 
479
479
  //# sourceMappingURL=CaseSetInfoDialog.js.map