@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.
- 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/CaseInfoDialog.js +242 -241
- package/dist/_chunks/CaseInfoDialog.js.map +1 -1
- package/dist/_chunks/CaseSetInfoDialog.js +224 -224
- package/dist/_chunks/CaseSetInfoDialog.js.map +1 -1
- package/dist/_chunks/Dashboard.js +549 -550
- package/dist/_chunks/Dashboard.js.map +1 -1
- package/dist/_chunks/FindSimilarCasesDialog.js +76 -76
- package/dist/_chunks/FindSimilarCasesDialog.js.map +1 -1
- package/dist/_chunks/LegendaItem.js.map +1 -1
- package/dist/_chunks/LineListWidget.js +138 -136
- 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 +318 -318
- package/dist/_chunks/Upload.js.map +1 -1
- package/dist/_chunks/{chunk-BV7QT456.js → chunk-OB3PAWPO.js} +3 -3
- package/dist/_chunks/chunk-OB3PAWPO.js.map +1 -0
- package/dist/_chunks/cloneDeep.js +1 -1
- package/dist/_chunks/cloneDeep.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/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/HistogramWidget/index.js +161 -162
- package/dist/components/ui/HistogramWidget/index.js.map +1 -1
- package/dist/components/ui/SequenceDownloadDialog/index.js +22 -22
- package/dist/locale/en.json +6 -0
- package/dist/locale/nl.json +7 -1
- package/dist/pages/CasesDetailPage/index.js +1 -1
- package/dist/pages/ColsAdminPage/index.js +1 -1
- package/dist/pages/ConceptsAdminPage/index.js +1 -1
- package/dist/pages/DimsAdminPage/index.js +1 -1
- package/dist/pages/EventsDetailPage/index.js +1 -1
- package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js +120 -86
- package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/RefColsAdminPage/index.js +1 -1
- package/dist/pages/RegionSetShapesAdminPage/index.js +1 -1
- package/dist/pages/RegionsAdminPage/index.js +1 -1
- package/dist/pages/UserEffectiveRightsAdminPage/index.js +1 -1
- package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +59 -59
- package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js.map +1 -1
- package/dist/routes/index.js +93 -91
- package/dist/routes/index.js.map +1 -1
- package/dist/setup/setup.js +2 -3
- package/dist/setup/setup.js.map +1 -1
- package/package.json +73 -72
- package/dist/_chunks/chunk-BV7QT456.js.map +0 -1
- package/dist/_chunks/index.esm.js +0 -1465
- 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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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
|
|
19
|
-
import { t as
|
|
20
|
-
import { CaseDbCaseApi as
|
|
21
|
-
import { QueryClientService as
|
|
22
|
-
import { FORM_FIELD_DEFINITION_TYPE as
|
|
23
|
-
import { NotificationService as
|
|
24
|
-
import { Box as
|
|
25
|
-
import { use as
|
|
26
|
-
import { useTranslation as
|
|
27
|
-
import { Fragment as
|
|
28
|
-
import { ResponseHandler as
|
|
29
|
-
import { useItemQuery as
|
|
30
|
-
import { useArray as
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
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
|
|
49
|
-
let r = v(), i = y(), { t: o } =
|
|
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 } =
|
|
55
|
-
queryFn: async ({ signal: e }) => (await
|
|
56
|
-
queryKey:
|
|
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 } =
|
|
63
|
+
}, { data: f, error: p, isLoading: m } = oe({
|
|
63
64
|
enabled: d.members.length > 0,
|
|
64
|
-
queryFn: async ({ signal: e }) => (await
|
|
65
|
-
queryKey:
|
|
66
|
-
}), h =
|
|
67
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
70
|
+
children: [/* @__PURE__ */ W(L, {
|
|
70
71
|
variant: "h6",
|
|
71
72
|
children: o`Events`
|
|
72
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
79
|
+
children: [f?.length > 0 && /* @__PURE__ */ G(M, {
|
|
79
80
|
size: "small",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
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__ */
|
|
86
|
+
/* @__PURE__ */ W(P, {
|
|
86
87
|
sx: { width: "calc(100% * 1/3)" },
|
|
87
88
|
children: o`Category`
|
|
88
89
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ W(P, {
|
|
90
91
|
sx: { width: "calc(100% * 1/3)" },
|
|
91
92
|
children: o`Status`
|
|
92
93
|
})
|
|
93
|
-
] }) }), /* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
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__ */
|
|
100
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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
|
-
},
|
|
109
|
-
let u =
|
|
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]), _ =
|
|
115
|
+
}, [t]), _ = z((t, r) => {
|
|
115
116
|
h(!0), a(!0), (async () => {
|
|
116
|
-
let o =
|
|
117
|
+
let o = D.getInstance().getQueryKeyDependencies([n.CASES], !0), s = k.getInstance().showNotification({
|
|
117
118
|
isLoading: !0,
|
|
118
|
-
message:
|
|
119
|
+
message: S("Saving case data"),
|
|
119
120
|
severity: "info"
|
|
120
121
|
});
|
|
121
122
|
try {
|
|
122
|
-
await
|
|
123
|
-
let n = (await
|
|
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:
|
|
132
|
+
on_exists: E.UPDATE
|
|
132
133
|
})).data;
|
|
133
|
-
if (n.status !==
|
|
134
|
-
f(e.id, e),
|
|
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
|
-
|
|
137
|
+
k.getInstance().fulfillNotification(s, S("Could not save case data."), "error");
|
|
137
138
|
} finally {
|
|
138
|
-
await
|
|
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__ */
|
|
149
|
+
return /* @__PURE__ */ G(A, {
|
|
149
150
|
...l,
|
|
150
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ W(L, {
|
|
151
152
|
variant: "h6",
|
|
152
|
-
children:
|
|
153
|
-
}), /* @__PURE__ */
|
|
153
|
+
children: S`Content`
|
|
154
|
+
}), /* @__PURE__ */ G(A, { children: [m && /* @__PURE__ */ W(ge, {
|
|
154
155
|
inline: !0,
|
|
155
|
-
label:
|
|
156
|
-
}), !
|
|
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
|
-
},
|
|
166
|
-
let { t: n } =
|
|
167
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
171
|
+
/* @__PURE__ */ W(L, {
|
|
171
172
|
variant: "h6",
|
|
172
173
|
children: n`Read-only content`
|
|
173
174
|
}),
|
|
174
|
-
!e && /* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
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__ */
|
|
180
|
+
children: e && /* @__PURE__ */ G(M, {
|
|
180
181
|
size: "small",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
185
|
+
}), /* @__PURE__ */ W(P, {
|
|
185
186
|
sx: { width: "calc(100% * 2/3)" },
|
|
186
187
|
children: n`Value`
|
|
187
|
-
})] }) }), /* @__PURE__ */
|
|
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
|
-
},
|
|
193
|
-
let { t: i } =
|
|
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__ */
|
|
200
|
+
return /* @__PURE__ */ G(A, {
|
|
200
201
|
...n,
|
|
201
202
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ W(L, {
|
|
203
204
|
variant: "h6",
|
|
204
205
|
children: i`Content`
|
|
205
206
|
}),
|
|
206
|
-
!e && /* @__PURE__ */
|
|
207
|
-
e && /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
213
|
+
}), /* @__PURE__ */ W(P, {
|
|
213
214
|
sx: { width: "calc(100% / 3 * 2)" },
|
|
214
215
|
children: i`Value`
|
|
215
|
-
})] }) }), /* @__PURE__ */
|
|
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__ */
|
|
218
|
+
return /* @__PURE__ */ G(I, { children: [/* @__PURE__ */ W(P, {
|
|
218
219
|
sx: { width: "calc(100% / 3)" },
|
|
219
220
|
children: t.label
|
|
220
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ G(P, {
|
|
221
222
|
sx: { width: "calc(100% / 3 * 2)" },
|
|
222
|
-
children: [n.col_type ===
|
|
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 !==
|
|
230
|
+
}), n.col_type !== w.ORGANIZATION && /* @__PURE__ */ W(U, { children: i.long })]
|
|
230
231
|
})] }, t.id);
|
|
231
232
|
}) })]
|
|
232
233
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ W(fe, { ref: a })
|
|
234
235
|
]
|
|
235
236
|
});
|
|
236
|
-
},
|
|
237
|
-
let { t } =
|
|
238
|
-
return /* @__PURE__ */
|
|
237
|
+
}, we = ({ ...e }) => {
|
|
238
|
+
let { t } = H();
|
|
239
|
+
return /* @__PURE__ */ G(A, {
|
|
239
240
|
...e,
|
|
240
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ W(L, {
|
|
241
242
|
variant: "h6",
|
|
242
243
|
children: t`Shared in`
|
|
243
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ W(_, {})]
|
|
244
245
|
});
|
|
245
|
-
},
|
|
246
|
-
let { t: o } =
|
|
247
|
-
definition:
|
|
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:
|
|
252
|
-
}], [o,
|
|
253
|
-
resolver:
|
|
254
|
-
values:
|
|
255
|
-
}), { handleSubmit:
|
|
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 =
|
|
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
|
|
265
|
-
let n =
|
|
266
|
-
r.length > 0 && await
|
|
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
|
|
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
|
-
|
|
272
|
+
k.getInstance().fulfillNotification(s, o("Could not save case data collections."), "error");
|
|
272
273
|
} finally {
|
|
273
|
-
await
|
|
274
|
+
await D.getInstance().invalidateQueryKeys(a), c(!1), i(!1), r();
|
|
274
275
|
}
|
|
275
276
|
})();
|
|
276
277
|
}, [
|
|
277
|
-
|
|
278
|
+
u,
|
|
278
279
|
e.id,
|
|
279
280
|
r,
|
|
280
281
|
i,
|
|
281
282
|
o
|
|
282
283
|
]);
|
|
283
|
-
return s ? /* @__PURE__ */
|
|
284
|
+
return s ? /* @__PURE__ */ W(ge, {
|
|
284
285
|
inline: !0,
|
|
285
286
|
label: o`Saving case data collections`
|
|
286
|
-
}) : /* @__PURE__ */
|
|
287
|
+
}) : /* @__PURE__ */ G(A, {
|
|
287
288
|
...a,
|
|
288
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: [/* @__PURE__ */ W(L, {
|
|
289
290
|
variant: "h6",
|
|
290
291
|
children: o`Data collections`
|
|
291
|
-
}), /* @__PURE__ */
|
|
292
|
-
formFieldDefinitions:
|
|
292
|
+
}), /* @__PURE__ */ W(ae, {
|
|
293
|
+
formFieldDefinitions: f,
|
|
293
294
|
formId: t,
|
|
294
|
-
formMethods:
|
|
295
|
-
onSubmit:
|
|
296
|
-
schema:
|
|
295
|
+
formMethods: g,
|
|
296
|
+
onSubmit: _(v),
|
|
297
|
+
schema: d
|
|
297
298
|
})]
|
|
298
299
|
});
|
|
299
|
-
},
|
|
300
|
+
}, De = /* @__PURE__ */ function(e) {
|
|
300
301
|
return e.EDIT = "EDIT", e.INFO = "INFO", e.SHARING = "SHARING", e;
|
|
301
|
-
}({}), Z =
|
|
302
|
-
let { t: a } =
|
|
303
|
-
|
|
304
|
-
}, [
|
|
305
|
-
await
|
|
306
|
-
}, [t,
|
|
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:
|
|
309
|
-
associationQueryKeys:
|
|
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:
|
|
314
|
-
onSuccess:
|
|
315
|
-
queryFn: async (e) => await
|
|
316
|
-
resourceQueryKey:
|
|
317
|
-
}),
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
]), { data:
|
|
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: !
|
|
327
|
-
queryFn: async ({ signal: e }) => (await
|
|
327
|
+
enabled: !F && !E,
|
|
328
|
+
queryFn: async ({ signal: e }) => (await C.getInstance().casesGetOne(i.caseId, { signal: e })).data
|
|
328
329
|
}
|
|
329
|
-
}),
|
|
330
|
+
}), fe = B(() => ({
|
|
330
331
|
invert: !1,
|
|
331
332
|
key: "case_id",
|
|
332
|
-
members: [
|
|
333
|
+
members: [Y?.id],
|
|
333
334
|
type: "UUID_SET"
|
|
334
|
-
}), [
|
|
335
|
-
enabled: !!
|
|
336
|
-
queryFn: async ({ signal: e }) => (await
|
|
337
|
-
queryKey:
|
|
338
|
-
}), Z =
|
|
339
|
-
|
|
340
|
-
}, []),
|
|
341
|
-
|
|
342
|
-
}, []),
|
|
343
|
-
|
|
344
|
-
}, []),
|
|
345
|
-
|
|
346
|
-
}, []),
|
|
347
|
-
|
|
348
|
-
}, []),
|
|
349
|
-
|
|
350
|
-
}, []),
|
|
351
|
-
|
|
352
|
-
}, [
|
|
353
|
-
|
|
354
|
-
r(
|
|
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
|
-
|
|
357
|
+
b,
|
|
357
358
|
r,
|
|
358
359
|
a
|
|
359
|
-
]),
|
|
360
|
+
]), te(() => {
|
|
360
361
|
let t = [];
|
|
361
|
-
(
|
|
362
|
-
...
|
|
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:
|
|
367
|
-
startIcon: /* @__PURE__ */
|
|
367
|
+
onClick: je,
|
|
368
|
+
startIcon: /* @__PURE__ */ W(he, {}),
|
|
368
369
|
variant: "outlined"
|
|
369
|
-
}),
|
|
370
|
-
...
|
|
370
|
+
}), b === "EDIT" && Z ? t.push({
|
|
371
|
+
...X.createAttributes("CaseInfoDialog-saveButton"),
|
|
371
372
|
color: "secondary",
|
|
372
373
|
disabled: $,
|
|
373
|
-
form:
|
|
374
|
+
form: A,
|
|
374
375
|
label: a`Save`,
|
|
375
|
-
startIcon: /* @__PURE__ */
|
|
376
|
+
startIcon: /* @__PURE__ */ W(le, {}),
|
|
376
377
|
type: "submit",
|
|
377
378
|
variant: "contained"
|
|
378
|
-
}) :
|
|
379
|
-
...
|
|
379
|
+
}) : b === "SHARING" && Q ? t.push({
|
|
380
|
+
...X.createAttributes("CaseInfoDialog-saveButton"),
|
|
380
381
|
color: "secondary",
|
|
381
382
|
disabled: $,
|
|
382
|
-
form:
|
|
383
|
+
form: j,
|
|
383
384
|
label: a`Save`,
|
|
384
|
-
startIcon: /* @__PURE__ */
|
|
385
|
+
startIcon: /* @__PURE__ */ W(le, {}),
|
|
385
386
|
type: "submit",
|
|
386
387
|
variant: "contained"
|
|
387
|
-
}) :
|
|
388
|
-
...
|
|
388
|
+
}) : b === "INFO" && (t.push({
|
|
389
|
+
...X.createAttributes("CaseSetInfoDialog-deleteButton"),
|
|
389
390
|
color: "primary",
|
|
390
|
-
disabled: !
|
|
391
|
+
disabled: !Oe(),
|
|
391
392
|
label: a`Delete`,
|
|
392
|
-
onClick:
|
|
393
|
-
startIcon: /* @__PURE__ */
|
|
393
|
+
onClick: Pe,
|
|
394
|
+
startIcon: /* @__PURE__ */ W(me, {}),
|
|
394
395
|
variant: "outlined"
|
|
395
396
|
}), t.push({
|
|
396
|
-
...
|
|
397
|
+
...X.createAttributes("CaseInfoDialog-editDataCollectionsButton"),
|
|
397
398
|
color: "primary",
|
|
398
399
|
disabled: !Q,
|
|
399
400
|
label: a`Share`,
|
|
400
|
-
onClick:
|
|
401
|
-
startIcon: /* @__PURE__ */
|
|
401
|
+
onClick: Ae,
|
|
402
|
+
startIcon: /* @__PURE__ */ W(pe, {}),
|
|
402
403
|
variant: "outlined"
|
|
403
404
|
}), t.push({
|
|
404
|
-
...
|
|
405
|
+
...X.createAttributes("CaseInfoDialog-editCaseContentButton"),
|
|
405
406
|
color: "primary",
|
|
406
407
|
disabled: !Z,
|
|
407
408
|
label: a`Edit`,
|
|
408
|
-
onClick:
|
|
409
|
-
startIcon: /* @__PURE__ */
|
|
409
|
+
onClick: ke,
|
|
410
|
+
startIcon: /* @__PURE__ */ W(ce, {}),
|
|
410
411
|
variant: "outlined"
|
|
411
412
|
})), e(t);
|
|
412
413
|
}, [
|
|
413
414
|
e,
|
|
414
|
-
|
|
415
|
+
ke,
|
|
415
416
|
a,
|
|
416
|
-
|
|
417
|
+
b,
|
|
418
|
+
je,
|
|
417
419
|
Ae,
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
O,
|
|
420
|
+
A,
|
|
421
|
+
j,
|
|
421
422
|
t,
|
|
422
423
|
$,
|
|
423
424
|
Q,
|
|
424
|
-
|
|
425
|
-
|
|
425
|
+
Pe,
|
|
426
|
+
Oe,
|
|
426
427
|
Z
|
|
427
428
|
]);
|
|
428
|
-
let
|
|
429
|
-
createdInDataCollection:
|
|
429
|
+
let Ie = B(() => ({
|
|
430
|
+
createdInDataCollection: Y ? h.map.get(Y.created_in_data_collection_id) : void 0,
|
|
430
431
|
itemDataCollectionLinks: [ve],
|
|
431
|
-
rights:
|
|
432
|
-
userDataCollectionOptions:
|
|
433
|
-
userDataCollections:
|
|
434
|
-
userDataCollectionsMap:
|
|
432
|
+
rights: J.data,
|
|
433
|
+
userDataCollectionOptions: _.options,
|
|
434
|
+
userDataCollections: p.data,
|
|
435
|
+
userDataCollectionsMap: h.map
|
|
435
436
|
}), [
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
p.data,
|
|
438
|
+
h.map,
|
|
439
|
+
_.options,
|
|
439
440
|
ve,
|
|
440
|
-
|
|
441
|
-
|
|
441
|
+
J.data,
|
|
442
|
+
Y
|
|
442
443
|
]);
|
|
443
|
-
return
|
|
444
|
+
return E ? /* @__PURE__ */ W(ge, {
|
|
444
445
|
inline: !0,
|
|
445
446
|
label: a`Refreshing data`
|
|
446
|
-
}) : /* @__PURE__ */ U
|
|
447
|
-
error:
|
|
447
|
+
}) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(K, {
|
|
448
|
+
error: ue || Te,
|
|
448
449
|
inlineSpinner: !0,
|
|
449
|
-
isLoading:
|
|
450
|
-
loadables:
|
|
450
|
+
isLoading: de || De,
|
|
451
|
+
loadables: ae,
|
|
451
452
|
shouldHideActionButtons: !0,
|
|
452
|
-
children: /* @__PURE__ */
|
|
453
|
-
caseAbac:
|
|
453
|
+
children: /* @__PURE__ */ G(g, {
|
|
454
|
+
caseAbac: Ie,
|
|
454
455
|
children: [
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
caseDbCase:
|
|
456
|
+
/* @__PURE__ */ W(Se, {
|
|
457
|
+
caseDbCase: Y,
|
|
457
458
|
sx: { marginBottom: 2 }
|
|
458
459
|
}),
|
|
459
|
-
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
caseDbCase:
|
|
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__ */
|
|
466
|
-
caseDbCase:
|
|
466
|
+
/* @__PURE__ */ W(Ce, {
|
|
467
|
+
caseDbCase: Y,
|
|
467
468
|
sx: { marginBottom: 2 }
|
|
468
469
|
})
|
|
469
470
|
] }),
|
|
470
|
-
|
|
471
|
-
caseDbCase:
|
|
472
|
-
caseRights:
|
|
473
|
-
formId:
|
|
474
|
-
onFinish:
|
|
475
|
-
onIsSavingChange:
|
|
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
|
-
|
|
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
|
-
|
|
482
|
-
caseDbCase:
|
|
483
|
-
formId:
|
|
484
|
-
onFinish:
|
|
485
|
-
onIsSavingChange:
|
|
482
|
+
b === "SHARING" && Q && /* @__PURE__ */ W(Ee, {
|
|
483
|
+
caseDbCase: Y,
|
|
484
|
+
formId: j,
|
|
485
|
+
onFinish: M,
|
|
486
|
+
onIsSavingChange: Ne
|
|
486
487
|
}),
|
|
487
|
-
|
|
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__ */
|
|
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:
|
|
498
|
-
ref:
|
|
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,
|
|
508
|
+
export { Z as n, De as t };
|
|
508
509
|
|
|
509
510
|
//# sourceMappingURL=CaseInfoDialog.js.map
|