mirror of
https://github.com/twentyhq/twenty.git
synced 2025-01-07 09:17:31 +03:00
parent
1f5492b4a7
commit
28779f0fb8
@ -6,6 +6,7 @@ const StyledSettingsPageContainer = styled.div<{ width?: number }>`
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: ${({ theme }) => theme.spacing(8)};
|
gap: ${({ theme }) => theme.spacing(8)};
|
||||||
|
overflow: auto;
|
||||||
padding: ${({ theme }) => theme.spacing(8)};
|
padding: ${({ theme }) => theme.spacing(8)};
|
||||||
width: ${({ width }) => (width ? width + 'px' : objectSettingsWidth)};
|
width: ${({ width }) => (width ? width + 'px' : objectSettingsWidth)};
|
||||||
`;
|
`;
|
||||||
|
@ -64,7 +64,7 @@ export const SettingsObjectFieldTypeSelectSection = ({
|
|||||||
}),
|
}),
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
{fieldType === 'TEXT' && (
|
{['NUMBER', 'TEXT'].includes(fieldType) && (
|
||||||
<StyledSettingsObjectFieldTypeCard
|
<StyledSettingsObjectFieldTypeCard
|
||||||
preview={
|
preview={
|
||||||
<SettingsObjectFieldPreview
|
<SettingsObjectFieldPreview
|
||||||
|
@ -12,15 +12,31 @@ const meta: Meta<typeof SettingsObjectFieldPreview> = {
|
|||||||
fieldIconKey: 'IconNotes',
|
fieldIconKey: 'IconNotes',
|
||||||
fieldLabel: 'Description',
|
fieldLabel: 'Description',
|
||||||
fieldType: 'TEXT',
|
fieldType: 'TEXT',
|
||||||
objectIconKey: 'IconUser',
|
isObjectCustom: false,
|
||||||
objectLabelPlural: 'People',
|
objectIconKey: 'IconBuildingSkyscraper',
|
||||||
objectNamePlural: 'people',
|
objectLabelPlural: 'Companies',
|
||||||
|
objectNamePlural: 'companies',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
type Story = StoryObj<typeof SettingsObjectFieldPreview>;
|
type Story = StoryObj<typeof SettingsObjectFieldPreview>;
|
||||||
|
|
||||||
export const StandardObject: Story = { args: { isObjectCustom: false } };
|
export const Text: Story = {};
|
||||||
|
|
||||||
export const CustomObject: Story = { args: { isObjectCustom: true } };
|
export const Number: Story = {
|
||||||
|
args: {
|
||||||
|
fieldIconKey: 'IconUsers',
|
||||||
|
fieldLabel: 'Employees',
|
||||||
|
fieldType: 'NUMBER',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const CustomObject: Story = {
|
||||||
|
args: {
|
||||||
|
isObjectCustom: true,
|
||||||
|
objectIconKey: 'IconApps',
|
||||||
|
objectLabelPlural: 'Workspaces',
|
||||||
|
objectNamePlural: 'workspaces',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
@ -9,7 +9,16 @@ const meta: Meta<typeof SettingsObjectFieldTypeSelectSection> = {
|
|||||||
title: 'Modules/Settings/DataModel/SettingsObjectFieldTypeSelectSection',
|
title: 'Modules/Settings/DataModel/SettingsObjectFieldTypeSelectSection',
|
||||||
component: SettingsObjectFieldTypeSelectSection,
|
component: SettingsObjectFieldTypeSelectSection,
|
||||||
decorators: [ComponentDecorator],
|
decorators: [ComponentDecorator],
|
||||||
args: { fieldType: 'NUMBER' },
|
args: {
|
||||||
|
fieldType: 'NUMBER',
|
||||||
|
fieldIconKey: 'IconUsers',
|
||||||
|
fieldLabel: 'Employees',
|
||||||
|
fieldName: 'employees',
|
||||||
|
isObjectCustom: false,
|
||||||
|
objectIconKey: 'IconUser',
|
||||||
|
objectLabelPlural: 'People',
|
||||||
|
objectNamePlural: 'people',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
@ -17,6 +26,10 @@ type Story = StoryObj<typeof SettingsObjectFieldTypeSelectSection>;
|
|||||||
|
|
||||||
export const Default: Story = {};
|
export const Default: Story = {};
|
||||||
|
|
||||||
|
export const Disabled: Story = {
|
||||||
|
args: { disabled: true },
|
||||||
|
};
|
||||||
|
|
||||||
export const WithOpenSelect: Story = {
|
export const WithOpenSelect: Story = {
|
||||||
play: async ({ canvasElement }) => {
|
play: async ({ canvasElement }) => {
|
||||||
const canvas = within(canvasElement);
|
const canvas = within(canvasElement);
|
||||||
|
@ -13,7 +13,7 @@ export const dataTypes: Record<
|
|||||||
MetadataFieldDataType,
|
MetadataFieldDataType,
|
||||||
{ label: string; Icon: IconComponent; defaultValue?: unknown }
|
{ label: string; Icon: IconComponent; defaultValue?: unknown }
|
||||||
> = {
|
> = {
|
||||||
NUMBER: { label: 'Number', Icon: IconNumbers },
|
NUMBER: { label: 'Number', Icon: IconNumbers, defaultValue: 2000 },
|
||||||
TEXT: {
|
TEXT: {
|
||||||
label: 'Text',
|
label: 'Text',
|
||||||
Icon: IconTextSize,
|
Icon: IconTextSize,
|
||||||
|
Loading…
Reference in New Issue
Block a user