Skip to content
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

Merged
merged 3 commits into from
Aug 28, 2023

Conversation

thaisguigon
Copy link
Contributor

Closes #1193

@thaisguigon thaisguigon marked this pull request as ready for review August 28, 2023 09:59
@thaisguigon thaisguigon force-pushed the refactor/add-ColumnDefinition-type branch from fb6da01 to a95148e Compare August 28, 2023 10:00
@ergomake
Copy link

ergomake bot commented Aug 28, 2023

Hi 👋

We couldn't create a preview environment for this pull-request 😥

You can see your environment build logs here. Please double-check your docker-compose.yml file is valid.

If you need help, email us at contact@getergomake.com or join Discord.

Click here to disable Ergomake.

@ergomake
Copy link

ergomake bot commented Aug 28, 2023

Hi 👋

We couldn't create a preview environment for this pull-request 😥

You can see your environment build logs here. Please double-check your docker-compose.yml file is valid.

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>[] =
Copy link
Member

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

Copy link
Contributor Author

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>[] = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

peopleAvailableColumnDefinitions

Copy link
Contributor Author

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>[] = [
Copy link
Member

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.

Copy link
Contributor Author

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);
Copy link
Member

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>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fieldDefinition => columnDefinition?

Copy link
Contributor Author

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>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

field => columnDefinition here too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@thaisguigon thaisguigon force-pushed the refactor/add-ColumnDefinition-type branch from a95148e to f6883ef Compare August 28, 2023 15:28
Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaisguigon thaisguigon merged commit 74919ef into main Aug 28, 2023
@thaisguigon thaisguigon deleted the refactor/add-ColumnDefinition-type branch August 28, 2023 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AADev, I don't see any reference of viewFields in Table (should be named columnDefinitions)
2 participants