Cleanup messed up actionstatus sorting. We used sort param but had
hardcoded sorting in the reposirory. I added also reportAt based sorting. Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -50,13 +50,6 @@ public interface ActionStatusRepository
|
||||
*/
|
||||
Page<ActionStatus> findByAction(Pageable pageReq, Action action);
|
||||
|
||||
/**
|
||||
* @param pageReq
|
||||
* @param action
|
||||
* @return
|
||||
*/
|
||||
Page<ActionStatus> findByActionOrderByIdDesc(Pageable pageReq, Action action);
|
||||
|
||||
/**
|
||||
* Finds all status updates for the defined action and target order by
|
||||
* {@link ActionStatus#getId()} desc including
|
||||
@@ -71,6 +64,6 @@ public interface ActionStatusRepository
|
||||
* @return Page with found targets
|
||||
*/
|
||||
@EntityGraph(value = "ActionStatus.withMessages", type = EntityGraphType.LOAD)
|
||||
Page<ActionStatus> getByActionOrderByIdDesc(Pageable pageReq, Action action);
|
||||
Page<ActionStatus> getByAction(Pageable pageReq, Action action);
|
||||
|
||||
}
|
||||
|
||||
@@ -925,7 +925,7 @@ public class DeploymentManagement {
|
||||
|
||||
/**
|
||||
* retrieves all the {@link ActionStatus} entries of the given
|
||||
* {@link Action} and {@link Target} in the order latest first.
|
||||
* {@link Action} and {@link Target}.
|
||||
*
|
||||
* @param pageReq
|
||||
* pagination parameter
|
||||
@@ -937,12 +937,12 @@ public class DeploymentManagement {
|
||||
* @return the corresponding {@link Page} of {@link ActionStatus}
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_TARGET)
|
||||
public Page<ActionStatus> findActionStatusMessagesByActionInDescOrder(final Pageable pageReq, final Action action,
|
||||
public Page<ActionStatus> findActionStatusByAction(final Pageable pageReq, final Action action,
|
||||
final boolean withMessages) {
|
||||
if (withMessages) {
|
||||
return actionStatusRepository.getByActionOrderByIdDesc(pageReq, action);
|
||||
return actionStatusRepository.getByAction(pageReq, action);
|
||||
} else {
|
||||
return actionStatusRepository.findByActionOrderByIdDesc(pageReq, action);
|
||||
return actionStatusRepository.findByAction(pageReq, action);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user