@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.
- package/dist/_chunks/AddCasesToEventDialog.js +98 -98
- package/dist/_chunks/AddCasesToEventDialog.js.map +1 -1
- package/dist/_chunks/CaseContentForm.js +10 -10
- package/dist/_chunks/CaseDbDownloadUtil.js +1 -1
- package/dist/_chunks/CaseDbDownloadUtil.js.map +1 -1
- package/dist/_chunks/CaseInfoDialog.js +222 -222
- package/dist/_chunks/CaseInfoDialog.js.map +1 -1
- package/dist/_chunks/CaseSetInfoDialog.js +222 -222
- package/dist/_chunks/CaseSetInfoDialog.js.map +1 -1
- package/dist/_chunks/CasesAlreadyInCaseSetWarning.js.map +1 -1
- package/dist/_chunks/Dashboard.js +296 -295
- package/dist/_chunks/Dashboard.js.map +1 -1
- package/dist/_chunks/FindSimilarCasesDialog.js +81 -81
- package/dist/_chunks/FindSimilarCasesDialog.js.map +1 -1
- package/dist/_chunks/HomePageTrends.js.map +1 -1
- package/dist/_chunks/LegendaItem.js.map +1 -1
- package/dist/_chunks/LineListWidget.js +46 -45
- package/dist/_chunks/LineListWidget.js.map +1 -1
- package/dist/_chunks/PanelSeparator.js +3 -3
- package/dist/_chunks/PanelSeparator.js.map +1 -1
- package/dist/_chunks/Upload.js +422 -418
- package/dist/_chunks/Upload.js.map +1 -1
- package/dist/_chunks/UploadUtil.js +44 -40
- package/dist/_chunks/UploadUtil.js.map +1 -1
- package/dist/_chunks/chunk-BV7QT456.js +1 -1
- package/dist/_chunks/chunk-BV7QT456.js.map +1 -1
- package/dist/_chunks/cloneDeep.js +1 -1
- package/dist/_chunks/cloneDeep.js.map +1 -1
- package/dist/_chunks/dashboardStore.js.map +1 -1
- package/dist/_chunks/esm.js +3 -3
- package/dist/_chunks/esm.js.map +1 -1
- package/dist/_chunks/index.module.js +1 -1
- package/dist/_chunks/index.module.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/shallow.js +2 -2
- package/dist/_chunks/shallow.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +24 -24
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/services/EventBusService/EventBusService.d.ts +9 -2
- package/dist/classes/services/EventBusService/index.js.map +1 -1
- package/dist/components/form/fields/ArrangementEditor/index.js +30 -30
- package/dist/components/ui/CreateEventDialog/index.js +40 -40
- package/dist/components/ui/CreateEventDialog/index.js.map +1 -1
- package/dist/components/ui/MapWidget/index.js.map +1 -1
- package/dist/components/ui/RemoveCasesFromEventDialog/index.js.map +1 -1
- package/dist/components/ui/SequenceDownloadDialog/index.js +57 -44
- package/dist/components/ui/SequenceDownloadDialog/index.js.map +1 -1
- package/dist/components/ui/TreeWidget/index.js +8 -2
- package/dist/components/ui/TreeWidget/index.js.map +1 -1
- package/dist/locale/en.json +0 -11
- package/dist/locale/nl.json +0 -11
- package/dist/models/config.d.ts +2 -0
- package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +59 -59
- package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js.map +1 -1
- package/dist/utils/UploadUtil/UploadUtil.d.ts +1 -0
- package/package.json +68 -75
- package/dist/_chunks/index.esm.js +0 -1465
- package/dist/_chunks/index.esm.js.map +0 -1
- package/dist/components/ui/FileSelector/FileSelector.d.ts +0 -7
- package/dist/components/ui/FileSelector/index.d.ts +0 -1
- package/dist/components/ui/FileSelector/index.js +0 -206
- package/dist/components/ui/FileSelector/index.js.map +0 -1
- package/dist/utils/FileUtil/FileUtil.d.ts +0 -5
- package/dist/utils/FileUtil/index.d.ts +0 -1
- package/dist/utils/FileUtil/index.js +0 -15
- package/dist/utils/FileUtil/index.js.map +0 -1
|
@@ -3,359 +3,359 @@ 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 "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
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
|
|
26
|
-
import { ResponseHandler as
|
|
27
|
-
import { useItemQuery as
|
|
28
|
-
import { useArray as
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import {
|
|
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";
|
|
38
39
|
import me from "@mui/icons-material/Delete";
|
|
39
|
-
import he from "@mui/icons-material/
|
|
40
|
-
import
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import { SchemaUtil as X } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
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
|
|
47
|
+
var _e = ({ caseSet: e, ...t }) => {
|
|
48
48
|
let { t: n } = V();
|
|
49
|
-
return /* @__PURE__ */ U(
|
|
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(
|
|
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
|
-
},
|
|
60
|
-
let { t:
|
|
61
|
-
dataCollectionIds:
|
|
62
|
-
shouldApplySharingToCases:
|
|
63
|
-
}), []),
|
|
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
|
-
|
|
66
|
-
let
|
|
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:
|
|
68
|
+
message: l("Saving case set data collections"),
|
|
69
69
|
severity: "info"
|
|
70
70
|
});
|
|
71
71
|
try {
|
|
72
|
-
await
|
|
73
|
-
let t =
|
|
74
|
-
n.length > 0 && await
|
|
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
|
|
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
|
-
|
|
79
|
+
A.getInstance().fulfillNotification(u, l("Could not save case set data collections."), "error");
|
|
80
80
|
} finally {
|
|
81
|
-
await
|
|
81
|
+
await D.getInstance().invalidateQueryKeys(c), o && await r.applyDataCollectionLinks({
|
|
82
82
|
caseSetDataCollectionIds: i,
|
|
83
83
|
caseSetId: e.id,
|
|
84
84
|
caseTypeId: t
|
|
85
|
-
}),
|
|
85
|
+
}), d(!1), s(!1), a();
|
|
86
86
|
}
|
|
87
87
|
})();
|
|
88
88
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
s,
|
|
90
|
+
l,
|
|
91
|
+
m?.rights,
|
|
92
|
+
m.itemDataCollectionLinks,
|
|
93
93
|
e.id,
|
|
94
94
|
a,
|
|
95
95
|
t
|
|
96
|
-
]),
|
|
97
|
-
definition:
|
|
98
|
-
label:
|
|
96
|
+
]), g = z(() => [{
|
|
97
|
+
definition: O.AUTOCOMPLETE,
|
|
98
|
+
label: l`Data collections`,
|
|
99
99
|
multiple: !0,
|
|
100
100
|
name: "dataCollectionIds",
|
|
101
|
-
options:
|
|
101
|
+
options: m?.itemDataCollectionOptions?.[0] ?? []
|
|
102
102
|
}, {
|
|
103
|
-
definition:
|
|
104
|
-
label:
|
|
103
|
+
definition: O.BOOLEAN,
|
|
104
|
+
label: l`Should the same sharing be applied to the cases in the event?`,
|
|
105
105
|
name: "shouldApplySharingToCases"
|
|
106
|
-
}], [
|
|
107
|
-
dataCollectionIds:
|
|
106
|
+
}], [m, l]), _ = z(() => ({
|
|
107
|
+
dataCollectionIds: m?.rights?.[0]?.shared_in_data_collection_ids ?? [],
|
|
108
108
|
shouldApplySharingToCases: !0
|
|
109
|
-
}), [
|
|
110
|
-
resolver:
|
|
111
|
-
values:
|
|
112
|
-
}), { handleSubmit:
|
|
113
|
-
return
|
|
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:
|
|
116
|
-
}) : /* @__PURE__ */ H(
|
|
117
|
-
...
|
|
118
|
-
children: /* @__PURE__ */ H(
|
|
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:
|
|
122
|
-
onSubmit:
|
|
123
|
-
schema:
|
|
121
|
+
formMethods: y,
|
|
122
|
+
onSubmit: b(h),
|
|
123
|
+
schema: p
|
|
124
124
|
})
|
|
125
125
|
});
|
|
126
|
-
},
|
|
126
|
+
}, ye = ({ ...e }) => {
|
|
127
127
|
let { t } = V();
|
|
128
|
-
return /* @__PURE__ */ U(
|
|
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(
|
|
133
|
+
}), /* @__PURE__ */ H(m, {})]
|
|
134
134
|
});
|
|
135
|
-
},
|
|
136
|
-
let a =
|
|
137
|
-
case_set_category_id:
|
|
138
|
-
case_set_status_id:
|
|
139
|
-
case_type_id:
|
|
140
|
-
code:
|
|
141
|
-
description:
|
|
142
|
-
name:
|
|
143
|
-
}), []),
|
|
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]),
|
|
145
|
+
}, [r]), f = L(() => {
|
|
146
146
|
r();
|
|
147
|
-
}, [r]),
|
|
147
|
+
}, [r]), p = z(() => [
|
|
148
148
|
{
|
|
149
|
-
definition:
|
|
149
|
+
definition: O.AUTOCOMPLETE,
|
|
150
150
|
disabled: !!e,
|
|
151
|
-
label:
|
|
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:
|
|
158
|
-
label:
|
|
157
|
+
definition: O.TEXTFIELD,
|
|
158
|
+
label: T`Event name`,
|
|
159
159
|
name: "name"
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
|
-
definition:
|
|
163
|
-
label:
|
|
162
|
+
definition: O.TEXTFIELD,
|
|
163
|
+
label: T`Code`,
|
|
164
164
|
name: "code"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
|
-
definition:
|
|
168
|
-
label:
|
|
167
|
+
definition: O.RICH_TEXT,
|
|
168
|
+
label: T`Description`,
|
|
169
169
|
name: "description"
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
|
-
definition:
|
|
173
|
-
label:
|
|
174
|
-
loading:
|
|
172
|
+
definition: O.AUTOCOMPLETE,
|
|
173
|
+
label: T`Category`,
|
|
174
|
+
loading: s.isLoading,
|
|
175
175
|
name: "case_set_category_id",
|
|
176
|
-
options:
|
|
176
|
+
options: s.options
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
|
-
definition:
|
|
180
|
-
label:
|
|
181
|
-
loading:
|
|
179
|
+
definition: O.AUTOCOMPLETE,
|
|
180
|
+
label: T`Status`,
|
|
181
|
+
loading: l.isLoading,
|
|
182
182
|
name: "case_set_status_id",
|
|
183
|
-
options:
|
|
183
|
+
options: l.options
|
|
184
184
|
}
|
|
185
185
|
], [
|
|
186
186
|
e,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
s.isLoading,
|
|
188
|
+
s.options,
|
|
189
|
+
l.isLoading,
|
|
190
|
+
l.options,
|
|
191
191
|
a.isLoading,
|
|
192
192
|
a.options
|
|
193
|
-
]), { isMutating:
|
|
194
|
-
getErrorNotificationMessage: (e) =>
|
|
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) =>
|
|
200
|
-
getSuccessNotificationMessage: (e) => /* @__PURE__ */ H(
|
|
201
|
-
onError:
|
|
202
|
-
onSuccess:
|
|
203
|
-
queryFn: async (e, t) => (await
|
|
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:
|
|
207
|
+
resourceQueryKey: D.getInstance().getGenericKey(n.CASE_SETS)
|
|
208
208
|
});
|
|
209
209
|
R(() => {
|
|
210
|
-
i(
|
|
211
|
-
}, [
|
|
212
|
-
let
|
|
213
|
-
|
|
210
|
+
i(m);
|
|
211
|
+
}, [m, i]);
|
|
212
|
+
let y = L((t) => {
|
|
213
|
+
_(e), h(t);
|
|
214
214
|
}, [
|
|
215
215
|
e,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
]),
|
|
219
|
-
resolver:
|
|
220
|
-
values:
|
|
221
|
-
}), { handleSubmit:
|
|
222
|
-
return
|
|
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:
|
|
225
|
-
}) : /* @__PURE__ */ H(
|
|
226
|
-
formFieldDefinitions:
|
|
224
|
+
label: T`Saving event data`
|
|
225
|
+
}) : /* @__PURE__ */ H(G, {
|
|
226
|
+
formFieldDefinitions: p,
|
|
227
227
|
formId: t,
|
|
228
|
-
formMethods:
|
|
229
|
-
onSubmit:
|
|
230
|
-
schema:
|
|
228
|
+
formMethods: S,
|
|
229
|
+
onSubmit: k(y),
|
|
230
|
+
schema: u
|
|
231
231
|
});
|
|
232
|
-
},
|
|
233
|
-
let r =
|
|
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(
|
|
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(
|
|
243
|
+
}), /* @__PURE__ */ H(ie, {
|
|
244
244
|
inlineSpinner: !0,
|
|
245
|
-
loadables:
|
|
245
|
+
loadables: c,
|
|
246
246
|
shouldHideActionButtons: !0,
|
|
247
|
-
children: /* @__PURE__ */ U(
|
|
247
|
+
children: /* @__PURE__ */ U(M, {
|
|
248
248
|
size: "small",
|
|
249
|
-
children: [/* @__PURE__ */ H(
|
|
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(
|
|
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,
|
|
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
|
-
},
|
|
266
|
-
let { t: c } = V(),
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
]),
|
|
271
|
+
]), ee = L(() => {
|
|
272
272
|
t();
|
|
273
|
-
}, [t]),
|
|
273
|
+
}, [t]), F = L(() => {
|
|
274
274
|
t();
|
|
275
|
-
}, [t]), { isMutating:
|
|
276
|
-
associationQueryKeys:
|
|
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:
|
|
281
|
-
onSuccess:
|
|
282
|
-
queryFn: async (e) => await
|
|
283
|
-
resourceQueryKey:
|
|
284
|
-
}), { data:
|
|
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: !
|
|
289
|
-
queryFn: async ({ signal: e }) => (await
|
|
288
|
+
enabled: !I,
|
|
289
|
+
queryFn: async ({ signal: e }) => (await E.getInstance().caseSetsGetOne(o.caseSetId, { signal: e })).data
|
|
290
290
|
}
|
|
291
|
-
}),
|
|
291
|
+
}), Y = z(() => ({
|
|
292
292
|
invert: !1,
|
|
293
293
|
key: "case_set_id",
|
|
294
|
-
members: [
|
|
294
|
+
members: [G?.id],
|
|
295
295
|
type: "UUID_SET"
|
|
296
|
-
}), [
|
|
297
|
-
enabled: !!
|
|
298
|
-
queryFn: async ({ signal: e }) => (await
|
|
299
|
-
queryKey:
|
|
300
|
-
}),
|
|
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),
|
|
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
|
-
|
|
311
|
+
O(e);
|
|
312
312
|
}, []), je = L(() => {
|
|
313
313
|
j.current.open();
|
|
314
314
|
}, []), Me = L(() => {
|
|
315
|
-
|
|
316
|
-
}, [
|
|
317
|
-
await
|
|
318
|
-
}, [
|
|
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
|
-
|
|
321
|
-
}, [
|
|
322
|
-
i(
|
|
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
|
-
|
|
328
|
+
G
|
|
329
329
|
]), R(() => {
|
|
330
330
|
let t = [];
|
|
331
331
|
(y || x) && t.push({
|
|
332
|
-
...
|
|
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(
|
|
337
|
+
startIcon: /* @__PURE__ */ H(he, {}),
|
|
338
338
|
variant: "outlined"
|
|
339
339
|
}), y ? t.push({
|
|
340
|
-
...
|
|
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(
|
|
345
|
+
startIcon: /* @__PURE__ */ H(de, {}),
|
|
346
346
|
type: "submit",
|
|
347
347
|
variant: "contained"
|
|
348
348
|
}) : x ? t.push({
|
|
349
|
-
...
|
|
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(
|
|
354
|
+
startIcon: /* @__PURE__ */ H(de, {}),
|
|
355
355
|
type: "submit",
|
|
356
356
|
variant: "contained"
|
|
357
357
|
}) : (t.push({
|
|
358
|
-
...
|
|
358
|
+
...K.createAttributes("CaseSetInfoDialog-deleteButton"),
|
|
359
359
|
color: "primary",
|
|
360
360
|
disabled: !we(),
|
|
361
361
|
label: c`Delete`,
|
|
@@ -363,23 +363,23 @@ var ve = ({ caseSet: e, ...t }) => {
|
|
|
363
363
|
startIcon: /* @__PURE__ */ H(me, {}),
|
|
364
364
|
variant: "outlined"
|
|
365
365
|
}, {
|
|
366
|
-
...
|
|
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(
|
|
371
|
+
startIcon: /* @__PURE__ */ H(pe, {}),
|
|
372
372
|
variant: "outlined"
|
|
373
373
|
}, {
|
|
374
|
-
...
|
|
374
|
+
...K.createAttributes("CaseSetInfoDialog-editCaseContentButton"),
|
|
375
375
|
color: "primary",
|
|
376
|
-
disabled: !
|
|
376
|
+
disabled: !Se,
|
|
377
377
|
label: c`Edit`,
|
|
378
378
|
onClick: Te,
|
|
379
|
-
startIcon: /* @__PURE__ */ H(
|
|
379
|
+
startIcon: /* @__PURE__ */ H(le, {}),
|
|
380
380
|
variant: "outlined"
|
|
381
381
|
}), s && t.push({
|
|
382
|
-
...
|
|
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
|
-
|
|
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
|
-
|
|
405
|
+
Se,
|
|
406
406
|
Ce,
|
|
407
407
|
we
|
|
408
408
|
]);
|
|
409
409
|
let Pe = z(() => ({
|
|
410
|
-
createdInDataCollection:
|
|
411
|
-
itemDataCollectionLinks: [
|
|
412
|
-
rights:
|
|
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:
|
|
414
|
+
userDataCollections: g.data,
|
|
415
415
|
userDataCollectionsMap: _.map
|
|
416
416
|
}), [
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
417
|
+
G,
|
|
418
|
+
X,
|
|
419
|
+
m.data,
|
|
420
420
|
v.options,
|
|
421
421
|
_.map,
|
|
422
|
-
|
|
422
|
+
g.data
|
|
423
423
|
]);
|
|
424
|
-
return k ||
|
|
424
|
+
return k || I ? /* @__PURE__ */ H(J, {
|
|
425
425
|
inline: !0,
|
|
426
426
|
label: c`Refreshing data`
|
|
427
|
-
}) : /* @__PURE__ */ U(
|
|
428
|
-
error:
|
|
427
|
+
}) : /* @__PURE__ */ U(re, { children: [/* @__PURE__ */ H(ie, {
|
|
428
|
+
error: ue || Z,
|
|
429
429
|
inlineSpinner: !0,
|
|
430
|
-
isLoading:
|
|
431
|
-
loadables:
|
|
430
|
+
isLoading: q || Q,
|
|
431
|
+
loadables: P,
|
|
432
432
|
shouldHideActionButtons: !0,
|
|
433
|
-
children: /* @__PURE__ */ U(
|
|
433
|
+
children: /* @__PURE__ */ U(p, {
|
|
434
434
|
caseAbac: Pe,
|
|
435
435
|
children: [
|
|
436
|
-
!y && !x && /* @__PURE__ */ U(
|
|
437
|
-
/* @__PURE__ */ H(
|
|
438
|
-
caseSet:
|
|
436
|
+
!y && !x && /* @__PURE__ */ U(re, { children: [
|
|
437
|
+
/* @__PURE__ */ H(xe, {
|
|
438
|
+
caseSet: G,
|
|
439
439
|
sx: { marginBottom: 2 }
|
|
440
440
|
}),
|
|
441
|
-
/* @__PURE__ */ H(
|
|
442
|
-
/* @__PURE__ */ H(
|
|
443
|
-
caseSet:
|
|
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(
|
|
448
|
-
caseSet:
|
|
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(
|
|
454
|
-
caseSet:
|
|
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(
|
|
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 {
|
|
477
|
+
export { Se as t };
|
|
478
478
|
|
|
479
479
|
//# sourceMappingURL=CaseSetInfoDialog.js.map
|