@ -1,5 +1,4 @@
|
||||
import { ActorFieldDisplay } from '@/object-record/record-field/meta-types/display/components/ActorFieldDisplay';
|
||||
import { FieldActorValue } from '@/object-record/record-field/types/FieldMetadata';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { ComponentDecorator } from 'twenty-ui';
|
||||
|
||||
@ -13,11 +12,10 @@ const meta: Meta = {
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
ChipGeneratorsDecorator,
|
||||
getFieldDecorator('person', 'actor', {
|
||||
getFieldDecorator('company', 'createdBy', {
|
||||
id: '1',
|
||||
name: 'John Doe',
|
||||
source: 'API',
|
||||
workspaceMemberId: undefined,
|
||||
} satisfies FieldActorValue),
|
||||
}),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: ActorFieldDisplay,
|
||||
|
||||
@ -11,7 +11,16 @@ const meta: Meta = {
|
||||
title: 'UI/Data/Field/Display/AddressFieldDisplay',
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
getFieldDecorator('person', 'testAddress'),
|
||||
getFieldDecorator('company', 'address', {
|
||||
addressCity: 'San Francisco',
|
||||
addressCountry: 'United States',
|
||||
addressStreet1: '1234 Elm Street',
|
||||
addressStreet2: 'Apt 1234',
|
||||
addressLat: 0,
|
||||
addressLng: 0,
|
||||
addressPostcode: '12345',
|
||||
addressState: 'CA',
|
||||
} as FieldAddressValue),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: AddressFieldDisplay,
|
||||
@ -32,7 +41,7 @@ export const Elipsis: Story = {
|
||||
container: { width: 100 },
|
||||
},
|
||||
decorators: [
|
||||
getFieldDecorator('person', 'testAddress', {
|
||||
getFieldDecorator('company', 'address', {
|
||||
addressCity:
|
||||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam',
|
||||
addressCountry: 'United States',
|
||||
|
||||
@ -10,7 +10,7 @@ const meta: Meta = {
|
||||
title: 'UI/Data/Field/Display/BooleanFieldDisplay',
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
getFieldDecorator('person', 'testBoolean'),
|
||||
getFieldDecorator('company', 'idealCustomerProfile'),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: BooleanFieldDisplay,
|
||||
|
||||
@ -10,7 +10,10 @@ const meta: Meta = {
|
||||
title: 'UI/Data/Field/Display/JsonFieldDisplay',
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
getFieldDecorator('person', 'testJson'),
|
||||
getFieldDecorator('company', 'testRawJson', {
|
||||
key1: 'value1',
|
||||
key2: 'value2',
|
||||
}),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: JsonFieldDisplay,
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { ComponentDecorator } from 'twenty-ui';
|
||||
|
||||
import { LinkFieldDisplay } from '@/object-record/record-field/meta-types/display/components/LinkFieldDisplay';
|
||||
import { getFieldDecorator } from '~/testing/decorators/getFieldDecorator';
|
||||
import { MemoryRouterDecorator } from '~/testing/decorators/MemoryRouterDecorator';
|
||||
import { getProfilingStory } from '~/testing/profiling/utils/getProfilingStory';
|
||||
|
||||
const meta: Meta = {
|
||||
title: 'UI/Data/Field/Display/LinkFieldDisplay',
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
getFieldDecorator('person', 'testLink'),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: LinkFieldDisplay,
|
||||
args: {},
|
||||
parameters: {
|
||||
chromatic: { disableSnapshot: true },
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof LinkFieldDisplay>;
|
||||
|
||||
export const Default: Story = {};
|
||||
|
||||
export const Performance = getProfilingStory({
|
||||
componentName: 'LinkFieldDisplay',
|
||||
averageThresholdInMs: 0.5,
|
||||
numberOfRuns: 50,
|
||||
numberOfTestsPerRun: 100,
|
||||
});
|
||||
@ -1,5 +1,5 @@
|
||||
import { useContext, useEffect } from 'react';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { useContext, useEffect } from 'react';
|
||||
import { ComponentDecorator } from 'twenty-ui';
|
||||
|
||||
import { FieldFocusContext } from '@/object-record/record-field/contexts/FieldFocusContext';
|
||||
@ -23,7 +23,11 @@ const meta: Meta = {
|
||||
title: 'UI/Data/Field/Display/LinksFieldDisplay',
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
getFieldDecorator('person', 'testLinks'),
|
||||
getFieldDecorator('company', 'domainName', {
|
||||
primaryLinkUrl: 'https://www.google.com',
|
||||
primaryLinkLabel: 'Google',
|
||||
secondaryLinks: ['https://www.toto.com'],
|
||||
}),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: LinksFieldDisplay,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useContext, useEffect } from 'react';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { useContext, useEffect } from 'react';
|
||||
import { ComponentDecorator } from 'twenty-ui';
|
||||
|
||||
import { FieldFocusContext } from '@/object-record/record-field/contexts/FieldFocusContext';
|
||||
@ -23,7 +23,11 @@ const meta: Meta = {
|
||||
title: 'UI/Data/Field/Display/MultiSelectFieldDisplay',
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
getFieldDecorator('person', 'testMultiSelect'),
|
||||
getFieldDecorator('company', 'testMultiSelect', [
|
||||
'Option 1',
|
||||
'Option 2',
|
||||
'Option 3',
|
||||
]),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: MultiSelectFieldDisplay,
|
||||
|
||||
@ -10,7 +10,7 @@ const meta: Meta = {
|
||||
title: 'UI/Data/Field/Display/RatingFieldDisplay',
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
getFieldDecorator('person', 'testRating'),
|
||||
getFieldDecorator('company', 'testRating'),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: RatingFieldDisplay,
|
||||
|
||||
@ -10,7 +10,7 @@ const meta: Meta = {
|
||||
title: 'UI/Data/Field/Display/SelectFieldDisplay',
|
||||
decorators: [
|
||||
MemoryRouterDecorator,
|
||||
getFieldDecorator('person', 'testSelect'),
|
||||
getFieldDecorator('task', 'status'),
|
||||
ComponentDecorator,
|
||||
],
|
||||
component: SelectFieldDisplay,
|
||||
|
||||
Reference in New Issue
Block a user