Introduce soft deleted list option for soft deletable entities (#3093)
* Introduce soft deleted list option for soft deletable entities Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * fix verify build Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * fix typo in license Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * Add sorting option on deleted field Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * add missing import in tests Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * Rename SoftDeletedFilter to SoftDeletedMode and its values Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * Introduce MgmtSoftDeletedMode on api layer Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * remove unused imports Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * Integrate the enum on API layer Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * Fix OpenApi spec Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * address some comments Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * Get rid of count(SoftDeletedMode) at all Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * remove formatter for enum - stop supporting lowercase values in API Signed-off-by: strailov <Stanislav.Trailov@bosch.io> --------- Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
This commit is contained in:
committed by
GitHub
parent
95680962cc
commit
f44b6268b0
@@ -95,7 +95,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
(query, rsqlFilter) -> Optional.ofNullable(
|
||||
hawkbitClient.getDistributionSetRestApi()
|
||||
.getDistributionSets(rsqlFilter, query.getOffset(), query.getPageSize(), Utils.getSortParam(query
|
||||
.getSortOrders()))
|
||||
.getSortOrders()), null)
|
||||
.getBody())
|
||||
.stream().flatMap(body -> body.getContent().stream()),
|
||||
e -> new CreateDialog(hawkbitClient).result(),
|
||||
@@ -158,7 +158,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
type.setItemLabelGenerator(MgmtDistributionSetType::getName);
|
||||
type.setItems(Optional.ofNullable(
|
||||
hawkbitClient.getDistributionSetTypeRestApi()
|
||||
.getDistributionSetTypes(null, 0, 20, Constants.NAME_ASC)
|
||||
.getDistributionSetTypes(null, 0, 20, Constants.NAME_ASC, null)
|
||||
.getBody())
|
||||
.map(PagedList::getContent)
|
||||
.orElseGet(Collections::emptyList));
|
||||
@@ -266,7 +266,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
this::readyToCreate,
|
||||
Optional.ofNullable(
|
||||
hawkbitClient.getDistributionSetTypeRestApi()
|
||||
.getDistributionSetTypes(null, 0, 30, Constants.CREATED_AT_DESC)
|
||||
.getDistributionSetTypes(null, 0, 30, Constants.CREATED_AT_DESC, null)
|
||||
.getBody())
|
||||
.map(body -> body.getContent().toArray(new MgmtDistributionSetType[0]))
|
||||
.orElseGet(() -> new MgmtDistributionSetType[0]));
|
||||
@@ -353,6 +353,8 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
||||
v -> new Utils.BaseDialog<Void>("Add Software Modules") {
|
||||
|
||||
{
|
||||
setHeight("80vh");
|
||||
setWidth("80vw");
|
||||
final SoftwareModuleView softwareModulesView = new SoftwareModuleView(false, hawkbitClient);
|
||||
add(softwareModulesView);
|
||||
final Button addBtn = new Button("Add");
|
||||
|
||||
@@ -96,7 +96,7 @@ public final class RolloutView extends TableView<MgmtRolloutResponseBody, Long>
|
||||
(query, rsqlFilter) -> Optional.ofNullable(
|
||||
hawkbitClient.getRolloutRestApi()
|
||||
.getRollouts(
|
||||
rsqlFilter, query.getOffset(), query.getPageSize(), Constants.NAME_ASC, "full")
|
||||
rsqlFilter, query.getOffset(), query.getPageSize(), Constants.NAME_ASC, "full", null)
|
||||
.getBody()).stream().flatMap(page -> page.getContent().stream()),
|
||||
selectionGrid -> new CreateDialog(hawkbitClient).result(),
|
||||
selectionGrid -> {
|
||||
@@ -344,7 +344,7 @@ public final class RolloutView extends TableView<MgmtRolloutResponseBody, Long>
|
||||
"Distribution Set",
|
||||
this::readyToCreate,
|
||||
query -> hawkbitClient.getDistributionSetRestApi()
|
||||
.getDistributionSets(query.getFilter().orElse(null), query.getOffset(), query.getPageSize(), Constants.NAME_ASC)
|
||||
.getDistributionSets(query.getFilter().orElse(null), query.getOffset(), query.getPageSize(), Constants.NAME_ASC, null)
|
||||
.getBody().getContent().stream());
|
||||
distributionSet.setRequiredIndicatorVisible(true);
|
||||
distributionSet.setItemLabelGenerator(distributionSetO -> distributionSetO.getName() + ":" + distributionSetO.getVersion());
|
||||
|
||||
@@ -98,7 +98,8 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
},
|
||||
(query, rsqlFilter) -> Optional.ofNullable(
|
||||
hawkbitClient.getSoftwareModuleRestApi()
|
||||
.getSoftwareModules(rsqlFilter, query.getOffset(), query.getPageSize(), Constants.NAME_ASC)
|
||||
.getSoftwareModules(rsqlFilter, query.getOffset(), query.getPageSize(), Constants.NAME_ASC,
|
||||
null)
|
||||
.getBody())
|
||||
.stream().map(PagedList::getContent).flatMap(List::stream),
|
||||
isParent ? v -> new CreateDialog(hawkbitClient).result() : null,
|
||||
@@ -137,7 +138,7 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
type.setItemLabelGenerator(MgmtSoftwareModuleType::getName);
|
||||
type.setItems(Optional.ofNullable(
|
||||
hawkbitClient.getSoftwareModuleTypeRestApi()
|
||||
.getTypes(null, 0, 20, Constants.NAME_ASC)
|
||||
.getTypes(null, 0, 20, Constants.NAME_ASC, null)
|
||||
.getBody())
|
||||
.map(PagedList::getContent)
|
||||
.orElseGet(Collections::emptyList));
|
||||
@@ -231,7 +232,7 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
this::readyToCreate,
|
||||
Optional.ofNullable(
|
||||
hawkbitClient.getSoftwareModuleTypeRestApi()
|
||||
.getTypes(null, 0, 30, Constants.NAME_ASC)
|
||||
.getTypes(null, 0, 30, Constants.NAME_ASC, null)
|
||||
.getBody())
|
||||
.map(body -> body.getContent().toArray(new MgmtSoftwareModuleType[0]))
|
||||
.orElseGet(() -> new MgmtSoftwareModuleType[0]));
|
||||
@@ -264,7 +265,7 @@ public class SoftwareModuleView extends TableView<MgmtSoftwareModule, Long> {
|
||||
distType.setItems(
|
||||
Optional.ofNullable(
|
||||
hawkbitClient.getDistributionSetTypeRestApi()
|
||||
.getDistributionSetTypes(null, 0, 30, Constants.NAME_ASC)
|
||||
.getDistributionSetTypes(null, 0, 30, Constants.NAME_ASC, null)
|
||||
.getBody())
|
||||
.map(body -> body.getContent().toArray(new MgmtDistributionSetType[0]))
|
||||
.orElseGet(() -> new MgmtDistributionSetType[0]));
|
||||
|
||||
@@ -256,7 +256,8 @@ public class TargetFilterQueryView extends TableView<TargetFilterQueryView.Targe
|
||||
query.getFilter().orElse(null),
|
||||
query.getOffset(),
|
||||
query.getLimit(),
|
||||
Constants.NAME_ASC)
|
||||
Constants.NAME_ASC,
|
||||
null)
|
||||
.getBody()).stream().flatMap(body -> body.getContent().stream()));
|
||||
distributionSet.setItemLabelGenerator(ds -> ds.getName() + ":" + ds.getVersion());
|
||||
distributionSet.focus();
|
||||
|
||||
@@ -869,7 +869,7 @@ public final class TargetView extends TableView<TargetView.TargetWithDs, String>
|
||||
"Distribution Set",
|
||||
this::readyToAssign,
|
||||
query -> hawkbitClient.getDistributionSetRestApi()
|
||||
.getDistributionSets(query.getFilter().orElse(null), query.getOffset(), query.getPageSize(), Constants.NAME_ASC)
|
||||
.getDistributionSets(query.getFilter().orElse(null), query.getOffset(), query.getPageSize(), Constants.NAME_ASC, null)
|
||||
.getBody().getContent().stream());
|
||||
distributionSet.setRequiredIndicatorVisible(true);
|
||||
distributionSet.setItemLabelGenerator(distributionSetO -> distributionSetO.getName() + ":" + distributionSetO.getVersion());
|
||||
|
||||
Reference in New Issue
Block a user