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

Moved logic from FolderTreeControllerBase service layer #15976

Merged
merged 4 commits into from Apr 4, 2024

Conversation

bergmania
Copy link
Member

@bergmania bergmania commented Apr 3, 2024

Summary

This PR moves some logic from the FolderTreeControllerBase into the EntityService and EntityRepository.

This required the repository to support multiple orderings statements. To make this part non-breaking, I added a Ordering? Next property on the Ordering class, that is currently only supported by the EntityRepository.

Test

  • Ensure the Root / Children endpoints works as expected
    • Folders should be listed before items
    • Sorting by name if type do not allow sorting - E.g. Document Types.
  • Ensure take=0 cases works as expected and return the correct count.

@bergmania bergmania marked this pull request as ready for review April 3, 2024 11:18
@kjac
Copy link
Contributor

kjac commented Apr 3, 2024

The code looks great and the whole thing tests out really well.

✅ Pagination works
✅ Take by zero works

However, I think the custom ordering should have been added to DataTypeTreeControllerBase instead of MediaTypeTreeControllerBase.

Here's what I see in the UI (and in the endpoint outputs too):

Data types:

image

Media types:

image

When moving the custom ordering to data types from media types, the folders are correctly placed at the top:

Data types:

image

Media types:

image

It kinda also makes sense when considering it's an alphanumeric sorting on NodeObjectType:

  • NodeObjectType.DataType: 30A2A501-1978-4DDB-A57B-F7EFED43BA3C
  • NodeObjectType.DataTypeContainer: 521231E3-8B37-469C-9F9D-51AFC91FEB7B
  • NodeObjectType.MediaType: 4EA4382B-2F5A-4C2B-9587-AE9B3CF3602E
  • NodeObjectType.MediaTypeContainer: 42AEF799-B288-4744-9B10-BE144B73CDC4

I'll take the liberty of pushing those changes 😄

Copy link
Contributor

@kjac kjac left a comment

Choose a reason for hiding this comment

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

Works like a charm!

@kjac kjac merged commit 3cc1488 into v14/dev Apr 4, 2024
15 of 16 checks passed
@kjac kjac deleted the v14/refactor_foldertreecontrollerbase branch April 4, 2024 09:27
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.

None yet

2 participants