-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/generic editable cell all types #987
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
795fd09
Added generic relation cell
lucasbordeau 3fe6ef4
Deactivated debug
lucasbordeau bb8c33b
Added default warning
lucasbordeau 75ad274
Put back display component
lucasbordeau cf02eb8
Removed unused types
lucasbordeau 9e4c11e
wip
lucasbordeau 13cd9f0
Merge branch 'main' into feat/generic-editable-cell-chip
lucasbordeau 72763fa
Renamed to view field
lucasbordeau 136efde
Use new view field structure to have chip working
lucasbordeau d2b91a7
Finished
lucasbordeau a88d953
Merge branch 'main' into feat/generic-editable-cell-chip
lucasbordeau 4c61107
Added a temp feature flag
lucasbordeau a06de3c
Added double text chip cell
lucasbordeau c0f4b5d
Ok
lucasbordeau 2e45fc9
Finished tables
lucasbordeau 2573656
Fixed icon size
lucasbordeau 00d89b0
Fixed bug on date field
lucasbordeau db6c1df
Use icon index
lucasbordeau 8d9da31
Fix
lucasbordeau 0416533
Fixed naming
lucasbordeau a6639e4
Fix
lucasbordeau 67d696b
Merge branch 'main' into feat/generic-editable-cell-all-types
lucasbordeau 841dc3f
removed file from merge
lucasbordeau 56dffd8
Fixed tests
lucasbordeau d0d8e2c
Coverage
lucasbordeau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
front/src/modules/companies/constants/companyFieldMetadataArray.tsx
This file was deleted.
Oops, something went wrong.
105 changes: 105 additions & 0 deletions
105
front/src/modules/companies/constants/companyViewFields.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { | ||
IconBuildingSkyscraper, | ||
IconCalendarEvent, | ||
IconLink, | ||
IconMap, | ||
IconUser, | ||
IconUsers, | ||
} from '@/ui/icon/index'; | ||
import { Entity } from '@/ui/relation-picker/types/EntityTypeForSelect'; | ||
import { | ||
ViewFieldChipMetadata, | ||
ViewFieldDateMetadata, | ||
ViewFieldDefinition, | ||
ViewFieldMetadata, | ||
ViewFieldNumberMetadata, | ||
ViewFieldRelationMetadata, | ||
ViewFieldTextMetadata, | ||
ViewFieldURLMetadata, | ||
} from '@/ui/table/types/ViewField'; | ||
|
||
export const companyViewFields: ViewFieldDefinition<ViewFieldMetadata>[] = [ | ||
{ | ||
id: 'name', | ||
columnLabel: 'Name', | ||
columnIcon: <IconBuildingSkyscraper />, | ||
columnSize: 180, | ||
columnOrder: 1, | ||
metadata: { | ||
type: 'chip', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have put the type in view field, not in metadata |
||
urlFieldName: 'domainName', | ||
contentFieldName: 'name', | ||
relationType: Entity.Company, | ||
}, | ||
} as ViewFieldDefinition<ViewFieldChipMetadata>, | ||
{ | ||
id: 'domainName', | ||
columnLabel: 'URL', | ||
columnIcon: <IconLink />, | ||
columnSize: 100, | ||
columnOrder: 2, | ||
metadata: { | ||
type: 'url', | ||
fieldName: 'domainName', | ||
placeHolder: 'example.com', | ||
}, | ||
} as ViewFieldDefinition<ViewFieldURLMetadata>, | ||
{ | ||
id: 'accountOwner', | ||
columnLabel: 'Account Owner', | ||
columnIcon: <IconUser />, | ||
columnSize: 150, | ||
columnOrder: 3, | ||
metadata: { | ||
type: 'relation', | ||
fieldName: 'accountOwner', | ||
relationType: Entity.User, | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldRelationMetadata>, | ||
{ | ||
id: 'createdAt', | ||
columnLabel: 'Creation', | ||
columnIcon: <IconCalendarEvent />, | ||
columnSize: 150, | ||
columnOrder: 4, | ||
metadata: { | ||
type: 'date', | ||
fieldName: 'createdAt', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldDateMetadata>, | ||
{ | ||
id: 'employees', | ||
columnLabel: 'Employees', | ||
columnIcon: <IconUsers />, | ||
columnSize: 150, | ||
columnOrder: 5, | ||
metadata: { | ||
type: 'number', | ||
fieldName: 'employees', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldNumberMetadata>, | ||
{ | ||
id: 'linkedin', | ||
columnLabel: 'LinkedIn', | ||
columnIcon: <IconMap />, | ||
columnSize: 170, | ||
columnOrder: 6, | ||
metadata: { | ||
type: 'url', | ||
fieldName: 'linkedinUrl', | ||
placeHolder: 'LinkedIn URL', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldURLMetadata>, | ||
{ | ||
id: 'address', | ||
columnLabel: 'Address', | ||
columnIcon: <IconMap />, | ||
columnSize: 170, | ||
columnOrder: 7, | ||
metadata: { | ||
type: 'text', | ||
fieldName: 'address', | ||
placeHolder: 'Address', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldTextMetadata>, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
front/src/modules/companies/table/components/CompanyTableV2.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
front/src/modules/people/constants/peopleFieldMetadataArray.tsx
This file was deleted.
Oops, something went wrong.
122 changes: 122 additions & 0 deletions
122
front/src/modules/people/constants/peopleViewFields.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
import { | ||
IconBrandLinkedin, | ||
IconBriefcase, | ||
IconBuildingSkyscraper, | ||
IconCalendarEvent, | ||
IconMail, | ||
IconMap, | ||
IconPhone, | ||
IconUser, | ||
} from '@/ui/icon/index'; | ||
import { Entity } from '@/ui/relation-picker/types/EntityTypeForSelect'; | ||
import { | ||
ViewFieldDateMetadata, | ||
ViewFieldDefinition, | ||
ViewFieldDoubleTextChipMetadata, | ||
ViewFieldMetadata, | ||
ViewFieldPhoneMetadata, | ||
ViewFieldRelationMetadata, | ||
ViewFieldTextMetadata, | ||
ViewFieldURLMetadata, | ||
} from '@/ui/table/types/ViewField'; | ||
|
||
export const peopleViewFields: ViewFieldDefinition<ViewFieldMetadata>[] = [ | ||
{ | ||
id: 'displayName', | ||
columnLabel: 'People', | ||
columnIcon: <IconUser />, | ||
columnSize: 210, | ||
columnOrder: 1, | ||
metadata: { | ||
type: 'double-text-chip', | ||
firstValueFieldName: 'firstName', | ||
secondValueFieldName: 'lastName', | ||
firstValuePlaceholder: 'First name', | ||
secondValuePlaceholder: 'Last name', | ||
entityType: Entity.Person, | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldDoubleTextChipMetadata>, | ||
{ | ||
id: 'email', | ||
columnLabel: 'Email', | ||
columnIcon: <IconMail />, | ||
columnSize: 150, | ||
columnOrder: 2, | ||
metadata: { | ||
type: 'text', | ||
fieldName: 'email', | ||
placeHolder: 'Email', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldTextMetadata>, | ||
{ | ||
id: 'company', | ||
columnLabel: 'Company', | ||
columnIcon: <IconBuildingSkyscraper />, | ||
columnSize: 150, | ||
columnOrder: 3, | ||
metadata: { | ||
type: 'relation', | ||
fieldName: 'company', | ||
relationType: Entity.Company, | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldRelationMetadata>, | ||
{ | ||
id: 'phone', | ||
columnLabel: 'Phone', | ||
columnIcon: <IconPhone />, | ||
columnSize: 150, | ||
columnOrder: 4, | ||
metadata: { | ||
type: 'phone', | ||
fieldName: 'phone', | ||
placeHolder: 'Phone', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldPhoneMetadata>, | ||
{ | ||
id: 'createdAt', | ||
columnLabel: 'Creation', | ||
columnIcon: <IconCalendarEvent />, | ||
columnSize: 150, | ||
columnOrder: 5, | ||
metadata: { | ||
type: 'date', | ||
fieldName: 'createdAt', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldDateMetadata>, | ||
{ | ||
id: 'city', | ||
columnLabel: 'City', | ||
columnIcon: <IconMap />, | ||
columnSize: 150, | ||
columnOrder: 6, | ||
metadata: { | ||
type: 'text', | ||
fieldName: 'city', | ||
placeHolder: 'City', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldTextMetadata>, | ||
{ | ||
id: 'jobTitle', | ||
columnLabel: 'Job title', | ||
columnIcon: <IconBriefcase />, | ||
columnSize: 150, | ||
columnOrder: 7, | ||
metadata: { | ||
type: 'text', | ||
fieldName: 'jobTitle', | ||
placeHolder: 'Job title', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldTextMetadata>, | ||
{ | ||
id: 'linkedin', | ||
columnLabel: 'LinkedIn', | ||
columnIcon: <IconBrandLinkedin />, | ||
columnSize: 150, | ||
columnOrder: 8, | ||
metadata: { | ||
type: 'url', | ||
fieldName: 'linkedinUrl', | ||
placeHolder: 'LinkedIn', | ||
}, | ||
} satisfies ViewFieldDefinition<ViewFieldURLMetadata>, | ||
]; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ViewFieldDefinition => ViewField ?