-
Notifications
You must be signed in to change notification settings - Fork 2
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 #2412
base: master
Are you sure you want to change the base?
Conversation
@@ -244,8 +251,13 @@ public List<AdminCasesSearchResponseItem> adminCaseSearch(AdminCasesSearchReques | |||
if (matchingCaseIds.size() > adminSearchMaxResults) { | |||
throw new DartsApiException(CaseApiError.TOO_MANY_RESULTS); | |||
} | |||
List<CourtCaseEntity> matchingCases = caseRepository.findAllById(matchingCaseIds); | |||
hearingRepository.findByCaseIds(matchingCaseIds); | |||
List<CourtCaseEntity> matchingCases = caseRepository.findAll(new Specification<CourtCaseEntity>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a specific database call to get the matching cases by the order by name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is only used here i stuck it in the service but it does make more sense to be in the repository layer as we are not doing any dynamic filters.
Will move :)
|
||
for (int i = 0; i < events.size(); i++) { | ||
EventMapping event = events.get(i); | ||
System.out.println(".andExpect(jsonPath(\"$[" + i + "].name\", Matchers.is(\"" + event.getName() + "\")))"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.out in production code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was left over from some testing good spot will remove :)
|
||
///admin/retention-policy-types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many dashes for comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed this comment as it does not provide any real value :)
WHERE cc.id in :ids | ||
ORDER BY cc.id DESC | ||
""") | ||
List<CourtCaseEntity> findAllWithIdMatchingOneOf(List<Integer> ids); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have added this new method to the repository so you need to have an integration repository test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added :)
@@ -13,7 +14,8 @@ | |||
@Repository | |||
public interface RetentionPolicyTypeRepository extends | |||
RevisionRepository<RetentionPolicyTypeEntity, Integer, Long>, | |||
JpaRepository<RetentionPolicyTypeEntity, Integer> { | |||
JpaRepository<RetentionPolicyTypeEntity, Integer>, | |||
JpaSpecificationExecutor<RetentionPolicyTypeEntity> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have added JpaSpecificationExecutor without using it. Is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
5a0feab
to
adaa648
Compare
Links
Change description
The tables on admin portal are not sorted by a particular field by default and just return the results as the database returns them.
The following tables need sorting as specified:
** Audio: Hearings date & Channel - [~leanne.jacobs] to move to another ticket following screen redesign
** {color:#00875a}Transcripts: CaseID{color}
All sorted descending
Acceptance criteria
Each table as listed above sorts by default by the attribute labelled after the colon :
Does this PR introduce a breaking change? (check one with "x")