1997 new object field step 1 create page (#2054)
* add ObjectNewField page * add story * refactored to include step1 * replaced step1 by step-1 and fix onCLick behavior * refactor stories * refactoring in progress * refactor SettingsPageContainer * refactor SettingsPageContainer
This commit is contained in:
@ -29,6 +29,7 @@ import { Tasks } from '~/pages/tasks/Tasks';
|
|||||||
import { getPageTitleFromPath } from '~/utils/title-utils';
|
import { getPageTitleFromPath } from '~/utils/title-utils';
|
||||||
|
|
||||||
import { ObjectTablePage } from './pages/companies/ObjectsTable';
|
import { ObjectTablePage } from './pages/companies/ObjectsTable';
|
||||||
|
import { SettingsObjectNewFieldStep1 } from './pages/settings/data-model/SettingsObjectNewField/SettingsObjectNewFieldStep1';
|
||||||
|
|
||||||
export const App = () => {
|
export const App = () => {
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
@ -102,6 +103,10 @@ export const App = () => {
|
|||||||
path={SettingsPath.NewObject}
|
path={SettingsPath.NewObject}
|
||||||
element={<SettingsNewObject />}
|
element={<SettingsNewObject />}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
path={SettingsPath.ObjectNewFieldStep1}
|
||||||
|
element={<SettingsObjectNewFieldStep1 />}
|
||||||
|
/>
|
||||||
</Routes>
|
</Routes>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
|
import { objectSettingsWidth } from '../data-model/constants/objectSettings';
|
||||||
|
|
||||||
|
const StyledSettingsPageContainer = styled.div<{ width?: number }>`
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: ${({ theme }) => theme.spacing(8)};
|
||||||
|
padding: ${({ theme }) => theme.spacing(8)};
|
||||||
|
width: ${({ width }) => (width ? width + 'px' : objectSettingsWidth)};
|
||||||
|
`;
|
||||||
|
|
||||||
|
export { StyledSettingsPageContainer as SettingsPageContainer };
|
||||||
@ -4,6 +4,7 @@ export enum SettingsPath {
|
|||||||
Objects = 'objects',
|
Objects = 'objects',
|
||||||
ObjectDetail = 'objects/:pluralObjectName',
|
ObjectDetail = 'objects/:pluralObjectName',
|
||||||
ObjectEdit = 'objects/:pluralObjectName/edit',
|
ObjectEdit = 'objects/:pluralObjectName/edit',
|
||||||
|
ObjectNewFieldStep1 = 'objects/:pluralObjectName/new-field/step-1',
|
||||||
NewObject = 'objects/new',
|
NewObject = 'objects/new',
|
||||||
WorkspaceMembersPage = 'workspace-members',
|
WorkspaceMembersPage = 'workspace-members',
|
||||||
Workspace = 'workspace',
|
Workspace = 'workspace',
|
||||||
|
|||||||
@ -25,8 +25,6 @@ const StyledSection = styled.div<{
|
|||||||
fontColor: SectionFontColor;
|
fontColor: SectionFontColor;
|
||||||
}>`
|
}>`
|
||||||
color: ${({ theme, fontColor }) => theme.font.color[fontColor]};
|
color: ${({ theme, fontColor }) => theme.font.color[fontColor]};
|
||||||
margin-bottom: ${({ theme }) => theme.spacing(4)};
|
|
||||||
margin-top: ${({ theme }) => theme.spacing(4)};
|
|
||||||
text-align: ${({ alignment }) => alignment};
|
text-align: ${({ alignment }) => alignment};
|
||||||
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
|
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
|
||||||
`;
|
`;
|
||||||
|
|||||||
@ -19,7 +19,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.CreateProfile },
|
args: { routePath: AppPath.CreateProfile },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: [
|
msw: [
|
||||||
graphql.query(
|
graphql.query(
|
||||||
getOperationName(GET_CURRENT_USER) ?? '',
|
getOperationName(GET_CURRENT_USER) ?? '',
|
||||||
|
|||||||
@ -19,7 +19,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.CreateWorkspace },
|
args: { routePath: AppPath.CreateWorkspace },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: [
|
msw: [
|
||||||
graphql.query(
|
graphql.query(
|
||||||
getOperationName(GET_CURRENT_USER) ?? '',
|
getOperationName(GET_CURRENT_USER) ?? '',
|
||||||
|
|||||||
@ -16,7 +16,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.SignIn },
|
args: { routePath: AppPath.SignIn },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
cookie: {
|
cookie: {
|
||||||
tokenPair: '{}',
|
tokenPair: '{}',
|
||||||
|
|||||||
@ -20,7 +20,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.CompaniesPage },
|
args: { routePath: AppPath.CompaniesPage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -21,7 +21,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.CompaniesPage },
|
args: { routePath: AppPath.CompaniesPage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,7 +19,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.CompaniesPage },
|
args: { routePath: AppPath.CompaniesPage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,7 +15,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.CompaniesPage },
|
args: { routePath: AppPath.CompaniesPage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,7 +29,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
routeParams: { ':companyId': mockedCompaniesData[0].id },
|
routeParams: { ':companyId': mockedCompaniesData[0].id },
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: [
|
msw: [
|
||||||
...graphqlMocks,
|
...graphqlMocks,
|
||||||
graphql.query(
|
graphql.query(
|
||||||
|
|||||||
@ -14,7 +14,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
routePath: 'toto-not-found',
|
routePath: 'toto-not-found',
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -16,7 +16,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.OpportunitiesPage },
|
args: { routePath: AppPath.OpportunitiesPage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -20,7 +20,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.PeoplePage },
|
args: { routePath: AppPath.PeoplePage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -21,7 +21,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.PeoplePage },
|
args: { routePath: AppPath.PeoplePage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,7 +28,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.PeoplePage },
|
args: { routePath: AppPath.PeoplePage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -20,7 +20,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.PeoplePage },
|
args: { routePath: AppPath.PeoplePage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,7 +15,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.PeoplePage },
|
args: { routePath: AppPath.PeoplePage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,7 +19,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
routeParams: { ':personId': mockedPeopleData[0].id },
|
routeParams: { ':personId': mockedPeopleData[0].id },
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import { IconSettings } from '@/ui/display/icon';
|
import { IconSettings } from '@/ui/display/icon';
|
||||||
import { H1Title } from '@/ui/display/typography/components/H1Title';
|
import { H1Title } from '@/ui/display/typography/components/H1Title';
|
||||||
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
||||||
@ -8,12 +9,8 @@ import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer'
|
|||||||
import { Section } from '@/ui/layout/section/components/Section';
|
import { Section } from '@/ui/layout/section/components/Section';
|
||||||
import { useColorScheme } from '@/ui/theme/hooks/useColorScheme';
|
import { useColorScheme } from '@/ui/theme/hooks/useColorScheme';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledH1Title = styled(H1Title)`
|
||||||
display: flex;
|
margin-bottom: 0;
|
||||||
flex-direction: column;
|
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
|
||||||
padding-bottom: ${({ theme }) => theme.spacing(10)};
|
|
||||||
width: 350px;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const SettingsExperience = () => {
|
export const SettingsExperience = () => {
|
||||||
@ -21,13 +18,13 @@ export const SettingsExperience = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<StyledContainer>
|
<SettingsPageContainer width={350}>
|
||||||
<H1Title title="Experience" />
|
<StyledH1Title title="Experience" />
|
||||||
<Section>
|
<Section>
|
||||||
<H2Title title="Appearance" />
|
<H2Title title="Appearance" />
|
||||||
<ColorSchemePicker value={colorScheme} onChange={setColorScheme} />
|
<ColorSchemePicker value={colorScheme} onChange={setColorScheme} />
|
||||||
</Section>
|
</Section>
|
||||||
</StyledContainer>
|
</SettingsPageContainer>
|
||||||
</SubMenuTopBarContainer>
|
</SubMenuTopBarContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import { DeleteAccount } from '@/settings/profile/components/DeleteAccount';
|
import { DeleteAccount } from '@/settings/profile/components/DeleteAccount';
|
||||||
import { EmailField } from '@/settings/profile/components/EmailField';
|
import { EmailField } from '@/settings/profile/components/EmailField';
|
||||||
import { NameFields } from '@/settings/profile/components/NameFields';
|
import { NameFields } from '@/settings/profile/components/NameFields';
|
||||||
@ -11,50 +12,39 @@ import { H2Title } from '@/ui/display/typography/components/H2Title';
|
|||||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
||||||
import { Section } from '@/ui/layout/section/components/Section';
|
import { Section } from '@/ui/layout/section/components/Section';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledH1Title = styled(H1Title)`
|
||||||
display: flex;
|
margin-bottom: 0;
|
||||||
flex-direction: column;
|
|
||||||
height: fit-content;
|
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
|
||||||
padding-bottom: ${({ theme }) => theme.spacing(10)};
|
|
||||||
padding-bottom: 30px;
|
|
||||||
width: 350px;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const SettingsProfile = () => (
|
export const SettingsProfile = () => (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<>
|
<SettingsPageContainer width={350}>
|
||||||
<StyledContainer>
|
<StyledH1Title title="Profile" />
|
||||||
<H1Title title="Profile" />
|
<Section>
|
||||||
<Section>
|
<H2Title title="Picture" />
|
||||||
<H2Title title="Picture" />
|
<ProfilePictureUploader />
|
||||||
<ProfilePictureUploader />
|
</Section>
|
||||||
</Section>
|
<Section>
|
||||||
<Section>
|
<H2Title title="Name" description="Your name as it will be displayed" />
|
||||||
<H2Title
|
<NameFields />
|
||||||
title="Name"
|
</Section>
|
||||||
description="Your name as it will be displayed"
|
<Section>
|
||||||
/>
|
<H2Title
|
||||||
<NameFields />
|
title="Email"
|
||||||
</Section>
|
description="The email associated to your account"
|
||||||
<Section>
|
/>
|
||||||
<H2Title
|
<EmailField />
|
||||||
title="Email"
|
</Section>
|
||||||
description="The email associated to your account"
|
<Section>
|
||||||
/>
|
<H2Title
|
||||||
<EmailField />
|
title="Support"
|
||||||
</Section>
|
addornment={<ToggleField />}
|
||||||
<Section>
|
description="Grant Twenty support temporary access to your account so we can troubleshoot problems or recover content on your behalf. You can revoke access at any time."
|
||||||
<H2Title
|
/>
|
||||||
title="Support"
|
</Section>
|
||||||
addornment={<ToggleField />}
|
<Section>
|
||||||
description="Grant Twenty support temporary access to your account so we can troubleshoot problems or recover content on your behalf. You can revoke access at any time."
|
<DeleteAccount />
|
||||||
/>
|
</Section>
|
||||||
</Section>
|
</SettingsPageContainer>
|
||||||
<Section>
|
|
||||||
<DeleteAccount />
|
|
||||||
</Section>
|
|
||||||
</StyledContainer>
|
|
||||||
</>
|
|
||||||
</SubMenuTopBarContainer>
|
</SubMenuTopBarContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import { DeleteWorkspace } from '@/settings/profile/components/DeleteWorkspace';
|
import { DeleteWorkspace } from '@/settings/profile/components/DeleteWorkspace';
|
||||||
import { NameField } from '@/settings/workspace/components/NameField';
|
import { NameField } from '@/settings/workspace/components/NameField';
|
||||||
import { WorkspaceLogoUploader } from '@/settings/workspace/components/WorkspaceLogoUploader';
|
import { WorkspaceLogoUploader } from '@/settings/workspace/components/WorkspaceLogoUploader';
|
||||||
@ -9,31 +10,26 @@ import { H2Title } from '@/ui/display/typography/components/H2Title';
|
|||||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
||||||
import { Section } from '@/ui/layout/section/components/Section';
|
import { Section } from '@/ui/layout/section/components/Section';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledH1Title = styled(H1Title)`
|
||||||
display: flex;
|
margin-bottom: 0;
|
||||||
flex-direction: column;
|
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
|
||||||
width: 350px;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const SettingsWorkspace = () => (
|
export const SettingsWorkspace = () => (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<div>
|
<SettingsPageContainer width={350}>
|
||||||
<StyledContainer>
|
<StyledH1Title title="General" />
|
||||||
<H1Title title="General" />
|
<Section>
|
||||||
<Section>
|
<H2Title title="Picture" />
|
||||||
<H2Title title="Picture" />
|
<WorkspaceLogoUploader />
|
||||||
<WorkspaceLogoUploader />
|
</Section>
|
||||||
</Section>
|
<Section>
|
||||||
<Section>
|
<H2Title title="Name" description="Name of your workspace" />
|
||||||
<H2Title title="Name" description="Name of your workspace" />
|
<NameField />
|
||||||
<NameField />
|
</Section>
|
||||||
</Section>
|
|
||||||
|
|
||||||
<Section>
|
<Section>
|
||||||
<DeleteWorkspace />
|
<DeleteWorkspace />
|
||||||
</Section>
|
</Section>
|
||||||
</StyledContainer>
|
</SettingsPageContainer>
|
||||||
</div>
|
|
||||||
</SubMenuTopBarContainer>
|
</SubMenuTopBarContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import styled from '@emotion/styled';
|
|||||||
import { useRecoilState } from 'recoil';
|
import { useRecoilState } from 'recoil';
|
||||||
|
|
||||||
import { currentUserState } from '@/auth/states/currentUserState';
|
import { currentUserState } from '@/auth/states/currentUserState';
|
||||||
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import { IconSettings, IconTrash } from '@/ui/display/icon';
|
import { IconSettings, IconTrash } from '@/ui/display/icon';
|
||||||
import { H1Title } from '@/ui/display/typography/components/H1Title';
|
import { H1Title } from '@/ui/display/typography/components/H1Title';
|
||||||
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
||||||
@ -17,12 +18,8 @@ import {
|
|||||||
useRemoveWorkspaceMemberMutation,
|
useRemoveWorkspaceMemberMutation,
|
||||||
} from '~/generated/graphql';
|
} from '~/generated/graphql';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledH1Title = styled(H1Title)`
|
||||||
display: flex;
|
margin-bottom: 0;
|
||||||
flex-direction: column;
|
|
||||||
height: fit-content;
|
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
|
||||||
width: 350px;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledButtonContainer = styled.div`
|
const StyledButtonContainer = styled.div`
|
||||||
@ -84,8 +81,8 @@ export const SettingsWorkspaceMembers = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<StyledContainer>
|
<SettingsPageContainer width={350}>
|
||||||
<H1Title title="Members" />
|
<StyledH1Title title="Members" />
|
||||||
{workspace?.inviteHash && (
|
{workspace?.inviteHash && (
|
||||||
<Section>
|
<Section>
|
||||||
<H2Title
|
<H2Title
|
||||||
@ -124,7 +121,7 @@ export const SettingsWorkspaceMembers = () => {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Section>
|
</Section>
|
||||||
</StyledContainer>
|
</SettingsPageContainer>
|
||||||
<ConfirmationModal
|
<ConfirmationModal
|
||||||
isOpen={isConfirmationModalOpen}
|
isOpen={isConfirmationModalOpen}
|
||||||
setIsOpen={setIsConfirmationModalOpen}
|
setIsOpen={setIsConfirmationModalOpen}
|
||||||
|
|||||||
@ -14,7 +14,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: '/settings/experience' },
|
args: { routePath: '/settings/experience' },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,7 +15,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: '/settings/profile' },
|
args: { routePath: '/settings/profile' },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -14,7 +14,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: '/settings/workspace' },
|
args: { routePath: '/settings/workspace' },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -16,7 +16,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: '/settings/workspace-members' },
|
args: { routePath: '/settings/workspace-members' },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
import styled from '@emotion/styled';
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
|
|
||||||
import { objectSettingsWidth } from '@/settings/data-model/constants/objectSettings';
|
|
||||||
import { SettingsNewObjectType } from '@/settings/data-model/new-object/components/SettingsNewObjectType';
|
import { SettingsNewObjectType } from '@/settings/data-model/new-object/components/SettingsNewObjectType';
|
||||||
import { IconSettings } from '@/ui/display/icon';
|
import { IconSettings } from '@/ui/display/icon';
|
||||||
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
||||||
@ -8,20 +6,10 @@ import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer'
|
|||||||
import { Section } from '@/ui/layout/section/components/Section';
|
import { Section } from '@/ui/layout/section/components/Section';
|
||||||
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
|
||||||
align-items: flex-start;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: ${({ theme }) => theme.spacing(8)};
|
|
||||||
height: fit-content;
|
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
|
||||||
width: ${objectSettingsWidth};
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const SettingsNewObject = () => {
|
export const SettingsNewObject = () => {
|
||||||
return (
|
return (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<StyledContainer>
|
<SettingsPageContainer>
|
||||||
<Breadcrumb
|
<Breadcrumb
|
||||||
links={[
|
links={[
|
||||||
{ children: 'Objects', href: '/settings/objects' },
|
{ children: 'Objects', href: '/settings/objects' },
|
||||||
@ -35,7 +23,7 @@ export const SettingsNewObject = () => {
|
|||||||
/>
|
/>
|
||||||
<SettingsNewObjectType />
|
<SettingsNewObjectType />
|
||||||
</Section>
|
</Section>
|
||||||
</StyledContainer>
|
</SettingsPageContainer>
|
||||||
</SubMenuTopBarContainer>
|
</SubMenuTopBarContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,12 +2,12 @@ import { useEffect } from 'react';
|
|||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import {
|
import {
|
||||||
activeFieldItems,
|
activeFieldItems,
|
||||||
activeObjectItems,
|
activeObjectItems,
|
||||||
disabledFieldItems,
|
disabledFieldItems,
|
||||||
} from '@/settings/data-model/constants/mockObjects';
|
} from '@/settings/data-model/constants/mockObjects';
|
||||||
import { objectSettingsWidth } from '@/settings/data-model/constants/objectSettings';
|
|
||||||
import { SettingsAboutSection } from '@/settings/data-model/object-details/components/SettingsObjectAboutSection';
|
import { SettingsAboutSection } from '@/settings/data-model/object-details/components/SettingsObjectAboutSection';
|
||||||
import {
|
import {
|
||||||
SettingsObjectFieldItemTableRow,
|
SettingsObjectFieldItemTableRow,
|
||||||
@ -18,26 +18,16 @@ import { IconPlus, IconSettings } from '@/ui/display/icon';
|
|||||||
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
||||||
import { Button } from '@/ui/input/button/components/Button';
|
import { Button } from '@/ui/input/button/components/Button';
|
||||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
||||||
|
import { Section } from '@/ui/layout/section/components/Section';
|
||||||
import { Table } from '@/ui/layout/table/components/Table';
|
import { Table } from '@/ui/layout/table/components/Table';
|
||||||
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
|
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
|
||||||
import { TableSection } from '@/ui/layout/table/components/TableSection';
|
import { TableSection } from '@/ui/layout/table/components/TableSection';
|
||||||
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledDiv = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
justify-content: flex-end;
|
||||||
height: fit-content;
|
padding-top: ${({ theme }) => theme.spacing(2)};
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
|
||||||
width: ${objectSettingsWidth};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const StyledBreadcrumb = styled(Breadcrumb)`
|
|
||||||
margin-bottom: ${({ theme }) => theme.spacing(8)};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const StyledAddFieldButton = styled(Button)`
|
|
||||||
align-self: flex-end;
|
|
||||||
margin-top: ${({ theme }) => theme.spacing(2)};
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const SettingsObjectDetail = () => {
|
export const SettingsObjectDetail = () => {
|
||||||
@ -54,8 +44,8 @@ export const SettingsObjectDetail = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<StyledContainer>
|
<SettingsPageContainer>
|
||||||
<StyledBreadcrumb
|
<Breadcrumb
|
||||||
links={[
|
links={[
|
||||||
{ children: 'Objects', href: '/settings/objects' },
|
{ children: 'Objects', href: '/settings/objects' },
|
||||||
{ children: activeObject?.name ?? '' },
|
{ children: activeObject?.name ?? '' },
|
||||||
@ -68,43 +58,54 @@ export const SettingsObjectDetail = () => {
|
|||||||
type={activeObject.type}
|
type={activeObject.type}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<H2Title
|
<Section>
|
||||||
title="Fields"
|
<H2Title
|
||||||
description={`Customise the fields available in the ${activeObject?.singularName} views and their display order in the ${activeObject?.singularName} detail view and menus.`}
|
title="Fields"
|
||||||
/>
|
description={`Customise the fields available in the ${activeObject?.singularName} views and their display order in the ${activeObject?.singularName} detail view and menus.`}
|
||||||
<Table>
|
/>
|
||||||
<StyledObjectFieldTableRow>
|
<Table>
|
||||||
<TableHeader>Name</TableHeader>
|
<StyledObjectFieldTableRow>
|
||||||
<TableHeader>Field type</TableHeader>
|
<TableHeader>Name</TableHeader>
|
||||||
<TableHeader>Data type</TableHeader>
|
<TableHeader>Field type</TableHeader>
|
||||||
<TableHeader></TableHeader>
|
<TableHeader>Data type</TableHeader>
|
||||||
</StyledObjectFieldTableRow>
|
<TableHeader></TableHeader>
|
||||||
<TableSection title="Active">
|
</StyledObjectFieldTableRow>
|
||||||
{activeFieldItems.map((fieldItem) => (
|
<TableSection title="Active">
|
||||||
<SettingsObjectFieldItemTableRow
|
{activeFieldItems.map((fieldItem) => (
|
||||||
key={fieldItem.name}
|
|
||||||
fieldItem={fieldItem}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</TableSection>
|
|
||||||
{!!disabledFieldItems.length && (
|
|
||||||
<TableSection isInitiallyExpanded={false} title="Disabled">
|
|
||||||
{disabledFieldItems.map((fieldItem) => (
|
|
||||||
<SettingsObjectFieldItemTableRow
|
<SettingsObjectFieldItemTableRow
|
||||||
key={fieldItem.name}
|
key={fieldItem.name}
|
||||||
fieldItem={fieldItem}
|
fieldItem={fieldItem}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</TableSection>
|
</TableSection>
|
||||||
)}
|
{!!disabledFieldItems.length && (
|
||||||
</Table>
|
<TableSection isInitiallyExpanded={false} title="Disabled">
|
||||||
<StyledAddFieldButton
|
{disabledFieldItems.map((fieldItem) => (
|
||||||
Icon={IconPlus}
|
<SettingsObjectFieldItemTableRow
|
||||||
title="Add Field"
|
key={fieldItem.name}
|
||||||
size="small"
|
fieldItem={fieldItem}
|
||||||
variant="secondary"
|
/>
|
||||||
/>
|
))}
|
||||||
</StyledContainer>
|
</TableSection>
|
||||||
|
)}
|
||||||
|
</Table>
|
||||||
|
<StyledDiv>
|
||||||
|
<Button
|
||||||
|
Icon={IconPlus}
|
||||||
|
title="Add Field"
|
||||||
|
size="small"
|
||||||
|
variant="secondary"
|
||||||
|
onClick={() =>
|
||||||
|
navigate(
|
||||||
|
disabledFieldItems.length
|
||||||
|
? './new-field/step-1'
|
||||||
|
: './new-field/step-2',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</StyledDiv>
|
||||||
|
</Section>
|
||||||
|
</SettingsPageContainer>
|
||||||
</SubMenuTopBarContainer>
|
</SubMenuTopBarContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,21 +1,14 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useNavigate, useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import styled from '@emotion/styled';
|
|
||||||
|
|
||||||
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import { activeObjectItems } from '@/settings/data-model/constants/mockObjects';
|
import { activeObjectItems } from '@/settings/data-model/constants/mockObjects';
|
||||||
import { objectSettingsWidth } from '@/settings/data-model/constants/objectSettings';
|
|
||||||
import { SettingsObjectIconSection } from '@/settings/data-model/object-edit/SettingsObjectIconSection';
|
import { SettingsObjectIconSection } from '@/settings/data-model/object-edit/SettingsObjectIconSection';
|
||||||
import { AppPath } from '@/types/AppPath';
|
import { AppPath } from '@/types/AppPath';
|
||||||
import { IconSettings } from '@/ui/display/icon';
|
import { IconSettings } from '@/ui/display/icon';
|
||||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
||||||
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
|
||||||
height: fit-content;
|
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
|
||||||
width: ${objectSettingsWidth};
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const SettingsObjectEdit = () => {
|
export const SettingsObjectEdit = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { pluralObjectName = '' } = useParams();
|
const { pluralObjectName = '' } = useParams();
|
||||||
@ -29,7 +22,7 @@ export const SettingsObjectEdit = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<StyledContainer>
|
<SettingsPageContainer>
|
||||||
<Breadcrumb
|
<Breadcrumb
|
||||||
links={[
|
links={[
|
||||||
{ children: 'Objects', href: '/settings/objects' },
|
{ children: 'Objects', href: '/settings/objects' },
|
||||||
@ -46,7 +39,7 @@ export const SettingsObjectEdit = () => {
|
|||||||
iconKey={activeObject.Icon.name}
|
iconKey={activeObject.Icon.name}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</StyledContainer>
|
</SettingsPageContainer>
|
||||||
</SubMenuTopBarContainer>
|
</SubMenuTopBarContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -0,0 +1,38 @@
|
|||||||
|
import { useEffect } from 'react';
|
||||||
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
|
import { activeObjectItems } from '@/settings/data-model/constants/mockObjects';
|
||||||
|
import { AppPath } from '@/types/AppPath';
|
||||||
|
import { IconSettings } from '@/ui/display/icon';
|
||||||
|
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
||||||
|
import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
||||||
|
|
||||||
|
export const SettingsObjectNewFieldStep1 = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const { pluralObjectName = '' } = useParams();
|
||||||
|
const activeObject = activeObjectItems.find(
|
||||||
|
(activeObject) => activeObject.name.toLowerCase() === pluralObjectName,
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!activeObject) navigate(AppPath.NotFound);
|
||||||
|
}, [activeObject, navigate]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
|
<SettingsPageContainer>
|
||||||
|
<Breadcrumb
|
||||||
|
links={[
|
||||||
|
{ children: 'Objects', href: '/settings/objects' },
|
||||||
|
{
|
||||||
|
children: activeObject?.name ?? '',
|
||||||
|
href: `/settings/objects/${pluralObjectName}`,
|
||||||
|
},
|
||||||
|
{ children: 'New Field' },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</SettingsPageContainer>
|
||||||
|
</SubMenuTopBarContainer>
|
||||||
|
);
|
||||||
|
};
|
||||||
@ -2,11 +2,11 @@ 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';
|
||||||
|
|
||||||
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import {
|
import {
|
||||||
activeObjectItems,
|
activeObjectItems,
|
||||||
disabledObjectItems,
|
disabledObjectItems,
|
||||||
} from '@/settings/data-model/constants/mockObjects';
|
} from '@/settings/data-model/constants/mockObjects';
|
||||||
import { objectSettingsWidth } from '@/settings/data-model/constants/objectSettings';
|
|
||||||
import {
|
import {
|
||||||
IconChevronRight,
|
IconChevronRight,
|
||||||
IconDotsVertical,
|
IconDotsVertical,
|
||||||
@ -18,18 +18,13 @@ import { H1Title } from '@/ui/display/typography/components/H1Title';
|
|||||||
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
||||||
import { Button } from '@/ui/input/button/components/Button';
|
import { Button } from '@/ui/input/button/components/Button';
|
||||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
||||||
|
import { Section } from '@/ui/layout/section/components/Section';
|
||||||
import { Table } from '@/ui/layout/table/components/Table';
|
import { Table } from '@/ui/layout/table/components/Table';
|
||||||
import { TableCell } from '@/ui/layout/table/components/TableCell';
|
import { TableCell } from '@/ui/layout/table/components/TableCell';
|
||||||
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
|
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
|
||||||
import { TableRow } from '@/ui/layout/table/components/TableRow';
|
import { TableRow } from '@/ui/layout/table/components/TableRow';
|
||||||
import { TableSection } from '@/ui/layout/table/components/TableSection';
|
import { TableSection } from '@/ui/layout/table/components/TableSection';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
|
||||||
height: fit-content;
|
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
|
||||||
width: ${objectSettingsWidth};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const StyledTableRow = styled(TableRow)`
|
const StyledTableRow = styled(TableRow)`
|
||||||
grid-template-columns: 180px 98.7px 98.7px 98.7px 36px;
|
grid-template-columns: 180px 98.7px 98.7px 98.7px 36px;
|
||||||
`;
|
`;
|
||||||
@ -61,7 +56,6 @@ const StyledHeader = styled.div`
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: ${({ theme }) => theme.spacing(8)};
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledH1Title = styled(H1Title)`
|
const StyledH1Title = styled(H1Title)`
|
||||||
@ -74,7 +68,7 @@ export const SettingsObjects = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<StyledContainer>
|
<SettingsPageContainer>
|
||||||
<StyledHeader>
|
<StyledHeader>
|
||||||
<StyledH1Title title="Objects" />
|
<StyledH1Title title="Objects" />
|
||||||
<Button
|
<Button
|
||||||
@ -87,49 +81,26 @@ export const SettingsObjects = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</StyledHeader>
|
</StyledHeader>
|
||||||
<H2Title title="Existing objects" />
|
<Section>
|
||||||
<Table>
|
<H2Title title="Existing objects" />
|
||||||
<StyledTableRow>
|
<Table>
|
||||||
<TableHeader>Name</TableHeader>
|
<StyledTableRow>
|
||||||
<TableHeader>Type</TableHeader>
|
<TableHeader>Name</TableHeader>
|
||||||
<TableHeader align="right">Fields</TableHeader>
|
<TableHeader>Type</TableHeader>
|
||||||
<TableHeader align="right">Instances</TableHeader>
|
<TableHeader align="right">Fields</TableHeader>
|
||||||
<TableHeader></TableHeader>
|
<TableHeader align="right">Instances</TableHeader>
|
||||||
</StyledTableRow>
|
<TableHeader></TableHeader>
|
||||||
<TableSection title="Active">
|
</StyledTableRow>
|
||||||
{activeObjectItems.map((objectItem) => (
|
<TableSection title="Active">
|
||||||
<StyledTableRow
|
{activeObjectItems.map((objectItem) => (
|
||||||
key={objectItem.name}
|
<StyledTableRow
|
||||||
onClick={() =>
|
key={objectItem.name}
|
||||||
navigate(`/settings/objects/${objectItem.name.toLowerCase()}`)
|
onClick={() =>
|
||||||
}
|
navigate(
|
||||||
>
|
`/settings/objects/${objectItem.name.toLowerCase()}`,
|
||||||
<StyledNameTableCell>
|
)
|
||||||
<objectItem.Icon size={theme.icon.size.md} />
|
}
|
||||||
{objectItem.name}
|
>
|
||||||
</StyledNameTableCell>
|
|
||||||
<TableCell>
|
|
||||||
{objectItem.type === 'standard' ? (
|
|
||||||
<StyledTag color="blue" text="Standard" />
|
|
||||||
) : (
|
|
||||||
<StyledTag color="orange" text="Custom" />
|
|
||||||
)}
|
|
||||||
</TableCell>
|
|
||||||
<TableCell align="right">{objectItem.fields}</TableCell>
|
|
||||||
<TableCell align="right">{objectItem.instances}</TableCell>
|
|
||||||
<StyledIconTableCell>
|
|
||||||
<StyledIconChevronRight
|
|
||||||
size={theme.icon.size.md}
|
|
||||||
stroke={theme.icon.stroke.sm}
|
|
||||||
/>
|
|
||||||
</StyledIconTableCell>
|
|
||||||
</StyledTableRow>
|
|
||||||
))}
|
|
||||||
</TableSection>
|
|
||||||
{!!disabledObjectItems.length && (
|
|
||||||
<TableSection title="Disabled">
|
|
||||||
{disabledObjectItems.map((objectItem) => (
|
|
||||||
<StyledTableRow key={objectItem.name}>
|
|
||||||
<StyledNameTableCell>
|
<StyledNameTableCell>
|
||||||
<objectItem.Icon size={theme.icon.size.md} />
|
<objectItem.Icon size={theme.icon.size.md} />
|
||||||
{objectItem.name}
|
{objectItem.name}
|
||||||
@ -144,7 +115,7 @@ export const SettingsObjects = () => {
|
|||||||
<TableCell align="right">{objectItem.fields}</TableCell>
|
<TableCell align="right">{objectItem.fields}</TableCell>
|
||||||
<TableCell align="right">{objectItem.instances}</TableCell>
|
<TableCell align="right">{objectItem.instances}</TableCell>
|
||||||
<StyledIconTableCell>
|
<StyledIconTableCell>
|
||||||
<StyledIconDotsVertical
|
<StyledIconChevronRight
|
||||||
size={theme.icon.size.md}
|
size={theme.icon.size.md}
|
||||||
stroke={theme.icon.stroke.sm}
|
stroke={theme.icon.stroke.sm}
|
||||||
/>
|
/>
|
||||||
@ -152,9 +123,36 @@ export const SettingsObjects = () => {
|
|||||||
</StyledTableRow>
|
</StyledTableRow>
|
||||||
))}
|
))}
|
||||||
</TableSection>
|
</TableSection>
|
||||||
)}
|
{!!disabledObjectItems.length && (
|
||||||
</Table>
|
<TableSection title="Disabled">
|
||||||
</StyledContainer>
|
{disabledObjectItems.map((objectItem) => (
|
||||||
|
<StyledTableRow key={objectItem.name}>
|
||||||
|
<StyledNameTableCell>
|
||||||
|
<objectItem.Icon size={theme.icon.size.md} />
|
||||||
|
{objectItem.name}
|
||||||
|
</StyledNameTableCell>
|
||||||
|
<TableCell>
|
||||||
|
{objectItem.type === 'standard' ? (
|
||||||
|
<StyledTag color="blue" text="Standard" />
|
||||||
|
) : (
|
||||||
|
<StyledTag color="orange" text="Custom" />
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="right">{objectItem.fields}</TableCell>
|
||||||
|
<TableCell align="right">{objectItem.instances}</TableCell>
|
||||||
|
<StyledIconTableCell>
|
||||||
|
<StyledIconDotsVertical
|
||||||
|
size={theme.icon.size.md}
|
||||||
|
stroke={theme.icon.stroke.sm}
|
||||||
|
/>
|
||||||
|
</StyledIconTableCell>
|
||||||
|
</StyledTableRow>
|
||||||
|
))}
|
||||||
|
</TableSection>
|
||||||
|
)}
|
||||||
|
</Table>
|
||||||
|
</Section>
|
||||||
|
</SettingsPageContainer>
|
||||||
</SubMenuTopBarContainer>
|
</SubMenuTopBarContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -16,7 +16,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
routePath: '/settings/objects/new',
|
routePath: '/settings/objects/new',
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -17,7 +17,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
routeParams: { ':pluralObjectName': 'companies' },
|
routeParams: { ':pluralObjectName': 'companies' },
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -17,7 +17,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
routeParams: { ':pluralObjectName': 'companies' },
|
routeParams: { ':pluralObjectName': 'companies' },
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
import { Meta, StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
PageDecorator,
|
||||||
|
PageDecoratorArgs,
|
||||||
|
} from '~/testing/decorators/PageDecorator';
|
||||||
|
import { graphqlMocks } from '~/testing/graphqlMocks';
|
||||||
|
|
||||||
|
import { SettingsObjectNewFieldStep1 } from '../../SettingsObjectNewField/SettingsObjectNewFieldStep1';
|
||||||
|
|
||||||
|
const meta: Meta<PageDecoratorArgs> = {
|
||||||
|
title: 'Pages/Settings/SettingsObjectNewField/SettingsObjectNewFieldStep1',
|
||||||
|
component: SettingsObjectNewFieldStep1,
|
||||||
|
decorators: [PageDecorator],
|
||||||
|
args: {
|
||||||
|
routePath: '/settings/objects/:pluralObjectName/new-field/step-1',
|
||||||
|
routeParams: { ':pluralObjectName': 'companies' },
|
||||||
|
},
|
||||||
|
parameters: {
|
||||||
|
msw: graphqlMocks,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
|
||||||
|
export type Story = StoryObj<typeof SettingsObjectNewFieldStep1>;
|
||||||
|
|
||||||
|
export const Default: Story = {};
|
||||||
@ -16,7 +16,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: '/settings/objects' },
|
args: { routePath: '/settings/objects' },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,7 +15,6 @@ const meta: Meta<PageDecoratorArgs> = {
|
|||||||
decorators: [PageDecorator],
|
decorators: [PageDecorator],
|
||||||
args: { routePath: AppPath.TasksPage },
|
args: { routePath: AppPath.TasksPage },
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: { story: 'inline', iframeHeight: '500px' },
|
|
||||||
msw: graphqlMocks,
|
msw: graphqlMocks,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user