0fa2a4524a
## Summary This PR replaces the Active/Inactive accordion sections with a modern filter dropdown button and enables full access to system objects in advanced mode. ## Changes ### UI Improvements - ✅ Replaced accordion sections with a filter button dropdown (matching the design pattern from the Group filter) - ✅ Added 'Deactivated' toggle filter (hidden by default, uses IconArchive) - ✅ Added 'System objects' toggle filter (only visible in advanced mode, uses IconSettings) - ✅ Fixed search input width to properly fill available space - ✅ Proper button sizing and alignment ### System Objects Support - ✅ Made system objects visible when 'System objects' filter is toggled on - ✅ System objects are now fully clickable and accessible - ✅ Updated object detail page to support system objects - ✅ Updated field creation/edit pages to support system objects - ✅ System objects can now have custom fields added ### Architecture - ✅ Implemented scalable filter architecture using a single filtered list - ✅ Easy to add more filters in the future (e.g., show remote objects) - ✅ All filters work independently and can be combined ## Testing - [x] Tested deactivated objects toggle - [x] Tested system objects toggle (only shows in advanced mode) - [x] Tested clicking on system objects - [x] Tested adding custom fields to system objects - [x] No linter errors ## Screenshots See attached screenshots in the conversation for the new filter UI. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a filter dropdown to the Settings Objects table (incl. deactivated/system toggles), enables system objects across settings/field flows, seeds core views (workspace members, messages, threads, calendar events), and adds actions for Workspace Members. > > - **Settings UI** > - **Objects Table**: Replaces Active/Inactive sections with a single filterable list and dropdown (`Deactivated`, `System objects` in advanced mode); updates props to `objectMetadataItems` and removes accordion sections. > - **Search/UX**: Search input fills available space; inactive rows show activation/delete menu; active rows remain navigable. > - **Pages Updated**: `SettingsObjects`, `SettingsApplicationDetailContentTab` switch to new table API; object detail and new-field flows use `findObjectMetadataItemByNamePlural` (works with system objects). > - **Action Menu** > - **Workspace Members**: Adds `WORKSPACE_MEMBERS_ACTIONS_CONFIG` with "Manage members in settings" action; wired into `getActionConfig` for `WorkspaceMember`. > - **Server (Core Views Seed)** > - Adds default views: `workspaceMembersAllView`, `messagesAllView`, `messageThreadsAllView`, `calendarEventsAllView`; included in `prefillCoreViews`. > - Marks workflow entities as system (`WorkflowRun`, `WorkflowVersion`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6a2856df85104665bd986cc63f2d54f19bf668d0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
59 lines
2.0 KiB
TypeScript
59 lines
2.0 KiB
TypeScript
import { useParams } from 'react-router-dom';
|
|
|
|
import { useWorkspaceFavorites } from '@/favorites/hooks/useWorkspaceFavorites';
|
|
import { NavigationDrawerSectionForObjectMetadataItems } from '@/object-metadata/components/NavigationDrawerSectionForObjectMetadataItems';
|
|
import { NavigationDrawerSectionForObjectMetadataItemsSkeletonLoader } from '@/object-metadata/components/NavigationDrawerSectionForObjectMetadataItemsSkeletonLoader';
|
|
import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';
|
|
import { useIsPrefetchLoading } from '@/prefetch/hooks/useIsPrefetchLoading';
|
|
import { useLingui } from '@lingui/react/macro';
|
|
|
|
export const NavigationDrawerOpenedSection = () => {
|
|
const { t } = useLingui();
|
|
|
|
const { activeObjectMetadataItems } = useFilteredObjectMetadataItems();
|
|
const filteredActiveNonSystemObjectMetadataItems =
|
|
activeObjectMetadataItems.filter((item) => !item.isRemote);
|
|
|
|
const loading = useIsPrefetchLoading();
|
|
|
|
const { workspaceFavoritesObjectMetadataItems } = useWorkspaceFavorites();
|
|
|
|
const {
|
|
objectNamePlural: currentObjectNamePlural,
|
|
objectNameSingular: currentObjectNameSingular,
|
|
} = useParams();
|
|
|
|
if (!currentObjectNamePlural && !currentObjectNameSingular) {
|
|
return;
|
|
}
|
|
|
|
const objectMetadataItem = filteredActiveNonSystemObjectMetadataItems.find(
|
|
(item) =>
|
|
item.namePlural === currentObjectNamePlural ||
|
|
item.nameSingular === currentObjectNameSingular,
|
|
);
|
|
|
|
if (!objectMetadataItem) {
|
|
return;
|
|
}
|
|
|
|
const shouldDisplayObjectInOpenedSection =
|
|
!workspaceFavoritesObjectMetadataItems
|
|
.map((item) => item.id)
|
|
.includes(objectMetadataItem.id);
|
|
|
|
if (loading) {
|
|
return <NavigationDrawerSectionForObjectMetadataItemsSkeletonLoader />;
|
|
}
|
|
|
|
return (
|
|
shouldDisplayObjectInOpenedSection && (
|
|
<NavigationDrawerSectionForObjectMetadataItems
|
|
sectionTitle={t`Opened`}
|
|
objectMetadataItems={[objectMetadataItem]}
|
|
isRemote={false}
|
|
/>
|
|
)
|
|
);
|
|
};
|