@rebasepro/admin 0.12.1-canary.gdfba2a1 → 0.12.1-canary.ge191fb7
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/README.md +1 -1
- package/dist/{CollectionEditorDialog-B8j6HArJ.js → CollectionEditorDialog-Dhn0S4FT.js} +59 -54
- package/dist/{CollectionEditorDialog-B8j6HArJ.js.map → CollectionEditorDialog-Dhn0S4FT.js.map} +1 -1
- package/dist/{PropertyEditView-D2b9_nbC.js → PropertyEditView-JPN12E-0.js} +26 -9
- package/dist/{PropertyEditView-D2b9_nbC.js.map → PropertyEditView-JPN12E-0.js.map} +1 -1
- package/dist/{RouterCollectionsStudioView-CXUtYIc1.js → RouterCollectionsStudioView-Cv0tAxtu.js} +5 -5
- package/dist/{RouterCollectionsStudioView-CXUtYIc1.js.map → RouterCollectionsStudioView-Cv0tAxtu.js.map} +1 -1
- package/dist/collection_editor/serializable_types.d.ts +4 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +1 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +8 -0
- package/dist/collection_editor_ui.js +5 -5
- package/dist/collection_editor_ui.js.map +1 -1
- package/dist/components/CollectionTableBinding/column_utils.d.ts +17 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +7 -2
- package/dist/components/CollectionViewBinding/SortButton.d.ts +24 -0
- package/dist/components/CollectionViewBinding/SplitListCloseButton.d.ts +10 -0
- package/dist/components/CollectionViewBinding/SplitViewContext.d.ts +23 -0
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.d.ts +26 -0
- package/dist/components/DetailViewBinding.d.ts +5 -0
- package/dist/components/EditFormActions.d.ts +12 -1
- package/dist/components/EditViewBinding.d.ts +6 -1
- package/dist/components/EntityIdentityBar.d.ts +53 -0
- package/dist/components/EntityInspector.d.ts +29 -0
- package/dist/components/EntityPreviewNesting.d.ts +25 -0
- package/dist/components/EntityViewBinding.d.ts +9 -0
- package/dist/components/InlineEntityPreview.d.ts +47 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/{export-CrDJOGKn.js → export-DghFk-W0.js} +2 -2
- package/dist/{export-CrDJOGKn.js.map → export-DghFk-W0.js.map} +1 -1
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/EntityFormActions.d.ts +11 -1
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/components/FieldBlock.d.ts +30 -0
- package/dist/form/components/FormRail.d.ts +18 -0
- package/dist/form/components/FormSections.d.ts +16 -0
- package/dist/form/components/index.d.ts +3 -2
- package/dist/form/components/useRailVisible.d.ts +24 -0
- package/dist/form/field_bindings/BinaryFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/GeopointFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +1 -1
- package/dist/{history-s6Nzt7RF.js → history-c-iE7d4k.js} +32 -31
- package/dist/history-c-iE7d4k.js.map +1 -0
- package/dist/hooks/navigation/utils.d.ts +16 -0
- package/dist/hooks/useBuildSidePanel.d.ts +14 -0
- package/dist/hooks/useEntityDisplayTitle.d.ts +18 -0
- package/dist/hooks/useRecordActions.d.ts +17 -0
- package/dist/{import-Ci32nU0G.js → import-DLY5UYDa.js} +2 -2
- package/dist/{import-Ci32nU0G.js.map → import-DLY5UYDa.js.map} +1 -1
- package/dist/index.js +95 -29
- package/dist/index.js.map +1 -1
- package/dist/preview/components/InlineEntityListPreview.d.ts +15 -0
- package/dist/preview/index.d.ts +1 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
- package/dist/types/components/EntityFormActionsProps.d.ts +0 -1
- package/dist/types/components/EntityFormProps.d.ts +0 -5
- package/dist/types/fields.d.ts +24 -0
- package/dist/{util-BwZuV81o.js → util-BnRLzp4j.js} +2013 -1072
- package/dist/util-BnRLzp4j.js.map +1 -0
- package/package.json +18 -20
- package/src/collection_editor/ConfigControllerProvider.tsx +1 -1
- package/src/collection_editor/serializable_types.ts +4 -3
- package/src/collection_editor/serializable_utils.ts +51 -17
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +65 -22
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +38 -30
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -1
- package/src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/RouterCollectionsStudioView.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +16 -0
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +127 -15
- package/src/collection_editor/validateCollectionJson.ts +3 -3
- package/src/components/AdminModeSyncer.tsx +1 -1
- package/src/components/CollectionTableBinding/PropertyTableCell.tsx +10 -2
- package/src/components/CollectionTableBinding/column_utils.tsx +59 -2
- package/src/components/CollectionTableBinding/table_bindings.tsx +2 -1
- package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +23 -16
- package/src/components/CollectionViewBinding/CollectionViewActions.tsx +7 -1
- package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +9 -2
- package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +47 -12
- package/src/components/CollectionViewBinding/SortButton.tsx +189 -0
- package/src/components/CollectionViewBinding/SplitListCloseButton.tsx +33 -0
- package/src/components/CollectionViewBinding/SplitListView.tsx +18 -3
- package/src/components/CollectionViewBinding/SplitViewContext.tsx +34 -0
- package/src/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.ts +48 -9
- package/src/components/CollectionViewBinding/useBoardDataController.tsx +80 -25
- package/src/components/CollectionViewBinding/usePreviewSlots.ts +18 -6
- package/src/components/DefaultAppBar.tsx +1 -1
- package/src/components/DefaultDrawer.tsx +1 -1
- package/src/components/DetailViewBinding.tsx +100 -143
- package/src/components/DrawerNavigationItem.tsx +1 -1
- package/src/components/EditFormActions.tsx +54 -129
- package/src/components/EditViewBinding.tsx +182 -93
- package/src/components/EntityIdentityBar.tsx +288 -0
- package/src/components/EntityInspector.tsx +132 -0
- package/src/components/EntityPreviewBinding.tsx +6 -2
- package/src/components/EntityPreviewNesting.tsx +50 -0
- package/src/components/EntityViewBinding.tsx +35 -32
- package/src/components/HomePage/FavouritesView.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -1
- package/src/components/InlineEntityPreview.tsx +149 -0
- package/src/components/RebaseLayout.tsx +1 -1
- package/src/components/RebaseNavigation.tsx +45 -5
- package/src/components/RebaseRouteDefs.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +2 -2
- package/src/components/SidePanelBinding.tsx +19 -13
- package/src/components/UserSelector.tsx +12 -6
- package/src/components/common/default_entity_actions.tsx +4 -3
- package/src/components/history/EntityHistoryEntry.tsx +28 -7
- package/src/components/history/EntityHistoryView.tsx +20 -20
- package/src/components/history/LastEditedByIndicator.tsx +4 -3
- package/src/components/index.ts +2 -0
- package/src/data_import/utils/get_import_inference_type.ts +6 -0
- package/src/form/EntityForm.tsx +267 -179
- package/src/form/EntityFormActions.tsx +50 -99
- package/src/form/EntityFormBinding.tsx +4 -2
- package/src/form/PropertyFieldBinding.tsx +4 -0
- package/src/form/components/FieldBlock.tsx +119 -0
- package/src/form/components/FormRail.tsx +125 -0
- package/src/form/components/FormSections.tsx +118 -0
- package/src/form/components/index.tsx +3 -2
- package/src/form/components/useRailVisible.tsx +46 -0
- package/src/form/field_bindings/BinaryFieldBinding.tsx +3 -2
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +3 -2
- package/src/form/field_bindings/GeopointFieldBinding.tsx +3 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +1 -2
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +3 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -1
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +2 -1
- package/src/form/field_bindings/RelationFieldBinding.tsx +6 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +4 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +3 -2
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +31 -8
- package/src/form/field_bindings/SwitchFieldBinding.tsx +7 -3
- package/src/form/field_bindings/TextFieldBinding.tsx +18 -16
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +3 -2
- package/src/form/field_bindings/VectorFieldBinding.tsx +2 -1
- package/src/hooks/navigation/useBuildUrlController.tsx +1 -1
- package/src/hooks/navigation/useTopLevelNavigation.ts +18 -7
- package/src/hooks/navigation/utils.ts +20 -0
- package/src/hooks/useBuildSideDialogsController.tsx +2 -2
- package/src/hooks/useBuildSidePanel.tsx +22 -61
- package/src/hooks/useEntityDisplayTitle.tsx +60 -0
- package/src/hooks/useHistory.ts +6 -5
- package/src/hooks/useRecordActions.tsx +69 -0
- package/src/hooks/useResolvedUsers.ts +10 -5
- package/src/preview/PropertyPreview.tsx +48 -22
- package/src/preview/components/InlineEntityListPreview.tsx +42 -0
- package/src/preview/components/ReferencePreview.tsx +34 -14
- package/src/preview/components/RelationPreview.tsx +34 -14
- package/src/preview/index.ts +1 -0
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +24 -1
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +25 -1
- package/src/routes/RebaseRoute.tsx +2 -2
- package/src/types/components/EntityFormActionsProps.tsx +0 -1
- package/src/types/components/EntityFormProps.tsx +0 -6
- package/src/types/fields.tsx +27 -0
- package/dist/form/components/FormEntry.d.ts +0 -6
- package/dist/form/components/FormLayout.d.ts +0 -5
- package/dist/history-s6Nzt7RF.js.map +0 -1
- package/dist/util-BwZuV81o.js.map +0 -1
- package/src/form/components/FormEntry.tsx +0 -22
- package/src/form/components/FormLayout.tsx +0 -16
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ CMS frontend — content management views, forms, routing, visual schema editor,
|
|
|
8
8
|
pnpm add @rebasepro/admin
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
**Peer dependencies:** `react >= 19`, `react-dom >= 19
|
|
11
|
+
**Peer dependencies:** `react >= 19.2.7`, `react-dom >= 19.2.7`, `react-router ^8`
|
|
12
12
|
|
|
13
13
|
## What This Package Does
|
|
14
14
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { $t as CollectionTableBinding, A as getFieldId, Ct as convertDataToEntity, Dt as useImportConfig, Et as getInferenceType, Ft as FieldCaption,
|
|
3
|
-
import { a as updatePropertyFromWidget, c as useAIModifiedPaths, i as supportedFields, l as useSafeSnackbarController, n as PropertyForm, o as PropertyTree, r as PropertyFormDialog, s as AIModifiedPathsProvider } from "./PropertyEditView-
|
|
2
|
+
import { $t as CollectionTableBinding, A as getFieldId, Ct as convertDataToEntity, Dt as useImportConfig, Et as getInferenceType, Ft as FieldCaption, Ln as useCollectionRegistryController, Nt as PropertyConfigBadge, Ot as ImportSaveInProgress, Pt as SearchIconsView, St as DataNewPropertiesMapping, Zt as useSelectionController, _ as useCollectionsConfigController, i as namespaceToPropertiesOrderPath, in as useUrlController, k as getFieldConfig, kt as ImportFileUpload, l as validateCollectionJson, m as toSerializableCollectionConfig, n as getFullIdPath, o as CollectionGenerationApiError, on as useNavigationStateController, r as idToPropertiesPath, t as getFullId, vt as useCollectionEditorController, xt as ImportNewPropertyFieldPreview } from "./util-BnRLzp4j.js";
|
|
3
|
+
import { a as updatePropertyFromWidget, c as useAIModifiedPaths, i as supportedFields, l as useSafeSnackbarController, n as PropertyForm, o as PropertyTree, r as PropertyFormDialog, s as AIModifiedPathsProvider } from "./PropertyEditView-JPN12E-0.js";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { Alert, AppWindow, ArrowLeftIcon, BooleanSwitchWithLabel, Button, Card, CheckIcon, Chip, CircularProgress, CircularProgressCenter, CodeIcon, ColumnsIcon, Container, CopyIcon, DebouncedTextField, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, FileIcon, FileSearchIcon, FileTextIcon, IconButton, KanbanIcon, KeyIcon, LayoutGridIcon, ListIcon, LoadingButton, Menu, MultiSelect, MultiSelectItem, PanelLeftIcon, Paper, PlusIcon, Select, SelectItem, ShoppingCartIcon, SquareIcon, Tab, TableIcon, Tabs, TextField, ToggleButtonGroup, Tooltip, Trash2Icon, Typography, UserIcon, XIcon, cls, coolIconKeys, defaultBorderMixin, iconSize } from "@rebasepro/ui";
|
|
7
|
-
import { buildCollectionFromTableMetadata,
|
|
7
|
+
import { buildCollectionFromTableMetadata, getGeneratedPolicyNames, getSubcollections, getTableName, isPropertyBuilder } from "@rebasepro/common";
|
|
8
8
|
import { AIIcon, ConfirmationDialog, ErrorView, IconForView, UnsavedChangesDialog, removeInitialAndTrailingSlashes, useAuthController, useCustomizationController, useLargeLayout, useRebaseContext, useUnsavedChangesDialog } from "@rebasepro/app";
|
|
9
9
|
import { Field, Formex, clone, getIn, useCreateFormex, useFormex } from "@rebasepro/forms";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { camelCase, getPolicyNamesForRule,
|
|
11
|
+
import { camelCase, getPolicyNamesForRule, isEmptyObject, mergeDeep, prettifyIdentifier, randomString, removeUndefined, singular, slugify, toSnakeCase, unslugify } from "@rebasepro/utils";
|
|
12
12
|
import { getDataSourceCapabilities } from "@rebasepro/types";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
import { buildEntityPropertiesFromData, buildPropertyFromData } from "@rebasepro/inference";
|
|
@@ -2385,6 +2385,8 @@ function toSecurityRule(policy) {
|
|
|
2385
2385
|
function CollectionRLSTab() {
|
|
2386
2386
|
const { values, setFieldValue } = useFormex();
|
|
2387
2387
|
const [editingPolicy, setEditingPolicy] = useState(null);
|
|
2388
|
+
const { readOnly, readOnlyReason } = useCollectionsConfigController();
|
|
2389
|
+
const readOnlyTitle = readOnlyReason || "This backend does not accept collection edits.";
|
|
2388
2390
|
const rules = values.securityRules || [];
|
|
2389
2391
|
const { databaseAdmin } = useRebaseContext();
|
|
2390
2392
|
const [dbPolicies, setDbPolicies] = useState([]);
|
|
@@ -2468,27 +2470,10 @@ function CollectionRLSTab() {
|
|
|
2468
2470
|
};
|
|
2469
2471
|
}, [databaseAdmin]);
|
|
2470
2472
|
const tableName = values.id || values.table || values.alias;
|
|
2471
|
-
/**
|
|
2472
|
-
* Every policy name `rebase db push` would write for this collection.
|
|
2473
|
-
*
|
|
2474
|
-
* Two things make this more than `rules.map(r => r.name)`:
|
|
2475
|
-
* - a rule without an explicit `name` becomes `<table>_<op>_<hash>`, so
|
|
2476
|
-
* comparing `rule.name` to `policyname` never matches for it;
|
|
2477
|
-
* - the generator also injects the safe-by-default baseline
|
|
2478
|
-
* (`<table>_default_admin_*`), which is in no collection's `securityRules`.
|
|
2479
|
-
*
|
|
2480
|
-
* Missing either made Rebase's own policies look hand-written, and offered to
|
|
2481
|
-
* import them back into the codebase that produced them.
|
|
2482
|
-
*/
|
|
2483
2473
|
const generatedPolicyNames = useMemo(() => {
|
|
2484
2474
|
if (!tableName) return /* @__PURE__ */ new Set();
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
}, [
|
|
2488
|
-
rules,
|
|
2489
|
-
tableName,
|
|
2490
|
-
values
|
|
2491
|
-
]);
|
|
2475
|
+
return getGeneratedPolicyNames(values);
|
|
2476
|
+
}, [tableName, values]);
|
|
2492
2477
|
const unmappedPolicies = dbPolicies.filter((dp) => !generatedPolicyNames.has(dp.policyname));
|
|
2493
2478
|
const handleSave = async (newPolicy) => {
|
|
2494
2479
|
const rule = toSecurityRule(newPolicy);
|
|
@@ -2511,11 +2496,15 @@ function CollectionRLSTab() {
|
|
|
2511
2496
|
children: [/* @__PURE__ */ jsx(Typography, {
|
|
2512
2497
|
variant: "h5",
|
|
2513
2498
|
children: "Row Level Security"
|
|
2514
|
-
}), /* @__PURE__ */ jsx(
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2499
|
+
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
2500
|
+
title: readOnly ? readOnlyTitle : void 0,
|
|
2501
|
+
children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
|
|
2502
|
+
variant: "filled",
|
|
2503
|
+
color: "neutral",
|
|
2504
|
+
disabled: readOnly,
|
|
2505
|
+
onClick: () => setEditingPolicy("new"),
|
|
2506
|
+
children: "CREATE POLICY"
|
|
2507
|
+
}) })
|
|
2519
2508
|
})]
|
|
2520
2509
|
}),
|
|
2521
2510
|
rules.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
@@ -2557,6 +2546,7 @@ function CollectionRLSTab() {
|
|
|
2557
2546
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
2558
2547
|
size: "small",
|
|
2559
2548
|
variant: "text",
|
|
2549
|
+
disabled: readOnly,
|
|
2560
2550
|
onClick: () => setEditingPolicy({
|
|
2561
2551
|
policyname: rule.name ?? "",
|
|
2562
2552
|
tablename: values.id || values.table || values.alias || "your_table",
|
|
@@ -2569,6 +2559,7 @@ function CollectionRLSTab() {
|
|
|
2569
2559
|
children: "EDIT"
|
|
2570
2560
|
}), /* @__PURE__ */ jsx(IconButton, {
|
|
2571
2561
|
size: "small",
|
|
2562
|
+
disabled: readOnly,
|
|
2572
2563
|
onClick: () => {
|
|
2573
2564
|
setFieldValue("securityRules", rules.filter((r) => r.name !== rule.name));
|
|
2574
2565
|
},
|
|
@@ -2637,15 +2628,19 @@ function CollectionRLSTab() {
|
|
|
2637
2628
|
})]
|
|
2638
2629
|
}), /* @__PURE__ */ jsx("div", {
|
|
2639
2630
|
className: "flex items-center gap-1 sm:gap-2 shrink-0",
|
|
2640
|
-
children: /* @__PURE__ */ jsx(
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2631
|
+
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
2632
|
+
title: readOnly ? readOnlyTitle : void 0,
|
|
2633
|
+
children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
|
|
2634
|
+
size: "small",
|
|
2635
|
+
variant: "outlined",
|
|
2636
|
+
color: "primary",
|
|
2637
|
+
disabled: readOnly,
|
|
2638
|
+
onClick: () => {
|
|
2639
|
+
const rule = toSecurityRule(dp);
|
|
2640
|
+
setFieldValue("securityRules", [...rules, rule]);
|
|
2641
|
+
},
|
|
2642
|
+
children: "Import to codebase"
|
|
2643
|
+
}) })
|
|
2649
2644
|
})
|
|
2650
2645
|
})]
|
|
2651
2646
|
}, dp.policyname))
|
|
@@ -2971,10 +2966,12 @@ function CollectionEditor(props) {
|
|
|
2971
2966
|
}, [collection, fallbackSlug]);
|
|
2972
2967
|
const initialValues = React$1.useMemo(() => {
|
|
2973
2968
|
return initialCollection ? applyPropertyConfigs(initialCollection, propertyConfigs) : copyFromProp ? (() => {
|
|
2974
|
-
const { subcollections: _sub, ...rest } = copyFromProp;
|
|
2969
|
+
const { subcollections: _sub, schema: _schema, auth: _auth, ...rest } = copyFromProp;
|
|
2975
2970
|
return {
|
|
2976
2971
|
...rest,
|
|
2977
2972
|
name: "",
|
|
2973
|
+
slug: fallbackSlug,
|
|
2974
|
+
table: "",
|
|
2978
2975
|
ownerId: authController.user?.uid ?? ""
|
|
2979
2976
|
};
|
|
2980
2977
|
})() : {
|
|
@@ -3009,6 +3006,8 @@ function CollectionEditor(props) {
|
|
|
3009
3006
|
});
|
|
3010
3007
|
}
|
|
3011
3008
|
function CollectionEditorInternal({ isNewCollection, configController, editedCollectionId, parentCollectionSlugs, parentEntityIds, path, collectionInference, handleClose, extraView, handleCancel, setFormDirty, getUser, parentCollection, getData, existingPaths, existingIds, includeTemplates, collection, setCollection, initialValues, propertyConfigs, existingEntities, initialView: initialViewProp, expandKanban, generateCollection, onAnalyticsEvent, fullScreen, unmappedTables, onFetchTableMetadata, propertyTypePresets, hiddenPropertyTypes, renderExtraPropertyFields, renderExtraCollectionFields, visibleTabs, standalone }) {
|
|
3009
|
+
/** Why the submit buttons below are dead, straight from the backend. */
|
|
3010
|
+
const readOnlyTitle = configController?.readOnlyReason || "This backend does not accept collection edits.";
|
|
3012
3011
|
const importConfigRaw = useImportConfig();
|
|
3013
3012
|
const urlControllerRaw = useUrlController();
|
|
3014
3013
|
const collectionRegistryRaw = useCollectionRegistryController();
|
|
@@ -3292,14 +3291,17 @@ function CollectionEditorInternal({ isNewCollection, configController, editedCol
|
|
|
3292
3291
|
onAnalyticsEvent
|
|
3293
3292
|
}), fullScreen && !isNewCollection && /* @__PURE__ */ jsx("div", {
|
|
3294
3293
|
className: "flex items-center gap-2",
|
|
3295
|
-
children: /* @__PURE__ */ jsx(
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3294
|
+
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
3295
|
+
title: configController?.readOnly ? readOnlyTitle : void 0,
|
|
3296
|
+
children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(LoadingButton, {
|
|
3297
|
+
variant: "filled",
|
|
3298
|
+
color: "primary",
|
|
3299
|
+
type: "submit",
|
|
3300
|
+
onClick: () => formController.handleSubmit(),
|
|
3301
|
+
disabled: !dirty || isSubmitting || configController?.readOnly,
|
|
3302
|
+
loading: isSubmitting,
|
|
3303
|
+
children: configController?.readOnly ? "Update (Read-only)" : "Update"
|
|
3304
|
+
}) })
|
|
3303
3305
|
})
|
|
3304
3306
|
})]
|
|
3305
3307
|
})]
|
|
@@ -3470,13 +3472,16 @@ function CollectionEditorInternal({ isNewCollection, configController, editedCol
|
|
|
3470
3472
|
startIcon: currentView === "properties" ? /* @__PURE__ */ jsx(CheckIcon, {}) : void 0,
|
|
3471
3473
|
children: [currentView === "general" && "Next", currentView === "properties" && "Create collection"]
|
|
3472
3474
|
}),
|
|
3473
|
-
!isNewCollection && !fullScreen && /* @__PURE__ */ jsx(
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3475
|
+
!isNewCollection && !fullScreen && /* @__PURE__ */ jsx(Tooltip, {
|
|
3476
|
+
title: configController?.readOnly ? readOnlyTitle : void 0,
|
|
3477
|
+
children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(LoadingButton, {
|
|
3478
|
+
variant: "filled",
|
|
3479
|
+
color: "primary",
|
|
3480
|
+
type: "submit",
|
|
3481
|
+
disabled: isSubmitting || configController?.readOnly,
|
|
3482
|
+
loading: isSubmitting,
|
|
3483
|
+
children: configController?.readOnly ? "Update collection (Read-only)" : "Update collection"
|
|
3484
|
+
}) })
|
|
3480
3485
|
})
|
|
3481
3486
|
]
|
|
3482
3487
|
})]
|
|
@@ -3545,4 +3550,4 @@ var validateId = (value, isNewCollection, existingPaths, existingIds) => {
|
|
|
3545
3550
|
//#endregion
|
|
3546
3551
|
export { CollectionEditorDialog as n, CollectionEditorDialog_exports as r, CollectionEditor as t };
|
|
3547
3552
|
|
|
3548
|
-
//# sourceMappingURL=CollectionEditorDialog-
|
|
3553
|
+
//# sourceMappingURL=CollectionEditorDialog-Dhn0S4FT.js.map
|