@rebasepro/admin 0.5.0 → 0.6.1
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 +7 -3
- package/dist/CollectionEditorDialog-HNXGxXdO.js +3549 -0
- package/dist/CollectionEditorDialog-HNXGxXdO.js.map +1 -0
- package/dist/CollectionsStudioView-B1mN33GB.js +170 -0
- package/dist/CollectionsStudioView-B1mN33GB.js.map +1 -0
- package/dist/PropertyEditView-C2wp8kQ9.js +3660 -0
- package/dist/PropertyEditView-C2wp8kQ9.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +2 -2
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -1
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -1
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
- package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -1
- package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -1
- package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +1 -9
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +2 -1
- package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +1 -1
- package/dist/collection_editor_ui.js +4 -11
- package/dist/components/ArrayContainer.d.ts +3 -3
- package/dist/components/ClearFilterSortButton.d.ts +1 -1
- package/dist/components/CollectionEditorDialogs.d.ts +2 -1
- package/dist/components/CollectionPanel.d.ts +2 -27
- package/dist/components/DefaultAppBar.d.ts +1 -1
- package/dist/components/DefaultDrawer.d.ts +4 -4
- package/dist/components/DeleteEntityDialog.d.ts +2 -1
- package/dist/components/DrawerNavigationGroup.d.ts +1 -1
- package/dist/components/DrawerNavigationItem.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +3 -3
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +2 -1
- package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
- package/dist/components/EntityCollectionView/Board.d.ts +2 -1
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +0 -24
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +2 -1
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
- package/dist/components/EntityCollectionView/SplitListView.d.ts +1 -1
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
- package/dist/components/EntityDetailView.d.ts +1 -1
- package/dist/components/EntityEditView.d.ts +2 -2
- package/dist/components/EntityEditViewFormActions.d.ts +2 -1
- package/dist/components/EntityJsonPreview.d.ts +2 -1
- package/dist/components/EntityPreview.d.ts +3 -3
- package/dist/components/EntitySidePanel.d.ts +2 -1
- package/dist/components/EntityView.d.ts +2 -1
- package/dist/components/FieldCaption.d.ts +1 -1
- package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
- package/dist/components/HomePage/FavouritesView.d.ts +1 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
- package/dist/components/HomePage/NavigationCard.d.ts +1 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
- package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
- package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
- package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
- package/dist/components/PropertyCollectionView.d.ts +2 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
- package/dist/components/RebaseAuthGate.d.ts +1 -1
- package/dist/components/RebaseLayout.d.ts +1 -1
- package/dist/components/RebaseNavigation.d.ts +1 -1
- package/dist/components/RebaseRouteDefs.d.ts +1 -1
- package/dist/components/RebaseShell.d.ts +1 -1
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
- package/dist/components/ReferenceWidget.d.ts +2 -1
- package/dist/components/SearchIconsView.d.ts +2 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +2 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
- package/dist/components/SideDialogs.d.ts +1 -1
- package/dist/components/SideEntityProvider.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +2 -1
- package/dist/components/app/AppBar.d.ts +1 -1
- package/dist/components/app/Drawer.d.ts +1 -1
- package/dist/components/common/default_entity_actions.d.ts +2 -1
- package/dist/components/history/EntityHistoryEntry.d.ts +1 -1
- package/dist/components/history/EntityHistoryView.d.ts +1 -1
- package/dist/components/history/LastEditedByFormAction.d.ts +2 -1
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -1
- package/dist/components/history/UserChip.d.ts +1 -1
- package/dist/data_export/export/BasicExportAction.d.ts +2 -1
- package/dist/data_export/export/ExportCollectionAction.d.ts +1 -1
- package/dist/data_import/components/DataNewPropertiesMapping.d.ts +1 -1
- package/dist/data_import/components/ImportFileUpload.d.ts +1 -1
- package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +2 -1
- package/dist/data_import/components/ImportSaveInProgress.d.ts +1 -1
- package/dist/data_import/import/ImportCollectionAction.d.ts +4 -3
- package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
- package/dist/editor/editor.d.ts +10 -4
- package/dist/editor/selectors/color-selector.d.ts +1 -1
- package/dist/editor/selectors/link-selector.d.ts +1 -1
- package/dist/editor/selectors/node-selector.d.ts +1 -1
- package/dist/editor/selectors/text-buttons.d.ts +1 -1
- package/dist/editor.js +2623 -3574
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -1
- package/dist/form/EntityFormActions.d.ts +2 -1
- package/dist/form/components/FieldHelperText.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +1 -1
- package/dist/form/components/FormLayout.d.ts +1 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
- package/dist/form/components/LocalChangesMenu.d.ts +2 -1
- package/dist/form/components/StorageItemPreview.d.ts +2 -1
- package/dist/form/components/StorageUploadProgress.d.ts +2 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +4 -3
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +2 -1
- package/dist/history-BO6VT85a.js +311 -0
- package/dist/history-BO6VT85a.js.map +1 -0
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +0 -2
- package/dist/hooks/navigation/useNavigationResolution.d.ts +5 -6
- package/dist/hooks/navigation/useResolvedCollections.d.ts +0 -2
- package/dist/hooks/useBreadcrumbsController.d.ts +2 -32
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3393
- package/dist/markdown-CklalUUk.js +526 -0
- package/dist/markdown-CklalUUk.js.map +1 -0
- package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
- package/dist/preview/components/EmptyValue.d.ts +2 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ImagePreview.d.ts +2 -1
- package/dist/preview/components/ReferencePreview.d.ts +2 -1
- package/dist/preview/components/RelationPreview.d.ts +2 -1
- package/dist/preview/components/StorageThumbnail.d.ts +1 -1
- package/dist/preview/components/UserPreview.d.ts +6 -3
- package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
- package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/routes/RebaseRoute.d.ts +1 -1
- package/dist/src-BYniefVu.js +24011 -0
- package/dist/src-BYniefVu.js.map +1 -0
- package/dist/types/components/PropertyPreviewProps.d.ts +4 -0
- package/dist/types/components/formex.d.ts +1 -40
- package/dist/types/fields.d.ts +9 -1
- package/dist/util/navigation_utils.d.ts +2 -1
- package/dist/util/previews.d.ts +5 -0
- package/dist/util/property_utils.d.ts +1 -1
- package/package.json +29 -26
- package/src/collection_editor/ConfigControllerProvider.tsx +10 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -0
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -1
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -1
- package/src/collection_editor/ui/EditorEntityAction.tsx +2 -1
- package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -1
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +2 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +2 -3
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -4
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +5 -2
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +7 -2
- package/src/collection_editor/validateCollectionJson.ts +2 -2
- package/src/components/ArrayContainer.tsx +5 -5
- package/src/components/CollectionPanel.tsx +51 -25
- package/src/components/DefaultAppBar.tsx +1 -2
- package/src/components/DefaultDrawer.tsx +3 -2
- package/src/components/DrawerNavigationGroup.tsx +3 -2
- package/src/components/DrawerNavigationItem.tsx +4 -4
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +30 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -0
- package/src/components/EntityCollectionView/Board.tsx +10 -8
- package/src/components/EntityCollectionView/BoardSortableList.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +6 -2
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +14 -4
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +48 -26
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +146 -73
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +2 -1
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +3 -2
- package/src/components/EntityCollectionView/FilterPresetsButton.tsx +4 -2
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +0 -1
- package/src/components/EntityCollectionView/useBoardDataController.tsx +17 -15
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +29 -19
- package/src/components/EntityDetailView.tsx +66 -30
- package/src/components/EntityEditView.tsx +70 -32
- package/src/components/EntitySidePanel.tsx +6 -3
- package/src/components/HomePage/ContentHomePage.tsx +3 -3
- package/src/components/HomePage/NavigationCard.tsx +9 -15
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/HomePage/NavigationGroup.tsx +1 -1
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -5
- package/src/components/RebaseLayout.tsx +5 -2
- package/src/components/RebaseNavigation.tsx +1 -4
- package/src/components/RebaseRouteDefs.tsx +5 -3
- package/src/components/SearchIconsView.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +2 -3
- package/src/components/SelectableTable/SelectionStore.ts +9 -3
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +28 -21
- package/src/components/UserSelector.tsx +92 -2
- package/src/components/common/default_entity_actions.tsx +33 -8
- package/src/components/field_configs.tsx +6 -3
- package/src/editor/editor.tsx +15 -9
- package/src/editor/extensions/Image/index.ts +2 -2
- package/src/editor/extensions/Image.ts +2 -2
- package/src/editor/extensions/clipboard.ts +2 -2
- package/src/editor/markdown-it-plugins.d.ts +24 -0
- package/src/editor/markdown.ts +2 -3
- package/src/form/EntityForm.tsx +21 -15
- package/src/form/field_bindings/MapFieldBinding.tsx +3 -3
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +4 -4
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -1
- package/src/form/field_bindings/VectorFieldBinding.tsx +3 -3
- package/src/form/validation.ts +17 -15
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -6
- package/src/hooks/navigation/useNavigationResolution.ts +143 -19
- package/src/hooks/navigation/useResolvedCollections.ts +4 -6
- package/src/hooks/useBreadcrumbsController.tsx +2 -34
- package/src/hooks/useBuildSideEntityController.tsx +25 -3
- package/src/index.ts +2 -2
- package/src/preview/PropertyPreview.tsx +6 -2
- package/src/preview/components/ReferencePreview.tsx +64 -13
- package/src/preview/components/RelationPreview.tsx +101 -13
- package/src/preview/components/UserPreview.tsx +5 -14
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/routes/RebaseRoute.tsx +5 -4
- package/src/types/components/PropertyPreviewProps.tsx +5 -0
- package/src/types/components/formex.tsx +1 -45
- package/src/types/fields.tsx +10 -1
- package/src/util/navigation_utils.ts +14 -4
- package/src/util/previews.ts +101 -4
- package/dist/CollectionEditorDialog-C8E440oK.js +0 -4574
- package/dist/CollectionEditorDialog-C8E440oK.js.map +0 -1
- package/dist/CollectionsStudioView-Brr_b06v.js +0 -217
- package/dist/CollectionsStudioView-Brr_b06v.js.map +0 -1
- package/dist/ExportCollectionAction-D3TTYXrq.js +0 -446
- package/dist/ExportCollectionAction-D3TTYXrq.js.map +0 -1
- package/dist/ImportCollectionAction-Dn7lya6E.js +0 -685
- package/dist/ImportCollectionAction-Dn7lya6E.js.map +0 -1
- package/dist/PropertyEditView-ChBleIbN.js +0 -8197
- package/dist/PropertyEditView-ChBleIbN.js.map +0 -1
- package/dist/collection_editor_ui.js.map +0 -1
- package/dist/index-D3S9x_RP.js +0 -462
- package/dist/index-D3S9x_RP.js.map +0 -1
- package/dist/index-D9RNzm01.js +0 -12
- package/dist/index-D9RNzm01.js.map +0 -1
- package/dist/index-DrrT332R.js +0 -8
- package/dist/index-DrrT332R.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown-DD2JDU1X.js +0 -618
- package/dist/markdown-DD2JDU1X.js.map +0 -1
- package/dist/useEntityHistory-UVsSclfZ.js +0 -123
- package/dist/useEntityHistory-UVsSclfZ.js.map +0 -1
- package/dist/util-COYYD8zr.js +0 -30474
- package/dist/util-COYYD8zr.js.map +0 -1
|
@@ -117,6 +117,7 @@ export const PropertyPreview = React.memo(function PropertyPreview<P extends Pro
|
|
|
117
117
|
size={props.size}
|
|
118
118
|
reference={new EntityReference({ id: value,
|
|
119
119
|
path: stringProperty.reference.path })}
|
|
120
|
+
textOnly={props.textOnly}
|
|
120
121
|
/>;
|
|
121
122
|
} else {
|
|
122
123
|
content = <EmptyValue/>;
|
|
@@ -213,6 +214,7 @@ path: stringProperty.reference.path })}
|
|
|
213
214
|
includeEntityLink={property.includeEntityLink}
|
|
214
215
|
size={props.size}
|
|
215
216
|
reference={value as EntityReference}
|
|
217
|
+
textOnly={props.textOnly}
|
|
216
218
|
/>;
|
|
217
219
|
} else {
|
|
218
220
|
content = buildWrongValueType(propertyKey, property.type, value);
|
|
@@ -229,7 +231,7 @@ path: stringProperty.reference.path })}
|
|
|
229
231
|
content = (
|
|
230
232
|
<div className="flex flex-col w-full gap-0.5">
|
|
231
233
|
{(value as unknown[]).map((item: unknown, index: number) => {
|
|
232
|
-
const entityRelation = normalizeToEntityRelation(item);
|
|
234
|
+
const entityRelation = normalizeToEntityRelation(item, "relation");
|
|
233
235
|
if (!entityRelation) return null;
|
|
234
236
|
return (
|
|
235
237
|
<div className="w-full"
|
|
@@ -241,6 +243,7 @@ path: stringProperty.reference.path })}
|
|
|
241
243
|
includeEntityLink={property.includeEntityLink}
|
|
242
244
|
size={"small"}
|
|
243
245
|
relation={entityRelation}
|
|
246
|
+
textOnly={props.textOnly}
|
|
244
247
|
/>
|
|
245
248
|
</div>
|
|
246
249
|
);
|
|
@@ -249,7 +252,7 @@ path: stringProperty.reference.path })}
|
|
|
249
252
|
);
|
|
250
253
|
} else {
|
|
251
254
|
// Single-cardinality relation
|
|
252
|
-
const relationValue = normalizeToEntityRelation(value);
|
|
255
|
+
const relationValue = normalizeToEntityRelation(value, "relation");
|
|
253
256
|
if (relationValue) {
|
|
254
257
|
content = <RelationPreview
|
|
255
258
|
disabled={!property.relation}
|
|
@@ -258,6 +261,7 @@ path: stringProperty.reference.path })}
|
|
|
258
261
|
includeEntityLink={property.includeEntityLink}
|
|
259
262
|
size={props.size}
|
|
260
263
|
relation={relationValue}
|
|
264
|
+
textOnly={props.textOnly}
|
|
261
265
|
/>;
|
|
262
266
|
} else {
|
|
263
267
|
content = buildWrongValueType(propertyKey, property.type, value);
|
|
@@ -3,12 +3,14 @@ import * as React from "react";
|
|
|
3
3
|
|
|
4
4
|
import { Entity, EntityReference } from "@rebasepro/types";
|
|
5
5
|
import type { PreviewSize } from "../../types/components/PropertyPreviewProps";
|
|
6
|
-
import { useCustomizationController, useEntityFetch } from "@rebasepro/core";
|
|
6
|
+
import { useCustomizationController, useEntityFetch, useComponentOverride, CollectionComponentOverrideProvider } from "@rebasepro/core";
|
|
7
7
|
import { Skeleton } from "@rebasepro/ui";
|
|
8
8
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
9
9
|
import { ErrorView } from "@rebasepro/core";
|
|
10
10
|
import { EntityPreview, EntityPreviewContainer } from "../../components/EntityPreview";
|
|
11
11
|
import { useCollectionRegistryController } from "../../index";
|
|
12
|
+
import { getEntityTitlePropertyKey } from "../../util/previews";
|
|
13
|
+
import { getValueInPath } from "@rebasepro/utils";
|
|
12
14
|
|
|
13
15
|
export type ReferencePreviewProps = {
|
|
14
16
|
disabled?: boolean;
|
|
@@ -19,6 +21,7 @@ export type ReferencePreviewProps = {
|
|
|
19
21
|
hover?: boolean;
|
|
20
22
|
includeEntityLink?: boolean;
|
|
21
23
|
includeId?: boolean;
|
|
24
|
+
textOnly?: boolean;
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
/**
|
|
@@ -28,6 +31,9 @@ export const ReferencePreview = function ReferencePreview(props: ReferencePrevie
|
|
|
28
31
|
const reference = props.reference;
|
|
29
32
|
if (!(typeof reference === "object" && "isEntityReference" in reference && reference.isEntityReference())) {
|
|
30
33
|
console.warn("Reference preview received value of type", typeof reference);
|
|
34
|
+
if (props.textOnly) {
|
|
35
|
+
return <span>{String(reference)}</span>;
|
|
36
|
+
}
|
|
31
37
|
return <EntityPreviewContainer
|
|
32
38
|
onClick={props.onClick}
|
|
33
39
|
size={props.size ?? "medium"}>
|
|
@@ -40,7 +46,9 @@ export const ReferencePreview = function ReferencePreview(props: ReferencePrevie
|
|
|
40
46
|
</ErrorBoundary>;
|
|
41
47
|
};
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
const DefaultMissingReference: React.FC<{ path: string }> = () => null;
|
|
50
|
+
|
|
51
|
+
function ReferencePreviewInternalInner({
|
|
44
52
|
disabled,
|
|
45
53
|
reference,
|
|
46
54
|
previewProperties,
|
|
@@ -48,18 +56,19 @@ function ReferencePreviewInternal({
|
|
|
48
56
|
hover,
|
|
49
57
|
onClick,
|
|
50
58
|
includeEntityLink = true,
|
|
51
|
-
includeId = true
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const collectionRegistryController = useCollectionRegistryController();
|
|
59
|
+
includeId = true,
|
|
60
|
+
textOnly,
|
|
61
|
+
collection
|
|
62
|
+
}: ReferencePreviewProps & { collection?: EntityCollection }) {
|
|
63
|
+
const ResolvedMissingReference = useComponentOverride("Entity.MissingReference", DefaultMissingReference);
|
|
57
64
|
|
|
58
|
-
const collection = collectionRegistryController.getCollection(reference.path);
|
|
59
65
|
if (!collection) {
|
|
60
|
-
if (
|
|
61
|
-
return <
|
|
66
|
+
if (ResolvedMissingReference !== DefaultMissingReference) {
|
|
67
|
+
return <ResolvedMissingReference path={reference.path}/>;
|
|
62
68
|
} else {
|
|
69
|
+
if (textOnly) {
|
|
70
|
+
return <span>{reference.path}</span>;
|
|
71
|
+
}
|
|
63
72
|
return <EntityPreviewContainer
|
|
64
73
|
onClick={onClick}
|
|
65
74
|
size={size ?? "medium"}>
|
|
@@ -78,9 +87,31 @@ function ReferencePreviewInternal({
|
|
|
78
87
|
includeEntityLink={includeEntityLink}
|
|
79
88
|
includeId={includeId}
|
|
80
89
|
onClick={onClick}
|
|
90
|
+
textOnly={textOnly}
|
|
81
91
|
hover={hover}/>
|
|
82
92
|
}
|
|
83
93
|
|
|
94
|
+
function ReferencePreviewInternal(props: ReferencePreviewProps) {
|
|
95
|
+
const collectionRegistryController = useCollectionRegistryController();
|
|
96
|
+
const collection = collectionRegistryController.getCollection(props.reference.path);
|
|
97
|
+
|
|
98
|
+
const content = (
|
|
99
|
+
<ReferencePreviewInternalInner
|
|
100
|
+
{...props}
|
|
101
|
+
collection={collection}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
if (collection?.components) {
|
|
106
|
+
return (
|
|
107
|
+
<CollectionComponentOverrideProvider overrides={collection.components}>
|
|
108
|
+
{content}
|
|
109
|
+
</CollectionComponentOverrideProvider>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
return content;
|
|
113
|
+
}
|
|
114
|
+
|
|
84
115
|
function ReferencePreviewExisting<M extends Record<string, unknown> = Record<string, unknown>>({
|
|
85
116
|
reference,
|
|
86
117
|
collection,
|
|
@@ -90,11 +121,15 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
90
121
|
includeEntityLink,
|
|
91
122
|
includeId,
|
|
92
123
|
onClick,
|
|
93
|
-
hover
|
|
124
|
+
hover,
|
|
125
|
+
textOnly
|
|
94
126
|
}: ReferencePreviewProps & {
|
|
95
127
|
collection: EntityCollection<M>
|
|
96
128
|
}) {
|
|
97
129
|
|
|
130
|
+
const ResolvedEntityPreview = useComponentOverride("Entity.Preview", EntityPreview);
|
|
131
|
+
const customizationController = useCustomizationController();
|
|
132
|
+
|
|
98
133
|
const {
|
|
99
134
|
entity,
|
|
100
135
|
dataLoading,
|
|
@@ -121,6 +156,9 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
121
156
|
tooltip={reference.path}/>;
|
|
122
157
|
}
|
|
123
158
|
if (body) {
|
|
159
|
+
if (textOnly) {
|
|
160
|
+
return <span>{reference.id}</span>;
|
|
161
|
+
}
|
|
124
162
|
|
|
125
163
|
return (
|
|
126
164
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
@@ -132,6 +170,9 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
132
170
|
}
|
|
133
171
|
|
|
134
172
|
if (dataLoading && !usedEntity) {
|
|
173
|
+
if (textOnly) {
|
|
174
|
+
return <Skeleton className="inline-block w-20 h-4" />;
|
|
175
|
+
}
|
|
135
176
|
return (
|
|
136
177
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
137
178
|
hover={disabled ? undefined : hover}
|
|
@@ -142,6 +183,9 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
142
183
|
}
|
|
143
184
|
|
|
144
185
|
if (!usedEntity) {
|
|
186
|
+
if (textOnly) {
|
|
187
|
+
return <span>{reference.id}</span>;
|
|
188
|
+
}
|
|
145
189
|
return (
|
|
146
190
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
147
191
|
hover={disabled ? undefined : hover}
|
|
@@ -151,7 +195,14 @@ function ReferencePreviewExisting<M extends Record<string, unknown> = Record<str
|
|
|
151
195
|
);
|
|
152
196
|
}
|
|
153
197
|
|
|
154
|
-
|
|
198
|
+
if (textOnly) {
|
|
199
|
+
const titleProperty = getEntityTitlePropertyKey(collection, customizationController.propertyConfigs);
|
|
200
|
+
const titleValue = titleProperty ? getValueInPath(usedEntity.values, titleProperty) : undefined;
|
|
201
|
+
const displayValue = titleValue !== undefined && titleValue !== null ? String(titleValue) : String(reference.id);
|
|
202
|
+
return <span className="truncate">{displayValue}</span>;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return <ResolvedEntityPreview size={size}
|
|
155
206
|
previewKeys={previewProperties}
|
|
156
207
|
disabled={disabled}
|
|
157
208
|
entity={usedEntity}
|
|
@@ -3,10 +3,12 @@ import * as React from "react";
|
|
|
3
3
|
|
|
4
4
|
import { Entity, EntityRelation } from "@rebasepro/types";
|
|
5
5
|
import type { PreviewSize } from "../../types/components/PropertyPreviewProps";
|
|
6
|
-
import { useCustomizationController, useEntityFetch, ErrorView } from "@rebasepro/core";
|
|
6
|
+
import { useCustomizationController, useEntityFetch, ErrorView, useComponentOverride, CollectionComponentOverrideProvider } from "@rebasepro/core";
|
|
7
7
|
import { Skeleton } from "@rebasepro/ui";
|
|
8
8
|
import { EntityPreview, EntityPreviewContainer } from "../../components";
|
|
9
9
|
import { useCollectionRegistryController } from "../../index";
|
|
10
|
+
import { getEntityTitlePropertyKey } from "../../util/previews";
|
|
11
|
+
import { getValueInPath } from "@rebasepro/utils";
|
|
10
12
|
|
|
11
13
|
export type RelationPreviewProps = {
|
|
12
14
|
disabled?: boolean;
|
|
@@ -17,8 +19,45 @@ export type RelationPreviewProps = {
|
|
|
17
19
|
hover?: boolean;
|
|
18
20
|
includeEntityLink?: boolean;
|
|
19
21
|
includeId?: boolean;
|
|
22
|
+
textOnly?: boolean;
|
|
20
23
|
};
|
|
21
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Extract a display name from a plain relation-shaped object that isn't
|
|
27
|
+
* a proper EntityRelation instance. Tries common name fields in the
|
|
28
|
+
* entity's values, then falls back to the id.
|
|
29
|
+
*/
|
|
30
|
+
function extractDisplayFromPlainObject(obj: unknown): string {
|
|
31
|
+
if (!obj || typeof obj !== "object") return "—";
|
|
32
|
+
const record = obj as Record<string, unknown>;
|
|
33
|
+
|
|
34
|
+
// Try data.values.{name,title,...} (EntityRelation.data is an Entity with .values)
|
|
35
|
+
const data = record.data;
|
|
36
|
+
if (data && typeof data === "object") {
|
|
37
|
+
const dataRecord = data as Record<string, unknown>;
|
|
38
|
+
const values = (dataRecord.values && typeof dataRecord.values === "object")
|
|
39
|
+
? dataRecord.values as Record<string, unknown>
|
|
40
|
+
: dataRecord;
|
|
41
|
+
const nameFields = ["name", "title", "label", "display_name", "displayName", "email", "username"];
|
|
42
|
+
for (const field of nameFields) {
|
|
43
|
+
const v = values[field];
|
|
44
|
+
if (v && typeof v === "string") return v;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Try direct fields on the object itself (some serialization paths flatten the data)
|
|
49
|
+
const directFields = ["name", "title", "label", "display_name", "displayName", "email"];
|
|
50
|
+
for (const field of directFields) {
|
|
51
|
+
const v = record[field];
|
|
52
|
+
if (v && typeof v === "string") return v;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Last resort: show the id
|
|
56
|
+
if ("id" in record && record.id != null) return String(record.id);
|
|
57
|
+
|
|
58
|
+
return "—";
|
|
59
|
+
}
|
|
60
|
+
|
|
22
61
|
/**
|
|
23
62
|
* @group Preview components
|
|
24
63
|
*/
|
|
@@ -26,6 +65,10 @@ export const RelationPreview = function RelationPreview(props: RelationPreviewPr
|
|
|
26
65
|
const relation = props.relation;
|
|
27
66
|
if (!(typeof relation === "object" && "isEntityRelation" in relation && relation.isEntityRelation())) {
|
|
28
67
|
console.warn("Relation preview received value of type", typeof relation);
|
|
68
|
+
if (props.textOnly) {
|
|
69
|
+
const display = extractDisplayFromPlainObject(relation);
|
|
70
|
+
return <span className="truncate">{display}</span>;
|
|
71
|
+
}
|
|
29
72
|
return <EntityPreviewContainer
|
|
30
73
|
onClick={props.onClick}
|
|
31
74
|
size={props.size}>
|
|
@@ -36,7 +79,9 @@ export const RelationPreview = function RelationPreview(props: RelationPreviewPr
|
|
|
36
79
|
return <RelationPreviewInternal {...props}/>;
|
|
37
80
|
};
|
|
38
81
|
|
|
39
|
-
|
|
82
|
+
const DefaultMissingReference: React.FC<{ path: string }> = () => null;
|
|
83
|
+
|
|
84
|
+
function RelationPreviewInternalInner({
|
|
40
85
|
disabled,
|
|
41
86
|
relation,
|
|
42
87
|
previewProperties,
|
|
@@ -44,18 +89,19 @@ function RelationPreviewInternal({
|
|
|
44
89
|
hover,
|
|
45
90
|
onClick,
|
|
46
91
|
includeEntityLink = true,
|
|
47
|
-
includeId = true
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const collectionRegistryController = useCollectionRegistryController();
|
|
92
|
+
includeId = true,
|
|
93
|
+
textOnly,
|
|
94
|
+
collection
|
|
95
|
+
}: RelationPreviewProps & { collection?: EntityCollection }) {
|
|
96
|
+
const ResolvedMissingReference = useComponentOverride("Entity.MissingReference", DefaultMissingReference);
|
|
53
97
|
|
|
54
|
-
const collection = collectionRegistryController.getCollection(relation.path);
|
|
55
98
|
if (!collection) {
|
|
56
|
-
if (
|
|
57
|
-
return <
|
|
99
|
+
if (ResolvedMissingReference !== DefaultMissingReference) {
|
|
100
|
+
return <ResolvedMissingReference path={relation.path}/>;
|
|
58
101
|
} else {
|
|
102
|
+
if (textOnly) {
|
|
103
|
+
return <span>{relation.path}</span>;
|
|
104
|
+
}
|
|
59
105
|
return <EntityPreviewContainer size={size}>
|
|
60
106
|
<ErrorView error={`Collection not found: ${relation.path}`}/>
|
|
61
107
|
</EntityPreviewContainer>;
|
|
@@ -71,9 +117,31 @@ function RelationPreviewInternal({
|
|
|
71
117
|
includeEntityLink={includeEntityLink}
|
|
72
118
|
includeId={includeId}
|
|
73
119
|
onClick={onClick}
|
|
120
|
+
textOnly={textOnly}
|
|
74
121
|
hover={hover}/>
|
|
75
122
|
}
|
|
76
123
|
|
|
124
|
+
function RelationPreviewInternal(props: RelationPreviewProps) {
|
|
125
|
+
const collectionRegistryController = useCollectionRegistryController();
|
|
126
|
+
const collection = collectionRegistryController.getCollection(props.relation.path);
|
|
127
|
+
|
|
128
|
+
const content = (
|
|
129
|
+
<RelationPreviewInternalInner
|
|
130
|
+
{...props}
|
|
131
|
+
collection={collection}
|
|
132
|
+
/>
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
if (collection?.components) {
|
|
136
|
+
return (
|
|
137
|
+
<CollectionComponentOverrideProvider overrides={collection.components}>
|
|
138
|
+
{content}
|
|
139
|
+
</CollectionComponentOverrideProvider>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
return content;
|
|
143
|
+
}
|
|
144
|
+
|
|
77
145
|
function RelationPreviewExisting<M extends Record<string, unknown> = Record<string, unknown>>({
|
|
78
146
|
relation,
|
|
79
147
|
collection,
|
|
@@ -83,12 +151,15 @@ function RelationPreviewExisting<M extends Record<string, unknown> = Record<stri
|
|
|
83
151
|
includeEntityLink,
|
|
84
152
|
includeId,
|
|
85
153
|
onClick,
|
|
86
|
-
hover
|
|
154
|
+
hover,
|
|
155
|
+
textOnly
|
|
87
156
|
}: RelationPreviewProps & {
|
|
88
157
|
collection: EntityCollection<M>
|
|
89
158
|
}) {
|
|
90
159
|
|
|
91
160
|
const passedEntity = relation.data;
|
|
161
|
+
const ResolvedEntityPreview = useComponentOverride("Entity.Preview", EntityPreview);
|
|
162
|
+
const customizationController = useCustomizationController();
|
|
92
163
|
|
|
93
164
|
const {
|
|
94
165
|
entity,
|
|
@@ -117,6 +188,9 @@ function RelationPreviewExisting<M extends Record<string, unknown> = Record<stri
|
|
|
117
188
|
}
|
|
118
189
|
|
|
119
190
|
if (body) {
|
|
191
|
+
if (textOnly) {
|
|
192
|
+
return <span>{relation.id}</span>;
|
|
193
|
+
}
|
|
120
194
|
return (
|
|
121
195
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
122
196
|
hover={disabled ? undefined : hover}
|
|
@@ -127,6 +201,9 @@ function RelationPreviewExisting<M extends Record<string, unknown> = Record<stri
|
|
|
127
201
|
}
|
|
128
202
|
|
|
129
203
|
if (dataLoading && !usedEntity) {
|
|
204
|
+
if (textOnly) {
|
|
205
|
+
return <Skeleton className="inline-block w-20 h-4" />;
|
|
206
|
+
}
|
|
130
207
|
return (
|
|
131
208
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
132
209
|
hover={disabled ? undefined : hover}
|
|
@@ -137,6 +214,9 @@ function RelationPreviewExisting<M extends Record<string, unknown> = Record<stri
|
|
|
137
214
|
}
|
|
138
215
|
|
|
139
216
|
if (!usedEntity) {
|
|
217
|
+
if (textOnly) {
|
|
218
|
+
return <span>{relation.id}</span>;
|
|
219
|
+
}
|
|
140
220
|
return (
|
|
141
221
|
<EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
142
222
|
hover={disabled ? undefined : hover}
|
|
@@ -145,7 +225,15 @@ function RelationPreviewExisting<M extends Record<string, unknown> = Record<stri
|
|
|
145
225
|
</EntityPreviewContainer>
|
|
146
226
|
);
|
|
147
227
|
}
|
|
148
|
-
|
|
228
|
+
|
|
229
|
+
if (textOnly) {
|
|
230
|
+
const titleProperty = getEntityTitlePropertyKey(collection, customizationController.propertyConfigs);
|
|
231
|
+
const titleValue = titleProperty ? getValueInPath(usedEntity.values, titleProperty) : undefined;
|
|
232
|
+
const displayValue = titleValue !== undefined && titleValue !== null ? String(titleValue) : String(relation.id);
|
|
233
|
+
return <span className="truncate">{displayValue}</span>;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return <ResolvedEntityPreview size={size}
|
|
149
237
|
previewKeys={previewProperties}
|
|
150
238
|
disabled={disabled}
|
|
151
239
|
entity={usedEntity}
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
|
|
2
1
|
import type { PropertyPreviewProps } from "../../types/components/PropertyPreviewProps";
|
|
3
2
|
import type { StringProperty } from "@rebasepro/types";
|
|
4
3
|
import React from "react";
|
|
5
|
-
import { useInternalUserManagementController } from "@rebasepro/core";
|
|
6
|
-
import { UserDisplay } from "@rebasepro/core";
|
|
7
4
|
import { EmptyValue } from "./EmptyValue";
|
|
8
5
|
import { Typography } from "@rebasepro/ui";
|
|
9
|
-
import { User } from "@rebasepro/types";
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
|
-
* Preview component for displaying user
|
|
13
|
-
*
|
|
8
|
+
* Preview component for displaying a user reference value.
|
|
9
|
+
*
|
|
10
|
+
* Shows the raw user ID. Collection-based user management means
|
|
11
|
+
* user records are fetched through the standard data layer.
|
|
14
12
|
*
|
|
15
13
|
* @group Preview components
|
|
16
14
|
*/
|
|
17
15
|
export function UserPreview({ value }: PropertyPreviewProps<StringProperty>) {
|
|
18
|
-
const getUser = useInternalUserManagementController<User>()?.getUser;
|
|
19
|
-
|
|
20
16
|
if (typeof value !== "string" || !value) {
|
|
21
17
|
return <EmptyValue/>;
|
|
22
18
|
}
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
if (!user) {
|
|
26
|
-
return <Typography variant={"caption"} color={"secondary"}>User not found: {value}</Typography>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return <UserDisplay user={user}/>;
|
|
20
|
+
return <Typography variant={"caption"} color={"secondary"}>{value}</Typography>;
|
|
30
21
|
}
|
|
@@ -25,7 +25,7 @@ export function ArrayOfMapsPreview({
|
|
|
25
25
|
const mapProperty = property.of;
|
|
26
26
|
const properties = mapProperty.properties;
|
|
27
27
|
if (!properties) {
|
|
28
|
-
throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property ${propertyKey}`);
|
|
28
|
+
throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property '${propertyKey}'${mapProperty.name ? ` ("${mapProperty.name}")` : ""}`);
|
|
29
29
|
}
|
|
30
30
|
const values = value as Record<string, unknown>[];
|
|
31
31
|
const previewProperties: string[] | undefined = (mapProperty as MapProperty).previewProperties;
|
|
@@ -5,7 +5,7 @@ import { EntityDetailView } from "../components/EntityDetailView";
|
|
|
5
5
|
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { useNavigate } from "react-router-dom";
|
|
7
7
|
import { EntityCollectionView } from "../components";
|
|
8
|
-
import { NotFoundPage, useUserConfigurationPersistence } from "@rebasepro/core";
|
|
8
|
+
import { NotFoundPage, useUserConfigurationPersistence, useComponentOverride } from "@rebasepro/core";
|
|
9
9
|
import { UnsavedChangesDialog } from "@rebasepro/core";
|
|
10
10
|
import { CircularProgressCenter } from "@rebasepro/ui";
|
|
11
11
|
import { getNavigationEntriesFromPath, NavigationViewCollectionInternal, NavigationViewEntityCustomInternal, NavigationViewInternal } from "@rebasepro/common";
|
|
@@ -20,6 +20,7 @@ export function RebaseRoute() {
|
|
|
20
20
|
const urlController = useUrlController();
|
|
21
21
|
const breadcrumbs = useBreadcrumbsController();
|
|
22
22
|
const userConfigPersistence = useUserConfigurationPersistence();
|
|
23
|
+
const ResolvedCollectionView = useComponentOverride("Collection.View", EntityCollectionView);
|
|
23
24
|
|
|
24
25
|
const hash = location.hash;
|
|
25
26
|
const isSidePanel = hash.includes("#side");
|
|
@@ -91,7 +92,7 @@ export function RebaseRoute() {
|
|
|
91
92
|
}
|
|
92
93
|
return null;
|
|
93
94
|
}
|
|
94
|
-
return <
|
|
95
|
+
return <ResolvedCollectionView
|
|
95
96
|
key={`collection_view_${collection.slug}`}
|
|
96
97
|
{...collection}
|
|
97
98
|
parentCollectionSlugs={[]} parentEntityIds={[]}
|
|
@@ -114,7 +115,7 @@ export function RebaseRoute() {
|
|
|
114
115
|
}
|
|
115
116
|
return null;
|
|
116
117
|
}
|
|
117
|
-
return <
|
|
118
|
+
return <ResolvedCollectionView
|
|
118
119
|
key={`collection_view_${collection.slug}`}
|
|
119
120
|
{...collection}
|
|
120
121
|
parentCollectionSlugs={[]} parentEntityIds={[]}
|
|
@@ -185,7 +186,7 @@ export function RebaseRoute() {
|
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
|
-
return <
|
|
189
|
+
return <ResolvedCollectionView
|
|
189
190
|
key={`collection_view_${collection.slug}`}
|
|
190
191
|
{...collection}
|
|
191
192
|
parentCollectionSlugs={[]} parentEntityIds={[]}
|
|
@@ -1,46 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export type { FormexController, FormexResetProps } from "@rebasepro/formex";
|
|
2
2
|
|
|
3
|
-
// this is duplicated from the formex package
|
|
4
|
-
export type FormexController<T extends object> = {
|
|
5
|
-
values: T;
|
|
6
|
-
initialValues: T;
|
|
7
|
-
setValues: (values: T) => void;
|
|
8
|
-
setFieldValue: (key: string, value: unknown, shouldValidate?: boolean) => void;
|
|
9
|
-
touched: Record<string, boolean>;
|
|
10
|
-
setFieldTouched: (key: string, touched: boolean, shouldValidate?: boolean) => void;
|
|
11
|
-
setTouched: (touched: Record<string, boolean>) => void;
|
|
12
|
-
dirty: boolean;
|
|
13
|
-
setDirty: (dirty: boolean) => void;
|
|
14
|
-
setSubmitCount: (submitCount: number) => void;
|
|
15
|
-
errors: Record<string, string>;
|
|
16
|
-
setFieldError: (key: string, error?: string) => void;
|
|
17
|
-
handleChange: (event: React.SyntheticEvent) => void,
|
|
18
|
-
handleBlur: (event: React.FocusEvent) => void,
|
|
19
|
-
handleSubmit: (event?: FormEvent<HTMLFormElement>) => void;
|
|
20
|
-
validate: () => void;
|
|
21
|
-
resetForm: (props?: FormexResetProps<T>) => void;
|
|
22
|
-
submitCount: number;
|
|
23
|
-
isSubmitting: boolean;
|
|
24
|
-
setSubmitting: (isSubmitting: boolean) => void;
|
|
25
|
-
isValidating: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The version of the form. This is incremented every time the form is reset
|
|
28
|
-
* or the form is submitted.
|
|
29
|
-
*/
|
|
30
|
-
version: number;
|
|
31
|
-
|
|
32
|
-
debugId?: string;
|
|
33
|
-
|
|
34
|
-
undo: () => void;
|
|
35
|
-
redo: () => void;
|
|
36
|
-
|
|
37
|
-
canUndo: boolean;
|
|
38
|
-
canRedo: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type FormexResetProps<T extends object> = {
|
|
42
|
-
values?: T;
|
|
43
|
-
submitCount?: number;
|
|
44
|
-
errors?: Record<string, string>;
|
|
45
|
-
touched?: Record<string, boolean>;
|
|
46
|
-
};
|
package/src/types/fields.tsx
CHANGED
|
@@ -179,10 +179,19 @@ export interface FormContext<M extends Record<string, unknown> = Record<string,
|
|
|
179
179
|
setFieldValue: (key: string, value: unknown, shouldValidate?: boolean) => void;
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
182
|
+
* Quietly persist the entity to the database without any UI feedback
|
|
183
|
+
* (no validation, no snackbar, no form reset).
|
|
184
|
+
* Use this for programmatic/background saves from custom views.
|
|
183
185
|
*/
|
|
184
186
|
save: (values: M) => void;
|
|
185
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Submit the form — validates, saves, resets the form, and shows
|
|
190
|
+
* a success snackbar. This is what the Save button calls.
|
|
191
|
+
* Use this from custom views when you want the full "user saved" experience.
|
|
192
|
+
*/
|
|
193
|
+
submit: () => void;
|
|
194
|
+
|
|
186
195
|
/**
|
|
187
196
|
* Collection of the entity being modified
|
|
188
197
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EntityCollection, UrlController, SideEntityController } from "@rebasepro/types";
|
|
1
|
+
import type { EntityCollection, UrlController, SideEntityController, NavigateOptions } from "@rebasepro/types";
|
|
2
2
|
|
|
3
3
|
// Canonical path utilities — single source of truth in @rebasepro/common
|
|
4
4
|
export {
|
|
@@ -26,7 +26,8 @@ export function navigateToEntity({
|
|
|
26
26
|
defaultValues,
|
|
27
27
|
sideEntityController,
|
|
28
28
|
onClose,
|
|
29
|
-
navigation
|
|
29
|
+
navigation,
|
|
30
|
+
replace
|
|
30
31
|
}:
|
|
31
32
|
|
|
32
33
|
{
|
|
@@ -47,7 +48,8 @@ export function navigateToEntity({
|
|
|
47
48
|
path: string;
|
|
48
49
|
sideEntityController: SideEntityController;
|
|
49
50
|
onClose?: () => void;
|
|
50
|
-
navigation: UrlController
|
|
51
|
+
navigation: UrlController;
|
|
52
|
+
replace?: boolean;
|
|
51
53
|
}) {
|
|
52
54
|
|
|
53
55
|
if (openEntityMode === "side_panel" || openEntityMode === "dialog") {
|
|
@@ -83,7 +85,15 @@ export function navigateToEntity({
|
|
|
83
85
|
// Use React Router location.state to carry defaultValues — the correct SPA
|
|
84
86
|
// approach. No URL size limits, no encoding, nothing in the address bar.
|
|
85
87
|
// EntityFullScreenRoute reads location.state.defaultValues on mount.
|
|
86
|
-
|
|
88
|
+
const navigateOptions: NavigateOptions = {};
|
|
89
|
+
if (replace !== undefined) {
|
|
90
|
+
navigateOptions.replace = replace;
|
|
91
|
+
}
|
|
92
|
+
if (defaultValues) {
|
|
93
|
+
navigateOptions.state = { defaultValues };
|
|
94
|
+
}
|
|
95
|
+
const hasOptions = Object.keys(navigateOptions).length > 0;
|
|
96
|
+
navigation.navigate(to, hasOptions ? navigateOptions : undefined);
|
|
87
97
|
}
|
|
88
98
|
|
|
89
99
|
}
|