DMP-4316: fix default sorting on tables on admin portal #2561
+168
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Links
Change description
Summary of Git Diff
This Git diff introduces several improvements and changes to the testing and implementation of media retrieval functionalities in the audio controller of the application. Notably, it adds sorting functionality for media associated with hearings and cases, enhances the creation of media entities, and updates the response models to include sorted lists.
Highlights
New Test Case for Sorting:
getMediaById_shouldSortByCaseNumberDecending
that verifies the sorting of cases and hearings by case number in descending order.Media Entity Creation Changes:
createAndSaveMediaEntity
method to accept a list of hearing entities instead of a single entity, allowing for more flexible media creation.Sorting Logic in Service Layer:
getMediasById
method ofAdminMediaServiceImpl
, ensuring that returned media entities are sorted by case number in descending order.New Test for Media Deletion Sorting:
getMediasMarkedForDeletion_shouldSortMediaByChannelAscending
to confirm that media marked for deletion is sorted by channel in ascending order.Refactor of Media Creation Method:
createAndSaveMediaEntity
in tests to include channel information, enhancing clarity and functionality in test setups.Enhanced Media Retrieval Logic:
getMediasMarkedForDeletion
method to sort media items by channel before returning them in the response, ensuring consistent ordering.These changes enhance the robustness and usability of the media retrieval functionalities, ensuring that data returned to users is well-structured and sorted according to the requirements.
Does this PR introduce a breaking change? (check one with "x")