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

Add no value column on Kanban #6252

Merged
merged 8 commits into from
Jul 15, 2024
Merged

Add no value column on Kanban #6252

merged 8 commits into from
Jul 15, 2024

Conversation

charlesBochet
Copy link
Member

@charlesBochet charlesBochet commented Jul 15, 2024

image

Open questions:

  • the Tag component does not match Figma in term of style and API for "transparent" | "outline". We need to discuss with @Bonapara what is the desired behavior here
  • right now opportunity.stage is not nullable. We need to discuss with @FelixMalfait and @Bonapara what we want here. I would advocate to make a it nullable for now until we introduce settings on select fields. custom select are nullable and it could be confusing for the user

Follow up:

  • enhance tests on Tags
  • add story to cover the No Value column on record board

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

  • Added 'no value' column to Kanban board (packages/twenty-front/src/modules/object-record/utils/computeRecordBoardColumnDefinitionsFromObjectMetadata.ts)
  • Introduced new column types for Kanban (packages/twenty-front/src/modules/object-record/record-board/types/RecordBoardColumnDefinition.ts)
  • Conditional color setting for 'no value' column (packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx)
  • Reordered import statements for consistency (packages/twenty-front/src/modules/object-record/record-board/components/RecordBoard.tsx)

4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

  • Added variant prop to Tag component for 'no value' column (packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx)
  • Updated boardFieldSelectValue prop to accept null values (packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexBoardColumnLoaderEffect.tsx)
  • Added new column for records with no value in Kanban board (packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexBoardDataLoader.tsx)
  • Handled null columnFieldSelectValue in filter for 'no value' column (packages/twenty-front/src/modules/object-record/record-index/hooks/useLoadRecordIndexBoardColumn.ts)
  • Reordered import statements in Tag component (packages/twenty-ui/src/display/tag/components/Tag.tsx)

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

boardFieldMetadataId={recordIndexKanbanFieldMetadataId}
boardFieldSelectValue={null}
recordBoardId={recordBoardId}
columnId={'no-value'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Style: Consider using a constant for 'no-value' to avoid magic strings.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

  • Conditional rendering for columnDefinition.actions in RecordBoardColumnHeader.tsx
  • Display header actions and dropdown menu only when actions are available
  • Relevant for the new 'no value' column in the Kanban board

No major changes found since last review.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

  • Stricter check for columnDefinition.actions length in packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx
  • Render actions only if columnDefinition.actions has items
  • Prevent potential rendering issues with empty columnDefinition.actions

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@@ -79,14 +80,23 @@ export const RecordBoardColumnHeader = () => {
>
<Tag
onClick={handleBoardColumnMenuOpen}
color={columnDefinition.color}
variant={
columnDefinition.type === RecordBoardColumnDefinitionType.Value
Copy link
Member Author

Choose a reason for hiding this comment

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

this is because of the Tag component not maching figma. we could have the transparent as a color variant

@@ -45,6 +45,13 @@ export const RecordIndexBoardDataLoader = ({
columnId={columnIds[index]}
/>
))}
<RecordIndexBoardColumnLoaderEffect
Copy link
Member Author

Choose a reason for hiding this comment

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

I actually think this should be computed from the recordBoardcolumnDefinition array just to be consistent

@FelixMalfait
Copy link
Member

Great! Maybe display @WorkspaceIsNullable() as "advanced option" during field creation/edition @Bonapara - could be a followup ticket?

But the issue @charlesBochet is the data migration will be painful if we need to go back the other way and make the stage field not-nullable, which we will want to do.

@charlesBochet
Copy link
Member Author

Okay, we have discussed this with @ijreilly and we are:

  • hiding "No Value" column + "no Value" select option in case of non nullable
  • on the backend, preventing to remove the defaultValue from a nonNullable so the record creation (draft) won't be broken

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

  • Added isNullable property to field definition metadata in packages/twenty-front/src/modules/object-metadata/utils/formatFieldMetadataItemAsFieldDefinition.ts
  • Conditional 'No value' option in SelectFieldInput.tsx based on isNullable property
  • Updated FieldSelectMetadata type to include isNullable in FieldMetadata.ts
  • Conditional rendering of 'no-value' column in RecordIndexBoardDataLoader.tsx if field is nullable
  • Added 'No Value' column to Kanban board in computeRecordBoardColumnDefinitionsFromObjectMetadata.ts based on isNullable property

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

boardFieldMetadataId={recordIndexKanbanFieldMetadataId}
boardFieldSelectValue={null}
recordBoardId={recordBoardId}
columnId={'no-value'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Style: Consider using a constant for 'no-value' to avoid magic strings.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

  • Added isNullable property to selectFieldDefinition in packages/twenty-front/src/modules/object-record/record-field/__mocks__/fieldDefinitions.ts
  • Added PrefetchDataProvider to providers in packages/twenty-front/src/testing/decorators/PageDecorator.tsx
  • Added new GraphQL query mock for CombinedFindManyRecords in packages/twenty-front/src/testing/graphqlMocks.ts
  • Updated mock data for views and view fields in packages/twenty-front/src/testing/mock-data/view-fields.ts and packages/twenty-front/src/testing/mock-data/views.ts
  • Removed variant prop from Tag component in packages/twenty-ui/src/display/tag/components/Tag.tsx

9 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings

Comment on lines 19 to 20
console.log(columnDefinitions);
console.log(viewFields);
Copy link
Contributor

Choose a reason for hiding this comment

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

Style: Remove console.log statements before merging to main to avoid cluttering the console output.

Comment on lines 20 to 21
console.log(viewFields);

Copy link
Contributor

Choose a reason for hiding this comment

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

Style: Remove console.log statements before merging to main to avoid cluttering the console output.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

  • Removed console.log statements from packages/twenty-front/src/modules/views/utils/mapViewFieldsToColumnDefinitions.ts

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

  • Introduced TagVariant type with 'solid' and 'outline' values in /packages/twenty-ui/src/display/tag/components/Tag.tsx
  • Updated TagProps interface to include variant property
  • Modified StyledTag to handle 'outline' variant with a dashed border

No major changes found since last review.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@ijreilly ijreilly merged commit 2cd624a into main Jul 15, 2024
13 checks passed
@ijreilly ijreilly deleted the kanban-no-value branch July 15, 2024 15:48
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.

3 participants