@firecms/collection_editor 3.0.0-beta.11 → 3.0.0-beta.13
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/ConfigControllerProvider.d.ts +0 -9
- package/dist/index.es.js +852 -668
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +850 -666
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collection_editor_controller.d.ts +0 -10
- package/dist/ui/collection_editor/CollectionDetailsForm.d.ts +3 -1
- package/dist/ui/collection_editor/LayoutModeSwitch.d.ts +5 -0
- package/dist/useCollectionEditorPlugin.d.ts +1 -10
- package/dist/utils/collections.d.ts +1 -1
- package/package.json +18 -17
- package/src/ConfigControllerProvider.tsx +1 -10
- package/src/types/collection_editor_controller.tsx +0 -7
- package/src/ui/HomePageEditorCollectionAction.tsx +1 -0
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +24 -14
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +42 -4
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +0 -2
- package/src/ui/collection_editor/EnumForm.tsx +2 -2
- package/src/ui/collection_editor/GetCodeDialog.tsx +1 -1
- package/src/ui/collection_editor/LayoutModeSwitch.tsx +54 -0
- package/src/ui/collection_editor/PropertyEditView.tsx +2 -1
- package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +10 -2
- package/src/ui/collection_editor/utils/strings.ts +13 -6
- package/src/useCollectionEditorPlugin.tsx +0 -9
- package/src/utils/collections.ts +13 -7
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, ArrayContainer, serializeRegExp, useSnackbarController, resolveEnumValues, isPropertyBuilder, useCustomizationController, getFieldConfig, ErrorBoundary, PropertyConfigBadge, unslugify, useNavigationController, mergeDeep, DEFAULT_FIELD_CONFIGS, getFieldId, isValidRegExp, isEmptyObject, ConfirmationDialog, useLargeLayout, makePropertiesEditable, resolveEntityView, useSelectionController, CircularProgressCenter, EntityCollectionTable, slugify,
|
|
3
|
+
import { FieldCaption, SearchIconsView, toSnakeCase, singular, IconForView, ArrayContainer, serializeRegExp, useSnackbarController, resolveEnumValues, isPropertyBuilder, useCustomizationController, getFieldConfig, ErrorBoundary, PropertyConfigBadge, unslugify, useNavigationController, mergeDeep, DEFAULT_FIELD_CONFIGS, getFieldId, isValidRegExp, isEmptyObject, ConfirmationDialog, useLargeLayout, makePropertiesEditable, resolveEntityView, useAuthController, useSelectionController, CircularProgressCenter, EntityCollectionTable, slugify, randomString, removeUndefined, ErrorView, removeInitialAndTrailingSlashes, getDefaultPropertiesOrder, joinCollectionLists } from "@firecms/core";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import React__default, { useContext, useState, useEffect, useMemo, useRef, useDeferredValue } from "react";
|
|
6
6
|
import equal from "react-fast-compare";
|
|
7
|
-
import {
|
|
7
|
+
import { cls, Typography, VerticalSplitIcon, Tooltip, Card, SquareIcon, useAutoComplete, Chip, TextField, Autocomplete, AutocompleteItem, SelectItem, Container, IconButton, DebouncedTextField, SettingsIcon, CloseIcon, Select, BooleanSwitchWithLabel, ExpandablePanel, Dialog, Badge, AutorenewIcon, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, RuleIcon, MultiSelectItem, CloudUploadIcon, MultiSelect, cardMixin, cardClickableMixin, cardSelectedMixin, FunctionsIcon, DoNotDisturbOnIcon, defaultBorderMixin, RemoveIcon, DragHandleIcon, AddIcon, SelectGroup, DeleteIcon, InfoLabel, fieldBackgroundMixin, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, WarningIcon, ContentCopyIcon, CodeIcon, Table, TableBody, TableRow, TableCell, Alert, Icon, coolIconKeys, Tabs, Tab, ArrowBackIcon, LoadingButton, CheckIcon, Menu, MoreVertIcon, MenuItem, UndoIcon, SaveIcon } from "@firecms/ui";
|
|
8
8
|
import * as Yup from "yup";
|
|
9
9
|
import { useFormex, getIn, Field, useCreateFormex, Formex, clone } from "@firecms/formex";
|
|
10
10
|
import { extractEnumFromValues, buildPropertyFromData, buildEntityPropertiesFromData } from "@firecms/schema_inference";
|
|
@@ -21,13 +21,154 @@ const YupSchema = Yup.object().shape({
|
|
|
21
21
|
const useCollectionEditorController = () => {
|
|
22
22
|
return useContext(CollectionEditorContext);
|
|
23
23
|
};
|
|
24
|
+
function LayoutModeSwitch(t0) {
|
|
25
|
+
const $ = c(29);
|
|
26
|
+
const {
|
|
27
|
+
value,
|
|
28
|
+
onChange,
|
|
29
|
+
className
|
|
30
|
+
} = t0;
|
|
31
|
+
let t1;
|
|
32
|
+
if ($[0] !== className) {
|
|
33
|
+
t1 = cls(className);
|
|
34
|
+
$[0] = className;
|
|
35
|
+
$[1] = t1;
|
|
36
|
+
} else {
|
|
37
|
+
t1 = $[1];
|
|
38
|
+
}
|
|
39
|
+
let t2;
|
|
40
|
+
let t3;
|
|
41
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
+
t2 = /* @__PURE__ */ jsx(Typography, { variant: "label", color: "secondary", className: "ml-3.5", children: "Document view" });
|
|
43
|
+
t3 = cls("flex flex-row gap-4");
|
|
44
|
+
$[2] = t2;
|
|
45
|
+
$[3] = t3;
|
|
46
|
+
} else {
|
|
47
|
+
t2 = $[2];
|
|
48
|
+
t3 = $[3];
|
|
49
|
+
}
|
|
50
|
+
let t4;
|
|
51
|
+
if ($[4] !== onChange) {
|
|
52
|
+
t4 = () => onChange("side_panel");
|
|
53
|
+
$[4] = onChange;
|
|
54
|
+
$[5] = t4;
|
|
55
|
+
} else {
|
|
56
|
+
t4 = $[5];
|
|
57
|
+
}
|
|
58
|
+
const t5 = value === "side_panel" ? "border-primary dark:border-primary" : "border-surface-400 dark:border-surface-600";
|
|
59
|
+
let t6;
|
|
60
|
+
if ($[6] !== t5) {
|
|
61
|
+
t6 = cls("my-2 rounded-md mx-0 p-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center", "text-surface-700 dark:text-surface-accent-300", "hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary", t5);
|
|
62
|
+
$[6] = t5;
|
|
63
|
+
$[7] = t6;
|
|
64
|
+
} else {
|
|
65
|
+
t6 = $[7];
|
|
66
|
+
}
|
|
67
|
+
let t7;
|
|
68
|
+
let t8;
|
|
69
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
70
|
+
t7 = /* @__PURE__ */ jsx(VerticalSplitIcon, {});
|
|
71
|
+
t8 = /* @__PURE__ */ jsx(Typography, { variant: "label", children: "Side panel" });
|
|
72
|
+
$[8] = t7;
|
|
73
|
+
$[9] = t8;
|
|
74
|
+
} else {
|
|
75
|
+
t7 = $[8];
|
|
76
|
+
t8 = $[9];
|
|
77
|
+
}
|
|
78
|
+
let t9;
|
|
79
|
+
if ($[10] !== t4 || $[11] !== t6) {
|
|
80
|
+
t9 = /* @__PURE__ */ jsx(Tooltip, { title: "Documents are open in a side panel", children: /* @__PURE__ */ jsxs(Card, { onClick: t4, className: t6, children: [
|
|
81
|
+
t7,
|
|
82
|
+
t8
|
|
83
|
+
] }) });
|
|
84
|
+
$[10] = t4;
|
|
85
|
+
$[11] = t6;
|
|
86
|
+
$[12] = t9;
|
|
87
|
+
} else {
|
|
88
|
+
t9 = $[12];
|
|
89
|
+
}
|
|
90
|
+
let t10;
|
|
91
|
+
if ($[13] !== onChange) {
|
|
92
|
+
t10 = () => onChange("full_screen");
|
|
93
|
+
$[13] = onChange;
|
|
94
|
+
$[14] = t10;
|
|
95
|
+
} else {
|
|
96
|
+
t10 = $[14];
|
|
97
|
+
}
|
|
98
|
+
const t11 = value === "full_screen" ? "border-primary dark:border-primary" : "border-surface-400 dark:border-surface-600";
|
|
99
|
+
let t12;
|
|
100
|
+
if ($[15] !== t11) {
|
|
101
|
+
t12 = cls("my-2 rounded-md mx-0 p-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center", "text-surface-700 dark:text-surface-accent-300", "hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary", t11);
|
|
102
|
+
$[15] = t11;
|
|
103
|
+
$[16] = t12;
|
|
104
|
+
} else {
|
|
105
|
+
t12 = $[16];
|
|
106
|
+
}
|
|
107
|
+
let t13;
|
|
108
|
+
let t14;
|
|
109
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
+
t13 = /* @__PURE__ */ jsx(SquareIcon, {});
|
|
111
|
+
t14 = /* @__PURE__ */ jsx(Typography, { variant: "label", children: "Full screen" });
|
|
112
|
+
$[17] = t13;
|
|
113
|
+
$[18] = t14;
|
|
114
|
+
} else {
|
|
115
|
+
t13 = $[17];
|
|
116
|
+
t14 = $[18];
|
|
117
|
+
}
|
|
118
|
+
let t15;
|
|
119
|
+
if ($[19] !== t10 || $[20] !== t12) {
|
|
120
|
+
t15 = /* @__PURE__ */ jsx(Tooltip, { title: "Documents are open full-screen", children: /* @__PURE__ */ jsxs(Card, { onClick: t10, className: t12, children: [
|
|
121
|
+
t13,
|
|
122
|
+
t14
|
|
123
|
+
] }) });
|
|
124
|
+
$[19] = t10;
|
|
125
|
+
$[20] = t12;
|
|
126
|
+
$[21] = t15;
|
|
127
|
+
} else {
|
|
128
|
+
t15 = $[21];
|
|
129
|
+
}
|
|
130
|
+
let t16;
|
|
131
|
+
if ($[22] !== t15 || $[23] !== t9) {
|
|
132
|
+
t16 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
|
|
133
|
+
t9,
|
|
134
|
+
t15
|
|
135
|
+
] });
|
|
136
|
+
$[22] = t15;
|
|
137
|
+
$[23] = t9;
|
|
138
|
+
$[24] = t16;
|
|
139
|
+
} else {
|
|
140
|
+
t16 = $[24];
|
|
141
|
+
}
|
|
142
|
+
let t17;
|
|
143
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
144
|
+
t17 = /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "ml-3.5", children: "Should documents be opened full screen or in an inline side dialog" });
|
|
145
|
+
$[25] = t17;
|
|
146
|
+
} else {
|
|
147
|
+
t17 = $[25];
|
|
148
|
+
}
|
|
149
|
+
let t18;
|
|
150
|
+
if ($[26] !== t1 || $[27] !== t16) {
|
|
151
|
+
t18 = /* @__PURE__ */ jsxs("div", { className: t1, children: [
|
|
152
|
+
t2,
|
|
153
|
+
t16,
|
|
154
|
+
t17
|
|
155
|
+
] });
|
|
156
|
+
$[26] = t1;
|
|
157
|
+
$[27] = t16;
|
|
158
|
+
$[28] = t18;
|
|
159
|
+
} else {
|
|
160
|
+
t18 = $[28];
|
|
161
|
+
}
|
|
162
|
+
return t18;
|
|
163
|
+
}
|
|
24
164
|
function CollectionDetailsForm(t0) {
|
|
25
|
-
const $ = c(
|
|
165
|
+
const $ = c(176);
|
|
26
166
|
const {
|
|
27
167
|
isNewCollection,
|
|
28
168
|
reservedGroups,
|
|
29
169
|
groups,
|
|
30
|
-
parentCollection
|
|
170
|
+
parentCollection,
|
|
171
|
+
children
|
|
31
172
|
} = t0;
|
|
32
173
|
const groupRef = React__default.useRef(null);
|
|
33
174
|
const {
|
|
@@ -40,7 +181,7 @@ function CollectionDetailsForm(t0) {
|
|
|
40
181
|
isSubmitting,
|
|
41
182
|
submitCount
|
|
42
183
|
} = useFormex();
|
|
43
|
-
|
|
184
|
+
useCollectionEditorController();
|
|
44
185
|
const [iconDialogOpen, setIconDialogOpen] = useState(false);
|
|
45
186
|
const [advancedPanelExpanded, setAdvancedPanelExpanded] = useState(false);
|
|
46
187
|
let t1;
|
|
@@ -96,7 +237,6 @@ function CollectionDetailsForm(t0) {
|
|
|
96
237
|
t4 = $[8];
|
|
97
238
|
}
|
|
98
239
|
useEffect(t3, t4);
|
|
99
|
-
const DatabaseField = collectionEditor.components?.DatabaseField ?? DefaultDatabaseField;
|
|
100
240
|
let t5;
|
|
101
241
|
if ($[9] !== values) {
|
|
102
242
|
t5 = /* @__PURE__ */ jsx(IconForView, { collectionOrView: values });
|
|
@@ -154,154 +294,153 @@ function CollectionDetailsForm(t0) {
|
|
|
154
294
|
t12 = $[14];
|
|
155
295
|
}
|
|
156
296
|
let t13;
|
|
157
|
-
if ($[15] !==
|
|
158
|
-
t13 = /* @__PURE__ */ jsx(
|
|
159
|
-
$[15] =
|
|
160
|
-
$[16] =
|
|
161
|
-
$[17] =
|
|
162
|
-
$[18] = t13;
|
|
297
|
+
if ($[15] !== updateDatabaseId || $[16] !== values.databaseId) {
|
|
298
|
+
t13 = /* @__PURE__ */ jsx(DefaultDatabaseField, { databaseId: values.databaseId, onDatabaseIdUpdate: updateDatabaseId });
|
|
299
|
+
$[15] = updateDatabaseId;
|
|
300
|
+
$[16] = values.databaseId;
|
|
301
|
+
$[17] = t13;
|
|
163
302
|
} else {
|
|
164
|
-
t13 = $[
|
|
303
|
+
t13 = $[17];
|
|
165
304
|
}
|
|
166
305
|
let t14;
|
|
167
|
-
if ($[
|
|
306
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
168
307
|
t14 = () => setIconDialogOpen(true);
|
|
169
|
-
$[
|
|
308
|
+
$[18] = t14;
|
|
170
309
|
} else {
|
|
171
|
-
t14 = $[
|
|
310
|
+
t14 = $[18];
|
|
172
311
|
}
|
|
173
312
|
let t15;
|
|
174
|
-
if ($[
|
|
313
|
+
if ($[19] !== collectionIcon) {
|
|
175
314
|
t15 = /* @__PURE__ */ jsx(Tooltip, { title: "Change icon", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { shape: "square", onClick: t14, children: collectionIcon }) });
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
315
|
+
$[19] = collectionIcon;
|
|
316
|
+
$[20] = t15;
|
|
178
317
|
} else {
|
|
179
|
-
t15 = $[
|
|
318
|
+
t15 = $[20];
|
|
180
319
|
}
|
|
181
320
|
let t16;
|
|
182
|
-
if ($[
|
|
321
|
+
if ($[21] !== t12 || $[22] !== t13 || $[23] !== t15) {
|
|
183
322
|
t16 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-2 py-2 pt-3 items-center", children: [
|
|
184
323
|
t12,
|
|
185
324
|
t13,
|
|
186
325
|
t15
|
|
187
326
|
] });
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
327
|
+
$[21] = t12;
|
|
328
|
+
$[22] = t13;
|
|
329
|
+
$[23] = t15;
|
|
330
|
+
$[24] = t16;
|
|
192
331
|
} else {
|
|
193
|
-
t16 = $[
|
|
332
|
+
t16 = $[24];
|
|
194
333
|
}
|
|
195
334
|
let t17;
|
|
196
|
-
if ($[
|
|
335
|
+
if ($[25] !== parentCollection) {
|
|
197
336
|
t17 = parentCollection && /* @__PURE__ */ jsx(Chip, { colorScheme: "tealDarker", children: /* @__PURE__ */ jsxs(Typography, { variant: "caption", children: [
|
|
198
337
|
"This is a subcollection of ",
|
|
199
338
|
/* @__PURE__ */ jsx("b", { children: parentCollection.name })
|
|
200
339
|
] }) });
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
340
|
+
$[25] = parentCollection;
|
|
341
|
+
$[26] = t17;
|
|
203
342
|
} else {
|
|
204
|
-
t17 = $[
|
|
343
|
+
t17 = $[26];
|
|
205
344
|
}
|
|
206
345
|
let t18;
|
|
207
|
-
if ($[
|
|
346
|
+
if ($[27] !== t16 || $[28] !== t17) {
|
|
208
347
|
t18 = /* @__PURE__ */ jsxs("div", { children: [
|
|
209
348
|
t16,
|
|
210
349
|
t17
|
|
211
350
|
] });
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
351
|
+
$[27] = t16;
|
|
352
|
+
$[28] = t17;
|
|
353
|
+
$[29] = t18;
|
|
215
354
|
} else {
|
|
216
|
-
t18 = $[
|
|
355
|
+
t18 = $[29];
|
|
217
356
|
}
|
|
218
357
|
const t19 = "grid grid-cols-12 gap-4";
|
|
219
358
|
const t20 = values.name ?? "";
|
|
220
359
|
let t21;
|
|
221
|
-
if ($[
|
|
360
|
+
if ($[30] !== updateName) {
|
|
222
361
|
t21 = (e) => updateName(e.target.value);
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
362
|
+
$[30] = updateName;
|
|
363
|
+
$[31] = t21;
|
|
225
364
|
} else {
|
|
226
|
-
t21 = $[
|
|
365
|
+
t21 = $[31];
|
|
227
366
|
}
|
|
228
367
|
const t22 = showErrors && Boolean(errors.name);
|
|
229
368
|
let t23;
|
|
230
|
-
if ($[
|
|
369
|
+
if ($[32] !== t20 || $[33] !== t21 || $[34] !== t22) {
|
|
231
370
|
t23 = /* @__PURE__ */ jsx(TextField, { value: t20, onChange: t21, label: "Name", autoFocus: true, required: true, error: t22 });
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
371
|
+
$[32] = t20;
|
|
372
|
+
$[33] = t21;
|
|
373
|
+
$[34] = t22;
|
|
374
|
+
$[35] = t23;
|
|
236
375
|
} else {
|
|
237
|
-
t23 = $[
|
|
376
|
+
t23 = $[35];
|
|
238
377
|
}
|
|
239
378
|
const t24 = touched.name && Boolean(errors.name);
|
|
240
379
|
const t25 = touched.name && Boolean(errors.name) ? errors.name : "Name of this collection, usually a plural name (e.g. Products)";
|
|
241
380
|
let t26;
|
|
242
|
-
if ($[
|
|
381
|
+
if ($[36] !== t24 || $[37] !== t25) {
|
|
243
382
|
t26 = /* @__PURE__ */ jsx(FieldCaption, { error: t24, children: t25 });
|
|
244
|
-
$[
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
383
|
+
$[36] = t24;
|
|
384
|
+
$[37] = t25;
|
|
385
|
+
$[38] = t26;
|
|
247
386
|
} else {
|
|
248
|
-
t26 = $[
|
|
387
|
+
t26 = $[38];
|
|
249
388
|
}
|
|
250
389
|
let t27;
|
|
251
|
-
if ($[
|
|
390
|
+
if ($[39] !== t23 || $[40] !== t26) {
|
|
252
391
|
t27 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
253
392
|
t23,
|
|
254
393
|
t26
|
|
255
394
|
] });
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
395
|
+
$[39] = t23;
|
|
396
|
+
$[40] = t26;
|
|
397
|
+
$[41] = t27;
|
|
259
398
|
} else {
|
|
260
|
-
t27 = $[
|
|
399
|
+
t27 = $[41];
|
|
261
400
|
}
|
|
262
401
|
const t28 = isSubcollection ? "" : "sm:col-span-8";
|
|
263
402
|
let t29;
|
|
264
|
-
if ($[
|
|
403
|
+
if ($[42] !== t28) {
|
|
265
404
|
t29 = cls("col-span-12 ", t28);
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
405
|
+
$[42] = t28;
|
|
406
|
+
$[43] = t29;
|
|
268
407
|
} else {
|
|
269
|
-
t29 = $[
|
|
408
|
+
t29 = $[43];
|
|
270
409
|
}
|
|
271
410
|
const t30 = !isNewCollection;
|
|
272
411
|
const t31 = showErrors && Boolean(errors.path);
|
|
273
412
|
let t32;
|
|
274
|
-
if ($[
|
|
413
|
+
if ($[44] !== t30 || $[45] !== t31) {
|
|
275
414
|
t32 = /* @__PURE__ */ jsx(Field, { name: "path", as: DebouncedTextField, label: "Path", disabled: t30, required: true, error: t31 });
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
415
|
+
$[44] = t30;
|
|
416
|
+
$[45] = t31;
|
|
417
|
+
$[46] = t32;
|
|
279
418
|
} else {
|
|
280
|
-
t32 = $[
|
|
419
|
+
t32 = $[46];
|
|
281
420
|
}
|
|
282
421
|
const t33 = touched.path && Boolean(errors.path);
|
|
283
422
|
const t34 = touched.path && Boolean(errors.path) ? errors.path : isSubcollection ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database";
|
|
284
423
|
let t35;
|
|
285
|
-
if ($[
|
|
424
|
+
if ($[47] !== t33 || $[48] !== t34) {
|
|
286
425
|
t35 = /* @__PURE__ */ jsx(FieldCaption, { error: t33, children: t34 });
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
426
|
+
$[47] = t33;
|
|
427
|
+
$[48] = t34;
|
|
428
|
+
$[49] = t35;
|
|
290
429
|
} else {
|
|
291
|
-
t35 = $[
|
|
430
|
+
t35 = $[49];
|
|
292
431
|
}
|
|
293
432
|
let t36;
|
|
294
|
-
if ($[
|
|
433
|
+
if ($[50] !== t29 || $[51] !== t32 || $[52] !== t35) {
|
|
295
434
|
t36 = /* @__PURE__ */ jsxs("div", { className: t29, children: [
|
|
296
435
|
t32,
|
|
297
436
|
t35
|
|
298
437
|
] });
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
438
|
+
$[50] = t29;
|
|
439
|
+
$[51] = t32;
|
|
440
|
+
$[52] = t35;
|
|
441
|
+
$[53] = t36;
|
|
303
442
|
} else {
|
|
304
|
-
t36 = $[
|
|
443
|
+
t36 = $[53];
|
|
305
444
|
}
|
|
306
445
|
const t37 = !isSubcollection && /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-4 relative", children: [
|
|
307
446
|
/* @__PURE__ */ jsx(TextField, { error: showErrors && Boolean(errors.group), disabled: isSubmitting, value: values.group ?? "", autoComplete: "off", onChange: (event) => setFieldValue("group", event.target.value), name: "group", inputRef: groupRef, label: "Group" }),
|
|
@@ -311,471 +450,492 @@ function CollectionDetailsForm(t0) {
|
|
|
311
450
|
}, children: /* @__PURE__ */ jsx("div", { className: "flex-grow", children: group_0 }) }, index + "_" + group_0)) }),
|
|
312
451
|
/* @__PURE__ */ jsx(FieldCaption, { children: showErrors && Boolean(errors.group) ? errors.group : "Group in the home page" })
|
|
313
452
|
] });
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
453
|
+
const t38 = values.openEntityMode ?? "side_panel";
|
|
454
|
+
let t39;
|
|
455
|
+
if ($[54] !== setFieldValue) {
|
|
456
|
+
t39 = (value) => setFieldValue("openEntityMode", value);
|
|
457
|
+
$[54] = setFieldValue;
|
|
458
|
+
$[55] = t39;
|
|
459
|
+
} else {
|
|
460
|
+
t39 = $[55];
|
|
461
|
+
}
|
|
462
|
+
let t40;
|
|
463
|
+
if ($[56] !== t38 || $[57] !== t39) {
|
|
464
|
+
t40 = /* @__PURE__ */ jsx(LayoutModeSwitch, { className: "col-span-12", value: t38, onChange: t39 });
|
|
465
|
+
$[56] = t38;
|
|
466
|
+
$[57] = t39;
|
|
467
|
+
$[58] = t40;
|
|
468
|
+
} else {
|
|
469
|
+
t40 = $[58];
|
|
470
|
+
}
|
|
471
|
+
let t41;
|
|
472
|
+
if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
|
|
473
|
+
t41 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row text-surface-500", children: [
|
|
317
474
|
/* @__PURE__ */ jsx(SettingsIcon, {}),
|
|
318
475
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "ml-2", children: "Advanced" })
|
|
319
476
|
] });
|
|
320
|
-
$[
|
|
477
|
+
$[59] = t41;
|
|
321
478
|
} else {
|
|
322
|
-
|
|
479
|
+
t41 = $[59];
|
|
323
480
|
}
|
|
324
|
-
const
|
|
325
|
-
const
|
|
326
|
-
let
|
|
327
|
-
if ($[
|
|
328
|
-
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
481
|
+
const t42 = !isNewCollection;
|
|
482
|
+
const t43 = showErrors && Boolean(errors.id);
|
|
483
|
+
let t44;
|
|
484
|
+
if ($[60] !== t42 || $[61] !== t43) {
|
|
485
|
+
t44 = /* @__PURE__ */ jsx(Field, { name: "id", as: DebouncedTextField, disabled: t42, label: "Collection id", error: t43 });
|
|
486
|
+
$[60] = t42;
|
|
487
|
+
$[61] = t43;
|
|
488
|
+
$[62] = t44;
|
|
332
489
|
} else {
|
|
333
|
-
|
|
490
|
+
t44 = $[62];
|
|
334
491
|
}
|
|
335
|
-
const
|
|
336
|
-
const
|
|
337
|
-
let
|
|
338
|
-
if ($[
|
|
339
|
-
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
} else {
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
let
|
|
347
|
-
if ($[
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
492
|
+
const t45 = touched.id && Boolean(errors.id);
|
|
493
|
+
const t46 = touched.id && Boolean(errors.id) ? errors.id : "This id identifies this collection. Typically the same as the path.";
|
|
494
|
+
let t47;
|
|
495
|
+
if ($[63] !== t45 || $[64] !== t46) {
|
|
496
|
+
t47 = /* @__PURE__ */ jsx(FieldCaption, { error: t45, children: t46 });
|
|
497
|
+
$[63] = t45;
|
|
498
|
+
$[64] = t46;
|
|
499
|
+
$[65] = t47;
|
|
500
|
+
} else {
|
|
501
|
+
t47 = $[65];
|
|
502
|
+
}
|
|
503
|
+
let t48;
|
|
504
|
+
if ($[66] !== t44 || $[67] !== t47) {
|
|
505
|
+
t48 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
506
|
+
t44,
|
|
507
|
+
t47
|
|
351
508
|
] });
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
509
|
+
$[66] = t44;
|
|
510
|
+
$[67] = t47;
|
|
511
|
+
$[68] = t48;
|
|
355
512
|
} else {
|
|
356
|
-
|
|
513
|
+
t48 = $[68];
|
|
357
514
|
}
|
|
358
|
-
const
|
|
359
|
-
let
|
|
360
|
-
if ($[
|
|
361
|
-
|
|
515
|
+
const t49 = showErrors && Boolean(errors.singularName);
|
|
516
|
+
let t50;
|
|
517
|
+
if ($[69] !== handleChange || $[70] !== setFieldTouched) {
|
|
518
|
+
t50 = (e_0) => {
|
|
362
519
|
setFieldTouched("singularName", true);
|
|
363
520
|
return handleChange(e_0);
|
|
364
521
|
};
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
522
|
+
$[69] = handleChange;
|
|
523
|
+
$[70] = setFieldTouched;
|
|
524
|
+
$[71] = t50;
|
|
368
525
|
} else {
|
|
369
|
-
|
|
526
|
+
t50 = $[71];
|
|
370
527
|
}
|
|
371
|
-
const
|
|
372
|
-
let
|
|
373
|
-
if ($[
|
|
374
|
-
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
528
|
+
const t51 = values.singularName ?? "";
|
|
529
|
+
let t52;
|
|
530
|
+
if ($[72] !== t49 || $[73] !== t50 || $[74] !== t51) {
|
|
531
|
+
t52 = /* @__PURE__ */ jsx(TextField, { error: t49, name: "singularName", "aria-describedby": "singularName-helper", onChange: t50, value: t51, label: "Singular name" });
|
|
532
|
+
$[72] = t49;
|
|
533
|
+
$[73] = t50;
|
|
534
|
+
$[74] = t51;
|
|
535
|
+
$[75] = t52;
|
|
379
536
|
} else {
|
|
380
|
-
|
|
537
|
+
t52 = $[75];
|
|
381
538
|
}
|
|
382
|
-
const
|
|
383
|
-
const
|
|
384
|
-
let
|
|
385
|
-
if ($[
|
|
386
|
-
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
} else {
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
let
|
|
394
|
-
if ($[
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
539
|
+
const t53 = showErrors && Boolean(errors.singularName);
|
|
540
|
+
const t54 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define a singular name for your entities";
|
|
541
|
+
let t55;
|
|
542
|
+
if ($[76] !== t53 || $[77] !== t54) {
|
|
543
|
+
t55 = /* @__PURE__ */ jsx(FieldCaption, { error: t53, children: t54 });
|
|
544
|
+
$[76] = t53;
|
|
545
|
+
$[77] = t54;
|
|
546
|
+
$[78] = t55;
|
|
547
|
+
} else {
|
|
548
|
+
t55 = $[78];
|
|
549
|
+
}
|
|
550
|
+
let t56;
|
|
551
|
+
if ($[79] !== t52 || $[80] !== t55) {
|
|
552
|
+
t56 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
553
|
+
t52,
|
|
554
|
+
t55
|
|
398
555
|
] });
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
556
|
+
$[79] = t52;
|
|
557
|
+
$[80] = t55;
|
|
558
|
+
$[81] = t56;
|
|
402
559
|
} else {
|
|
403
|
-
|
|
560
|
+
t56 = $[81];
|
|
404
561
|
}
|
|
405
|
-
const
|
|
406
|
-
let
|
|
407
|
-
if ($[
|
|
408
|
-
|
|
562
|
+
const t57 = showErrors && Boolean(errors.sideDialogWidth);
|
|
563
|
+
let t58;
|
|
564
|
+
if ($[82] !== setFieldTouched || $[83] !== setFieldValue) {
|
|
565
|
+
t58 = (e_1) => {
|
|
409
566
|
setFieldTouched("sideDialogWidth", true);
|
|
410
|
-
const
|
|
411
|
-
if (!
|
|
567
|
+
const value_0 = e_1.target.value;
|
|
568
|
+
if (!value_0) {
|
|
412
569
|
setFieldValue("sideDialogWidth", null);
|
|
413
570
|
} else {
|
|
414
|
-
if (!isNaN(Number(
|
|
415
|
-
setFieldValue("sideDialogWidth", Number(
|
|
571
|
+
if (!isNaN(Number(value_0))) {
|
|
572
|
+
setFieldValue("sideDialogWidth", Number(value_0));
|
|
416
573
|
}
|
|
417
574
|
}
|
|
418
575
|
};
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
576
|
+
$[82] = setFieldTouched;
|
|
577
|
+
$[83] = setFieldValue;
|
|
578
|
+
$[84] = t58;
|
|
422
579
|
} else {
|
|
423
|
-
|
|
580
|
+
t58 = $[84];
|
|
424
581
|
}
|
|
425
|
-
let
|
|
426
|
-
if ($[
|
|
427
|
-
|
|
582
|
+
let t59;
|
|
583
|
+
if ($[85] !== setFieldValue) {
|
|
584
|
+
t59 = () => {
|
|
428
585
|
setFieldValue("sideDialogWidth", null);
|
|
429
586
|
};
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
587
|
+
$[85] = setFieldValue;
|
|
588
|
+
$[86] = t59;
|
|
432
589
|
} else {
|
|
433
|
-
|
|
590
|
+
t59 = $[86];
|
|
434
591
|
}
|
|
435
|
-
const
|
|
436
|
-
let
|
|
437
|
-
if ($[
|
|
438
|
-
|
|
439
|
-
$[
|
|
592
|
+
const t60 = !values.sideDialogWidth;
|
|
593
|
+
let t61;
|
|
594
|
+
if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
|
|
595
|
+
t61 = /* @__PURE__ */ jsx(CloseIcon, { size: "small" });
|
|
596
|
+
$[87] = t61;
|
|
440
597
|
} else {
|
|
441
|
-
|
|
598
|
+
t61 = $[87];
|
|
442
599
|
}
|
|
443
|
-
let
|
|
444
|
-
if ($[
|
|
445
|
-
|
|
446
|
-
$[
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
600
|
+
let t62;
|
|
601
|
+
if ($[88] !== t59 || $[89] !== t60) {
|
|
602
|
+
t62 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t59, disabled: t60, children: t61 });
|
|
603
|
+
$[88] = t59;
|
|
604
|
+
$[89] = t60;
|
|
605
|
+
$[90] = t62;
|
|
449
606
|
} else {
|
|
450
|
-
|
|
607
|
+
t62 = $[90];
|
|
451
608
|
}
|
|
452
|
-
const
|
|
453
|
-
let t61;
|
|
454
|
-
if ($[87] !== t54 || $[88] !== t55 || $[89] !== t59 || $[90] !== t60) {
|
|
455
|
-
t61 = /* @__PURE__ */ jsx(TextField, { error: t54, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t55, endAdornment: t59, value: t60, label: "Side dialog width" });
|
|
456
|
-
$[87] = t54;
|
|
457
|
-
$[88] = t55;
|
|
458
|
-
$[89] = t59;
|
|
459
|
-
$[90] = t60;
|
|
460
|
-
$[91] = t61;
|
|
461
|
-
} else {
|
|
462
|
-
t61 = $[91];
|
|
463
|
-
}
|
|
464
|
-
const t62 = showErrors && Boolean(errors.singularName);
|
|
465
|
-
const t63 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
|
|
609
|
+
const t63 = values.sideDialogWidth ?? "";
|
|
466
610
|
let t64;
|
|
467
|
-
if ($[92] !==
|
|
468
|
-
t64 = /* @__PURE__ */ jsx(
|
|
469
|
-
$[
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
$[96] =
|
|
483
|
-
$[97] =
|
|
484
|
-
|
|
485
|
-
|
|
611
|
+
if ($[91] !== t57 || $[92] !== t58 || $[93] !== t62 || $[94] !== t63) {
|
|
612
|
+
t64 = /* @__PURE__ */ jsx(TextField, { error: t57, name: "sideDialogWidth", type: "number", "aria-describedby": "sideDialogWidth-helper", onChange: t58, endAdornment: t62, value: t63, label: "Side dialog width" });
|
|
613
|
+
$[91] = t57;
|
|
614
|
+
$[92] = t58;
|
|
615
|
+
$[93] = t62;
|
|
616
|
+
$[94] = t63;
|
|
617
|
+
$[95] = t64;
|
|
618
|
+
} else {
|
|
619
|
+
t64 = $[95];
|
|
620
|
+
}
|
|
621
|
+
const t65 = showErrors && Boolean(errors.singularName);
|
|
622
|
+
const t66 = showErrors && Boolean(errors.singularName) ? errors.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px";
|
|
623
|
+
let t67;
|
|
624
|
+
if ($[96] !== t65 || $[97] !== t66) {
|
|
625
|
+
t67 = /* @__PURE__ */ jsx(FieldCaption, { error: t65, children: t66 });
|
|
626
|
+
$[96] = t65;
|
|
627
|
+
$[97] = t66;
|
|
628
|
+
$[98] = t67;
|
|
629
|
+
} else {
|
|
630
|
+
t67 = $[98];
|
|
486
631
|
}
|
|
487
|
-
const t66 = showErrors && Boolean(errors.description);
|
|
488
|
-
const t67 = values.description ?? "";
|
|
489
632
|
let t68;
|
|
490
|
-
if ($[
|
|
491
|
-
t68 = /* @__PURE__ */
|
|
492
|
-
|
|
493
|
-
|
|
633
|
+
if ($[99] !== t64 || $[100] !== t67) {
|
|
634
|
+
t68 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
635
|
+
t64,
|
|
636
|
+
t67
|
|
637
|
+
] });
|
|
638
|
+
$[99] = t64;
|
|
494
639
|
$[100] = t67;
|
|
495
640
|
$[101] = t68;
|
|
496
641
|
} else {
|
|
497
642
|
t68 = $[101];
|
|
498
643
|
}
|
|
499
644
|
const t69 = showErrors && Boolean(errors.description);
|
|
500
|
-
const t70 =
|
|
645
|
+
const t70 = values.description ?? "";
|
|
501
646
|
let t71;
|
|
502
|
-
if ($[102] !==
|
|
503
|
-
t71 = /* @__PURE__ */ jsx(
|
|
504
|
-
$[102] =
|
|
505
|
-
$[103] =
|
|
506
|
-
$[104] =
|
|
507
|
-
|
|
508
|
-
t71 = $[104];
|
|
509
|
-
}
|
|
510
|
-
let t72;
|
|
511
|
-
if ($[105] !== t68 || $[106] !== t71) {
|
|
512
|
-
t72 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
513
|
-
t68,
|
|
514
|
-
t71
|
|
515
|
-
] });
|
|
516
|
-
$[105] = t68;
|
|
517
|
-
$[106] = t71;
|
|
518
|
-
$[107] = t72;
|
|
647
|
+
if ($[102] !== handleChange || $[103] !== t69 || $[104] !== t70) {
|
|
648
|
+
t71 = /* @__PURE__ */ jsx(TextField, { error: t69, name: "description", value: t70, onChange: handleChange, multiline: true, minRows: 2, "aria-describedby": "description-helper-text", label: "Description" });
|
|
649
|
+
$[102] = handleChange;
|
|
650
|
+
$[103] = t69;
|
|
651
|
+
$[104] = t70;
|
|
652
|
+
$[105] = t71;
|
|
519
653
|
} else {
|
|
520
|
-
|
|
654
|
+
t71 = $[105];
|
|
521
655
|
}
|
|
522
|
-
const
|
|
656
|
+
const t72 = showErrors && Boolean(errors.description);
|
|
657
|
+
const t73 = showErrors && Boolean(errors.description) ? errors.description : "Description of the collection, you can use markdown";
|
|
523
658
|
let t74;
|
|
524
|
-
if ($[
|
|
525
|
-
t74 =
|
|
659
|
+
if ($[106] !== t72 || $[107] !== t73) {
|
|
660
|
+
t74 = /* @__PURE__ */ jsx(FieldCaption, { error: t72, children: t73 });
|
|
661
|
+
$[106] = t72;
|
|
662
|
+
$[107] = t73;
|
|
526
663
|
$[108] = t74;
|
|
527
664
|
} else {
|
|
528
665
|
t74 = $[108];
|
|
529
666
|
}
|
|
530
667
|
let t75;
|
|
531
|
-
if ($[109] !==
|
|
532
|
-
t75 = /* @__PURE__ */
|
|
533
|
-
|
|
534
|
-
|
|
668
|
+
if ($[109] !== t71 || $[110] !== t74) {
|
|
669
|
+
t75 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
670
|
+
t71,
|
|
671
|
+
t74
|
|
672
|
+
] });
|
|
673
|
+
$[109] = t71;
|
|
674
|
+
$[110] = t74;
|
|
535
675
|
$[111] = t75;
|
|
536
676
|
} else {
|
|
537
677
|
t75 = $[111];
|
|
538
678
|
}
|
|
539
|
-
const t76 =
|
|
679
|
+
const t76 = values.defaultSize ?? "";
|
|
540
680
|
let t77;
|
|
541
|
-
if ($[112]
|
|
542
|
-
t77 = (
|
|
681
|
+
if ($[112] === Symbol.for("react.memo_cache_sentinel")) {
|
|
682
|
+
t77 = ["xs", "s", "m", "l", "xl"].map(_temp2$7);
|
|
683
|
+
$[112] = t77;
|
|
684
|
+
} else {
|
|
685
|
+
t77 = $[112];
|
|
686
|
+
}
|
|
687
|
+
let t78;
|
|
688
|
+
if ($[113] !== handleChange || $[114] !== t76) {
|
|
689
|
+
t78 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(Select, { name: "defaultSize", size: "large", fullWidth: true, label: "Default row size", position: "item-aligned", onChange: handleChange, value: t76, renderValue: _temp$b, children: t77 }) });
|
|
690
|
+
$[113] = handleChange;
|
|
691
|
+
$[114] = t76;
|
|
692
|
+
$[115] = t78;
|
|
693
|
+
} else {
|
|
694
|
+
t78 = $[115];
|
|
695
|
+
}
|
|
696
|
+
const t79 = customIdValue === "code_defined";
|
|
697
|
+
let t80;
|
|
698
|
+
if ($[116] !== setFieldValue) {
|
|
699
|
+
t80 = (v) => {
|
|
543
700
|
if (v === "code_defined") {
|
|
544
701
|
throw new Error("This should not happen");
|
|
545
|
-
} else {
|
|
546
|
-
if (v === "true") {
|
|
547
|
-
setFieldValue("customId", true);
|
|
548
|
-
} else {
|
|
549
|
-
if (v === "false") {
|
|
550
|
-
setFieldValue("customId", false);
|
|
551
|
-
} else {
|
|
552
|
-
if (v === "optional") {
|
|
553
|
-
setFieldValue("customId", "optional");
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
702
|
}
|
|
703
|
+
setFieldValue("customId", v);
|
|
558
704
|
};
|
|
559
|
-
$[
|
|
560
|
-
$[
|
|
705
|
+
$[116] = setFieldValue;
|
|
706
|
+
$[117] = t80;
|
|
561
707
|
} else {
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
const t78 = customIdValue ?? "";
|
|
565
|
-
let t79;
|
|
566
|
-
let t80;
|
|
567
|
-
let t81;
|
|
568
|
-
if ($[114] === Symbol.for("react.memo_cache_sentinel")) {
|
|
569
|
-
t79 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
|
|
570
|
-
t80 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
|
|
571
|
-
t81 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
|
|
572
|
-
$[114] = t79;
|
|
573
|
-
$[115] = t80;
|
|
574
|
-
$[116] = t81;
|
|
575
|
-
} else {
|
|
576
|
-
t79 = $[114];
|
|
577
|
-
t80 = $[115];
|
|
578
|
-
t81 = $[116];
|
|
708
|
+
t80 = $[117];
|
|
579
709
|
}
|
|
710
|
+
const t81 = customIdValue ?? "";
|
|
580
711
|
let t82;
|
|
581
|
-
if ($[117] !== t76 || $[118] !== t77 || $[119] !== t78) {
|
|
582
|
-
t82 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t76, onValueChange: t77, value: t78, renderValue: _temp3$4, children: [
|
|
583
|
-
t79,
|
|
584
|
-
t80,
|
|
585
|
-
t81
|
|
586
|
-
] }) });
|
|
587
|
-
$[117] = t76;
|
|
588
|
-
$[118] = t77;
|
|
589
|
-
$[119] = t78;
|
|
590
|
-
$[120] = t82;
|
|
591
|
-
} else {
|
|
592
|
-
t82 = $[120];
|
|
593
|
-
}
|
|
594
712
|
let t83;
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
713
|
+
let t84;
|
|
714
|
+
if ($[118] === Symbol.for("react.memo_cache_sentinel")) {
|
|
715
|
+
t82 = /* @__PURE__ */ jsx(SelectItem, { value: "false", children: "Document ID is generated automatically" });
|
|
716
|
+
t83 = /* @__PURE__ */ jsx(SelectItem, { value: "true", children: "Users must define an ID" });
|
|
717
|
+
t84 = /* @__PURE__ */ jsx(SelectItem, { value: "optional", children: "Users can define an ID, but it is not required" });
|
|
718
|
+
$[118] = t82;
|
|
719
|
+
$[119] = t83;
|
|
720
|
+
$[120] = t84;
|
|
721
|
+
} else {
|
|
722
|
+
t82 = $[118];
|
|
723
|
+
t83 = $[119];
|
|
724
|
+
t84 = $[120];
|
|
601
725
|
}
|
|
602
|
-
const t84 = values.collectionGroup ?? false;
|
|
603
726
|
let t85;
|
|
604
|
-
if ($[
|
|
605
|
-
t85 = /* @__PURE__ */ jsx(
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
727
|
+
if ($[121] !== t79 || $[122] !== t80 || $[123] !== t81) {
|
|
728
|
+
t85 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsxs(Select, { name: "customId", label: "Document IDs generation", position: "item-aligned", size: "large", fullWidth: true, disabled: t79, onValueChange: t80, value: t81, renderValue: _temp3$4, children: [
|
|
729
|
+
t82,
|
|
730
|
+
t83,
|
|
731
|
+
t84
|
|
732
|
+
] }) });
|
|
733
|
+
$[121] = t79;
|
|
734
|
+
$[122] = t80;
|
|
735
|
+
$[123] = t81;
|
|
736
|
+
$[124] = t85;
|
|
609
737
|
} else {
|
|
610
|
-
t85 = $[
|
|
738
|
+
t85 = $[124];
|
|
611
739
|
}
|
|
612
740
|
let t86;
|
|
613
|
-
if ($[
|
|
614
|
-
t86 =
|
|
741
|
+
if ($[125] !== setFieldValue) {
|
|
742
|
+
t86 = (v_0) => setFieldValue("collectionGroup", v_0);
|
|
743
|
+
$[125] = setFieldValue;
|
|
615
744
|
$[126] = t86;
|
|
616
745
|
} else {
|
|
617
746
|
t86 = $[126];
|
|
618
747
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
] });
|
|
625
|
-
$[127] = t85;
|
|
748
|
+
const t87 = values.collectionGroup ?? false;
|
|
749
|
+
let t88;
|
|
750
|
+
if ($[127] !== t86 || $[128] !== t87) {
|
|
751
|
+
t88 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Collection group", onValueChange: t86, value: t87 });
|
|
752
|
+
$[127] = t86;
|
|
626
753
|
$[128] = t87;
|
|
754
|
+
$[129] = t88;
|
|
627
755
|
} else {
|
|
628
|
-
|
|
756
|
+
t88 = $[129];
|
|
629
757
|
}
|
|
630
|
-
let
|
|
631
|
-
if ($[
|
|
632
|
-
|
|
633
|
-
$[
|
|
634
|
-
$[130] = t88;
|
|
758
|
+
let t89;
|
|
759
|
+
if ($[130] === Symbol.for("react.memo_cache_sentinel")) {
|
|
760
|
+
t89 = /* @__PURE__ */ jsx(FieldCaption, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." });
|
|
761
|
+
$[130] = t89;
|
|
635
762
|
} else {
|
|
636
|
-
|
|
763
|
+
t89 = $[130];
|
|
637
764
|
}
|
|
638
|
-
const t89 = values.textSearchEnabled ?? false;
|
|
639
765
|
let t90;
|
|
640
|
-
if ($[131] !== t88
|
|
641
|
-
t90 = /* @__PURE__ */
|
|
766
|
+
if ($[131] !== t88) {
|
|
767
|
+
t90 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-4", children: [
|
|
768
|
+
t88,
|
|
769
|
+
t89
|
|
770
|
+
] });
|
|
642
771
|
$[131] = t88;
|
|
643
|
-
$[132] =
|
|
644
|
-
$[133] = t90;
|
|
772
|
+
$[132] = t90;
|
|
645
773
|
} else {
|
|
646
|
-
t90 = $[
|
|
774
|
+
t90 = $[132];
|
|
647
775
|
}
|
|
648
776
|
let t91;
|
|
649
|
-
if ($[
|
|
650
|
-
t91 =
|
|
777
|
+
if ($[133] !== setFieldValue) {
|
|
778
|
+
t91 = (v_1) => setFieldValue("textSearchEnabled", v_1);
|
|
779
|
+
$[133] = setFieldValue;
|
|
651
780
|
$[134] = t91;
|
|
652
781
|
} else {
|
|
653
782
|
t91 = $[134];
|
|
654
783
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
] });
|
|
661
|
-
$[135] = t90;
|
|
784
|
+
const t92 = values.textSearchEnabled ?? false;
|
|
785
|
+
let t93;
|
|
786
|
+
if ($[135] !== t91 || $[136] !== t92) {
|
|
787
|
+
t93 = /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { position: "start", size: "large", label: "Enable text search for this collection", onValueChange: t91, value: t92 });
|
|
788
|
+
$[135] = t91;
|
|
662
789
|
$[136] = t92;
|
|
790
|
+
$[137] = t93;
|
|
663
791
|
} else {
|
|
664
|
-
|
|
792
|
+
t93 = $[137];
|
|
665
793
|
}
|
|
666
|
-
let
|
|
667
|
-
if ($[
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
794
|
+
let t94;
|
|
795
|
+
if ($[138] === Symbol.for("react.memo_cache_sentinel")) {
|
|
796
|
+
t94 = /* @__PURE__ */ jsx(FieldCaption, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." });
|
|
797
|
+
$[138] = t94;
|
|
798
|
+
} else {
|
|
799
|
+
t94 = $[138];
|
|
800
|
+
}
|
|
801
|
+
let t95;
|
|
802
|
+
if ($[139] !== t93) {
|
|
803
|
+
t95 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
|
|
804
|
+
t93,
|
|
805
|
+
t94
|
|
806
|
+
] });
|
|
807
|
+
$[139] = t93;
|
|
808
|
+
$[140] = t95;
|
|
809
|
+
} else {
|
|
810
|
+
t95 = $[140];
|
|
811
|
+
}
|
|
812
|
+
let t96;
|
|
813
|
+
if ($[141] !== t48 || $[142] !== t56 || $[143] !== t68 || $[144] !== t75 || $[145] !== t78 || $[146] !== t85 || $[147] !== t90 || $[148] !== t95) {
|
|
814
|
+
t96 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4 p-4", children: [
|
|
815
|
+
t48,
|
|
816
|
+
t56,
|
|
817
|
+
t68,
|
|
673
818
|
t75,
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
819
|
+
t78,
|
|
820
|
+
t85,
|
|
821
|
+
t90,
|
|
822
|
+
t95
|
|
677
823
|
] });
|
|
678
|
-
$[
|
|
679
|
-
$[
|
|
680
|
-
$[
|
|
681
|
-
$[
|
|
682
|
-
$[
|
|
683
|
-
$[
|
|
684
|
-
$[
|
|
685
|
-
$[
|
|
686
|
-
$[
|
|
687
|
-
} else {
|
|
688
|
-
|
|
824
|
+
$[141] = t48;
|
|
825
|
+
$[142] = t56;
|
|
826
|
+
$[143] = t68;
|
|
827
|
+
$[144] = t75;
|
|
828
|
+
$[145] = t78;
|
|
829
|
+
$[146] = t85;
|
|
830
|
+
$[147] = t90;
|
|
831
|
+
$[148] = t95;
|
|
832
|
+
$[149] = t96;
|
|
833
|
+
} else {
|
|
834
|
+
t96 = $[149];
|
|
689
835
|
}
|
|
690
|
-
let
|
|
691
|
-
if ($[
|
|
692
|
-
|
|
693
|
-
$[
|
|
694
|
-
$[
|
|
695
|
-
$[
|
|
836
|
+
let t97;
|
|
837
|
+
if ($[150] !== advancedPanelExpanded || $[151] !== t96) {
|
|
838
|
+
t97 = /* @__PURE__ */ jsx(ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t96 });
|
|
839
|
+
$[150] = advancedPanelExpanded;
|
|
840
|
+
$[151] = t96;
|
|
841
|
+
$[152] = t97;
|
|
696
842
|
} else {
|
|
697
|
-
|
|
843
|
+
t97 = $[152];
|
|
698
844
|
}
|
|
699
|
-
let
|
|
700
|
-
if ($[
|
|
701
|
-
|
|
845
|
+
let t98;
|
|
846
|
+
if ($[153] !== children || $[154] !== t97) {
|
|
847
|
+
t98 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 mt-8", children: [
|
|
848
|
+
t97,
|
|
849
|
+
children
|
|
850
|
+
] });
|
|
851
|
+
$[153] = children;
|
|
852
|
+
$[154] = t97;
|
|
853
|
+
$[155] = t98;
|
|
854
|
+
} else {
|
|
855
|
+
t98 = $[155];
|
|
856
|
+
}
|
|
857
|
+
let t99;
|
|
858
|
+
if ($[156] !== t27 || $[157] !== t36 || $[158] !== t37 || $[159] !== t40 || $[160] !== t98) {
|
|
859
|
+
t99 = /* @__PURE__ */ jsxs("div", { className: t19, children: [
|
|
702
860
|
t27,
|
|
703
861
|
t36,
|
|
704
862
|
t37,
|
|
705
|
-
|
|
863
|
+
t40,
|
|
864
|
+
t98
|
|
706
865
|
] });
|
|
707
|
-
$[
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
710
|
-
$[
|
|
711
|
-
$[
|
|
866
|
+
$[156] = t27;
|
|
867
|
+
$[157] = t36;
|
|
868
|
+
$[158] = t37;
|
|
869
|
+
$[159] = t40;
|
|
870
|
+
$[160] = t98;
|
|
871
|
+
$[161] = t99;
|
|
712
872
|
} else {
|
|
713
|
-
|
|
873
|
+
t99 = $[161];
|
|
714
874
|
}
|
|
715
|
-
let
|
|
716
|
-
if ($[
|
|
717
|
-
|
|
875
|
+
let t100;
|
|
876
|
+
if ($[162] === Symbol.for("react.memo_cache_sentinel")) {
|
|
877
|
+
t100 = /* @__PURE__ */ jsx("div", { style: {
|
|
718
878
|
height: "52px"
|
|
719
879
|
} });
|
|
720
|
-
$[
|
|
880
|
+
$[162] = t100;
|
|
721
881
|
} else {
|
|
722
|
-
|
|
882
|
+
t100 = $[162];
|
|
723
883
|
}
|
|
724
|
-
let
|
|
725
|
-
if ($[
|
|
726
|
-
|
|
884
|
+
let t101;
|
|
885
|
+
if ($[163] !== setFieldValue) {
|
|
886
|
+
t101 = (icon) => {
|
|
727
887
|
setIconDialogOpen(false);
|
|
728
888
|
setFieldValue("icon", icon);
|
|
729
889
|
};
|
|
730
|
-
$[
|
|
731
|
-
$[
|
|
890
|
+
$[163] = setFieldValue;
|
|
891
|
+
$[164] = t101;
|
|
732
892
|
} else {
|
|
733
|
-
|
|
893
|
+
t101 = $[164];
|
|
734
894
|
}
|
|
735
|
-
let
|
|
736
|
-
if ($[
|
|
737
|
-
|
|
738
|
-
$[
|
|
739
|
-
$[
|
|
740
|
-
$[
|
|
895
|
+
let t102;
|
|
896
|
+
if ($[165] !== t101 || $[166] !== values.icon) {
|
|
897
|
+
t102 = /* @__PURE__ */ jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsx(SearchIconsView, { selectedIcon: values.icon, onIconSelected: t101 }) });
|
|
898
|
+
$[165] = t101;
|
|
899
|
+
$[166] = values.icon;
|
|
900
|
+
$[167] = t102;
|
|
741
901
|
} else {
|
|
742
|
-
|
|
902
|
+
t102 = $[167];
|
|
743
903
|
}
|
|
744
|
-
let
|
|
745
|
-
if ($[
|
|
746
|
-
|
|
747
|
-
$[
|
|
748
|
-
$[
|
|
749
|
-
$[
|
|
904
|
+
let t103;
|
|
905
|
+
if ($[168] !== iconDialogOpen || $[169] !== t102) {
|
|
906
|
+
t103 = /* @__PURE__ */ jsx(Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t102 });
|
|
907
|
+
$[168] = iconDialogOpen;
|
|
908
|
+
$[169] = t102;
|
|
909
|
+
$[170] = t103;
|
|
750
910
|
} else {
|
|
751
|
-
|
|
911
|
+
t103 = $[170];
|
|
752
912
|
}
|
|
753
|
-
let
|
|
754
|
-
if ($[
|
|
755
|
-
|
|
913
|
+
let t104;
|
|
914
|
+
if ($[171] !== T0 || $[172] !== t103 || $[173] !== t18 || $[174] !== t99) {
|
|
915
|
+
t104 = /* @__PURE__ */ jsx("div", { className: t7, children: /* @__PURE__ */ jsxs(T0, { maxWidth: t8, className: t9, children: [
|
|
756
916
|
t18,
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
917
|
+
t99,
|
|
918
|
+
t100,
|
|
919
|
+
t103
|
|
760
920
|
] }) });
|
|
761
|
-
$[
|
|
762
|
-
$[
|
|
763
|
-
$[
|
|
764
|
-
$[
|
|
765
|
-
$[
|
|
921
|
+
$[171] = T0;
|
|
922
|
+
$[172] = t103;
|
|
923
|
+
$[173] = t18;
|
|
924
|
+
$[174] = t99;
|
|
925
|
+
$[175] = t104;
|
|
766
926
|
} else {
|
|
767
|
-
|
|
927
|
+
t104 = $[175];
|
|
768
928
|
}
|
|
769
|
-
return
|
|
929
|
+
return t104;
|
|
770
930
|
}
|
|
771
|
-
function _temp3$4(
|
|
772
|
-
if (
|
|
931
|
+
function _temp3$4(value_3) {
|
|
932
|
+
if (value_3 === "code_defined") {
|
|
773
933
|
return "Code defined";
|
|
774
934
|
} else {
|
|
775
|
-
if (
|
|
935
|
+
if (value_3 === "true") {
|
|
776
936
|
return "Users must define an ID";
|
|
777
937
|
} else {
|
|
778
|
-
if (
|
|
938
|
+
if (value_3 === "optional") {
|
|
779
939
|
return "Users can define an ID, but it is not required";
|
|
780
940
|
} else {
|
|
781
941
|
return "Document ID is generated automatically";
|
|
@@ -783,11 +943,11 @@ function _temp3$4(value_2) {
|
|
|
783
943
|
}
|
|
784
944
|
}
|
|
785
945
|
}
|
|
786
|
-
function _temp2$7(
|
|
787
|
-
return /* @__PURE__ */ jsx(SelectItem, { value:
|
|
946
|
+
function _temp2$7(value_2) {
|
|
947
|
+
return /* @__PURE__ */ jsx(SelectItem, { value: value_2, children: value_2.toUpperCase() }, `size-select-${value_2}`);
|
|
788
948
|
}
|
|
789
|
-
function _temp$b(
|
|
790
|
-
return
|
|
949
|
+
function _temp$b(value_1) {
|
|
950
|
+
return value_1.toUpperCase();
|
|
791
951
|
}
|
|
792
952
|
function DefaultDatabaseField(t0) {
|
|
793
953
|
const $ = c(5);
|
|
@@ -1036,7 +1196,7 @@ function EnumFormFields(t0) {
|
|
|
1036
1196
|
let t6;
|
|
1037
1197
|
if ($[15] !== allowDataInference || $[16] !== disabled || $[17] !== inferValues || $[18] !== inferring) {
|
|
1038
1198
|
t6 = allowDataInference && /* @__PURE__ */ jsxs(Button, { loading: inferring, disabled: disabled || inferring, variant: "text", size: "small", onClick: inferValues, children: [
|
|
1039
|
-
inferring ? /* @__PURE__ */ jsx(CircularProgress, { size: "
|
|
1199
|
+
inferring ? /* @__PURE__ */ jsx(CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsx(AutorenewIcon, {}),
|
|
1040
1200
|
"Infer values from data"
|
|
1041
1201
|
] });
|
|
1042
1202
|
$[15] = allowDataInference;
|
|
@@ -1080,7 +1240,7 @@ function EnumFormFields(t0) {
|
|
|
1080
1240
|
}
|
|
1081
1241
|
let t10;
|
|
1082
1242
|
if ($[26] !== buildEntry || $[27] !== disabled || $[28] !== enumValuesPath || $[29] !== t8 || $[30] !== values.enumValues) {
|
|
1083
|
-
t10 = /* @__PURE__ */ jsx(ArrayContainer, { droppableId: enumValuesPath, addLabel: "Add enum value", value: values.enumValues, disabled, size: "small", buildEntry, onInternalIdAdded: setLastInternalIdAdded,
|
|
1243
|
+
t10 = /* @__PURE__ */ jsx(ArrayContainer, { droppableId: enumValuesPath, addLabel: "Add enum value", value: values.enumValues, disabled, size: "small", buildEntry, onInternalIdAdded: setLastInternalIdAdded, canAddElements: true, onValueChange: t8, newDefaultEntry: t9 });
|
|
1084
1244
|
$[26] = buildEntry;
|
|
1085
1245
|
$[27] = disabled;
|
|
1086
1246
|
$[28] = enumValuesPath;
|
|
@@ -6432,9 +6592,11 @@ function WidgetSelectViewItem(t0) {
|
|
|
6432
6592
|
}
|
|
6433
6593
|
function camelCase(str) {
|
|
6434
6594
|
if (!str) return "";
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6595
|
+
if (str.length === 1) return str.toLowerCase();
|
|
6596
|
+
const parts = str.split(/[-_ ]+/).filter(Boolean);
|
|
6597
|
+
if (parts.length === 0) return "";
|
|
6598
|
+
return parts[0].toLowerCase() + // Transform remaining parts to have first letter uppercase
|
|
6599
|
+
parts.slice(1).map((part) => part.charAt(0).toUpperCase() + part.substring(1).toLowerCase()).join("");
|
|
6438
6600
|
}
|
|
6439
6601
|
function GetCodeDialog(t0) {
|
|
6440
6602
|
const $ = c(22);
|
|
@@ -6462,7 +6624,7 @@ function GetCodeDialog(t0) {
|
|
|
6462
6624
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
6463
6625
|
t2 = /* @__PURE__ */ jsxs(Typography, { variant: "body2", className: "my-4 mb-8", children: [
|
|
6464
6626
|
"If you want to customise the collection in code, you can add this collection code to your CMS app configuration. More info in the ",
|
|
6465
|
-
/* @__PURE__ */ jsx("a", { rel: "noopener noreferrer", href: "https://firecms.co/docs/
|
|
6627
|
+
/* @__PURE__ */ jsx("a", { rel: "noopener noreferrer", href: "https://firecms.co/docs/cloud/quickstart", children: "docs" }),
|
|
6466
6628
|
"."
|
|
6467
6629
|
] });
|
|
6468
6630
|
$[2] = t2;
|
|
@@ -6750,7 +6912,6 @@ function CollectionPropertiesEditorForm({
|
|
|
6750
6912
|
previousId,
|
|
6751
6913
|
namespace: namespace_3
|
|
6752
6914
|
}) => {
|
|
6753
|
-
console.log("!!!!!! onPropertyChanged", property_0);
|
|
6754
6915
|
const fullId_0 = id_0 ? getFullId(id_0, namespace_3) : void 0;
|
|
6755
6916
|
const propertyPath = fullId_0 ? idToPropertiesPath(fullId_0) : void 0;
|
|
6756
6917
|
if (previousId && previousId !== id_0) {
|
|
@@ -8304,10 +8465,8 @@ function CollectionEditorImportMapping(t0) {
|
|
|
8304
8465
|
editable: true
|
|
8305
8466
|
};
|
|
8306
8467
|
if (propertyPath_0) {
|
|
8307
|
-
|
|
8468
|
+
{
|
|
8308
8469
|
setFieldValue(propertyPath_0, inferredNewProperty, false);
|
|
8309
|
-
} else {
|
|
8310
|
-
setFieldValue(propertyPath_0, property_1, false);
|
|
8311
8470
|
}
|
|
8312
8471
|
setFieldTouched(propertyPath_0, true, false);
|
|
8313
8472
|
}
|
|
@@ -8614,102 +8773,104 @@ function PropertySelectItem(t0) {
|
|
|
8614
8773
|
return t9;
|
|
8615
8774
|
}
|
|
8616
8775
|
function CollectionEditorImportDataPreview(t0) {
|
|
8617
|
-
const $ = c(
|
|
8776
|
+
const $ = c(19);
|
|
8618
8777
|
const {
|
|
8619
8778
|
importConfig,
|
|
8620
8779
|
properties,
|
|
8621
8780
|
propertiesOrder
|
|
8622
8781
|
} = t0;
|
|
8782
|
+
const authController = useAuthController();
|
|
8623
8783
|
const [loading, setLoading] = useState(false);
|
|
8624
8784
|
let t1;
|
|
8625
|
-
if ($[0] !==
|
|
8785
|
+
if ($[0] !== authController || $[1] !== importConfig || $[2] !== properties) {
|
|
8626
8786
|
t1 = async function loadEntities2() {
|
|
8627
|
-
const mappedData = importConfig.importData.map((d) => convertDataToEntity(d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
|
|
8787
|
+
const mappedData = importConfig.importData.map((d) => convertDataToEntity(authController, d, importConfig.idColumn, importConfig.headersMapping, properties, "TEMP_PATH", importConfig.defaultValues));
|
|
8628
8788
|
importConfig.setEntities(mappedData);
|
|
8629
8789
|
};
|
|
8630
|
-
$[0] =
|
|
8631
|
-
$[1] =
|
|
8632
|
-
$[2] =
|
|
8790
|
+
$[0] = authController;
|
|
8791
|
+
$[1] = importConfig;
|
|
8792
|
+
$[2] = properties;
|
|
8793
|
+
$[3] = t1;
|
|
8633
8794
|
} else {
|
|
8634
|
-
t1 = $[
|
|
8795
|
+
t1 = $[3];
|
|
8635
8796
|
}
|
|
8636
8797
|
const loadEntities = t1;
|
|
8637
8798
|
let t2;
|
|
8638
|
-
if ($[
|
|
8799
|
+
if ($[4] !== loadEntities) {
|
|
8639
8800
|
t2 = () => {
|
|
8640
8801
|
loadEntities().finally(() => setLoading(false));
|
|
8641
8802
|
};
|
|
8642
|
-
$[
|
|
8643
|
-
$[
|
|
8803
|
+
$[4] = loadEntities;
|
|
8804
|
+
$[5] = t2;
|
|
8644
8805
|
} else {
|
|
8645
|
-
t2 = $[
|
|
8806
|
+
t2 = $[5];
|
|
8646
8807
|
}
|
|
8647
8808
|
let t3;
|
|
8648
|
-
if ($[
|
|
8809
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8649
8810
|
t3 = [];
|
|
8650
|
-
$[
|
|
8811
|
+
$[6] = t3;
|
|
8651
8812
|
} else {
|
|
8652
|
-
t3 = $[
|
|
8813
|
+
t3 = $[6];
|
|
8653
8814
|
}
|
|
8654
8815
|
useEffect(t2, t3);
|
|
8655
8816
|
const selectionController = useSelectionController();
|
|
8656
8817
|
if (loading) {
|
|
8657
8818
|
let t42;
|
|
8658
|
-
if ($[
|
|
8819
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8659
8820
|
t42 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
|
|
8660
|
-
$[
|
|
8821
|
+
$[7] = t42;
|
|
8661
8822
|
} else {
|
|
8662
|
-
t42 = $[
|
|
8823
|
+
t42 = $[7];
|
|
8663
8824
|
}
|
|
8664
8825
|
return t42;
|
|
8665
8826
|
}
|
|
8666
8827
|
let t4;
|
|
8667
|
-
if ($[
|
|
8828
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8668
8829
|
t4 = /* @__PURE__ */ jsxs("div", { children: [
|
|
8669
8830
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: "Imported data preview" }),
|
|
8670
8831
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", children: "Entities with the same id will be overwritten" })
|
|
8671
8832
|
] });
|
|
8672
|
-
$[
|
|
8833
|
+
$[8] = t4;
|
|
8673
8834
|
} else {
|
|
8674
|
-
t4 = $[
|
|
8835
|
+
t4 = $[8];
|
|
8675
8836
|
}
|
|
8676
8837
|
let t5;
|
|
8677
|
-
if ($[
|
|
8838
|
+
if ($[9] !== importConfig.entities) {
|
|
8678
8839
|
t5 = {
|
|
8679
8840
|
data: importConfig.entities,
|
|
8680
8841
|
dataLoading: false,
|
|
8681
8842
|
noMoreToLoad: false
|
|
8682
8843
|
};
|
|
8683
|
-
$[
|
|
8684
|
-
$[
|
|
8844
|
+
$[9] = importConfig.entities;
|
|
8845
|
+
$[10] = t5;
|
|
8685
8846
|
} else {
|
|
8686
|
-
t5 = $[
|
|
8847
|
+
t5 = $[10];
|
|
8687
8848
|
}
|
|
8688
8849
|
let t6;
|
|
8689
|
-
if ($[
|
|
8850
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8690
8851
|
t6 = /* @__PURE__ */ jsx("div", { className: "h-12" });
|
|
8691
|
-
$[
|
|
8852
|
+
$[11] = t6;
|
|
8692
8853
|
} else {
|
|
8693
|
-
t6 = $[
|
|
8854
|
+
t6 = $[11];
|
|
8694
8855
|
}
|
|
8695
8856
|
let t7;
|
|
8696
|
-
if ($[
|
|
8857
|
+
if ($[12] !== propertiesOrder) {
|
|
8697
8858
|
t7 = propertiesOrder.map(_temp$1);
|
|
8698
|
-
$[
|
|
8699
|
-
$[
|
|
8859
|
+
$[12] = propertiesOrder;
|
|
8860
|
+
$[13] = t7;
|
|
8700
8861
|
} else {
|
|
8701
|
-
t7 = $[
|
|
8862
|
+
t7 = $[13];
|
|
8702
8863
|
}
|
|
8703
8864
|
let t8;
|
|
8704
|
-
if ($[
|
|
8705
|
-
t8 = /* @__PURE__ */ jsx(EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, properties, enablePopupIcon: false });
|
|
8706
|
-
$[
|
|
8707
|
-
$[
|
|
8708
|
-
$[
|
|
8709
|
-
$[
|
|
8710
|
-
$[
|
|
8865
|
+
if ($[14] !== properties || $[15] !== selectionController || $[16] !== t5 || $[17] !== t7) {
|
|
8866
|
+
t8 = /* @__PURE__ */ jsx(EntityCollectionTable, { title: t4, tableController: t5, endAdornment: t6, filterable: false, sortable: false, selectionController, displayedColumnIds: t7, openEntityMode: "side_panel", properties, enablePopupIcon: false });
|
|
8867
|
+
$[14] = properties;
|
|
8868
|
+
$[15] = selectionController;
|
|
8869
|
+
$[16] = t5;
|
|
8870
|
+
$[17] = t7;
|
|
8871
|
+
$[18] = t8;
|
|
8711
8872
|
} else {
|
|
8712
|
-
t8 = $[
|
|
8873
|
+
t8 = $[18];
|
|
8713
8874
|
}
|
|
8714
8875
|
return t8;
|
|
8715
8876
|
}
|
|
@@ -9169,7 +9330,7 @@ function CollectionEditorInternal({
|
|
|
9169
9330
|
const updatedFullPath = fullPath?.includes("/") ? fullPath?.split("/").slice(0, -1).join("/") + "/" + path : path;
|
|
9170
9331
|
const pathError_0 = validatePath(path, isNewCollection, existingPaths, values_1.id);
|
|
9171
9332
|
const parentPaths = !pathError_0 && parentCollectionIds ? navigation.convertIdsToPaths(parentCollectionIds) : void 0;
|
|
9172
|
-
const resolvedPath = !pathError_0 ? navigation.
|
|
9333
|
+
const resolvedPath = !pathError_0 ? navigation.resolveIdsFrom(updatedFullPath) : void 0;
|
|
9173
9334
|
const getDataWithPath = resolvedPath && getData ? async () => {
|
|
9174
9335
|
const data = await getData(resolvedPath, parentPaths ?? []);
|
|
9175
9336
|
if (existingEntities) {
|
|
@@ -9206,82 +9367,109 @@ function CollectionEditorInternal({
|
|
|
9206
9367
|
setNextMode();
|
|
9207
9368
|
};
|
|
9208
9369
|
const editable = collection?.editable === void 0 || collection?.editable === true;
|
|
9370
|
+
const isMergedCollection = collection?.merged ?? false;
|
|
9209
9371
|
const collectionEditable = editable || isNewCollection;
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
})
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
/* @__PURE__ */ jsx(
|
|
9254
|
-
"
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9372
|
+
const [deleteRequested, setDeleteRequested] = useState(false);
|
|
9373
|
+
const deleteCollection = () => {
|
|
9374
|
+
if (!collection) return;
|
|
9375
|
+
configController?.deleteCollection({
|
|
9376
|
+
id: collection.id
|
|
9377
|
+
}).then(() => {
|
|
9378
|
+
setDeleteRequested(false);
|
|
9379
|
+
handleCancel();
|
|
9380
|
+
snackbarController.open({
|
|
9381
|
+
message: "Collection deleted",
|
|
9382
|
+
type: "success"
|
|
9383
|
+
});
|
|
9384
|
+
});
|
|
9385
|
+
};
|
|
9386
|
+
return /* @__PURE__ */ jsxs(DialogContent, { fullHeight: true, children: [
|
|
9387
|
+
/* @__PURE__ */ jsx(Formex, { value: formController, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9388
|
+
!isNewCollection && /* @__PURE__ */ jsxs(Tabs, { value: currentView, innerClassName: cls(defaultBorderMixin, "px-4 h-14 w-full justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
|
|
9389
|
+
/* @__PURE__ */ jsx(Tab, { value: "details", children: "Details" }),
|
|
9390
|
+
/* @__PURE__ */ jsx(Tab, { value: "properties", children: "Properties" }),
|
|
9391
|
+
/* @__PURE__ */ jsx(Tab, { value: "subcollections", children: "Additional views" })
|
|
9392
|
+
] }),
|
|
9393
|
+
/* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
|
|
9394
|
+
currentView === "loading" && /* @__PURE__ */ jsx(CircularProgressCenter, {}),
|
|
9395
|
+
currentView === "extra_view" && path && extraView?.View && /* @__PURE__ */ jsx(extraView.View, { path }),
|
|
9396
|
+
currentView === "welcome" && /* @__PURE__ */ jsx(CollectionEditorWelcomeView, { path, onContinue: (importData, propertiesOrder_0) => {
|
|
9397
|
+
if (importData) {
|
|
9398
|
+
onImportDataSet(importData, propertiesOrder_0);
|
|
9399
|
+
setCurrentView("import_data_mapping");
|
|
9400
|
+
} else {
|
|
9401
|
+
setCurrentView("details");
|
|
9402
|
+
}
|
|
9403
|
+
}, existingCollectionPaths: existingPaths, parentCollection, pathSuggestions }),
|
|
9404
|
+
currentView === "import_data_mapping" && importConfig && /* @__PURE__ */ jsx(CollectionEditorImportMapping, { importConfig, collectionEditable, propertyConfigs }),
|
|
9405
|
+
currentView === "import_data_preview" && importConfig && /* @__PURE__ */ jsx(CollectionEditorImportDataPreview, { importConfig, properties: values_1.properties, propertiesOrder: values_1.propertiesOrder }),
|
|
9406
|
+
currentView === "import_data_saving" && importConfig && /* @__PURE__ */ jsx(ImportSaveInProgress, { importConfig, collection: values_1, path, onImportSuccess: async (importedCollection) => {
|
|
9407
|
+
snackbarController.open({
|
|
9408
|
+
type: "info",
|
|
9409
|
+
message: "Data imported successfully"
|
|
9410
|
+
});
|
|
9411
|
+
await saveCollection(values_1);
|
|
9412
|
+
handleClose(importedCollection);
|
|
9413
|
+
} }),
|
|
9414
|
+
currentView === "details" && /* @__PURE__ */ jsx(CollectionDetailsForm, { existingPaths, existingIds, groups, parentCollectionIds, parentCollection, isNewCollection, children: !isNewCollection && isMergedCollection && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 mt-8", children: [
|
|
9415
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "secondary", children: "This collection is defined in code. The changes done in this editor will override the properties defined in code. You can delete the overridden values to revert to the state defined in code." }),
|
|
9416
|
+
/* @__PURE__ */ jsx(Button, { color: "neutral", onClick: () => {
|
|
9417
|
+
setDeleteRequested(true);
|
|
9418
|
+
}, children: "Reset to code" })
|
|
9419
|
+
] }) }),
|
|
9420
|
+
currentView === "subcollections" && collection && /* @__PURE__ */ jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
|
|
9421
|
+
currentView === "properties" && /* @__PURE__ */ jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
|
|
9422
|
+
const current = removeUndefined({
|
|
9423
|
+
...propertyErrorsRef.current,
|
|
9424
|
+
[getFullIdPath(propertyKey, namespace)]: removeUndefined(error_0, true)
|
|
9425
|
+
}, true);
|
|
9426
|
+
propertyErrorsRef.current = current;
|
|
9427
|
+
formController.validate();
|
|
9428
|
+
}, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsx(IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
|
|
9429
|
+
currentView !== "welcome" && /* @__PURE__ */ jsxs(DialogActions, { position: "absolute", children: [
|
|
9430
|
+
error && /* @__PURE__ */ jsx(ErrorView, { error }),
|
|
9431
|
+
isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => {
|
|
9432
|
+
importConfig.setInUse(false);
|
|
9433
|
+
return setCurrentView("welcome");
|
|
9434
|
+
}, children: [
|
|
9435
|
+
/* @__PURE__ */ jsx(ArrowBackIcon, {}),
|
|
9436
|
+
"Back"
|
|
9437
|
+
] }),
|
|
9438
|
+
isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => {
|
|
9439
|
+
setCurrentView("import_data_mapping");
|
|
9440
|
+
}, children: [
|
|
9441
|
+
/* @__PURE__ */ jsx(ArrowBackIcon, {}),
|
|
9442
|
+
"Back"
|
|
9443
|
+
] }),
|
|
9444
|
+
isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
|
|
9445
|
+
/* @__PURE__ */ jsx(ArrowBackIcon, {}),
|
|
9446
|
+
"Back"
|
|
9447
|
+
] }),
|
|
9448
|
+
isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxs(Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
|
|
9449
|
+
/* @__PURE__ */ jsx(ArrowBackIcon, {}),
|
|
9450
|
+
"Back"
|
|
9451
|
+
] }),
|
|
9452
|
+
/* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => {
|
|
9453
|
+
handleCancel();
|
|
9454
|
+
}, children: "Cancel" }),
|
|
9455
|
+
isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
|
|
9456
|
+
isNewCollection && currentView === "import_data_preview" && /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: () => {
|
|
9457
|
+
setNextMode();
|
|
9458
|
+
}, children: "Next" }),
|
|
9459
|
+
isNewCollection && (currentView === "details" || currentView === "properties") && /* @__PURE__ */ jsxs(LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, disabled: isSubmitting || currentView === "details" && !validValues, startIcon: currentView === "properties" ? /* @__PURE__ */ jsx(CheckIcon, {}) : void 0, children: [
|
|
9460
|
+
currentView === "details" && "Next",
|
|
9461
|
+
currentView === "properties" && "Create collection"
|
|
9462
|
+
] }),
|
|
9463
|
+
!isNewCollection && /* @__PURE__ */ jsx(LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, children: "Update collection" })
|
|
9464
|
+
] })
|
|
9282
9465
|
] })
|
|
9283
|
-
] })
|
|
9284
|
-
|
|
9466
|
+
] }) }),
|
|
9467
|
+
/* @__PURE__ */ jsx(ConfirmationDialog, { open: deleteRequested, onAccept: deleteCollection, onCancel: () => setDeleteRequested(false), title: /* @__PURE__ */ jsx(Fragment, { children: "Delete the stored config?" }), body: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9468
|
+
" This will ",
|
|
9469
|
+
/* @__PURE__ */ jsx("b", { children: "not delete any data" }),
|
|
9470
|
+
", only the stored config, and reset to the code state."
|
|
9471
|
+
] }) })
|
|
9472
|
+
] });
|
|
9285
9473
|
}
|
|
9286
9474
|
function applyPropertyConfigs(collection, propertyConfigs) {
|
|
9287
9475
|
const {
|
|
@@ -9345,7 +9533,7 @@ const validateId = (value, isNewCollection, existingPaths, existingIds) => {
|
|
|
9345
9533
|
const ConfigControllerContext = React__default.createContext({});
|
|
9346
9534
|
const CollectionEditorContext = React__default.createContext({});
|
|
9347
9535
|
const ConfigControllerProvider = React__default.memo(function ConfigControllerProvider2(t0) {
|
|
9348
|
-
const $ = c(
|
|
9536
|
+
const $ = c(67);
|
|
9349
9537
|
const {
|
|
9350
9538
|
children,
|
|
9351
9539
|
collectionConfigController,
|
|
@@ -9356,8 +9544,7 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9356
9544
|
getPathSuggestions,
|
|
9357
9545
|
getUser,
|
|
9358
9546
|
getData,
|
|
9359
|
-
onAnalyticsEvent
|
|
9360
|
-
components
|
|
9547
|
+
onAnalyticsEvent
|
|
9361
9548
|
} = t0;
|
|
9362
9549
|
const navigation = useNavigationController();
|
|
9363
9550
|
const navigate = useNavigate();
|
|
@@ -9475,28 +9662,26 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9475
9662
|
const createCollection = t3;
|
|
9476
9663
|
const t4 = configPermissions ?? defaultConfigPermissions;
|
|
9477
9664
|
let t5;
|
|
9478
|
-
if ($[6] !==
|
|
9665
|
+
if ($[6] !== createCollection || $[7] !== editCollection || $[8] !== editProperty || $[9] !== getPathSuggestions || $[10] !== t4) {
|
|
9479
9666
|
t5 = {
|
|
9480
9667
|
editCollection,
|
|
9481
9668
|
createCollection,
|
|
9482
9669
|
editProperty,
|
|
9483
9670
|
configPermissions: t4,
|
|
9484
|
-
getPathSuggestions
|
|
9485
|
-
components
|
|
9671
|
+
getPathSuggestions
|
|
9486
9672
|
};
|
|
9487
|
-
$[6] =
|
|
9488
|
-
$[7] =
|
|
9489
|
-
$[8] =
|
|
9490
|
-
$[9] =
|
|
9491
|
-
$[10] =
|
|
9492
|
-
$[11] =
|
|
9493
|
-
$[12] = t5;
|
|
9673
|
+
$[6] = createCollection;
|
|
9674
|
+
$[7] = editCollection;
|
|
9675
|
+
$[8] = editProperty;
|
|
9676
|
+
$[9] = getPathSuggestions;
|
|
9677
|
+
$[10] = t4;
|
|
9678
|
+
$[11] = t5;
|
|
9494
9679
|
} else {
|
|
9495
|
-
t5 = $[
|
|
9680
|
+
t5 = $[11];
|
|
9496
9681
|
}
|
|
9497
9682
|
const t6 = Boolean(currentDialog);
|
|
9498
9683
|
let t7;
|
|
9499
|
-
if ($[
|
|
9684
|
+
if ($[12] !== currentDialog || $[13] !== navigate || $[14] !== navigation) {
|
|
9500
9685
|
t7 = (collection_0) => {
|
|
9501
9686
|
if (currentDialog?.redirect) {
|
|
9502
9687
|
if (collection_0 && currentDialog?.isNewCollection && !currentDialog.parentCollectionIds.length) {
|
|
@@ -9506,29 +9691,29 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9506
9691
|
}
|
|
9507
9692
|
setCurrentDialog(void 0);
|
|
9508
9693
|
};
|
|
9509
|
-
$[
|
|
9510
|
-
$[
|
|
9511
|
-
$[
|
|
9512
|
-
$[
|
|
9694
|
+
$[12] = currentDialog;
|
|
9695
|
+
$[13] = navigate;
|
|
9696
|
+
$[14] = navigation;
|
|
9697
|
+
$[15] = t7;
|
|
9513
9698
|
} else {
|
|
9514
|
-
t7 = $[
|
|
9699
|
+
t7 = $[15];
|
|
9515
9700
|
}
|
|
9516
9701
|
let t8;
|
|
9517
|
-
if ($[
|
|
9702
|
+
if ($[16] !== collectionConfigController || $[17] !== collectionInference || $[18] !== currentDialog || $[19] !== extraView || $[20] !== getData || $[21] !== getPathSuggestions || $[22] !== getUser || $[23] !== reservedGroups || $[24] !== t6 || $[25] !== t7) {
|
|
9518
9703
|
t8 = /* @__PURE__ */ jsx(CollectionEditorDialog, { open: t6, configController: collectionConfigController, isNewCollection: false, collectionInference, ...currentDialog, getData, reservedGroups, extraView, pathSuggestions: getPathSuggestions, getUser, handleClose: t7 });
|
|
9519
|
-
$[
|
|
9520
|
-
$[
|
|
9521
|
-
$[
|
|
9522
|
-
$[
|
|
9523
|
-
$[
|
|
9524
|
-
$[
|
|
9525
|
-
$[
|
|
9526
|
-
$[
|
|
9527
|
-
$[
|
|
9528
|
-
$[
|
|
9529
|
-
$[
|
|
9704
|
+
$[16] = collectionConfigController;
|
|
9705
|
+
$[17] = collectionInference;
|
|
9706
|
+
$[18] = currentDialog;
|
|
9707
|
+
$[19] = extraView;
|
|
9708
|
+
$[20] = getData;
|
|
9709
|
+
$[21] = getPathSuggestions;
|
|
9710
|
+
$[22] = getUser;
|
|
9711
|
+
$[23] = reservedGroups;
|
|
9712
|
+
$[24] = t6;
|
|
9713
|
+
$[25] = t7;
|
|
9714
|
+
$[26] = t8;
|
|
9530
9715
|
} else {
|
|
9531
|
-
t8 = $[
|
|
9716
|
+
t8 = $[26];
|
|
9532
9717
|
}
|
|
9533
9718
|
const t9 = Boolean(currentPropertyDialog);
|
|
9534
9719
|
const t10 = Boolean(currentPropertyDialog?.propertyKey);
|
|
@@ -9536,21 +9721,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9536
9721
|
const t12 = !currentPropertyDialog ? false : !currentPropertyDialog?.propertyKey;
|
|
9537
9722
|
const t13 = currentPropertyDialog?.collectionEditable ?? false;
|
|
9538
9723
|
let t14;
|
|
9539
|
-
if ($[
|
|
9724
|
+
if ($[27] !== currentPropertyDialog || $[28] !== getData || $[29] !== navigation) {
|
|
9540
9725
|
t14 = getData && currentPropertyDialog?.editedCollectionId ? () => {
|
|
9541
9726
|
console.debug("get data for property", currentPropertyDialog?.editedCollectionId);
|
|
9542
|
-
const resolvedPath = navigation.
|
|
9727
|
+
const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId);
|
|
9543
9728
|
return getData(resolvedPath, []);
|
|
9544
9729
|
} : void 0;
|
|
9545
|
-
$[
|
|
9546
|
-
$[
|
|
9547
|
-
$[
|
|
9548
|
-
$[
|
|
9730
|
+
$[27] = currentPropertyDialog;
|
|
9731
|
+
$[28] = getData;
|
|
9732
|
+
$[29] = navigation;
|
|
9733
|
+
$[30] = t14;
|
|
9549
9734
|
} else {
|
|
9550
|
-
t14 = $[
|
|
9735
|
+
t14 = $[30];
|
|
9551
9736
|
}
|
|
9552
9737
|
let t15;
|
|
9553
|
-
if ($[
|
|
9738
|
+
if ($[31] !== collectionConfigController || $[32] !== currentPropertyDialog || $[33] !== snackbarController) {
|
|
9554
9739
|
t15 = (t162) => {
|
|
9555
9740
|
const {
|
|
9556
9741
|
id: id_0,
|
|
@@ -9579,15 +9764,15 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9579
9764
|
return false;
|
|
9580
9765
|
});
|
|
9581
9766
|
};
|
|
9582
|
-
$[
|
|
9583
|
-
$[
|
|
9584
|
-
$[
|
|
9585
|
-
$[
|
|
9767
|
+
$[31] = collectionConfigController;
|
|
9768
|
+
$[32] = currentPropertyDialog;
|
|
9769
|
+
$[33] = snackbarController;
|
|
9770
|
+
$[34] = t15;
|
|
9586
9771
|
} else {
|
|
9587
|
-
t15 = $[
|
|
9772
|
+
t15 = $[34];
|
|
9588
9773
|
}
|
|
9589
9774
|
let t16;
|
|
9590
|
-
if ($[
|
|
9775
|
+
if ($[35] !== collectionConfigController || $[36] !== currentPropertyDialog?.currentPropertiesOrder || $[37] !== currentPropertyDialog?.editedCollectionId || $[38] !== currentPropertyDialog?.namespace || $[39] !== currentPropertyDialog?.parentCollectionIds || $[40] !== currentPropertyDialog?.propertyKey || $[41] !== snackbarController) {
|
|
9591
9776
|
t16 = () => {
|
|
9592
9777
|
if (!currentPropertyDialog?.propertyKey) {
|
|
9593
9778
|
return;
|
|
@@ -9610,21 +9795,21 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9610
9795
|
return false;
|
|
9611
9796
|
});
|
|
9612
9797
|
};
|
|
9613
|
-
$[
|
|
9614
|
-
$[
|
|
9615
|
-
$[
|
|
9616
|
-
$[
|
|
9617
|
-
$[
|
|
9618
|
-
$[
|
|
9619
|
-
$[
|
|
9620
|
-
$[
|
|
9798
|
+
$[35] = collectionConfigController;
|
|
9799
|
+
$[36] = currentPropertyDialog?.currentPropertiesOrder;
|
|
9800
|
+
$[37] = currentPropertyDialog?.editedCollectionId;
|
|
9801
|
+
$[38] = currentPropertyDialog?.namespace;
|
|
9802
|
+
$[39] = currentPropertyDialog?.parentCollectionIds;
|
|
9803
|
+
$[40] = currentPropertyDialog?.propertyKey;
|
|
9804
|
+
$[41] = snackbarController;
|
|
9805
|
+
$[42] = t16;
|
|
9621
9806
|
} else {
|
|
9622
|
-
t16 = $[
|
|
9807
|
+
t16 = $[42];
|
|
9623
9808
|
}
|
|
9624
9809
|
let t17;
|
|
9625
9810
|
let t18;
|
|
9626
9811
|
let t19;
|
|
9627
|
-
if ($[
|
|
9812
|
+
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9628
9813
|
t17 = () => {
|
|
9629
9814
|
setCurrentPropertyDialog(void 0);
|
|
9630
9815
|
};
|
|
@@ -9632,64 +9817,64 @@ const ConfigControllerProvider = React__default.memo(function ConfigControllerPr
|
|
|
9632
9817
|
setCurrentPropertyDialog(void 0);
|
|
9633
9818
|
};
|
|
9634
9819
|
t19 = {};
|
|
9635
|
-
$[
|
|
9636
|
-
$[
|
|
9637
|
-
$[
|
|
9820
|
+
$[43] = t17;
|
|
9821
|
+
$[44] = t18;
|
|
9822
|
+
$[45] = t19;
|
|
9638
9823
|
} else {
|
|
9639
|
-
t17 = $[
|
|
9640
|
-
t18 = $[
|
|
9641
|
-
t19 = $[
|
|
9824
|
+
t17 = $[43];
|
|
9825
|
+
t18 = $[44];
|
|
9826
|
+
t19 = $[45];
|
|
9642
9827
|
}
|
|
9643
9828
|
let t20;
|
|
9644
|
-
if ($[
|
|
9829
|
+
if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9645
9830
|
t20 = [];
|
|
9646
|
-
$[
|
|
9831
|
+
$[46] = t20;
|
|
9647
9832
|
} else {
|
|
9648
|
-
t20 = $[
|
|
9833
|
+
t20 = $[46];
|
|
9649
9834
|
}
|
|
9650
9835
|
const t21 = currentPropertyDialog?.property;
|
|
9651
9836
|
const t22 = currentPropertyDialog?.propertyKey;
|
|
9652
9837
|
let t23;
|
|
9653
|
-
if ($[
|
|
9838
|
+
if ($[47] !== propertyConfigs || $[48] !== t10 || $[49] !== t11 || $[50] !== t12 || $[51] !== t13 || $[52] !== t14 || $[53] !== t15 || $[54] !== t16 || $[55] !== t21 || $[56] !== t22 || $[57] !== t9) {
|
|
9654
9839
|
t23 = /* @__PURE__ */ jsx(PropertyFormDialog, { open: t9, includeIdAndName: true, existingProperty: t10, autoUpdateId: t11, autoOpenTypeSelect: t12, inArray: false, collectionEditable: t13, getData: t14, onPropertyChanged: t15, onPropertyChangedImmediate: false, onDelete: t16, onError: _temp2, onOkClicked: t17, onCancel: t18, initialErrors: t19, forceShowErrors: false, existingPropertyKeys: t20, allowDataInference: true, propertyConfigs, property: t21, propertyKey: t22 });
|
|
9655
|
-
$[
|
|
9656
|
-
$[
|
|
9657
|
-
$[
|
|
9658
|
-
$[
|
|
9659
|
-
$[
|
|
9660
|
-
$[
|
|
9661
|
-
$[
|
|
9662
|
-
$[
|
|
9663
|
-
$[
|
|
9664
|
-
$[
|
|
9665
|
-
$[
|
|
9666
|
-
$[
|
|
9667
|
-
} else {
|
|
9668
|
-
t23 = $[
|
|
9840
|
+
$[47] = propertyConfigs;
|
|
9841
|
+
$[48] = t10;
|
|
9842
|
+
$[49] = t11;
|
|
9843
|
+
$[50] = t12;
|
|
9844
|
+
$[51] = t13;
|
|
9845
|
+
$[52] = t14;
|
|
9846
|
+
$[53] = t15;
|
|
9847
|
+
$[54] = t16;
|
|
9848
|
+
$[55] = t21;
|
|
9849
|
+
$[56] = t22;
|
|
9850
|
+
$[57] = t9;
|
|
9851
|
+
$[58] = t23;
|
|
9852
|
+
} else {
|
|
9853
|
+
t23 = $[58];
|
|
9669
9854
|
}
|
|
9670
9855
|
let t24;
|
|
9671
|
-
if ($[
|
|
9856
|
+
if ($[59] !== children || $[60] !== t23 || $[61] !== t5 || $[62] !== t8) {
|
|
9672
9857
|
t24 = /* @__PURE__ */ jsxs(CollectionEditorContext.Provider, { value: t5, children: [
|
|
9673
9858
|
children,
|
|
9674
9859
|
t8,
|
|
9675
9860
|
t23
|
|
9676
9861
|
] });
|
|
9677
|
-
$[
|
|
9678
|
-
$[
|
|
9679
|
-
$[
|
|
9680
|
-
$[
|
|
9681
|
-
$[
|
|
9862
|
+
$[59] = children;
|
|
9863
|
+
$[60] = t23;
|
|
9864
|
+
$[61] = t5;
|
|
9865
|
+
$[62] = t8;
|
|
9866
|
+
$[63] = t24;
|
|
9682
9867
|
} else {
|
|
9683
|
-
t24 = $[
|
|
9868
|
+
t24 = $[63];
|
|
9684
9869
|
}
|
|
9685
9870
|
let t25;
|
|
9686
|
-
if ($[
|
|
9871
|
+
if ($[64] !== collectionConfigController || $[65] !== t24) {
|
|
9687
9872
|
t25 = /* @__PURE__ */ jsx(ConfigControllerContext.Provider, { value: collectionConfigController, children: t24 });
|
|
9688
|
-
$[
|
|
9689
|
-
$[
|
|
9690
|
-
$[
|
|
9873
|
+
$[64] = collectionConfigController;
|
|
9874
|
+
$[65] = t24;
|
|
9875
|
+
$[66] = t25;
|
|
9691
9876
|
} else {
|
|
9692
|
-
t25 = $[
|
|
9877
|
+
t25 = $[66];
|
|
9693
9878
|
}
|
|
9694
9879
|
return t25;
|
|
9695
9880
|
}, equal);
|
|
@@ -10304,7 +10489,7 @@ function NewCollectionCard(t0) {
|
|
|
10304
10489
|
return t8;
|
|
10305
10490
|
}
|
|
10306
10491
|
function useCollectionEditorPlugin(t0) {
|
|
10307
|
-
const $ = c(
|
|
10492
|
+
const $ = c(15);
|
|
10308
10493
|
const {
|
|
10309
10494
|
collectionConfigController,
|
|
10310
10495
|
configPermissions,
|
|
@@ -10314,11 +10499,10 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10314
10499
|
getUser,
|
|
10315
10500
|
collectionInference,
|
|
10316
10501
|
getData,
|
|
10317
|
-
onAnalyticsEvent
|
|
10318
|
-
components
|
|
10502
|
+
onAnalyticsEvent
|
|
10319
10503
|
} = t0;
|
|
10320
10504
|
let t1;
|
|
10321
|
-
if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !==
|
|
10505
|
+
if ($[0] !== collectionConfigController || $[1] !== collectionInference || $[2] !== configPermissions || $[3] !== extraView || $[4] !== getData || $[5] !== getPathSuggestions || $[6] !== getUser || $[7] !== onAnalyticsEvent || $[8] !== reservedGroups) {
|
|
10322
10506
|
t1 = {
|
|
10323
10507
|
Component: ConfigControllerProvider,
|
|
10324
10508
|
props: {
|
|
@@ -10330,27 +10514,25 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10330
10514
|
getPathSuggestions,
|
|
10331
10515
|
getUser,
|
|
10332
10516
|
getData,
|
|
10333
|
-
onAnalyticsEvent
|
|
10334
|
-
components
|
|
10517
|
+
onAnalyticsEvent
|
|
10335
10518
|
}
|
|
10336
10519
|
};
|
|
10337
10520
|
$[0] = collectionConfigController;
|
|
10338
10521
|
$[1] = collectionInference;
|
|
10339
|
-
$[2] =
|
|
10340
|
-
$[3] =
|
|
10341
|
-
$[4] =
|
|
10342
|
-
$[5] =
|
|
10343
|
-
$[6] =
|
|
10344
|
-
$[7] =
|
|
10345
|
-
$[8] =
|
|
10346
|
-
$[9] =
|
|
10347
|
-
$[10] = t1;
|
|
10522
|
+
$[2] = configPermissions;
|
|
10523
|
+
$[3] = extraView;
|
|
10524
|
+
$[4] = getData;
|
|
10525
|
+
$[5] = getPathSuggestions;
|
|
10526
|
+
$[6] = getUser;
|
|
10527
|
+
$[7] = onAnalyticsEvent;
|
|
10528
|
+
$[8] = reservedGroups;
|
|
10529
|
+
$[9] = t1;
|
|
10348
10530
|
} else {
|
|
10349
|
-
t1 = $[
|
|
10531
|
+
t1 = $[9];
|
|
10350
10532
|
}
|
|
10351
10533
|
let t2;
|
|
10352
10534
|
let t3;
|
|
10353
|
-
if ($[
|
|
10535
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10354
10536
|
t2 = {
|
|
10355
10537
|
additionalActions: /* @__PURE__ */ jsx(NewCollectionButton, {}),
|
|
10356
10538
|
additionalChildrenStart: /* @__PURE__ */ jsx(IntroWidget, {}),
|
|
@@ -10363,14 +10545,14 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10363
10545
|
HeaderAction: CollectionViewHeaderAction,
|
|
10364
10546
|
AddColumnComponent: PropertyAddColumnComponent
|
|
10365
10547
|
};
|
|
10366
|
-
$[
|
|
10367
|
-
$[
|
|
10548
|
+
$[10] = t2;
|
|
10549
|
+
$[11] = t3;
|
|
10368
10550
|
} else {
|
|
10369
|
-
t2 = $[
|
|
10370
|
-
t3 = $[
|
|
10551
|
+
t2 = $[10];
|
|
10552
|
+
t3 = $[11];
|
|
10371
10553
|
}
|
|
10372
10554
|
let t4;
|
|
10373
|
-
if ($[
|
|
10555
|
+
if ($[12] !== collectionConfigController.loading || $[13] !== t1) {
|
|
10374
10556
|
t4 = {
|
|
10375
10557
|
key: "collection_editor",
|
|
10376
10558
|
loading: collectionConfigController.loading,
|
|
@@ -10378,11 +10560,11 @@ function useCollectionEditorPlugin(t0) {
|
|
|
10378
10560
|
homePage: t2,
|
|
10379
10561
|
collectionView: t3
|
|
10380
10562
|
};
|
|
10381
|
-
$[
|
|
10382
|
-
$[
|
|
10383
|
-
$[
|
|
10563
|
+
$[12] = collectionConfigController.loading;
|
|
10564
|
+
$[13] = t1;
|
|
10565
|
+
$[14] = t4;
|
|
10384
10566
|
} else {
|
|
10385
|
-
t4 = $[
|
|
10567
|
+
t4 = $[14];
|
|
10386
10568
|
}
|
|
10387
10569
|
return t4;
|
|
10388
10570
|
}
|
|
@@ -10458,17 +10640,19 @@ function IntroWidget(t0) {
|
|
|
10458
10640
|
}
|
|
10459
10641
|
return t6;
|
|
10460
10642
|
}
|
|
10461
|
-
const mergeCollections = (baseCollections, backendCollections, modifyCollection) => {
|
|
10643
|
+
const mergeCollections = (baseCollections, backendCollections = [], modifyCollection) => {
|
|
10462
10644
|
const markAsEditable = (c2) => {
|
|
10463
10645
|
makePropertiesEditable(c2.properties);
|
|
10464
10646
|
c2.subcollections?.forEach(markAsEditable);
|
|
10465
10647
|
};
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
console.debug("Collections
|
|
10470
|
-
|
|
10471
|
-
|
|
10648
|
+
backendCollections.forEach(markAsEditable);
|
|
10649
|
+
const result = joinCollectionLists(baseCollections, backendCollections, [], modifyCollection);
|
|
10650
|
+
result.sort((a, b) => baseCollections.findIndex((c2) => c2.id === a.id) - baseCollections.findIndex((c2) => c2.id === b.id));
|
|
10651
|
+
console.debug("Collections result", {
|
|
10652
|
+
baseCollections,
|
|
10653
|
+
backendCollections,
|
|
10654
|
+
result
|
|
10655
|
+
});
|
|
10472
10656
|
return result;
|
|
10473
10657
|
};
|
|
10474
10658
|
function MissingReferenceWidget(t0) {
|