feat: add Object Detail page (#1917)
* feat: add Object Detail page Closes #1813 * refactor: add object settings width constant
This commit is contained in:
@ -18,6 +18,7 @@ import { Opportunities } from '~/pages/opportunities/Opportunities';
|
|||||||
import { People } from '~/pages/people/People';
|
import { People } from '~/pages/people/People';
|
||||||
import { PersonShow } from '~/pages/people/PersonShow';
|
import { PersonShow } from '~/pages/people/PersonShow';
|
||||||
import { SettingsExperience } from '~/pages/settings/SettingsExperience';
|
import { SettingsExperience } from '~/pages/settings/SettingsExperience';
|
||||||
|
import { SettingsObjectDetail } from '~/pages/settings/SettingsObjectDetail';
|
||||||
import { SettingsObjects } from '~/pages/settings/SettingsObjects';
|
import { SettingsObjects } from '~/pages/settings/SettingsObjects';
|
||||||
import { SettingsProfile } from '~/pages/settings/SettingsProfile';
|
import { SettingsProfile } from '~/pages/settings/SettingsProfile';
|
||||||
import { SettingsWorkspace } from '~/pages/settings/SettingsWorkspace';
|
import { SettingsWorkspace } from '~/pages/settings/SettingsWorkspace';
|
||||||
@ -75,6 +76,10 @@ export const App = () => {
|
|||||||
path={SettingsPath.Objects}
|
path={SettingsPath.Objects}
|
||||||
element={<SettingsObjects />}
|
element={<SettingsObjects />}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
path={SettingsPath.ObjectDetail}
|
||||||
|
element={<SettingsObjectDetail />}
|
||||||
|
/>
|
||||||
</Routes>
|
</Routes>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -2,6 +2,7 @@ export enum SettingsPath {
|
|||||||
ProfilePage = 'profile',
|
ProfilePage = 'profile',
|
||||||
Experience = 'profile/experience',
|
Experience = 'profile/experience',
|
||||||
Objects = 'objects',
|
Objects = 'objects',
|
||||||
|
ObjectDetail = 'objects/:pluralObjectName',
|
||||||
WorkspaceMembersPage = 'workspace-members',
|
WorkspaceMembersPage = 'workspace-members',
|
||||||
Workspace = 'workspace',
|
Workspace = 'workspace',
|
||||||
}
|
}
|
||||||
|
|||||||
17
front/src/pages/settings/SettingsObjectDetail.tsx
Normal file
17
front/src/pages/settings/SettingsObjectDetail.tsx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
|
import { IconSettings } from '@/ui/icon';
|
||||||
|
import { SubMenuTopBarContainer } from '@/ui/layout/components/SubMenuTopBarContainer';
|
||||||
|
|
||||||
|
import { objectSettingsWidth } from './constants/objectSettings';
|
||||||
|
|
||||||
|
const StyledContainer = styled.div`
|
||||||
|
padding: ${({ theme }) => theme.spacing(8)};
|
||||||
|
width: ${objectSettingsWidth};
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const SettingsObjectDetail = () => (
|
||||||
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
|
<StyledContainer />
|
||||||
|
</SubMenuTopBarContainer>
|
||||||
|
);
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { useTheme } from '@emotion/react';
|
import { useTheme } from '@emotion/react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
@ -20,9 +21,11 @@ import { Tag } from '@/ui/tag/components/Tag';
|
|||||||
import { H1Title } from '@/ui/typography/components/H1Title';
|
import { H1Title } from '@/ui/typography/components/H1Title';
|
||||||
import { H2Title } from '@/ui/typography/components/H2Title';
|
import { H2Title } from '@/ui/typography/components/H2Title';
|
||||||
|
|
||||||
|
import { objectSettingsWidth } from './constants/objectSettings';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledContainer = styled.div`
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
padding: ${({ theme }) => theme.spacing(8)};
|
||||||
width: 512px;
|
width: ${objectSettingsWidth};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledTableRow = styled(TableRow)`
|
const StyledTableRow = styled(TableRow)`
|
||||||
@ -88,6 +91,7 @@ const disabledObjectItems = [
|
|||||||
|
|
||||||
export const SettingsObjects = () => {
|
export const SettingsObjects = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
@ -104,7 +108,12 @@ export const SettingsObjects = () => {
|
|||||||
</StyledTableRow>
|
</StyledTableRow>
|
||||||
<TableSection title="Active">
|
<TableSection title="Active">
|
||||||
{activeObjectItems.map((objectItem) => (
|
{activeObjectItems.map((objectItem) => (
|
||||||
<StyledTableRow key={objectItem.name} onClick={() => undefined}>
|
<StyledTableRow
|
||||||
|
key={objectItem.name}
|
||||||
|
onClick={() =>
|
||||||
|
navigate(`/settings/objects/${objectItem.name.toLowerCase()}`)
|
||||||
|
}
|
||||||
|
>
|
||||||
<StyledNameTableCell>
|
<StyledNameTableCell>
|
||||||
<objectItem.Icon size={theme.icon.size.md} />
|
<objectItem.Icon size={theme.icon.size.md} />
|
||||||
{objectItem.name}
|
{objectItem.name}
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
PageDecorator,
|
||||||
|
PageDecoratorArgs,
|
||||||
|
} from '~/testing/decorators/PageDecorator';
|
||||||
|
import { graphqlMocks } from '~/testing/graphqlMocks';
|
||||||
|
|
||||||
|
import { SettingsObjectDetail } from '../SettingsObjectDetail';
|
||||||
|
|
||||||
|
const meta: Meta<PageDecoratorArgs> = {
|
||||||
|
title: 'Pages/Settings/SettingsObjectDetail',
|
||||||
|
component: SettingsObjectDetail,
|
||||||
|
decorators: [PageDecorator],
|
||||||
|
args: { routePath: '/settings/objects/companies' },
|
||||||
|
parameters: {
|
||||||
|
docs: { story: 'inline', iframeHeight: '500px' },
|
||||||
|
msw: graphqlMocks,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
|
||||||
|
export type Story = StoryObj<typeof SettingsObjectDetail>;
|
||||||
|
|
||||||
|
export const Default: Story = {};
|
||||||
1
front/src/pages/settings/constants/objectSettings.ts
Normal file
1
front/src/pages/settings/constants/objectSettings.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const objectSettingsWidth = '512px';
|
||||||
Reference in New Issue
Block a user