Add system view fallback (#18536)
## Context The goal is to add a "See records" button in all objects that would redirect to that view (this will be done in a later PR). See screenshot below. <img width="665" height="312" alt="Screenshot 2026-03-10 at 15 54 36" src="https://github.com/user-attachments/assets/6e23a75b-cff0-4d93-bce8-b5481b05c6f6" /> ## Implementation - If a view does not exist on an object, there is a **temporary** fallback where the frontend creates the missing view as a custom view when going over the object index page - System objects are now surfaced but we don't want their records to be editable, they will be readonly (mostly, all fields will be non-editable except for their custom fields). - We can't create a new record of a system object, some actions are also hidden. - The backend now rejects if you are trying to delete the last view of an object
This commit is contained in:
+11
-4
@@ -116,8 +116,13 @@ export const DEFAULT_RECORD_COMMAND_MENU_ITEMS_CONFIG: Record<
|
||||
position: 2,
|
||||
isPinned: true,
|
||||
Icon: IconPlus,
|
||||
shouldBeRegistered: ({ objectPermissions, hasAnySoftDeleteFilterOnView }) =>
|
||||
(objectPermissions.canUpdateObjectRecords &&
|
||||
shouldBeRegistered: ({
|
||||
objectMetadataItem,
|
||||
objectPermissions,
|
||||
hasAnySoftDeleteFilterOnView,
|
||||
}) =>
|
||||
(!objectMetadataItem?.isSystem &&
|
||||
objectPermissions.canUpdateObjectRecords &&
|
||||
!hasAnySoftDeleteFilterOnView) ??
|
||||
false,
|
||||
availableOn: [CommandMenuItemViewType.INDEX_PAGE_NO_SELECTION],
|
||||
@@ -440,8 +445,10 @@ export const DEFAULT_RECORD_COMMAND_MENU_ITEMS_CONFIG: Record<
|
||||
Icon: IconFileImport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
shouldBeRegistered: ({ hasAnySoftDeleteFilterOnView }) =>
|
||||
!hasAnySoftDeleteFilterOnView,
|
||||
shouldBeRegistered: ({
|
||||
objectMetadataItem,
|
||||
hasAnySoftDeleteFilterOnView,
|
||||
}) => !objectMetadataItem?.isSystem && !hasAnySoftDeleteFilterOnView,
|
||||
availableOn: [CommandMenuItemViewType.INDEX_PAGE_NO_SELECTION],
|
||||
component: <ImportRecordsNoSelectionRecordCommand />,
|
||||
requiredPermissionFlag: PermissionFlagType.IMPORT_CSV,
|
||||
|
||||
Reference in New Issue
Block a user