refactor: index ViewField by viewId and key (#1416)
* refactor: index ViewField by viewId and key Closes #1413 * refactor: rename ViewField properties
This commit is contained in:
@ -95,7 +95,7 @@ export function CompanyShow() {
|
||||
return (
|
||||
<EditableFieldDefinitionContext.Provider
|
||||
value={fieldDefinition}
|
||||
key={fieldDefinition.id}
|
||||
key={fieldDefinition.key}
|
||||
>
|
||||
<GenericEditableField />
|
||||
</EditableFieldDefinitionContext.Provider>
|
||||
|
||||
@ -21,8 +21,8 @@ import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect';
|
||||
|
||||
export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
{
|
||||
id: 'domainName',
|
||||
label: 'Domain name',
|
||||
key: 'domainName',
|
||||
name: 'Domain name',
|
||||
icon: <IconLink />,
|
||||
type: 'url',
|
||||
metadata: {
|
||||
@ -31,8 +31,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldURLMetadata>,
|
||||
{
|
||||
id: 'accountOwner',
|
||||
label: 'Account owner',
|
||||
key: 'accountOwner',
|
||||
name: 'Account owner',
|
||||
icon: <IconUserCircle />,
|
||||
type: 'relation',
|
||||
metadata: {
|
||||
@ -41,8 +41,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldRelationMetadata>,
|
||||
{
|
||||
id: 'employees',
|
||||
label: 'Employees',
|
||||
key: 'employees',
|
||||
name: 'Employees',
|
||||
icon: <IconUsers />,
|
||||
type: 'number',
|
||||
metadata: {
|
||||
@ -51,8 +51,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldNumberMetadata>,
|
||||
{
|
||||
id: 'address',
|
||||
label: 'Address',
|
||||
key: 'address',
|
||||
name: 'Address',
|
||||
icon: <IconMap />,
|
||||
type: 'text',
|
||||
metadata: {
|
||||
@ -61,8 +61,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldTextMetadata>,
|
||||
{
|
||||
id: 'createdAt',
|
||||
label: 'Created at',
|
||||
key: 'createdAt',
|
||||
name: 'Created at',
|
||||
icon: <IconCalendar />,
|
||||
type: 'date',
|
||||
metadata: {
|
||||
@ -70,8 +70,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldDateMetadata>,
|
||||
{
|
||||
id: 'idealCustomerProfile',
|
||||
label: 'ICP',
|
||||
key: 'idealCustomerProfile',
|
||||
name: 'ICP',
|
||||
icon: <IconTarget />,
|
||||
type: 'boolean',
|
||||
metadata: {
|
||||
@ -79,8 +79,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldBooleanMetadata>,
|
||||
{
|
||||
id: 'xUrl',
|
||||
label: 'Twitter',
|
||||
key: 'xUrl',
|
||||
name: 'Twitter',
|
||||
icon: <IconBrandX />,
|
||||
type: 'url',
|
||||
metadata: {
|
||||
|
||||
@ -116,7 +116,7 @@ export function PersonShow() {
|
||||
return (
|
||||
<EditableFieldDefinitionContext.Provider
|
||||
value={fieldDefinition}
|
||||
key={fieldDefinition.id}
|
||||
key={fieldDefinition.key}
|
||||
>
|
||||
<GenericEditableField />
|
||||
</EditableFieldDefinitionContext.Provider>
|
||||
|
||||
@ -21,8 +21,8 @@ import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect';
|
||||
|
||||
export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
{
|
||||
id: 'email',
|
||||
label: 'Email',
|
||||
key: 'email',
|
||||
name: 'Email',
|
||||
icon: <IconMail />,
|
||||
type: 'text',
|
||||
metadata: {
|
||||
@ -31,8 +31,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldTextMetadata>,
|
||||
{
|
||||
id: 'company',
|
||||
label: 'Company',
|
||||
key: 'company',
|
||||
name: 'Company',
|
||||
icon: <IconBuildingSkyscraper />,
|
||||
type: 'relation',
|
||||
metadata: {
|
||||
@ -42,8 +42,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldRelationMetadata>,
|
||||
{
|
||||
id: 'phone',
|
||||
label: 'Phone',
|
||||
key: 'phone',
|
||||
name: 'Phone',
|
||||
icon: <IconPhone />,
|
||||
type: 'phone',
|
||||
metadata: {
|
||||
@ -52,8 +52,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldPhoneMetadata>,
|
||||
{
|
||||
id: 'createdAt',
|
||||
label: 'Created at',
|
||||
key: 'createdAt',
|
||||
name: 'Created at',
|
||||
icon: <IconCalendar />,
|
||||
type: 'date',
|
||||
metadata: {
|
||||
@ -61,8 +61,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldDateMetadata>,
|
||||
{
|
||||
id: 'city',
|
||||
label: 'City',
|
||||
key: 'city',
|
||||
name: 'City',
|
||||
icon: <IconMap />,
|
||||
type: 'text',
|
||||
metadata: {
|
||||
@ -71,8 +71,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldTextMetadata>,
|
||||
{
|
||||
id: 'jobTitle',
|
||||
label: 'Job Title',
|
||||
key: 'jobTitle',
|
||||
name: 'Job Title',
|
||||
icon: <IconBriefcase />,
|
||||
type: 'text',
|
||||
metadata: {
|
||||
@ -81,8 +81,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldTextMetadata>,
|
||||
{
|
||||
id: 'linkedinUrl',
|
||||
label: 'Linkedin URL',
|
||||
key: 'linkedinUrl',
|
||||
name: 'Linkedin URL',
|
||||
icon: <IconBrandLinkedin />,
|
||||
type: 'url',
|
||||
metadata: {
|
||||
@ -91,8 +91,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldURLMetadata>,
|
||||
{
|
||||
id: 'xUrl',
|
||||
label: 'X URL',
|
||||
key: 'xUrl',
|
||||
name: 'X URL',
|
||||
icon: <IconBrandX />,
|
||||
type: 'url',
|
||||
metadata: {
|
||||
|
||||
Reference in New Issue
Block a user