Simple UI: Fix NPE on missing description (#1637)
and add security target token in view Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -22,6 +22,7 @@ public interface Constants {
|
||||
String CREATED_AT = "Created at";
|
||||
String LAST_MODIFIED_BY = "Last modified by";
|
||||
String LAST_MODIFIED_AT = "Last modified at";
|
||||
String SECURITY_TOKEN = "Security Token";
|
||||
|
||||
// rollout
|
||||
String GROUP_COUNT = "Group Count";
|
||||
|
||||
@@ -211,13 +211,15 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
private final TextField createdAt = Utils.textField(Constants.CREATED_AT);
|
||||
private final TextField lastModifiedBy = Utils.textField(Constants.LAST_MODIFIED_BY);
|
||||
private final TextField lastModifiedAt = Utils.textField(Constants.LAST_MODIFIED_AT);
|
||||
private final TextField securityToken = Utils.textField(Constants.SECURITY_TOKEN);
|
||||
|
||||
private TargetDetails() {
|
||||
description.setMinLength(2);
|
||||
Stream.of(
|
||||
description,
|
||||
createdBy, createdAt,
|
||||
lastModifiedBy, lastModifiedAt)
|
||||
lastModifiedBy, lastModifiedAt,
|
||||
securityToken)
|
||||
.forEach(field -> {
|
||||
field.setReadOnly(true);
|
||||
add(field);
|
||||
@@ -228,11 +230,12 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
||||
}
|
||||
|
||||
private void setItem(final MgmtTarget target) {
|
||||
description.setValue(target.getDescription());
|
||||
description.setValue(target.getDescription() == null ? "N/A" : target.getDescription());
|
||||
createdBy.setValue(target.getCreatedBy());
|
||||
createdAt.setValue(new Date(target.getCreatedAt()).toString());
|
||||
lastModifiedBy.setValue(target.getLastModifiedBy());
|
||||
lastModifiedAt.setValue(new Date(target.getLastModifiedAt()).toString());
|
||||
securityToken.setValue(target.getSecurityToken());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user