Migrate view field to new data model - Part 2 (#2270)
* Migrate view field to new data model * Migrate view fields to new model
This commit is contained in:
@ -93,10 +93,10 @@ export const CompanyShow = () => {
|
||||
{companyShowFieldDefinition.map((fieldDefinition) => {
|
||||
return (
|
||||
<FieldContext.Provider
|
||||
key={company.id + fieldDefinition.key}
|
||||
key={company.id + fieldDefinition.fieldId}
|
||||
value={{
|
||||
entityId: company.id,
|
||||
recoilScopeId: company.id + fieldDefinition.key,
|
||||
recoilScopeId: company.id + fieldDefinition.fieldId,
|
||||
fieldDefinition,
|
||||
useUpdateEntityMutation: useUpdateOneCompanyMutation,
|
||||
hotkeyScope: InlineCellHotkeyScope.InlineCell,
|
||||
|
||||
@ -22,8 +22,8 @@ import { User } from '~/generated/graphql';
|
||||
|
||||
export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
{
|
||||
key: 'domainName',
|
||||
name: 'Domain name',
|
||||
fieldId: 'domainName',
|
||||
label: 'Domain name',
|
||||
Icon: IconLink,
|
||||
type: 'url',
|
||||
metadata: {
|
||||
@ -32,8 +32,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldURLMetadata>,
|
||||
{
|
||||
key: 'accountOwner',
|
||||
name: 'Account owner',
|
||||
fieldId: 'accountOwner',
|
||||
label: 'Account owner',
|
||||
Icon: IconUserCircle,
|
||||
type: 'relation',
|
||||
metadata: {
|
||||
@ -49,8 +49,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldRelationMetadata>,
|
||||
{
|
||||
key: 'employees',
|
||||
name: 'Employees',
|
||||
fieldId: 'employees',
|
||||
label: 'Employees',
|
||||
Icon: IconUsers,
|
||||
type: 'number',
|
||||
metadata: {
|
||||
@ -59,8 +59,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldNumberMetadata>,
|
||||
{
|
||||
key: 'address',
|
||||
name: 'Address',
|
||||
fieldId: 'address',
|
||||
label: 'Address',
|
||||
Icon: IconMap,
|
||||
type: 'text',
|
||||
metadata: {
|
||||
@ -69,8 +69,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldTextMetadata>,
|
||||
{
|
||||
key: 'idealCustomerProfile',
|
||||
name: 'ICP',
|
||||
fieldId: 'idealCustomerProfile',
|
||||
label: 'ICP',
|
||||
Icon: IconTarget,
|
||||
type: 'boolean',
|
||||
metadata: {
|
||||
@ -78,8 +78,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldBooleanMetadata>,
|
||||
{
|
||||
key: 'xUrl',
|
||||
name: 'Twitter',
|
||||
fieldId: 'xUrl',
|
||||
label: 'Twitter',
|
||||
Icon: IconBrandX,
|
||||
type: 'url',
|
||||
metadata: {
|
||||
@ -88,8 +88,8 @@ export const companyShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldURLMetadata>,
|
||||
{
|
||||
key: 'createdAt',
|
||||
name: 'Created at',
|
||||
fieldId: 'createdAt',
|
||||
label: 'Created at',
|
||||
Icon: IconCalendar,
|
||||
type: 'date',
|
||||
metadata: {
|
||||
|
||||
@ -121,12 +121,12 @@ export const PersonShow = () => {
|
||||
<FieldContext.Provider
|
||||
value={{
|
||||
entityId: person.id,
|
||||
recoilScopeId: person.id + fieldDefinition.name,
|
||||
recoilScopeId: person.id + fieldDefinition.label,
|
||||
fieldDefinition,
|
||||
useUpdateEntityMutation: useUpdateOnePersonMutation,
|
||||
hotkeyScope: InlineCellHotkeyScope.InlineCell,
|
||||
}}
|
||||
key={person.id + fieldDefinition.name}
|
||||
key={person.id + fieldDefinition.label}
|
||||
>
|
||||
<InlineCell />
|
||||
</FieldContext.Provider>
|
||||
|
||||
@ -23,8 +23,8 @@ import { getLogoUrlFromDomainName } from '~/utils';
|
||||
|
||||
export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
{
|
||||
key: 'email',
|
||||
name: 'Email',
|
||||
fieldId: 'email',
|
||||
label: 'Email',
|
||||
Icon: IconMail,
|
||||
type: 'text',
|
||||
metadata: {
|
||||
@ -33,8 +33,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldTextMetadata>,
|
||||
{
|
||||
key: 'company',
|
||||
name: 'Company',
|
||||
fieldId: 'company',
|
||||
label: 'Company',
|
||||
Icon: IconBuildingSkyscraper,
|
||||
type: 'relation',
|
||||
metadata: {
|
||||
@ -50,8 +50,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldRelationMetadata>,
|
||||
{
|
||||
key: 'phone',
|
||||
name: 'Phone',
|
||||
fieldId: 'phone',
|
||||
label: 'Phone',
|
||||
Icon: IconPhone,
|
||||
type: 'phone',
|
||||
metadata: {
|
||||
@ -60,8 +60,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldPhoneMetadata>,
|
||||
{
|
||||
key: 'jobTitle',
|
||||
name: 'Job Title',
|
||||
fieldId: 'jobTitle',
|
||||
label: 'Job Title',
|
||||
Icon: IconBriefcase,
|
||||
type: 'text',
|
||||
metadata: {
|
||||
@ -70,8 +70,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldTextMetadata>,
|
||||
{
|
||||
key: 'city',
|
||||
name: 'City',
|
||||
fieldId: 'city',
|
||||
label: 'City',
|
||||
Icon: IconMap,
|
||||
type: 'text',
|
||||
metadata: {
|
||||
@ -80,8 +80,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldTextMetadata>,
|
||||
{
|
||||
key: 'linkedinUrl',
|
||||
name: 'Linkedin URL',
|
||||
fieldId: 'linkedinUrl',
|
||||
label: 'Linkedin URL',
|
||||
Icon: IconBrandLinkedin,
|
||||
type: 'url',
|
||||
metadata: {
|
||||
@ -90,8 +90,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldURLMetadata>,
|
||||
{
|
||||
key: 'xUrl',
|
||||
name: 'X URL',
|
||||
fieldId: 'xUrl',
|
||||
label: 'X URL',
|
||||
Icon: IconBrandX,
|
||||
type: 'url',
|
||||
metadata: {
|
||||
@ -100,8 +100,8 @@ export const personShowFieldDefinition: FieldDefinition<FieldMetadata>[] = [
|
||||
},
|
||||
} satisfies FieldDefinition<FieldURLMetadata>,
|
||||
{
|
||||
key: 'createdAt',
|
||||
name: 'Created at',
|
||||
fieldId: 'createdAt',
|
||||
label: 'Created at',
|
||||
Icon: IconCalendar,
|
||||
type: 'date',
|
||||
metadata: {
|
||||
|
||||
@ -3,7 +3,7 @@ import { useRecoilState } from 'recoil';
|
||||
|
||||
import { currentUserState } from '@/auth/states/currentUserState';
|
||||
import { useFilter } from '@/ui/data/filter/hooks/useFilter';
|
||||
import { ViewFilterOperand } from '~/generated/graphql';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
|
||||
import { tasksFilters } from './tasks-filters';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user