Open Bonapara opened 1 week ago
To implement tab navigation on the Object detail page, follow these steps:
import { TabNavigation } from '@/ui/navigation/tab-navigation/components/TabNavigation';
SettingsObjectDetail.tsx
: Replace the current layout with the tab navigation component.export const SettingsObjectDetail = () => {
const navigate = useNavigate();
const { objectSlug = '' } = useParams();
const { findActiveObjectMetadataItemBySlug } = useFilteredObjectMetadataItems();
const activeObjectMetadataItem = findActiveObjectMetadataItemBySlug(objectSlug);
useEffect(() => {
if (!activeObjectMetadataItem) navigate(AppPath.NotFound);
}, [activeObjectMetadataItem, navigate]);
if (!activeObjectMetadataItem) return null;
return (
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
<SettingsPageContainer>
<Breadcrumb
links={[
{ children: 'Objects', href: '/settings/objects' },
{ children: activeObjectMetadataItem.labelPlural },
]}
/>
<TabNavigation
tabs={[
{ label: 'Fields', path: `/settings/objects/${objectSlug}/fields` },
{ label: 'Settings', path: `/settings/objects/${objectSlug}/settings` },
]}
/>
<Outlet />
</SettingsPageContainer>
</SubMenuTopBarContainer>
);
};
<Route path="/settings/objects/:objectSlug/fields" element={<FieldsComponent />} />
<Route path="/settings/objects/:objectSlug/settings" element={<SettingsComponent />} />
FieldsComponent
and SettingsComponent
: Implement these components to render the respective content for each tab.This will introduce tab navigation on the Object detail page, improving the user experience.
/packages/twenty-front/src/pages/settings/data-model/SettingsObjectDetail.tsx /packages/twenty-front/src/pages/settings/data-model/SettingsObjectEdit.tsx /packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1.tsx /packages/twenty-front/src/pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep2.tsx
Current Behavior
To access an object's settings, you have to click on the three-dot menu in the right part of the object name banner. This is cluttered and unclear. We want to improve this display.
Desired Behavior
We want to introduce tab navigation on the Object detail page. We should use the same component that we started using for the "Email and Calendar" advanced settings. The first tab should be "Fields" and the second tab should be "Settings."