Refactoring/simplifying rest resources code (2) (#2444)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-06-10 15:14:43 +03:00
committed by GitHub
parent e643707d41
commit 85ef8652fc
11 changed files with 47 additions and 52 deletions

View File

@@ -81,7 +81,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
},
(query, rsqlFilter) -> Optional.ofNullable(
hawkbitClient.getDistributionSetRestApi()
.getDistributionSets(query.getOffset(), query.getPageSize(), Constants.NAME_ASC, rsqlFilter)
.getDistributionSets(rsqlFilter, query.getOffset(), query.getPageSize(), Constants.NAME_ASC)
.getBody())
.stream().flatMap(body -> body.getContent().stream()),
e -> new CreateDialog(hawkbitClient).result(),

View File

@@ -91,7 +91,7 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
(query, rsqlFilter) -> Optional.ofNullable(
hawkbitClient.getRolloutRestApi()
.getRollouts(
query.getOffset(), query.getPageSize(), Constants.NAME_ASC, rsqlFilter, "full")
rsqlFilter, query.getOffset(), query.getPageSize(), Constants.NAME_ASC, "full")
.getBody()).stream().flatMap(page -> page.getContent().stream()),
selectionGrid -> new CreateDialog(hawkbitClient).result(),
selectionGrid -> {
@@ -243,8 +243,8 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
hawkbitClient.getRolloutRestApi()
.getRolloutGroups(
rollout.getId(),
query.getOffset(), query.getPageSize(),
null, null, "full")
null, query.getOffset(), query.getPageSize(),
null, "full")
.getBody())
.stream().flatMap(body -> body.getContent().stream())
.skip(query.getOffset())
@@ -294,7 +294,7 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
this::readyToCreate,
Optional.ofNullable(
hawkbitClient.getDistributionSetRestApi()
.getDistributionSets(0, 30, Constants.NAME_ASC, null)
.getDistributionSets(null, 0, 30, Constants.NAME_ASC)
.getBody())
.map(body -> body.getContent().toArray(new MgmtDistributionSet[0]))
.orElseGet(() -> new MgmtDistributionSet[0]));

View File

@@ -827,7 +827,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
this::readyToAssign,
Optional.ofNullable(
hawkbitClient.getDistributionSetRestApi()
.getDistributionSets(0, 30, Constants.NAME_ASC, null)
.getDistributionSets(null, 0, 30, Constants.NAME_ASC)
.getBody())
.map(body -> body.getContent().toArray(new MgmtDistributionSet[0]))
.orElseGet(() -> new MgmtDistributionSet[0])