Skip to content

Moved logic from FolderTreeControllerBase service layer#15976

Merged
kjac merged 4 commits into
v14/devfrom
v14/refactor_foldertreecontrollerbase
Apr 4, 2024
Merged

Moved logic from FolderTreeControllerBase service layer#15976
kjac merged 4 commits into
v14/devfrom
v14/refactor_foldertreecontrollerbase

Conversation

@bergmania

@bergmania bergmania commented Apr 3, 2024

Copy link
Copy Markdown
Member

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

kjac commented Apr 3, 2024

Copy link
Copy Markdown
Contributor

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 😄

@kjac kjac left a comment

Copy link
Copy Markdown
Contributor

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
@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.

2 participants