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

Fixed sort for Currency type #6333

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

lucasbordeau
Copy link
Contributor

@lucasbordeau lucasbordeau commented Jul 19, 2024

Fixes : #6056

  • Refactored the logic to get order by query variables for field types
  • Added a case for Currency field type

@lucasbordeau lucasbordeau linked an issue Jul 19, 2024 that may be closed by this pull request
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

  • packages/twenty-front/src/modules/object-metadata/constants/SortableFieldMetadataTypes.ts: Added Currency to SORTABLE_FIELD_METADATA_TYPES.
  • packages/twenty-front/src/modules/object-metadata/utils/formatFieldMetadataItemsAsSortDefinitions.ts: Refactored to use SORTABLE_FIELD_METADATA_TYPES constant.
  • packages/twenty-front/src/modules/object-metadata/utils/getObjectOrderByField.ts: Extracted switch-case logic to new utility getOrderByForFieldMetadataType.
  • packages/twenty-front/src/modules/object-metadata/utils/getOrderByForFieldMetadataType.ts: New utility function to handle order-by logic, including Currency.
  • packages/twenty-front/src/modules/object-record/object-sort-dropdown/utils/turnSortsIntoOrderBy.ts: Refactored to use getOrderByForFieldMetadataType and improved handling of field types.

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

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@Weiko Weiko merged commit b380064 into main Jul 19, 2024
12 of 13 checks passed
@Weiko Weiko deleted the 6056-i-should-be-able-to-sort-by-amount branch July 19, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I should be able to sort by amount
2 participants