-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
refactor: add ColumnDefinition type #1357
Conversation
fb6da01
to
a95148e
Compare
Hi 👋 We couldn't create a preview environment for this pull-request 😥 You can see your environment build logs here. Please double-check your If you need help, email us at contact@getergomake.com or join Discord. Click here to disable Ergomake. |
Hi 👋 We couldn't create a preview environment for this pull-request 😥 You can see your environment build logs here. Please double-check your If you need help, email us at contact@getergomake.com or join Discord. Click here to disable Ergomake. |
import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect'; | ||
import type { ColumnDefinition } from '@/ui/table/types/ColumnDefinition'; | ||
|
||
export const companiesFieldDefinitions: ColumnDefinition<ViewFieldMetadata>[] = |
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.
companiesAvailableColumnDefinitions?
I think we should also add "available" in the naming to make clear it's the full list and remove any confusion with the one coming from the views
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.
Done
|
||
export const peopleViewFields: ViewFieldDefinition<ViewFieldMetadata>[] = [ | ||
export const peopleFieldDefinitions: ColumnDefinition<ViewFieldMetadata>[] = [ |
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.
peopleAvailableColumnDefinitions
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.
Done
@@ -17,10 +17,8 @@ import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect'; | |||
export const pipelineViewFields: ViewFieldDefinition<ViewFieldMetadata>[] = [ |
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.
maybe not in this PR which is already big, but we need to create a follow up ticket:
this file should be named pipelineFieldsDefinitions.
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.
I renamed it pipelineAvailableFieldDefinitions
.
@@ -26,17 +26,17 @@ export function EntityTableCell({ cellIndex }: { cellIndex: number }) { | |||
setContextMenuOpenState(true); | |||
} | |||
|
|||
const viewField = useContext(ViewFieldContext); | |||
const columnDefinition = useContext(ColumnContext); |
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.
awesome!
@@ -29,34 +27,36 @@ import { GenericEditableTextCell } from '../type/components/GenericEditableTextC | |||
import { GenericEditableURLCell } from '../type/components/GenericEditableURLCell'; | |||
|
|||
type OwnProps = { | |||
viewField: ViewFieldDefinition<ViewFieldMetadata>; | |||
fieldDefinition: ColumnDefinition<ViewFieldMetadata>; |
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.
fieldDefinition => columnDefinition?
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.
Done
@@ -73,7 +73,7 @@ export function useUpdateEntityField() { | |||
: unknown, | |||
>( | |||
currentEntityId: string, | |||
viewField: ViewFieldDefinition<MetadataType>, | |||
field: ColumnDefinition<MetadataType>, |
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.
field => columnDefinition here too
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.
Done
a95148e
to
f6883ef
Compare
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.
LGTM
Closes #1193