Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -54,4 +54,6 @@ public interface Constants {
|
||||
String CANCEL_ESC = "Cancel (Esc)";
|
||||
|
||||
String NAME_ASC = "name:asc";
|
||||
|
||||
String NOT_AVAILABLE_NULL = "n/a (null)";
|
||||
}
|
||||
@@ -225,11 +225,9 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
||||
targetFilter.setValue(rollout.getTargetFilterQuery());
|
||||
final MgmtDistributionSet distributionSetMgmt = hawkbitClient.getDistributionSetRestApi()
|
||||
.getDistributionSet(rollout.getDistributionSetId()).getBody();
|
||||
if (distributionSetMgmt == null) { // should not be here
|
||||
distributionSet.setValue("n/a (null)");
|
||||
} else {
|
||||
distributionSet.setValue(distributionSetMgmt.getName() + ":" + distributionSetMgmt.getVersion());
|
||||
}
|
||||
distributionSet.setValue(distributionSetMgmt == null
|
||||
? NOT_AVAILABLE_NULL // should not be the case
|
||||
: distributionSetMgmt.getName() + ":" + distributionSetMgmt.getVersion());
|
||||
actonType.setValue(switch (rollout.getType()) {
|
||||
case SOFT -> Constants.SOFT;
|
||||
case FORCED -> Constants.FORCED;
|
||||
|
||||
@@ -379,8 +379,8 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
lastModifiedAt.setValue(new Date(target.getLastModifiedAt()).toString());
|
||||
securityToken.setValue(target.getSecurityToken());
|
||||
|
||||
MgmtPollStatus pollStatus = target.getPollStatus();
|
||||
lastPoll.setValue(new Date(pollStatus.getLastRequestAt()).toString());
|
||||
final MgmtPollStatus pollStatus = target.getPollStatus();
|
||||
lastPoll.setValue(pollStatus == null ? NOT_AVAILABLE_NULL : new Date(pollStatus.getLastRequestAt()).toString());
|
||||
final ResponseEntity<MgmtTargetAttributes> response = hawkbitClient.getTargetRestApi().getAttributes(target.getControllerId());
|
||||
if (response.getStatusCode().is2xxSuccessful()) {
|
||||
targetAttributes.setValue(Objects.requireNonNullElse(response.getBody(), Collections.emptyMap()).entrySet().stream()
|
||||
|
||||
Reference in New Issue
Block a user