@rebasepro/admin 0.2.3 → 0.2.5
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/{CollectionEditorDialog-CmGXXSY9.js → CollectionEditorDialog-Cn8-tGyL.js} +89 -79
- package/dist/CollectionEditorDialog-Cn8-tGyL.js.map +1 -0
- package/dist/{CollectionsStudioView-DcLHT5bU.js → CollectionsStudioView-C-Ts1rZt.js} +5 -4
- package/dist/{CollectionsStudioView-DcLHT5bU.js.map → CollectionsStudioView-C-Ts1rZt.js.map} +1 -1
- package/dist/{ExportCollectionAction-BfN34eWX.js → ExportCollectionAction-BRdKM3DF.js} +4 -3
- package/dist/ExportCollectionAction-BRdKM3DF.js.map +1 -0
- package/dist/{ImportCollectionAction-SZrInjhx.js → ImportCollectionAction-U-v7lGxO.js} +3 -2
- package/dist/{ImportCollectionAction-SZrInjhx.js.map → ImportCollectionAction-U-v7lGxO.js.map} +1 -1
- package/dist/{PropertyEditView-Cvryrb3B.js → PropertyEditView-BDNYkfNf.js} +128 -121
- package/dist/PropertyEditView-BDNYkfNf.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -5
- package/dist/collection_editor/index.d.ts +0 -1
- package/dist/collection_editor/types/collection_editor_controller.d.ts +0 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -3
- package/dist/collection_editor_ui.js +3 -3
- package/dist/components/ArrayContainer.d.ts +2 -2
- package/dist/components/DefaultAppBar.d.ts +18 -1
- package/dist/components/DefaultDrawer.d.ts +51 -3
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
- package/dist/components/EntityCollectionTable/table_bindings.d.ts +4 -3
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +4 -3
- package/dist/components/EntityEditView.d.ts +2 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +3 -3
- package/dist/components/PropertyCollectionView.d.ts +1 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
- package/dist/components/RebaseRouteDefs.d.ts +1 -1
- package/dist/components/SelectableTable/SelectionStore.d.ts +4 -1
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -2
- package/dist/components/admin/index.d.ts +1 -3
- package/dist/components/app/Drawer.d.ts +8 -1
- package/dist/data_export/export/export.d.ts +3 -3
- package/dist/editor/components/editor-bubble.d.ts +5 -1
- package/dist/editor/components/image-bubble.d.ts +5 -1
- package/dist/editor/components/index.d.ts +3 -3
- package/dist/editor/components/table-bubble.d.ts +5 -1
- package/dist/editor/nodeViews/ReactNodeView.d.ts +4 -1
- package/dist/editor/useProseMirror.d.ts +2 -2
- package/dist/editor/utils/remove_classes.d.ts +1 -1
- package/dist/editor.js +15 -14
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -2
- package/dist/form/components/StorageUploadProgress.d.ts +2 -2
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
- package/dist/form/validation.d.ts +3 -3
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +1 -1
- package/dist/hooks/navigation/useResolvedCollections.d.ts +6 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +3 -7
- package/dist/{index-DjduZG1T.js → index-DHaOV-7A.js} +3 -3
- package/dist/index-DHaOV-7A.js.map +1 -0
- package/dist/{index-MKPc70-v.js → index-DJSL_SCr.js} +3 -3
- package/dist/index-DJSL_SCr.js.map +1 -0
- package/dist/{index-PLIQXpTt.js → index-XMII4H3d.js} +3 -2
- package/dist/{index-PLIQXpTt.js.map → index-XMII4H3d.js.map} +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2688 -452
- package/dist/index.js.map +1 -1
- package/dist/{markdown-z2Ir7Cgo.js → markdown-DD2JDU1X.js} +2 -2
- package/dist/markdown-DD2JDU1X.js.map +1 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
- package/dist/types/components/EntityFormProps.d.ts +2 -2
- package/dist/types/fields.d.ts +1 -1
- package/dist/{util-DbWax_sV.js → util-0GYaJqL_.js} +1505 -2043
- package/dist/util-0GYaJqL_.js.map +1 -0
- package/package.json +8 -8
- package/src/collection_editor/ConfigControllerProvider.tsx +3 -13
- package/src/collection_editor/index.ts +1 -3
- package/src/collection_editor/pgColumnToProperty.ts +19 -2
- package/src/collection_editor/types/collection_editor_controller.tsx +0 -3
- package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -6
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -6
- package/src/collection_editor/ui/EditorEntityAction.tsx +1 -6
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +7 -14
- package/src/collection_editor/ui/NewCollectionCard.tsx +1 -5
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -8
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +8 -12
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +21 -21
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +4 -7
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +4 -4
- package/src/components/ArrayContainer.tsx +3 -3
- package/src/components/DefaultAppBar.tsx +52 -31
- package/src/components/DefaultDrawer.tsx +280 -67
- package/src/components/DrawerNavigationItem.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +6 -5
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +9 -7
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +12 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
- package/src/components/EntityCollectionTable/table_bindings.tsx +5 -4
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +4 -4
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +7 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +10 -5
- package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +1 -1
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +7 -6
- package/src/components/EntityDetailView.tsx +46 -24
- package/src/components/EntityEditView.tsx +51 -28
- package/src/components/EntityEditViewFormActions.tsx +4 -4
- package/src/components/EntityPreview.tsx +9 -4
- package/src/components/HomePage/HomePageDnD.tsx +3 -2
- package/src/components/PropertyCollectionView.tsx +1 -1
- package/src/components/PropertyIdCopyTooltip.tsx +1 -1
- package/src/components/RebaseLayout.tsx +5 -1
- package/src/components/RebaseNavigation.tsx +2 -2
- package/src/components/RebaseRouteDefs.tsx +6 -11
- package/src/components/RebaseShell.tsx +16 -13
- package/src/components/SearchIconsView.tsx +1 -8
- package/src/components/SelectableTable/SelectableTable.tsx +8 -11
- package/src/components/SelectableTable/SelectionStore.ts +1 -1
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +5 -5
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +3 -3
- package/src/components/SideEntityProvider.tsx +2 -1
- package/src/components/admin/index.ts +1 -3
- package/src/components/app/Drawer.tsx +9 -1
- package/src/components/app/Scaffold.tsx +5 -1
- package/src/components/index.ts +1 -3
- package/src/data_export/export/export.ts +17 -17
- package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
- package/src/editor/components/editor-bubble.tsx +32 -9
- package/src/editor/components/image-bubble.tsx +27 -11
- package/src/editor/components/index.ts +3 -3
- package/src/editor/components/table-bubble.tsx +79 -17
- package/src/editor/extensions/HighlightDecorationExtension.ts +3 -2
- package/src/editor/nodeViews/ReactNodeView.tsx +1 -1
- package/src/editor/nodeViews/TaskItemComponent.tsx +9 -8
- package/src/editor/schema.ts +135 -59
- package/src/editor/selectors/link-selector.tsx +8 -5
- package/src/editor/useProseMirror.ts +2 -2
- package/src/editor/utils/remove_classes.ts +6 -5
- package/src/form/EntityForm.tsx +15 -15
- package/src/form/EntityFormActions.tsx +2 -2
- package/src/form/PropertyFieldBinding.tsx +64 -64
- package/src/form/components/FieldHelperText.tsx +4 -4
- package/src/form/components/StorageUploadProgress.tsx +2 -2
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
- package/src/form/field_bindings/BlockFieldBinding.tsx +54 -53
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +290 -289
- package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +8 -6
- package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +84 -84
- package/src/form/field_bindings/SwitchFieldBinding.tsx +16 -16
- package/src/form/field_bindings/TextFieldBinding.tsx +77 -73
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +17 -17
- package/src/form/validation.ts +43 -43
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +4 -7
- package/src/hooks/navigation/useResolvedCollections.ts +27 -7
- package/src/hooks/navigation/useResolvedViews.tsx +8 -70
- package/src/index.ts +4 -3
- package/src/preview/PropertyPreview.tsx +2 -2
- package/src/preview/components/ImagePreview.tsx +2 -1
- package/src/preview/components/UrlComponentPreview.tsx +11 -2
- package/src/preview/components/UserPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -4
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +3 -2
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -8
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +4 -3
- package/src/preview/property_previews/NumberPropertyPreview.tsx +5 -3
- package/src/preview/property_previews/StringPropertyPreview.tsx +10 -8
- package/src/types/components/EntityFormActionsProps.tsx +1 -1
- package/src/types/components/EntityFormProps.tsx +2 -2
- package/src/types/fields.tsx +2 -2
- package/src/util/previews.ts +9 -1
- package/dist/CollectionEditorDialog-CmGXXSY9.js.map +0 -1
- package/dist/ContentHomePage-C7vFqKSe.js +0 -1784
- package/dist/ContentHomePage-C7vFqKSe.js.map +0 -1
- package/dist/ExportCollectionAction-BfN34eWX.js.map +0 -1
- package/dist/PropertyEditView-Cvryrb3B.js.map +0 -1
- package/dist/RoleChip-QtUFXeTp.js +0 -67
- package/dist/RoleChip-QtUFXeTp.js.map +0 -1
- package/dist/RolesView-BCb7qwWs.js +0 -437
- package/dist/RolesView-BCb7qwWs.js.map +0 -1
- package/dist/UsersView-Cex24r8H.js +0 -408
- package/dist/UsersView-Cex24r8H.js.map +0 -1
- package/dist/collection_editor/types/config_permissions.d.ts +0 -19
- package/dist/components/admin/RoleChip.d.ts +0 -4
- package/dist/components/admin/RolesFilterSelect.d.ts +0 -2
- package/dist/components/admin/RolesView.d.ts +0 -4
- package/dist/components/admin/UserRolesSelectField.d.ts +0 -2
- package/dist/components/admin/UsersView.d.ts +0 -4
- package/dist/index-DjduZG1T.js.map +0 -1
- package/dist/index-MKPc70-v.js.map +0 -1
- package/dist/markdown-z2Ir7Cgo.js.map +0 -1
- package/dist/util-DbWax_sV.js.map +0 -1
- package/src/collection_editor/types/config_permissions.ts +0 -20
- package/src/components/admin/RoleChip.tsx +0 -23
- package/src/components/admin/RolesFilterSelect.tsx +0 -45
- package/src/components/admin/RolesView.tsx +0 -465
- package/src/components/admin/UserRolesSelectField.tsx +0 -50
- package/src/components/admin/UsersView.tsx +0 -687
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ArrayProperty, DateProperty, Entity, EntityReference, EntityRelation, NumberProperty, Property, ReferenceProperty, RelationProperty, StringProperty } from "@rebasepro/types";
|
|
3
|
+
import { TableSize } from "@rebasepro/core";
|
|
3
4
|
|
|
4
5
|
import { VirtualTableInput } from "./fields/VirtualTableInput";
|
|
5
6
|
import { VirtualTableSelect } from "./fields/VirtualTableSelect";
|
|
@@ -14,7 +15,7 @@ import { TableRelationSelectorField } from "./fields/TableRelationSelectorField"
|
|
|
14
15
|
|
|
15
16
|
import { getPreviewSizeFrom } from "../../preview/util";
|
|
16
17
|
|
|
17
|
-
export interface TableFieldBindingProps<T =
|
|
18
|
+
export interface TableFieldBindingProps<T = unknown> {
|
|
18
19
|
propertyKey: string;
|
|
19
20
|
property: Property;
|
|
20
21
|
internalValue: T;
|
|
@@ -23,9 +24,9 @@ export interface TableFieldBindingProps<T = any> {
|
|
|
23
24
|
validationError?: Error;
|
|
24
25
|
disabled: boolean;
|
|
25
26
|
selected: boolean;
|
|
26
|
-
size:
|
|
27
|
+
size: TableSize;
|
|
27
28
|
align: "left" | "center" | "right";
|
|
28
|
-
entity: Entity<
|
|
29
|
+
entity: Entity<Record<string, unknown>>;
|
|
29
30
|
path: string;
|
|
30
31
|
openPopup?: (cellRect: DOMRect | undefined) => void;
|
|
31
32
|
}
|
|
@@ -100,7 +101,7 @@ export function getTableBindingForProperty(
|
|
|
100
101
|
property={property as StringProperty | ArrayProperty}
|
|
101
102
|
entity={entity}
|
|
102
103
|
path={path}
|
|
103
|
-
value={internalValue}
|
|
104
|
+
value={internalValue as string | string[] | null}
|
|
104
105
|
previewSize={getPreviewSizeFrom(size)}
|
|
105
106
|
updateValue={updateValue}
|
|
106
107
|
propertyKey={propertyKey}
|
|
@@ -109,6 +109,8 @@ export function EntityCollectionCardView<M extends Record<string, unknown> = Rec
|
|
|
109
109
|
|
|
110
110
|
// Infinite scroll with Intersection Observer — stable deps only
|
|
111
111
|
useEffect(() => {
|
|
112
|
+
if (!loadMoreRef.current) return;
|
|
113
|
+
|
|
112
114
|
const observer = new IntersectionObserver(
|
|
113
115
|
(entries) => {
|
|
114
116
|
const { paginationEnabled: pe, noMoreToLoad: nm, dataLoading: dl, itemCount: ic, pageSize: ps } = paginationStateRef.current;
|
|
@@ -124,12 +126,10 @@ export function EntityCollectionCardView<M extends Record<string, unknown> = Rec
|
|
|
124
126
|
}
|
|
125
127
|
);
|
|
126
128
|
|
|
127
|
-
|
|
128
|
-
observer.observe(loadMoreRef.current);
|
|
129
|
-
}
|
|
129
|
+
observer.observe(loadMoreRef.current);
|
|
130
130
|
|
|
131
131
|
return () => observer.disconnect();
|
|
132
|
-
}, [setItemCount]);
|
|
132
|
+
}, [setItemCount, data.length]);
|
|
133
133
|
|
|
134
134
|
// Scroll restoration — deferred to after layout paint
|
|
135
135
|
useEffect(() => {
|
|
@@ -139,6 +139,13 @@ function getScrollParent(element: HTMLElement | null): HTMLElement | null {
|
|
|
139
139
|
* PropertyPreview in list row columns (because it would blow up height).
|
|
140
140
|
*/
|
|
141
141
|
function isComplexPropertyType(property: Property): boolean {
|
|
142
|
+
if (property.type === "array") {
|
|
143
|
+
const ofProp = "of" in property ? property.of : undefined;
|
|
144
|
+
const innerProp = ofProp ? (Array.isArray(ofProp) ? ofProp[0] : ofProp) : undefined;
|
|
145
|
+
if (innerProp && typeof innerProp === "object" && "enum" in innerProp && innerProp.enum) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
142
149
|
return property.type === "array"
|
|
143
150
|
|| property.type === "map"
|
|
144
151
|
|| property.type === "reference"
|
|
@@ -40,7 +40,7 @@ import { EntityCollectionListView } from "./EntityCollectionListView";
|
|
|
40
40
|
import { SplitListView } from "./SplitListView";
|
|
41
41
|
import { EntityCollectionBoardView } from "./EntityCollectionBoardView";
|
|
42
42
|
import { ViewModeToggle, KanbanPropertyOption } from "./ViewModeToggle";
|
|
43
|
-
import { Button, cls, focusedDisabled, IconButton, Markdown, Popover, Skeleton, Tooltip, Typography, VirtualTableColumn , iconSize } from "@rebasepro/ui";
|
|
43
|
+
import { Button, cls, focusedDisabled, IconButton, Markdown, Popover, Skeleton, TextField, Tooltip, Typography, VirtualTableColumn , iconSize } from "@rebasepro/ui";
|
|
44
44
|
import { ArrowRightToLineIcon, ErrorBoundary, PlusIcon, SearchIcon } from "@rebasepro/ui";
|
|
45
45
|
import { setIn } from "@rebasepro/formex";
|
|
46
46
|
import { getSubcollectionColumnId } from "../EntityCollectionTable/internal/common";
|
|
@@ -1092,7 +1092,10 @@ export const EntityCollectionView = React.memo(
|
|
|
1092
1092
|
) : (
|
|
1093
1093
|
<div className="flex flex-col w-full h-full">
|
|
1094
1094
|
{toolbarNode}
|
|
1095
|
-
<div className=
|
|
1095
|
+
<div className={cls(
|
|
1096
|
+
"flex-1 flex flex-col",
|
|
1097
|
+
viewMode === "list" && "overflow-y-auto"
|
|
1098
|
+
)}>
|
|
1096
1099
|
{viewMode === "list" ? (
|
|
1097
1100
|
<div
|
|
1098
1101
|
className={cls(
|
|
@@ -1335,15 +1338,17 @@ function EntityIdHeaderWidget({
|
|
|
1335
1338
|
className={"w-96 max-w-full"}>
|
|
1336
1339
|
|
|
1337
1340
|
<div className="flex p-2 w-full gap-2">
|
|
1338
|
-
<
|
|
1341
|
+
<TextField
|
|
1339
1342
|
autoFocus={openPopup}
|
|
1340
1343
|
placeholder={t("find_entity_by_id")}
|
|
1341
|
-
|
|
1344
|
+
size="small"
|
|
1342
1345
|
onChange={(e) => {
|
|
1343
1346
|
setSearchString(e.target.value);
|
|
1344
1347
|
}}
|
|
1345
1348
|
value={searchString}
|
|
1346
|
-
className=
|
|
1349
|
+
className="flex-grow"
|
|
1350
|
+
inputClassName={cls("rounded-lg bg-white dark:bg-surface-900", focusedDisabled)}
|
|
1351
|
+
/>
|
|
1347
1352
|
<Button variant={"text"}
|
|
1348
1353
|
disabled={!(searchString.trim())}
|
|
1349
1354
|
type={"submit"}
|
|
@@ -43,7 +43,7 @@ export function useCollectionInlineEditor<M extends Record<string, unknown>>({
|
|
|
43
43
|
data: entity
|
|
44
44
|
}) => {
|
|
45
45
|
|
|
46
|
-
const updatedValues = setIn({}, propertyKey, value)
|
|
46
|
+
const updatedValues = setIn({}, propertyKey, value) as Partial<Record<string, unknown>>;
|
|
47
47
|
|
|
48
48
|
const saveProps: SaveEntityProps = {
|
|
49
49
|
path: entity.path ?? path,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
2
|
import { setIn } from "@rebasepro/formex";
|
|
3
|
-
import { EntityCollection, SaveEntityProps, RebaseData, RebaseContext } from "@rebasepro/types";
|
|
3
|
+
import { EntityCollection, SaveEntityProps, RebaseData, RebaseContext, AnalyticsController } from "@rebasepro/types";
|
|
4
4
|
import { saveEntityWithCallbacks } from "@rebasepro/core";
|
|
5
5
|
import { BoardItem } from "../board_types";
|
|
6
|
+
import { BoardDataController } from "../useBoardDataController";
|
|
6
7
|
import { generateKeyBetween } from "fractional-indexing";
|
|
7
8
|
|
|
8
9
|
export interface UseKanbanDragAndDropParams<M extends Record<string, unknown>> {
|
|
@@ -12,8 +13,8 @@ export interface UseKanbanDragAndDropParams<M extends Record<string, unknown>> {
|
|
|
12
13
|
orderProperty?: string;
|
|
13
14
|
dataClient: RebaseData;
|
|
14
15
|
context: RebaseContext;
|
|
15
|
-
boardDataController:
|
|
16
|
-
analyticsController:
|
|
16
|
+
boardDataController: BoardDataController<M>;
|
|
17
|
+
analyticsController: AnalyticsController;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export function useKanbanDragAndDrop<M extends Record<string, unknown>>({
|
|
@@ -77,18 +78,18 @@ export function useKanbanDragAndDrop<M extends Record<string, unknown>>({
|
|
|
77
78
|
b = null;
|
|
78
79
|
}
|
|
79
80
|
const newKey = generateKeyBetween(a, b);
|
|
80
|
-
updatedValues = setIn(updatedValues, orderProperty, newKey)
|
|
81
|
+
updatedValues = setIn(updatedValues, orderProperty, newKey) as Record<string, unknown>;
|
|
81
82
|
} catch (e) {
|
|
82
83
|
// Fallback: if keys are somehow invalid, generate from scratch
|
|
83
84
|
console.warn("fractional-indexing error, falling back:", e);
|
|
84
85
|
const newKey = generateKeyBetween(null, null);
|
|
85
|
-
updatedValues = setIn(updatedValues, orderProperty, newKey)
|
|
86
|
+
updatedValues = setIn(updatedValues, orderProperty, newKey) as Record<string, unknown>;
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
// Update column if it changed
|
|
90
91
|
if (isColumnChange) {
|
|
91
|
-
updatedValues = setIn(updatedValues, columnProperty, moveInfo.targetColumn)
|
|
92
|
+
updatedValues = setIn(updatedValues, columnProperty, moveInfo.targetColumn) as Record<string, unknown>;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
// Apply optimistic UI update to boardDataController's internal state
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
Typography
|
|
26
26
|
} from "@rebasepro/ui";
|
|
27
27
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
28
|
-
import { ErrorView, createFormexStub, usePermissions, useTranslation } from "@rebasepro/core";
|
|
28
|
+
import { ErrorView, createFormexStub, usePermissions, useTranslation, getIcon } from "@rebasepro/core";
|
|
29
29
|
import {
|
|
30
30
|
getSubcollections,
|
|
31
31
|
removeInitialAndTrailingSlashes,
|
|
@@ -386,33 +386,55 @@ function EntityDetailViewInner<M extends Record<string, unknown>>({
|
|
|
386
386
|
};
|
|
387
387
|
|
|
388
388
|
// Tabs
|
|
389
|
-
const subcollectionTabs = subcollections && subcollections.map((subcollection) =>
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
value={subcollection.slug}
|
|
393
|
-
key={`entity_detail_collection_tab_${subcollection.name}`}>
|
|
394
|
-
{subcollection.name}
|
|
395
|
-
</Tab>
|
|
396
|
-
);
|
|
397
|
-
|
|
398
|
-
const customViewTabsStart = resolvedEntityViews.filter(view => view.position === "start")
|
|
399
|
-
.map((view) =>
|
|
389
|
+
const subcollectionTabs = subcollections && subcollections.map((subcollection) => {
|
|
390
|
+
const icon = getIcon(subcollection.icon, undefined, undefined, "small");
|
|
391
|
+
return (
|
|
400
392
|
<Tab
|
|
401
|
-
className=
|
|
402
|
-
value={
|
|
403
|
-
key={`entity_detail_collection_tab_${
|
|
404
|
-
|
|
393
|
+
className="text-sm min-w-[90px]"
|
|
394
|
+
value={subcollection.slug}
|
|
395
|
+
key={`entity_detail_collection_tab_${subcollection.name}`}>
|
|
396
|
+
<span className="flex items-center gap-1.5">
|
|
397
|
+
{icon}
|
|
398
|
+
{subcollection.name}
|
|
399
|
+
</span>
|
|
405
400
|
</Tab>
|
|
406
401
|
);
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
const customViewTabsStart = resolvedEntityViews.filter(view => view.position === "start")
|
|
405
|
+
.map((view) => {
|
|
406
|
+
const icon = getIcon(view.icon, undefined, undefined, "small");
|
|
407
|
+
return (
|
|
408
|
+
<Tab
|
|
409
|
+
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
410
|
+
value={view.key}
|
|
411
|
+
key={`entity_detail_collection_tab_${view.name}`}>
|
|
412
|
+
{view.tabComponent ?? (
|
|
413
|
+
<span className="flex items-center gap-1.5">
|
|
414
|
+
{icon}
|
|
415
|
+
{view.name}
|
|
416
|
+
</span>
|
|
417
|
+
)}
|
|
418
|
+
</Tab>
|
|
419
|
+
);
|
|
420
|
+
});
|
|
407
421
|
const customViewTabsEnd = resolvedEntityViews.filter(view => !view.position || view.position === "end")
|
|
408
|
-
.map((view) =>
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
422
|
+
.map((view) => {
|
|
423
|
+
const icon = getIcon(view.icon, undefined, undefined, "small");
|
|
424
|
+
return (
|
|
425
|
+
<Tab
|
|
426
|
+
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
427
|
+
value={view.key}
|
|
428
|
+
key={`entity_detail_collection_tab_${view.name}`}>
|
|
429
|
+
{view.tabComponent ?? (
|
|
430
|
+
<span className="flex items-center gap-1.5">
|
|
431
|
+
{icon}
|
|
432
|
+
{view.name}
|
|
433
|
+
</span>
|
|
434
|
+
)}
|
|
435
|
+
</Tab>
|
|
436
|
+
);
|
|
437
|
+
});
|
|
416
438
|
|
|
417
439
|
const shouldShowTopBar = Boolean(barActions) || hasAdditionalViews || layout === "side_panel" || layout === "dialog";
|
|
418
440
|
|
|
@@ -35,7 +35,8 @@ import {
|
|
|
35
35
|
useEntityFetch,
|
|
36
36
|
useRebaseContext,
|
|
37
37
|
useLargeLayout,
|
|
38
|
-
useSlot
|
|
38
|
+
useSlot,
|
|
39
|
+
getIcon
|
|
39
40
|
} from "@rebasepro/core";
|
|
40
41
|
import { getEntityFromMemoryCache } from "@rebasepro/core";
|
|
41
42
|
import { EntityForm } from "../form";
|
|
@@ -84,7 +85,7 @@ export interface EntityEditViewProps<M extends Record<string, unknown> = Record<
|
|
|
84
85
|
onTabChange?: (props: OnTabChangeParams<M>) => void;
|
|
85
86
|
navigateBack?: () => void;
|
|
86
87
|
layout?: "side_panel" | "full_screen" | "split" | "dialog";
|
|
87
|
-
barActions?: (params: BarActionsParams) =>
|
|
88
|
+
barActions?: (params: BarActionsParams) => React.ReactNode;
|
|
88
89
|
formProps?: Partial<EntityFormProps<M>>,
|
|
89
90
|
/**
|
|
90
91
|
* Pre-populate the form with these values when creating a new entity.
|
|
@@ -270,7 +271,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
270
271
|
openEntityMode: layout,
|
|
271
272
|
status: status,
|
|
272
273
|
values: usedEntity?.values ?? ({} as M),
|
|
273
|
-
setFieldValue: (key: string, value:
|
|
274
|
+
setFieldValue: (key: string, value: unknown) => {
|
|
274
275
|
throw new Error("You can't update values in read only mode");
|
|
275
276
|
},
|
|
276
277
|
save: () => {
|
|
@@ -289,7 +290,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
289
290
|
[resolvedEntityViews]
|
|
290
291
|
);
|
|
291
292
|
|
|
292
|
-
const customViewsView:
|
|
293
|
+
const customViewsView: React.ReactNode[] | undefined = customViews && nonActionCustomViews
|
|
293
294
|
.map((customView) => {
|
|
294
295
|
|
|
295
296
|
if (!customView)
|
|
@@ -466,33 +467,55 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
466
467
|
Builder={resolveComponentRef(selectedSecondaryForm?.Builder as ComponentRef<EntityCustomViewParams<M>> | undefined) as React.ComponentType<EntityCustomViewParams<M>> | undefined}
|
|
467
468
|
/>;
|
|
468
469
|
|
|
469
|
-
const subcollectionTabs = subcollections && subcollections.map((subcollection) =>
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
value={subcollection.slug}
|
|
473
|
-
key={`entity_detail_collection_tab_${subcollection.name}`}>
|
|
474
|
-
{subcollection.name}
|
|
475
|
-
</Tab>
|
|
476
|
-
);
|
|
477
|
-
|
|
478
|
-
const customViewTabsStart = resolvedEntityViews.filter(view => view.position === "start")
|
|
479
|
-
.map((view) =>
|
|
470
|
+
const subcollectionTabs = subcollections && subcollections.map((subcollection) => {
|
|
471
|
+
const icon = getIcon(subcollection.icon, undefined, undefined, "small");
|
|
472
|
+
return (
|
|
480
473
|
<Tab
|
|
481
|
-
className=
|
|
482
|
-
value={
|
|
483
|
-
key={`entity_detail_collection_tab_${
|
|
484
|
-
|
|
474
|
+
className="text-sm min-w-[90px]"
|
|
475
|
+
value={subcollection.slug}
|
|
476
|
+
key={`entity_detail_collection_tab_${subcollection.name}`}>
|
|
477
|
+
<span className="flex items-center gap-1.5">
|
|
478
|
+
{icon}
|
|
479
|
+
{subcollection.name}
|
|
480
|
+
</span>
|
|
485
481
|
</Tab>
|
|
486
482
|
);
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
const customViewTabsStart = resolvedEntityViews.filter(view => view.position === "start")
|
|
486
|
+
.map((view) => {
|
|
487
|
+
const icon = getIcon(view.icon, undefined, undefined, "small");
|
|
488
|
+
return (
|
|
489
|
+
<Tab
|
|
490
|
+
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
491
|
+
value={view.key}
|
|
492
|
+
key={`entity_detail_collection_tab_${view.name}`}>
|
|
493
|
+
{view.tabComponent ?? (
|
|
494
|
+
<span className="flex items-center gap-1.5">
|
|
495
|
+
{icon}
|
|
496
|
+
{view.name}
|
|
497
|
+
</span>
|
|
498
|
+
)}
|
|
499
|
+
</Tab>
|
|
500
|
+
);
|
|
501
|
+
});
|
|
487
502
|
const customViewTabsEnd = resolvedEntityViews.filter(view => !view.position || view.position === "end")
|
|
488
|
-
.map((view) =>
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
503
|
+
.map((view) => {
|
|
504
|
+
const icon = getIcon(view.icon, undefined, undefined, "small");
|
|
505
|
+
return (
|
|
506
|
+
<Tab
|
|
507
|
+
className={!view.tabComponent ? "text-sm min-w-[90px]" : undefined}
|
|
508
|
+
value={view.key}
|
|
509
|
+
key={`entity_detail_collection_tab_${view.name}`}>
|
|
510
|
+
{view.tabComponent ?? (
|
|
511
|
+
<span className="flex items-center gap-1.5">
|
|
512
|
+
{icon}
|
|
513
|
+
{view.name}
|
|
514
|
+
</span>
|
|
515
|
+
)}
|
|
516
|
+
</Tab>
|
|
517
|
+
);
|
|
518
|
+
});
|
|
496
519
|
|
|
497
520
|
const shouldShowTopBar = Boolean(barActions) || hasAdditionalViews || layout === "side_panel" || layout === "dialog";
|
|
498
521
|
|
|
@@ -605,7 +628,7 @@ export function EntityEditViewInner<M extends Record<string, unknown>>({
|
|
|
605
628
|
return result;
|
|
606
629
|
}
|
|
607
630
|
|
|
608
|
-
function EntityFormSkeleton({ collection }: { collection: EntityCollection
|
|
631
|
+
function EntityFormSkeleton({ collection }: { collection: EntityCollection }) {
|
|
609
632
|
return (
|
|
610
633
|
<div className="flex-1 flex flex-row w-full overflow-y-auto justify-center">
|
|
611
634
|
<div className="relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit">
|
|
@@ -122,11 +122,11 @@ type ActionsViewProps<M extends Record<string, unknown>> = {
|
|
|
122
122
|
disabled: boolean,
|
|
123
123
|
status: "new" | "existing" | "copy",
|
|
124
124
|
sideDialogContext: SideDialogController,
|
|
125
|
-
pluginActions?:
|
|
125
|
+
pluginActions?: React.ReactNode[],
|
|
126
126
|
openEntityMode: "side_panel" | "full_screen" | "split" | "dialog";
|
|
127
127
|
navigateBack: () => void;
|
|
128
128
|
formContext: FormContext,
|
|
129
|
-
formex: FormexController<
|
|
129
|
+
formex: FormexController<Record<string, unknown>>;
|
|
130
130
|
t: (key: string, vars?: Record<string, string>) => string;
|
|
131
131
|
className?: string;
|
|
132
132
|
};
|
|
@@ -174,7 +174,7 @@ function buildBottomActions<M extends Record<string, unknown>>({
|
|
|
174
174
|
openEntityMode,
|
|
175
175
|
navigateBack,
|
|
176
176
|
formContext
|
|
177
|
-
} satisfies EntityActionClickProps<
|
|
177
|
+
} satisfies EntityActionClickProps<Record<string, unknown>>;
|
|
178
178
|
|
|
179
179
|
const isEnabled = !action.isEnabled || action.isEnabled(props);
|
|
180
180
|
return (
|
|
@@ -316,7 +316,7 @@ function EntityActionButton({
|
|
|
316
316
|
}: {
|
|
317
317
|
action: EntityAction,
|
|
318
318
|
enabled: boolean,
|
|
319
|
-
props: EntityActionClickProps<
|
|
319
|
+
props: EntityActionClickProps<Record<string, unknown>>
|
|
320
320
|
}) {
|
|
321
321
|
const snackbarController = useSnackbarController();
|
|
322
322
|
const [loading, setLoading] = React.useState(false);
|
|
@@ -352,10 +352,8 @@ export const EntityPreviewContainer = React.forwardRef<HTMLDivElement, EntityPre
|
|
|
352
352
|
}, ref) => {
|
|
353
353
|
return <div
|
|
354
354
|
ref={ref}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
tabIndex: 0
|
|
358
|
-
} as React.CSSProperties}
|
|
355
|
+
tabIndex={0}
|
|
356
|
+
style={style}
|
|
359
357
|
className={cls(
|
|
360
358
|
"bg-white dark:bg-surface-900",
|
|
361
359
|
size === "small" ? "min-h-[32px]" : "min-h-[44px]",
|
|
@@ -367,12 +365,19 @@ export const EntityPreviewContainer = React.forwardRef<HTMLDivElement, EntityPre
|
|
|
367
365
|
onClick ? "cursor-pointer" : "",
|
|
368
366
|
defaultBorderMixin,
|
|
369
367
|
className)}
|
|
368
|
+
role={onClick ? "button" : undefined}
|
|
370
369
|
onClick={(event) => {
|
|
371
370
|
if (onClick) {
|
|
372
371
|
event.preventDefault();
|
|
373
372
|
onClick(event);
|
|
374
373
|
}
|
|
375
374
|
}}
|
|
375
|
+
onKeyDown={(event) => {
|
|
376
|
+
if (onClick && (event.key === "Enter" || event.key === " ")) {
|
|
377
|
+
event.preventDefault();
|
|
378
|
+
onClick(event);
|
|
379
|
+
}
|
|
380
|
+
}}
|
|
376
381
|
{...props}>
|
|
377
382
|
{children}
|
|
378
383
|
</div>;
|
|
@@ -2,6 +2,7 @@ import type { NavigationEntry } from "@rebasepro/types";
|
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import {
|
|
4
4
|
Active,
|
|
5
|
+
Over,
|
|
5
6
|
closestCenter,
|
|
6
7
|
closestCorners,
|
|
7
8
|
CollisionDetection,
|
|
@@ -347,7 +348,7 @@ export function useHomePageDnd({
|
|
|
347
348
|
const handleDragOver = ({
|
|
348
349
|
active,
|
|
349
350
|
over
|
|
350
|
-
}: { active: Active; over:
|
|
351
|
+
}: { active: Active; over: Over | null }) => {
|
|
351
352
|
if (disabled || !over) return;
|
|
352
353
|
|
|
353
354
|
const activeIdNow = active.id;
|
|
@@ -398,7 +399,7 @@ export function useHomePageDnd({
|
|
|
398
399
|
const handleDragEnd = ({
|
|
399
400
|
active,
|
|
400
401
|
over
|
|
401
|
-
}: { active: Active; over:
|
|
402
|
+
}: { active: Active; over: Over | null }) => {
|
|
402
403
|
if (disabled || !over) {
|
|
403
404
|
resetDragState();
|
|
404
405
|
return;
|
|
@@ -53,7 +53,11 @@ export function RebaseLayout(props: RebaseLayoutProps) {
|
|
|
53
53
|
|
|
54
54
|
const adminModeController = useAdminModeController();
|
|
55
55
|
|
|
56
|
-
const ActiveAppBar = appBar ?? <AppBar
|
|
56
|
+
const ActiveAppBar = appBar ?? <AppBar
|
|
57
|
+
includeLanguageToggle={false}
|
|
58
|
+
includeModeToggle={false}
|
|
59
|
+
includeUserMenu={false}
|
|
60
|
+
/>;
|
|
57
61
|
const ActiveDrawer = drawer ?? (
|
|
58
62
|
<Drawer
|
|
59
63
|
title={title}
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
CustomizationControllerContext
|
|
14
14
|
} from "@rebasepro/core";
|
|
15
15
|
import { CircularProgressCenter } from "@rebasepro/ui";
|
|
16
|
-
import type { AppView, CollectionEditorOptions, EntityCustomView, EntityAction, EntityCollection } from "@rebasepro/types";
|
|
16
|
+
import type { AppView, CollectionEditorOptions, EntityCustomView, EntityAction, EntityCollection, RebasePlugin } from "@rebasepro/types";
|
|
17
17
|
import type { CollectionRegistryController } from "@rebasepro/types";
|
|
18
18
|
import type { UrlController, NavigationStateController } from "@rebasepro/types";
|
|
19
19
|
|
|
20
|
-
const EMPTY_PLUGINS:
|
|
20
|
+
const EMPTY_PLUGINS: RebasePlugin[] = [];
|
|
21
21
|
const EMPTY_COLLECTIONS: EntityCollection[] = [];
|
|
22
22
|
|
|
23
23
|
import { useBuildNavigationStateController } from "../hooks/navigation/useBuildNavigationStateController";
|
|
@@ -5,15 +5,12 @@ import {
|
|
|
5
5
|
RebaseRoutes,
|
|
6
6
|
UserSettingsView,
|
|
7
7
|
UIReferenceView,
|
|
8
|
-
NotFoundPage
|
|
9
|
-
useInternalUserManagementController
|
|
8
|
+
NotFoundPage
|
|
10
9
|
} from "@rebasepro/core";
|
|
11
10
|
import { CircularProgressCenter } from "@rebasepro/ui";
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const UsersView = lazy(() => import("./admin/UsersView").then(m => ({ default: m.UsersView })));
|
|
16
|
-
const RolesView = lazy(() => import("./admin/RolesView").then(m => ({ default: m.RolesView })));
|
|
12
|
+
import { ContentHomePage } from "./HomePage/ContentHomePage";
|
|
13
|
+
|
|
17
14
|
import { RebaseRoute } from "../routes/RebaseRoute";
|
|
18
15
|
import { CustomViewRoute } from "../routes/CustomViewRoute";
|
|
19
16
|
import { useNavigationStateController } from "../hooks/navigation/contexts/NavigationStateContext";
|
|
@@ -27,7 +24,7 @@ function SettingsView() {
|
|
|
27
24
|
const breadcrumbs = useBreadcrumbsController();
|
|
28
25
|
useEffect(() => {
|
|
29
26
|
breadcrumbs.set({
|
|
30
|
-
breadcrumbs: [{ title: t("
|
|
27
|
+
breadcrumbs: [{ title: t("account_settings"),
|
|
31
28
|
url: "/settings" }]
|
|
32
29
|
});
|
|
33
30
|
|
|
@@ -50,7 +47,7 @@ export interface RebaseRouteDefsProps {
|
|
|
50
47
|
* Route definitions for the CMS.
|
|
51
48
|
*
|
|
52
49
|
* Defines all standard routes: home, studio home, collection view,
|
|
53
|
-
* settings,
|
|
50
|
+
* settings, debug, custom views, and a catch-all 404.
|
|
54
51
|
*
|
|
55
52
|
* **Independently usable**: Use this when you want Rebase routes
|
|
56
53
|
* inside your own layout/navigation setup.
|
|
@@ -66,7 +63,6 @@ export interface RebaseRouteDefsProps {
|
|
|
66
63
|
*/
|
|
67
64
|
export function RebaseRouteDefs({ children, layout }: RebaseRouteDefsProps) {
|
|
68
65
|
const registry = useRebaseRegistry();
|
|
69
|
-
const userManagement = useInternalUserManagementController();
|
|
70
66
|
const navigationStateController = useNavigationStateController();
|
|
71
67
|
|
|
72
68
|
const cmsHomePage = registry.cmsConfig?.homePage ?? <Suspense fallback={<CircularProgressCenter/>}><ContentHomePage/></Suspense>;
|
|
@@ -87,8 +83,7 @@ export function RebaseRouteDefs({ children, layout }: RebaseRouteDefsProps) {
|
|
|
87
83
|
|
|
88
84
|
<Route path={"/c/*"} element={<RebaseRoute/>}/>
|
|
89
85
|
<Route path={"/settings"} element={<SettingsView/>}/>
|
|
90
|
-
|
|
91
|
-
{userManagement && <Route path={"/users"} element={<Suspense fallback={<CircularProgressCenter/>}><UsersView userManagement={userManagement}/></Suspense>}/>}
|
|
86
|
+
|
|
92
87
|
|
|
93
88
|
{/* Hidden debug route */}
|
|
94
89
|
<Route path={"/debug/ui"} element={<UIReferenceView/>}/>
|
|
@@ -2,6 +2,7 @@ import React, { useMemo } from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
useRebaseRegistry
|
|
4
4
|
} from "@rebasepro/core";
|
|
5
|
+
import { ErrorBoundary } from "@rebasepro/ui";
|
|
5
6
|
|
|
6
7
|
import { RebaseAuthGate } from "./RebaseAuthGate";
|
|
7
8
|
import { RebaseNavigation } from "./RebaseNavigation";
|
|
@@ -51,19 +52,21 @@ export function RebaseShell(props: RebaseShellProps) {
|
|
|
51
52
|
return (
|
|
52
53
|
<RebaseAuthGate>
|
|
53
54
|
<RebaseNavigation>
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
<ErrorBoundary fullPage>
|
|
56
|
+
<RebaseRouteDefs
|
|
57
|
+
layout={
|
|
58
|
+
<RebaseLayout
|
|
59
|
+
title={title}
|
|
60
|
+
appBar={appBar}
|
|
61
|
+
drawer={drawer}
|
|
62
|
+
autoOpenDrawer={autoOpenDrawer}
|
|
63
|
+
devViews={devViews}
|
|
64
|
+
/>
|
|
65
|
+
}
|
|
66
|
+
>
|
|
67
|
+
{children}
|
|
68
|
+
</RebaseRouteDefs>
|
|
69
|
+
</ErrorBoundary>
|
|
67
70
|
</RebaseNavigation>
|
|
68
71
|
</RebaseAuthGate>
|
|
69
72
|
);
|
|
@@ -10,18 +10,11 @@ import {
|
|
|
10
10
|
SearchBar,
|
|
11
11
|
Tooltip
|
|
12
12
|
} from "@rebasepro/ui";
|
|
13
|
-
import { iconsSearch
|
|
13
|
+
import { iconsSearch } from "@rebasepro/core";
|
|
14
14
|
import { useTranslation } from "@rebasepro/core";
|
|
15
15
|
|
|
16
16
|
const UPDATE_SEARCH_INDEX_WAIT_MS = 220;
|
|
17
17
|
|
|
18
|
-
if (iconSynonyms && process.env.NODE_ENV !== "production") {
|
|
19
|
-
Object.keys(iconSynonyms).forEach((icon: string) => {
|
|
20
|
-
if (!iconKeys.includes(icon)) {
|
|
21
|
-
console.warn(`The icon ${icon} no longer exists. Remove it from \`iconSynonyms\``);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
18
|
|
|
26
19
|
function toPascalCase(str: string): string {
|
|
27
20
|
return str.split(/[-_]/).map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|