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

DMP-4316: fix default sorting on tables on admin portal #2561

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Ben-Edwards-cgi
Copy link
Contributor

Links

Jira

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:

    • Added a test getMediaById_shouldSortByCaseNumberDecending that verifies the sorting of cases and hearings by case number in descending order.
  • Media Entity Creation Changes:

    • Updated the createAndSaveMediaEntity method to accept a list of hearing entities instead of a single entity, allowing for more flexible media creation.
    • Refactored the method to ensure it maintains the relationships between media and hearings correctly.
  • Sorting Logic in Service Layer:

    • Implemented sorting of cases and hearings in the getMediasById method of AdminMediaServiceImpl, ensuring that returned media entities are sorted by case number in descending order.
  • New Test for Media Deletion Sorting:

    • Added a test getMediasMarkedForDeletion_shouldSortMediaByChannelAscending to confirm that media marked for deletion is sorted by channel in ascending order.
  • Refactor of Media Creation Method:

    • Changed the parameters of createAndSaveMediaEntity in tests to include channel information, enhancing clarity and functionality in test setups.
  • Enhanced Media Retrieval Logic:

    • Improved the 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")

[ ] Yes
[X] No

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.

1 participant