@rebasepro/admin 0.8.0 → 0.9.1-canary.09aaf62
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 +26 -26
- package/dist/{CollectionEditorDialog-BO_aQ-Z4.js → CollectionEditorDialog-DbPpDDwb.js} +40 -18
- package/dist/CollectionEditorDialog-DbPpDDwb.js.map +1 -0
- package/dist/{PropertyEditView-DKzOpMjR.js → PropertyEditView-DfJbZ67t.js} +81 -73
- package/dist/PropertyEditView-DfJbZ67t.js.map +1 -0
- package/dist/{RouterCollectionsStudioView-BQTIExjA.js → RouterCollectionsStudioView-C6XQ7Il5.js} +5 -5
- package/dist/RouterCollectionsStudioView-C6XQ7Il5.js.map +1 -0
- package/dist/collection_editor/_cms_internals.d.ts +3 -3
- package/dist/collection_editor/api/generateCollectionApi.d.ts +8 -8
- package/dist/collection_editor/extensibility_types.d.ts +3 -3
- package/dist/collection_editor/index.d.ts +2 -2
- package/dist/collection_editor/pgColumnToProperty.d.ts +3 -3
- package/dist/collection_editor/serializable_types.d.ts +7 -7
- package/dist/collection_editor/serializable_utils.d.ts +8 -8
- package/dist/collection_editor/types/collection_editor_controller.d.ts +5 -5
- package/dist/collection_editor/types/collection_inference.d.ts +2 -2
- package/dist/collection_editor/types/config_controller.d.ts +7 -7
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -2
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +3 -3
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +4 -4
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +5 -5
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +3 -3
- package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +1 -1
- package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -2
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +2 -2
- package/dist/collection_editor/useSafeSnackbarController.d.ts +1 -1
- package/dist/collection_editor/validateCollectionJson.d.ts +2 -2
- package/dist/collection_editor_ui.js +5 -5
- package/dist/collection_editor_ui.js.map +1 -1
- package/dist/components/CollectionPanel.d.ts +4 -4
- package/dist/components/{EntityCollectionTable/EntityCollectionRowActions.d.ts → CollectionTableBinding/CollectionRowActions.d.ts} +3 -3
- package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +28 -0
- package/dist/components/{EntityCollectionTable/EntityCollectionTableProps.d.ts → CollectionTableBinding/CollectionTableBindingProps.d.ts} +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.d.ts +2 -2
- package/dist/components/CollectionTableBinding/index.d.ts +6 -0
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.d.ts +1 -1
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.d.ts +2 -2
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.d.ts +3 -3
- package/dist/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.d.ts +1 -1
- package/dist/components/{EntityCollectionView/EntityBoardCard.d.ts → CollectionViewBinding/BoardCardBinding.d.ts} +8 -8
- package/dist/components/{EntityCollectionView/EntityCollectionBoardView.d.ts → CollectionViewBinding/CollectionBoardViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionCardView.d.ts → CollectionViewBinding/CollectionCardViewBinding.d.ts} +5 -5
- package/dist/components/{EntityCollectionView/EntityCollectionListView.d.ts → CollectionViewBinding/CollectionListViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionViewActions.d.ts → CollectionViewBinding/CollectionViewActions.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionView.d.ts → CollectionViewBinding/CollectionViewBinding.d.ts} +4 -4
- package/dist/components/{EntityCollectionView/EntityCollectionViewStartActions.d.ts → CollectionViewBinding/CollectionViewStartActions.d.ts} +4 -4
- package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +21 -0
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.d.ts +3 -3
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.d.ts +3 -3
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.d.ts +2 -2
- package/dist/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.d.ts +2 -2
- package/dist/components/{EntityCollectionView/useEntityPreviewSlots.d.ts → CollectionViewBinding/usePreviewSlots.d.ts} +5 -5
- package/dist/components/DeleteEntityDialog.d.ts +4 -4
- package/dist/components/{EntityDetailView.d.ts → DetailViewBinding.d.ts} +5 -5
- package/dist/components/EditFormActions.d.ts +3 -0
- package/dist/components/{EntityEditView.d.ts → EditViewBinding.d.ts} +9 -9
- package/dist/components/{EntityPreview.d.ts → EntityPreviewBinding.d.ts} +13 -13
- package/dist/components/EntityViewBinding.d.ts +13 -0
- package/dist/components/{EntityJsonPreview.d.ts → JsonPreviewBinding.d.ts} +1 -1
- package/dist/components/{RebaseCMS.d.ts → RebaseAdmin.d.ts} +2 -2
- package/dist/components/RebaseLayout.d.ts +5 -4
- package/dist/components/RebaseNavigation.d.ts +1 -1
- package/dist/components/RebaseShell.d.ts +1 -0
- package/dist/components/ReferenceTable/{EntitySelectionTable.d.ts → SelectionTableBinding.d.ts} +5 -5
- package/dist/components/SelectableTable/SelectableTable.d.ts +6 -6
- package/dist/components/SelectableTable/SelectableTableContext.d.ts +3 -3
- package/dist/components/SelectableTable/SelectionStore.d.ts +2 -2
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +6 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +40 -0
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +7 -1
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +7 -1
- package/dist/components/SideDialogs.d.ts +1 -1
- package/dist/components/SidePanelBinding.d.ts +11 -0
- package/dist/components/{SideEntityProvider.d.ts → SidePanelProvider.d.ts} +7 -7
- package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
- package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
- package/dist/components/index.d.ts +15 -14
- package/dist/contexts/SidePanelControllerContext.d.ts +3 -0
- package/dist/data_export/export/ExportCollectionAction.d.ts +3 -3
- package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
- package/dist/editor.js +1 -1
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/components/LocalChangesMenu.d.ts +1 -1
- package/dist/form/components/StorageUploadProgress.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
- package/dist/form/form_utils.d.ts +2 -2
- package/dist/{history-B3cqBzEV.js → history-GSa4BgDt.js} +7 -7
- package/dist/history-GSa4BgDt.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
- package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +5 -5
- package/dist/hooks/navigation/useNavigationResolution.d.ts +4 -4
- package/dist/hooks/navigation/useResolvedCollections.d.ts +7 -7
- package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
- package/dist/hooks/navigation/utils.d.ts +5 -5
- package/dist/hooks/useBuildSidePanel.d.ts +6 -0
- package/dist/hooks/useCMSContext.d.ts +2 -2
- package/dist/hooks/{useEntityHistory.d.ts → useHistory.d.ts} +1 -1
- package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
- package/dist/hooks/{useEntitySelectionDialog.d.ts → useSelectionDialog.d.ts} +2 -2
- package/dist/hooks/useSideDialogsController.d.ts +1 -1
- package/dist/hooks/useSidePanel.d.ts +11 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{src-cxV1ODRG.js → src-B8WuGSPZ.js} +886 -692
- package/dist/src-B8WuGSPZ.js.map +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +2 -2
- package/dist/types/components/EntityFormProps.d.ts +3 -3
- package/dist/types/components/formex.d.ts +1 -1
- package/dist/types/fields.d.ts +2 -2
- package/dist/util/dataControllerAdapter.d.ts +2 -5
- package/dist/util/navigation_utils.d.ts +6 -6
- package/dist/util/previews.d.ts +3 -3
- package/dist/util/property_utils.d.ts +2 -2
- package/dist/util/{entity_view_constants.d.ts → view_constants.d.ts} +1 -1
- package/package.json +12 -17
- package/src/collection_editor/ConfigControllerProvider.tsx +11 -11
- package/src/collection_editor/_cms_internals.ts +3 -3
- package/src/collection_editor/api/generateCollectionApi.ts +8 -8
- package/src/collection_editor/extensibility_types.ts +3 -3
- package/src/collection_editor/index.ts +3 -3
- package/src/collection_editor/pgColumnToProperty.ts +3 -3
- package/src/collection_editor/serializable_types.ts +8 -8
- package/src/collection_editor/serializable_utils.ts +17 -17
- package/src/collection_editor/types/collection_editor_controller.tsx +5 -5
- package/src/collection_editor/types/collection_inference.ts +2 -2
- package/src/collection_editor/types/config_controller.tsx +7 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +3 -3
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +3 -3
- package/src/collection_editor/ui/EditorCollectionAction.tsx +3 -3
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +3 -3
- package/src/collection_editor/ui/EditorEntityAction.tsx +3 -3
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +1 -1
- package/src/collection_editor/ui/KanbanSetupAction.tsx +3 -3
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +1 -1
- package/src/collection_editor/ui/NewCollectionButton.tsx +1 -1
- package/src/collection_editor/ui/NewCollectionCard.tsx +1 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +6 -6
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +6 -6
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +29 -29
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +10 -10
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +38 -7
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/EntityActionsSelectDialog.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +7 -7
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +9 -9
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +46 -37
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +7 -7
- package/src/collection_editor/ui/collection_editor/SwitchControl.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/BooleanPropertyField.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
- package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
- package/src/collection_editor/useJsonCollectionsConfigController.tsx +13 -13
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +4 -4
- package/src/collection_editor/useSafeSnackbarController.ts +1 -1
- package/src/collection_editor/validateCollectionJson.ts +3 -3
- package/src/components/AdminModeSyncer.tsx +1 -1
- package/src/components/ArrayContainer.tsx +1 -1
- package/src/components/ClearFilterSortButton.tsx +1 -1
- package/src/components/CollectionPanel.tsx +14 -17
- package/src/components/{EntityCollectionTable/EntityCollectionRowActions.tsx → CollectionTableBinding/CollectionRowActions.tsx} +8 -8
- package/src/components/{EntityCollectionTable/EntityCollectionTable.tsx → CollectionTableBinding/CollectionTableBinding.tsx} +13 -13
- package/src/components/{EntityCollectionTable/EntityCollectionTableProps.tsx → CollectionTableBinding/CollectionTableBindingProps.tsx} +2 -2
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.tsx +1 -1
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.tsx +1 -1
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.tsx +7 -7
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.tsx +10 -10
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.tsx +7 -7
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.tsx +1 -1
- package/src/components/CollectionTableBinding/index.tsx +14 -0
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.tsx +1 -1
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.tsx +2 -2
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.tsx +1 -1
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.tsx +2 -2
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.tsx +6 -6
- package/src/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.tsx +1 -1
- package/src/components/{EntityCollectionView/EntityBoardCard.tsx → CollectionViewBinding/BoardCardBinding.tsx} +17 -17
- package/src/components/{EntityCollectionView/EntityCollectionBoardView.tsx → CollectionViewBinding/CollectionBoardViewBinding.tsx} +17 -16
- package/src/components/{EntityCollectionView/EntityCollectionCardView.tsx → CollectionViewBinding/CollectionCardViewBinding.tsx} +9 -9
- package/src/components/{EntityCollectionView/EntityCollectionListView.tsx → CollectionViewBinding/CollectionListViewBinding.tsx} +15 -15
- package/src/components/{EntityCollectionView/EntityCollectionViewActions.tsx → CollectionViewBinding/CollectionViewActions.tsx} +7 -7
- package/src/components/{EntityCollectionView/EntityCollectionView.tsx → CollectionViewBinding/CollectionViewBinding.tsx} +107 -92
- package/src/components/{EntityCollectionView/EntityCollectionViewStartActions.tsx → CollectionViewBinding/CollectionViewStartActions.tsx} +6 -6
- package/src/components/{EntityCollectionView/EntityCard.tsx → CollectionViewBinding/EntityCardBinding.tsx} +12 -12
- package/src/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.tsx +49 -72
- package/src/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.tsx +10 -10
- package/src/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.tsx +1 -1
- package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.ts +6 -6
- package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.ts +5 -5
- package/src/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.tsx +25 -13
- package/src/components/{EntityCollectionView/useEntityPreviewSlots.ts → CollectionViewBinding/usePreviewSlots.ts} +9 -9
- package/src/components/DefaultAppBar.tsx +3 -3
- package/src/components/DefaultDrawer.tsx +3 -3
- package/src/components/DeleteEntityDialog.tsx +7 -7
- package/src/components/{EntityDetailView.tsx → DetailViewBinding.tsx} +28 -31
- package/src/components/DrawerNavigationGroup.tsx +2 -2
- package/src/components/{EntityEditViewFormActions.tsx → EditFormActions.tsx} +16 -16
- package/src/components/{EntityEditView.tsx → EditViewBinding.tsx} +34 -37
- package/src/components/{EntityPreview.tsx → EntityPreviewBinding.tsx} +30 -30
- package/src/components/{EntityView.tsx → EntityViewBinding.tsx} +7 -7
- package/src/components/HomePage/ContentHomePage.tsx +4 -4
- package/src/components/HomePage/FavouritesView.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +4 -4
- package/src/components/HomePage/NavigationGroup.tsx +1 -1
- package/src/components/HomePage/RenameGroupDialog.tsx +1 -1
- package/src/components/{EntityJsonPreview.tsx → JsonPreviewBinding.tsx} +2 -2
- package/src/components/{RebaseCMS.tsx → RebaseAdmin.tsx} +6 -5
- package/src/components/RebaseAuthGate.tsx +2 -2
- package/src/components/RebaseLayout.tsx +7 -13
- package/src/components/RebaseNavigation.tsx +35 -11
- package/src/components/RebaseRouteDefs.tsx +2 -2
- package/src/components/RebaseShell.tsx +2 -1
- package/src/components/ReferenceTable/{EntitySelectionTable.tsx → SelectionTableBinding.tsx} +27 -24
- package/src/components/ReferenceWidget.tsx +4 -4
- package/src/components/RelationSelector.tsx +15 -13
- package/src/components/SearchIconsView.tsx +2 -2
- package/src/components/SelectableTable/SelectableTable.tsx +35 -88
- package/src/components/SelectableTable/SelectableTableContext.tsx +3 -3
- package/src/components/SelectableTable/SelectionStore.ts +4 -4
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +10 -2
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +34 -13
- package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +187 -0
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +22 -8
- package/src/components/SelectableTable/filters/RelationFilterField.tsx +17 -3
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +67 -13
- package/src/components/SideDialogs.tsx +4 -4
- package/src/components/{EntitySidePanel.tsx → SidePanelBinding.tsx} +20 -20
- package/src/components/{SideEntityProvider.tsx → SidePanelProvider.tsx} +17 -17
- package/src/components/UserSelector.tsx +1 -1
- package/src/components/admin/CreationResultDialog.tsx +6 -3
- package/src/components/app/Scaffold.tsx +6 -2
- package/src/components/common/default_entity_actions.tsx +132 -34
- package/src/components/field_configs.tsx +1 -1
- package/src/components/history/EntityHistoryEntry.tsx +3 -3
- package/src/components/history/EntityHistoryView.tsx +7 -7
- package/src/components/history/LastEditedByIndicator.tsx +4 -4
- package/src/components/index.ts +16 -15
- package/src/contexts/SidePanelControllerContext.tsx +5 -0
- package/src/data_export/export/BasicExportAction.tsx +1 -1
- package/src/data_export/export/ExportCollectionAction.tsx +5 -5
- package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
- package/src/data_import/components/ImportFileUpload.tsx +1 -1
- package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +1 -1
- package/src/data_import/components/ImportSaveInProgress.tsx +4 -4
- package/src/data_import/import/ImportCollectionAction.tsx +6 -6
- package/src/data_import/utils/data.ts +4 -4
- package/src/data_import/utils/get_properties_mapping.ts +1 -1
- package/src/editor/components/image-bubble.tsx +1 -1
- package/src/editor/components/table-bubble.tsx +1 -1
- package/src/editor/editor.tsx +1 -1
- package/src/editor/selectors/link-selector.tsx +1 -1
- package/src/editor/selectors/node-selector.tsx +1 -1
- package/src/form/EntityForm.tsx +6 -6
- package/src/form/EntityFormActions.tsx +4 -4
- package/src/form/EntityFormBinding.tsx +10 -10
- package/src/form/PropertyFieldBinding.tsx +7 -7
- package/src/form/components/ErrorFocus.tsx +1 -1
- package/src/form/components/LocalChangesMenu.tsx +3 -3
- package/src/form/components/StorageItemPreview.tsx +1 -1
- package/src/form/components/StorageUploadProgress.tsx +3 -3
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +5 -5
- package/src/form/field_bindings/BlockFieldBinding.tsx +2 -2
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +21 -21
- package/src/form/field_bindings/MapFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +3 -3
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +7 -7
- package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +3 -3
- package/src/form/form_utils.ts +3 -3
- package/src/hooks/index.ts +4 -4
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -2
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +11 -11
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +5 -5
- package/src/hooks/navigation/useNavigationResolution.ts +28 -13
- package/src/hooks/navigation/useResolvedCollections.ts +8 -8
- package/src/hooks/navigation/useTopLevelNavigation.ts +2 -2
- package/src/hooks/navigation/utils.ts +5 -5
- package/src/hooks/{useBuildSideEntityController.tsx → useBuildSidePanel.tsx} +29 -29
- package/src/hooks/useCMSContext.tsx +7 -7
- package/src/hooks/{useEntityHistory.ts → useHistory.ts} +2 -2
- package/src/hooks/useResolvedNavigationFrom.tsx +10 -5
- package/src/hooks/{useEntitySelectionDialog.tsx → useSelectionDialog.tsx} +7 -7
- package/src/hooks/useSideDialogsController.tsx +1 -1
- package/src/hooks/useSidePanel.tsx +13 -0
- package/src/index.ts +15 -15
- package/src/preview/PropertyPreview.tsx +2 -2
- package/src/preview/components/DatePreview.tsx +1 -1
- package/src/preview/components/EnumValuesChip.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +1 -1
- package/src/preview/components/ReferencePreview.tsx +11 -11
- package/src/preview/components/RelationPreview.tsx +13 -12
- package/src/preview/components/StorageThumbnail.tsx +1 -1
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +1 -1
- package/src/routes/RebaseRoute.tsx +12 -12
- package/src/types/components/EntityFormActionsProps.tsx +2 -2
- package/src/types/components/EntityFormProps.tsx +3 -3
- package/src/types/components/formex.tsx +1 -1
- package/src/types/fields.tsx +2 -2
- package/src/util/dataControllerAdapter.ts +9 -15
- package/src/util/navigation_utils.ts +7 -7
- package/src/util/previews.ts +7 -5
- package/src/util/property_utils.tsx +2 -2
- package/src/util/{entity_view_constants.ts → view_constants.ts} +1 -1
- package/dist/CollectionEditorDialog-BO_aQ-Z4.js.map +0 -1
- package/dist/PropertyEditView-DKzOpMjR.js.map +0 -1
- package/dist/RouterCollectionsStudioView-BQTIExjA.js.map +0 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -28
- package/dist/components/EntityCollectionTable/index.d.ts +0 -6
- package/dist/components/EntityCollectionView/EntityCard.d.ts +0 -21
- package/dist/components/EntityEditViewFormActions.d.ts +0 -3
- package/dist/components/EntitySidePanel.d.ts +0 -11
- package/dist/components/EntityView.d.ts +0 -13
- package/dist/contexts/SideEntityControllerContext.d.ts +0 -3
- package/dist/history-B3cqBzEV.js.map +0 -1
- package/dist/hooks/useBuildSideEntityController.d.ts +0 -6
- package/dist/hooks/useSideEntityController.d.ts +0 -11
- package/dist/src-cxV1ODRG.js.map +0 -1
- package/src/components/EntityCollectionTable/index.tsx +0 -14
- package/src/contexts/SideEntityControllerContext.tsx +0 -5
- package/src/hooks/useSideEntityController.tsx +0 -13
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.d.ts +0 -0
- /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.d.ts +0 -0
- /package/dist/components/{EntityCollectionView → CollectionViewBinding}/utils.d.ts +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.tsx +0 -0
- /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.tsx +0 -0
- /package/src/components/{EntityCollectionView → CollectionViewBinding}/utils.ts +0 -0
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Alert,
|
|
3
|
+
Button,
|
|
4
|
+
CopyIcon,
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogActions,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogTitle,
|
|
9
|
+
iconSize,
|
|
10
|
+
KeyRoundIcon,
|
|
11
|
+
Label,
|
|
12
|
+
LoadingButton,
|
|
13
|
+
PencilIcon,
|
|
14
|
+
RadioGroup,
|
|
15
|
+
RadioGroupItem,
|
|
16
|
+
TextField,
|
|
17
|
+
Trash2Icon,
|
|
18
|
+
Typography
|
|
19
|
+
} from "@rebasepro/ui";
|
|
2
20
|
import type { EntityAction, User, UserCreationResult } from "@rebasepro/types";
|
|
3
21
|
import {
|
|
4
|
-
ConfirmationDialog,
|
|
5
22
|
useAuthController,
|
|
6
23
|
useRebaseClient,
|
|
7
24
|
useSnackbarController,
|
|
8
25
|
useTranslation
|
|
9
|
-
} from "@rebasepro/
|
|
26
|
+
} from "@rebasepro/app";
|
|
10
27
|
import { DeleteEntityDialog } from "../DeleteEntityDialog";
|
|
11
|
-
import { addRecentId } from "../
|
|
28
|
+
import { addRecentId } from "../CollectionViewBinding/utils";
|
|
12
29
|
import { navigateToEntity } from "../../util/navigation_utils";
|
|
13
30
|
import { resolveDefaultSelectedView } from "@rebasepro/common";
|
|
14
31
|
import { CreationResultDialog } from "../admin/CreationResultDialog";
|
|
@@ -25,7 +42,7 @@ export const editEntityAction: EntityAction = {
|
|
|
25
42
|
collection,
|
|
26
43
|
path,
|
|
27
44
|
context,
|
|
28
|
-
|
|
45
|
+
sidePanelController,
|
|
29
46
|
highlightEntity,
|
|
30
47
|
unhighlightEntity,
|
|
31
48
|
openEntityMode
|
|
@@ -35,8 +52,8 @@ export const editEntityAction: EntityAction = {
|
|
|
35
52
|
throw new Error("INTERNAL: editEntityAction: Entity is undefined");
|
|
36
53
|
}
|
|
37
54
|
|
|
38
|
-
if (!
|
|
39
|
-
throw new Error("INTERNAL: editEntityAction:
|
|
55
|
+
if (!sidePanelController) {
|
|
56
|
+
throw new Error("INTERNAL: editEntityAction: sidePanelController is undefined");
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
highlightEntity?.(entity);
|
|
@@ -68,7 +85,7 @@ export const editEntityAction: EntityAction = {
|
|
|
68
85
|
collection,
|
|
69
86
|
entityId: entity.id,
|
|
70
87
|
path: newFullIdPath,
|
|
71
|
-
|
|
88
|
+
sidePanelController,
|
|
72
89
|
onClose: () => unhighlightEntity?.(entity),
|
|
73
90
|
navigation: context.urlController,
|
|
74
91
|
selectedTab: defaultSelectedView
|
|
@@ -88,7 +105,7 @@ export const copyEntityAction: EntityAction = {
|
|
|
88
105
|
collection,
|
|
89
106
|
context,
|
|
90
107
|
path,
|
|
91
|
-
|
|
108
|
+
sidePanelController,
|
|
92
109
|
highlightEntity,
|
|
93
110
|
unhighlightEntity,
|
|
94
111
|
openEntityMode
|
|
@@ -96,8 +113,8 @@ export const copyEntityAction: EntityAction = {
|
|
|
96
113
|
if (!entity) {
|
|
97
114
|
throw new Error("INTERNAL: copyEntityAction: Entity is undefined");
|
|
98
115
|
}
|
|
99
|
-
if (!
|
|
100
|
-
throw new Error("INTERNAL: copyEntityAction:
|
|
116
|
+
if (!sidePanelController) {
|
|
117
|
+
throw new Error("INTERNAL: copyEntityAction: sidePanelController is undefined");
|
|
101
118
|
}
|
|
102
119
|
highlightEntity?.(entity);
|
|
103
120
|
context?.analyticsController?.onAnalyticsEvent?.("copy_entity_click", {
|
|
@@ -115,7 +132,7 @@ export const copyEntityAction: EntityAction = {
|
|
|
115
132
|
entityId: entity.id,
|
|
116
133
|
path: usedPath,
|
|
117
134
|
copy: true,
|
|
118
|
-
|
|
135
|
+
sidePanelController,
|
|
119
136
|
onClose: () => unhighlightEntity?.(entity),
|
|
120
137
|
navigation: context.urlController
|
|
121
138
|
});
|
|
@@ -193,9 +210,23 @@ export function ResetPasswordActionDialog({
|
|
|
193
210
|
const { t } = useTranslation();
|
|
194
211
|
const [loading, setLoading] = useState(false);
|
|
195
212
|
const [creationResult, setCreationResult] = useState<UserCreationResult | null>(null);
|
|
213
|
+
const [mode, setMode] = useState<"email" | "manual">("email");
|
|
214
|
+
const [password, setPassword] = useState("");
|
|
215
|
+
const [confirmPassword, setConfirmPassword] = useState("");
|
|
216
|
+
const [error, setError] = useState<string | null>(null);
|
|
217
|
+
|
|
218
|
+
// Strength rules are enforced server side, and are overridable through auth
|
|
219
|
+
// hooks, so only the match is checked here; the server's message is surfaced.
|
|
220
|
+
const passwordsMatch = password === confirmPassword;
|
|
221
|
+
const canSubmit = mode === "email" || (password.length > 0 && passwordsMatch);
|
|
196
222
|
|
|
197
223
|
const handleConfirm = async () => {
|
|
224
|
+
if (mode === "manual" && !passwordsMatch) {
|
|
225
|
+
setError(t("passwords_dont_match") || "Passwords don't match");
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
198
228
|
setLoading(true);
|
|
229
|
+
setError(null);
|
|
199
230
|
try {
|
|
200
231
|
const baseUrl = client?.baseUrl || "";
|
|
201
232
|
const token = await getAuthToken?.();
|
|
@@ -204,28 +235,32 @@ export function ResetPasswordActionDialog({
|
|
|
204
235
|
headers: {
|
|
205
236
|
"Content-Type": "application/json",
|
|
206
237
|
...(token ? { "Authorization": `Bearer ${token}` } : {})
|
|
207
|
-
}
|
|
238
|
+
},
|
|
239
|
+
body: JSON.stringify(mode === "manual" ? { password } : {})
|
|
208
240
|
});
|
|
209
241
|
if (!response.ok) {
|
|
210
|
-
const
|
|
211
|
-
throw new Error(error.message || "Failed to reset password");
|
|
242
|
+
const errorBody = await response.json().catch(() => ({}));
|
|
243
|
+
throw new Error(errorBody.error?.message || errorBody.message || "Failed to reset password");
|
|
212
244
|
}
|
|
213
245
|
const data = await response.json();
|
|
214
|
-
setCreationResult({
|
|
215
|
-
user,
|
|
216
|
-
invitationSent: data.invitationSent ?? false,
|
|
217
|
-
temporaryPassword: data.temporaryPassword
|
|
218
|
-
});
|
|
219
246
|
snackbarController.open({
|
|
220
247
|
type: "success",
|
|
221
248
|
message: t("reset_password_success") || "Password reset successfully"
|
|
222
249
|
});
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
250
|
+
// Setting a password directly returns neither an invitation nor a
|
|
251
|
+
// temporary password, so there is no result to show.
|
|
252
|
+
if (data.invitationSent || data.temporaryPassword) {
|
|
253
|
+
setCreationResult({
|
|
254
|
+
user,
|
|
255
|
+
invitationSent: data.invitationSent ?? false,
|
|
256
|
+
temporaryPassword: data.temporaryPassword,
|
|
257
|
+
emailDeliveryFailed: data.emailDeliveryFailed ?? false
|
|
258
|
+
});
|
|
259
|
+
} else {
|
|
260
|
+
onClose();
|
|
261
|
+
}
|
|
262
|
+
} catch (e: unknown) {
|
|
263
|
+
setError(e instanceof Error ? e.message : (t("error_resetting_password") || "Error resetting password"));
|
|
229
264
|
} finally {
|
|
230
265
|
setLoading(false);
|
|
231
266
|
}
|
|
@@ -244,14 +279,77 @@ export function ResetPasswordActionDialog({
|
|
|
244
279
|
}
|
|
245
280
|
|
|
246
281
|
return (
|
|
247
|
-
<
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
282
|
+
<Dialog open={open} onOpenChange={(o) => !o ? onClose() : undefined} maxWidth="xl">
|
|
283
|
+
<DialogTitle variant="h5" gutterBottom={false}>
|
|
284
|
+
{t("reset_password") || "Reset Password"}
|
|
285
|
+
</DialogTitle>
|
|
286
|
+
<DialogContent>
|
|
287
|
+
<div className="flex flex-col gap-4 py-2">
|
|
288
|
+
<Typography variant="body2" color="secondary">
|
|
289
|
+
{user.email}
|
|
290
|
+
</Typography>
|
|
291
|
+
|
|
292
|
+
<RadioGroup value={mode} onValueChange={(v) => {
|
|
293
|
+
setMode(v as "email" | "manual");
|
|
294
|
+
setError(null);
|
|
295
|
+
}}>
|
|
296
|
+
<div className="flex items-center gap-2">
|
|
297
|
+
<RadioGroupItem value="email" id="reset-password-mode-email"/>
|
|
298
|
+
<Label htmlFor="reset-password-mode-email">
|
|
299
|
+
{t("reset_password_send_email") || "Send a password reset email"}
|
|
300
|
+
</Label>
|
|
301
|
+
</div>
|
|
302
|
+
<div className="flex items-center gap-2">
|
|
303
|
+
<RadioGroupItem value="manual" id="reset-password-mode-manual"/>
|
|
304
|
+
<Label htmlFor="reset-password-mode-manual">
|
|
305
|
+
{t("reset_password_set_manually") || "Set a password manually"}
|
|
306
|
+
</Label>
|
|
307
|
+
</div>
|
|
308
|
+
</RadioGroup>
|
|
309
|
+
|
|
310
|
+
{mode === "manual" && <>
|
|
311
|
+
<TextField
|
|
312
|
+
type="password"
|
|
313
|
+
value={password}
|
|
314
|
+
autoFocus
|
|
315
|
+
autoComplete="new-password"
|
|
316
|
+
label={t("new_password") || "New password"}
|
|
317
|
+
onChange={(e) => {
|
|
318
|
+
setPassword(e.target.value);
|
|
319
|
+
setError(null);
|
|
320
|
+
}}
|
|
321
|
+
/>
|
|
322
|
+
<TextField
|
|
323
|
+
type="password"
|
|
324
|
+
value={confirmPassword}
|
|
325
|
+
autoComplete="new-password"
|
|
326
|
+
error={confirmPassword.length > 0 && !passwordsMatch}
|
|
327
|
+
label={t("confirm_password") || "Confirm password"}
|
|
328
|
+
onChange={(e) => {
|
|
329
|
+
setConfirmPassword(e.target.value);
|
|
330
|
+
setError(null);
|
|
331
|
+
}}
|
|
332
|
+
/>
|
|
333
|
+
<Typography variant="caption" color="secondary">
|
|
334
|
+
{t("reset_password_set_manually_description") ||
|
|
335
|
+
"The password is updated immediately and no email is sent. Share it with the user securely."}
|
|
336
|
+
</Typography>
|
|
337
|
+
</>}
|
|
338
|
+
|
|
339
|
+
{error && <Alert color="error">
|
|
340
|
+
<Typography variant="body2">{error}</Typography>
|
|
341
|
+
</Alert>}
|
|
342
|
+
</div>
|
|
343
|
+
</DialogContent>
|
|
344
|
+
<DialogActions>
|
|
345
|
+
<Button variant="text" onClick={onClose} disabled={loading}>
|
|
346
|
+
{t("cancel")}
|
|
347
|
+
</Button>
|
|
348
|
+
<LoadingButton variant="filled" onClick={handleConfirm} loading={loading} disabled={!canSubmit}>
|
|
349
|
+
{t("reset_password") || "Reset Password"}
|
|
350
|
+
</LoadingButton>
|
|
351
|
+
</DialogActions>
|
|
352
|
+
</Dialog>
|
|
255
353
|
);
|
|
256
354
|
}
|
|
257
355
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
2
|
import type { Property } from "@rebasepro/types";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ import { PreviewSize } from "../../types/components/PropertyPreviewProps";
|
|
|
7
7
|
import { getPropertyInPath } from "../../util/property_utils";
|
|
8
8
|
import { PropertyPreview } from "../../preview/PropertyPreview";
|
|
9
9
|
import { SkeletonPropertyComponent } from "../../preview/property_previews/SkeletonPropertyComponent";
|
|
10
|
-
import { useAuthController } from "@rebasepro/
|
|
10
|
+
import { useAuthController } from "@rebasepro/app";
|
|
11
11
|
import { UserChip } from "./UserChip";
|
|
12
12
|
import { HistoryEntryData } from "../../hooks";
|
|
13
13
|
import { getValueInPath } from "@rebasepro/utils";
|
|
@@ -39,7 +39,7 @@ function deepEqual(a: unknown, b: unknown): boolean {
|
|
|
39
39
|
export type EntityHistoryEntryProps = {
|
|
40
40
|
size: PreviewSize;
|
|
41
41
|
actions?: React.ReactNode;
|
|
42
|
-
collection?:
|
|
42
|
+
collection?: CollectionConfig;
|
|
43
43
|
hover?: boolean;
|
|
44
44
|
entry: HistoryEntryData;
|
|
45
45
|
onClick?: (e: React.SyntheticEvent) => void;
|
|
@@ -4,10 +4,10 @@ import { useRef, useEffect } from "react";
|
|
|
4
4
|
import { cls, IconButton, Label, Tooltip, Typography } from "@rebasepro/ui";
|
|
5
5
|
import { ErrorBoundary, HistoryIcon } from "@rebasepro/ui";
|
|
6
6
|
import { EntityHistoryEntry } from "./EntityHistoryEntry";
|
|
7
|
-
import { useSnackbarController, useAuthController } from "@rebasepro/
|
|
8
|
-
import { ConfirmationDialog } from "@rebasepro/
|
|
7
|
+
import { useSnackbarController, useAuthController } from "@rebasepro/app";
|
|
8
|
+
import { ConfirmationDialog } from "@rebasepro/app";
|
|
9
9
|
import { useState } from "react";
|
|
10
|
-
import {
|
|
10
|
+
import { useHistory } from "../../index";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Entity history tab view. Shows a paginated list of entity revisions
|
|
@@ -32,7 +32,7 @@ export function EntityHistoryView<M extends Record<string, unknown>>({
|
|
|
32
32
|
hasMore,
|
|
33
33
|
loadMore,
|
|
34
34
|
revert
|
|
35
|
-
} =
|
|
35
|
+
} = useHistory({
|
|
36
36
|
slug,
|
|
37
37
|
entityId,
|
|
38
38
|
enabled: !!entityId,
|
|
@@ -72,7 +72,7 @@ export function EntityHistoryView<M extends Record<string, unknown>>({
|
|
|
72
72
|
|
|
73
73
|
if (!entity) {
|
|
74
74
|
return <div className="flex items-center justify-center h-full">
|
|
75
|
-
<Label>
|
|
75
|
+
<Label>History is only available for existing entities</Label>
|
|
76
76
|
</div>;
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -117,7 +117,7 @@ export function EntityHistoryView<M extends Record<string, unknown>>({
|
|
|
117
117
|
<div className="flex flex-col gap-2 max-w-6xl mx-auto w-full">
|
|
118
118
|
|
|
119
119
|
<Typography variant={"h5"} className={"mt-24 ml-4"}>
|
|
120
|
-
|
|
120
|
+
History
|
|
121
121
|
</Typography>
|
|
122
122
|
|
|
123
123
|
{isLoading && entries.length === 0 && (
|
|
@@ -136,7 +136,7 @@ export function EntityHistoryView<M extends Record<string, unknown>>({
|
|
|
136
136
|
No history available
|
|
137
137
|
</Label>
|
|
138
138
|
<Typography variant={"caption"} className={"ml-4"}>
|
|
139
|
-
When you save
|
|
139
|
+
When you save a entity, a new version is created and stored in the history.
|
|
140
140
|
</Typography>
|
|
141
141
|
</>}
|
|
142
142
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
2
|
import React, { useEffect, useState, useCallback } from "react";
|
|
3
3
|
;
|
|
4
|
-
import { useApiConfig } from "@rebasepro/
|
|
5
|
-
import { useAuthController } from "@rebasepro/
|
|
4
|
+
import { useApiConfig } from "@rebasepro/app";
|
|
5
|
+
import { useAuthController } from "@rebasepro/app";
|
|
6
6
|
import { HistoryEntryData } from "../../hooks";
|
|
7
7
|
|
|
8
8
|
function getRelativeTimeString(date: Date): string {
|
|
@@ -31,7 +31,7 @@ export function LastEditedByIndicator({
|
|
|
31
31
|
}: {
|
|
32
32
|
path: string;
|
|
33
33
|
entityId: string;
|
|
34
|
-
collection:
|
|
34
|
+
collection: CollectionConfig;
|
|
35
35
|
}) {
|
|
36
36
|
const apiConfig = useApiConfig();
|
|
37
37
|
const authController = useAuthController();
|
package/src/components/index.ts
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export {
|
|
1
|
+
export type { EntityViewBindingProps } from "./EntityViewBinding";
|
|
2
|
+
export { EntityViewBinding } from "./EntityViewBinding";
|
|
3
3
|
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./DetailViewBinding";
|
|
5
5
|
|
|
6
|
-
export type {
|
|
7
|
-
export {
|
|
6
|
+
export type { SelectionProps } from "./ReferenceTable/SelectionTableBinding";
|
|
7
|
+
export { SelectionTableBinding } from "./ReferenceTable/SelectionTableBinding";
|
|
8
8
|
|
|
9
9
|
export * from "./SelectableTable/SelectableTable";
|
|
10
10
|
export * from "./SelectableTable/SelectableTableContext";
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./
|
|
11
|
+
export * from "./SelectableTable/filters/FilterFieldBinding";
|
|
12
|
+
export * from "./CollectionViewBinding/CollectionViewBinding";
|
|
13
|
+
export * from "./CollectionViewBinding/CollectionViewActions";
|
|
14
|
+
export * from "./CollectionViewBinding/CollectionCardViewBinding";
|
|
15
|
+
export * from "./CollectionViewBinding/EntityCardBinding";
|
|
16
|
+
export * from "./CollectionViewBinding/useSelectionController";
|
|
16
17
|
|
|
17
18
|
export * from "./PropertyConfigBadge";
|
|
18
19
|
export * from "./PropertyIdCopyTooltip";
|
|
19
20
|
|
|
20
|
-
export * from "./
|
|
21
|
+
export * from "./CollectionTableBinding";
|
|
21
22
|
// VirtualTable is exported from @rebasepro/ui
|
|
22
23
|
export * from "./ArrayContainer";
|
|
23
24
|
export * from "./ReferenceWidget";
|
|
24
25
|
export * from "./SearchIconsView";
|
|
25
26
|
export * from "./FieldCaption";
|
|
26
|
-
export * from "./
|
|
27
|
+
export * from "./EntityPreviewBinding";
|
|
27
28
|
|
|
28
|
-
// history is lazy-loaded by
|
|
29
|
+
// history is lazy-loaded by EditViewBinding and resolutions.ts
|
|
29
30
|
// export * from "./history";
|
|
30
31
|
export * from "./common";
|
|
31
32
|
export * from "./field_configs";
|
|
32
33
|
|
|
33
|
-
export * from "./
|
|
34
|
+
export * from "./SidePanelProvider";
|
|
34
35
|
export * from "./AdminModeSyncer";
|
|
35
36
|
// Admin views: only CreationResultDialog remains (used by resetPasswordAction)
|
|
36
37
|
export * from "./app/AppBar";
|
|
@@ -45,7 +46,7 @@ export * from "./DrawerNavigationGroup";
|
|
|
45
46
|
export * from "./SideDialogs";
|
|
46
47
|
|
|
47
48
|
export * from "./app/useApp";
|
|
48
|
-
export * from "./
|
|
49
|
+
export * from "./RebaseAdmin";
|
|
49
50
|
export * from "./RebaseShell";
|
|
50
51
|
|
|
51
52
|
// Composable shell layers — each independently usable
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
useCustomizationController,
|
|
7
7
|
useData,
|
|
8
8
|
useTranslation
|
|
9
|
-
} from "@rebasepro/
|
|
9
|
+
} from "@rebasepro/app";
|
|
10
10
|
import { useCMSContext } from "../../hooks";
|
|
11
|
-
import { CollectionActionsProps, Entity,
|
|
11
|
+
import { CollectionActionsProps, Entity, CollectionConfig, ExportConfig, RebaseContext, User } from "@rebasepro/types";
|
|
12
12
|
import { getDefaultValuesFor } from "@rebasepro/common";
|
|
13
13
|
import {
|
|
14
14
|
Alert,
|
|
@@ -38,8 +38,8 @@ export function ExportCollectionAction<M extends Record<string, unknown>, USER e
|
|
|
38
38
|
onAnalyticsEvent,
|
|
39
39
|
exportAllowed,
|
|
40
40
|
notAllowedView
|
|
41
|
-
}: CollectionActionsProps<M, USER,
|
|
42
|
-
exportAllowed?: (props: { collectionEntitiesCount: number, path: string, collection:
|
|
41
|
+
}: CollectionActionsProps<M, USER, CollectionConfig<M>> & {
|
|
42
|
+
exportAllowed?: (props: { collectionEntitiesCount: number, path: string, collection: CollectionConfig }) => boolean;
|
|
43
43
|
notAllowedView?: React.ReactNode;
|
|
44
44
|
onAnalyticsEvent?: (event: string, params?: any) => void;
|
|
45
45
|
}) {
|
|
@@ -115,7 +115,7 @@ export function ExportCollectionAction<M extends Record<string, unknown>, USER e
|
|
|
115
115
|
return [...resolvedExportColumnsValues, ...resolvedColumnsValues];
|
|
116
116
|
}, [exportConfig?.additionalFields]);
|
|
117
117
|
|
|
118
|
-
const doDownload = useCallback(async (collection:
|
|
118
|
+
const doDownload = useCallback(async (collection: CollectionConfig<M>,
|
|
119
119
|
exportConfig: ExportConfig<any> | undefined) => {
|
|
120
120
|
|
|
121
121
|
onAnalyticsEvent?.("export_collection", {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
TextField,
|
|
17
17
|
Typography
|
|
18
18
|
} from "@rebasepro/ui";
|
|
19
|
-
import { getIn, setIn } from "@rebasepro/
|
|
19
|
+
import { getIn, setIn } from "@rebasepro/forms";
|
|
20
20
|
import { ImportConfig } from "../types";
|
|
21
21
|
|
|
22
22
|
export interface DataPropertyMappingProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileUpload, UploadIcon } from "@rebasepro/ui";
|
|
2
2
|
import { convertFileToJson } from "../utils/file_to_json";
|
|
3
|
-
import { useSnackbarController } from "@rebasepro/
|
|
3
|
+
import { useSnackbarController } from "@rebasepro/app";
|
|
4
4
|
|
|
5
5
|
export function ImportFileUpload({ onDataAdded }: {
|
|
6
6
|
onDataAdded: (data: object[], propertiesOrder?: string[]) => void
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useData } from "@rebasepro/
|
|
2
|
-
import { Entity,
|
|
1
|
+
import { useData } from "@rebasepro/app";
|
|
2
|
+
import { Entity, CollectionConfig } from "@rebasepro/types";
|
|
3
3
|
import { RebaseData } from "@rebasepro/types";
|
|
4
4
|
import { Button, CenteredView, CircularProgress, Typography } from "@rebasepro/ui";
|
|
5
5
|
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { ImportConfig } from "../types";
|
|
7
7
|
|
|
8
|
-
export function ImportSaveInProgress<C extends
|
|
8
|
+
export function ImportSaveInProgress<C extends CollectionConfig<any>>
|
|
9
9
|
({
|
|
10
10
|
path,
|
|
11
11
|
importConfig,
|
|
@@ -95,7 +95,7 @@ export function ImportSaveInProgress<C extends EntityCollection<any>>
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
function saveDataBatch(dataClient: RebaseData,
|
|
98
|
-
collection:
|
|
98
|
+
collection: CollectionConfig,
|
|
99
99
|
path: string,
|
|
100
100
|
data: Partial<Entity<any>>[],
|
|
101
101
|
offset = 0,
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
useAuthController,
|
|
4
4
|
useCustomizationController,
|
|
5
5
|
useSnackbarController
|
|
6
|
-
} from "@rebasepro/
|
|
6
|
+
} from "@rebasepro/app";
|
|
7
7
|
import { getPropertiesWithPropertiesOrder, getPropertyInPath } from "../../util";
|
|
8
|
-
import { CollectionActionsProps, Properties, Property, User,
|
|
8
|
+
import { CollectionActionsProps, Properties, Property, User, CollectionConfig } from "@rebasepro/types";
|
|
9
9
|
import {
|
|
10
10
|
getFieldConfig,
|
|
11
11
|
PropertyConfigBadge,
|
|
12
12
|
useSelectionController
|
|
13
13
|
} from "../../components";
|
|
14
|
-
import {
|
|
14
|
+
import { CollectionTableBinding } from "../../components/CollectionTableBinding/CollectionTableBinding";
|
|
15
15
|
import { useCollectionRegistryController } from "../../hooks";
|
|
16
16
|
import {
|
|
17
17
|
Button,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
Typography,
|
|
30
30
|
UploadIcon
|
|
31
31
|
} from "@rebasepro/ui";
|
|
32
|
-
import { buildEntityPropertiesFromData } from "@rebasepro/
|
|
32
|
+
import { buildEntityPropertiesFromData } from "@rebasepro/inference";
|
|
33
33
|
import { useImportConfig } from "../hooks";
|
|
34
34
|
import { convertDataToEntity, getInferenceType } from "../utils";
|
|
35
35
|
import { DataNewPropertiesMapping, ImportFileUpload, ImportSaveInProgress } from "../components";
|
|
@@ -176,7 +176,7 @@ export function ImportCollectionAction<M extends Record<string, unknown>, USER e
|
|
|
176
176
|
|
|
177
177
|
{step === "import_data_saving" && importConfig &&
|
|
178
178
|
<ImportSaveInProgress importConfig={importConfig}
|
|
179
|
-
collection={collection as
|
|
179
|
+
collection={collection as CollectionConfig}
|
|
180
180
|
path={path}
|
|
181
181
|
onImportSuccess={(importedCollection) => {
|
|
182
182
|
handleClose();
|
|
@@ -396,7 +396,7 @@ export function ImportDataPreview<M extends Record<string, unknown>>({
|
|
|
396
396
|
|
|
397
397
|
const selectionController = useSelectionController();
|
|
398
398
|
|
|
399
|
-
return <
|
|
399
|
+
return <CollectionTableBinding
|
|
400
400
|
title={<div>
|
|
401
401
|
<Typography variant={"subtitle2"}>Imported data preview</Typography>
|
|
402
402
|
<Typography variant={"caption"}>Entities with the same id will be overwritten</Typography>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getPropertyInPath } from "../../util";
|
|
2
|
-
import { AuthController, Entity,
|
|
2
|
+
import { AuthController, Entity, CollectionConfig, EntityReference, CollectionRegistryController, Properties, Property, Vector } from "@rebasepro/types";
|
|
3
3
|
import { isPropertyBuilder } from "@rebasepro/common";
|
|
4
4
|
import { unflattenObject } from "./file_to_json";
|
|
5
|
-
import { getIn } from "@rebasepro/
|
|
6
|
-
import { inferTypeFromValue } from "@rebasepro/
|
|
5
|
+
import { getIn } from "@rebasepro/forms";
|
|
6
|
+
import { inferTypeFromValue } from "@rebasepro/inference";
|
|
7
7
|
import { mergeDeep } from "@rebasepro/utils";
|
|
8
8
|
|
|
9
9
|
export function convertDataToEntity(authController: AuthController,
|
|
@@ -148,7 +148,7 @@ export function processValueMapping(authController: AuthController, value: any,
|
|
|
148
148
|
|
|
149
149
|
// If no explicit database was provided in the string, try to get it from the collection
|
|
150
150
|
if (databaseId === undefined) {
|
|
151
|
-
const targetCollection:
|
|
151
|
+
const targetCollection: CollectionConfig<any> | undefined = navigation.getCollection(path);
|
|
152
152
|
databaseId = targetCollection?.databaseId;
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -3,7 +3,7 @@ import { useProseMirrorContext } from "../hooks/useProseMirrorContext";
|
|
|
3
3
|
import { autoUpdate, computePosition, flip, offset, shift, type VirtualElement, type Placement } from "@floating-ui/dom";
|
|
4
4
|
import { NodeSelection } from "prosemirror-state";
|
|
5
5
|
import { TextField, defaultBorderMixin, Typography, cls } from "@rebasepro/ui";
|
|
6
|
-
import { useTranslation } from "@rebasepro/
|
|
6
|
+
import { useTranslation } from "@rebasepro/app";
|
|
7
7
|
|
|
8
8
|
export interface ImageBubbleProps {
|
|
9
9
|
options?: { placement?: Placement; offset?: number };
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type Placement
|
|
11
11
|
} from "@floating-ui/dom";
|
|
12
12
|
import { IconButton, Tooltip, defaultBorderMixin, cls } from "@rebasepro/ui";
|
|
13
|
-
import { useTranslation } from "@rebasepro/
|
|
13
|
+
import { useTranslation } from "@rebasepro/app";
|
|
14
14
|
import {
|
|
15
15
|
addColumnBefore,
|
|
16
16
|
addColumnAfter,
|
package/src/editor/editor.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useEffect, useState, useRef, useMemo } from "react";
|
|
3
3
|
import { EditorState, Selection } from "prosemirror-state";
|
|
4
4
|
import { cls, defaultBorderMixin, Separator, TextareaAutosize, useInjectStyles } from "@rebasepro/ui";
|
|
5
|
-
import { useTranslation } from "@rebasepro/
|
|
5
|
+
import { useTranslation } from "@rebasepro/app";
|
|
6
6
|
import { EditorBubble, ImageBubble, SlashCommandMenu, TableBubble, type JSONContent } from "./components";
|
|
7
7
|
import { NodeSelector } from "./selectors/node-selector";
|
|
8
8
|
import { LinkSelector } from "./selectors/link-selector";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from "react";
|
|
2
2
|
import { Button, CheckIcon, cls, focusedDisabled, iconSize, Popover, TextField, Trash2Icon } from "@rebasepro/ui";
|
|
3
|
-
import { useTranslation } from "@rebasepro/
|
|
3
|
+
import { useTranslation } from "@rebasepro/app";
|
|
4
4
|
import { useProseMirrorContext } from "../hooks/useProseMirrorContext";
|
|
5
5
|
import { getMarkAttributes, isMarkActive, setMark, unsetMark } from "../utils/prosemirror-utils";
|
|
6
6
|
import { schema } from "../schema";
|