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:
@@ -18,7 +18,6 @@
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-simple-ui</artifactId>
|
||||
<version>${revision}</version>
|
||||
<packaging>jar</packaging>
|
||||
@@ -27,6 +26,7 @@
|
||||
<properties>
|
||||
<vaadin.version>24.2.2</vaadin.version>
|
||||
<spring-cloud-starter-openfeign.version>4.0.4</spring-cloud-starter-openfeign.version>
|
||||
<openfeign-hc5.version>13.0</openfeign-hc5.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
@@ -86,18 +86,13 @@
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-hc5</artifactId>
|
||||
<version>13.0</version>
|
||||
<version>${openfeign-hc5.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -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