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>
|
<version>${revision}</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.eclipse.hawkbit</groupId>
|
|
||||||
<artifactId>hawkbit-simple-ui</artifactId>
|
<artifactId>hawkbit-simple-ui</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
@@ -27,6 +26,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<vaadin.version>24.2.2</vaadin.version>
|
<vaadin.version>24.2.2</vaadin.version>
|
||||||
<spring-cloud-starter-openfeign.version>4.0.4</spring-cloud-starter-openfeign.version>
|
<spring-cloud-starter-openfeign.version>4.0.4</spring-cloud-starter-openfeign.version>
|
||||||
|
<openfeign-hc5.version>13.0</openfeign-hc5.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
@@ -86,18 +86,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.github.openfeign</groupId>
|
<groupId>io.github.openfeign</groupId>
|
||||||
<artifactId>feign-hc5</artifactId>
|
<artifactId>feign-hc5</artifactId>
|
||||||
<version>13.0</version>
|
<version>${openfeign-hc5.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public interface Constants {
|
|||||||
String CREATED_AT = "Created at";
|
String CREATED_AT = "Created at";
|
||||||
String LAST_MODIFIED_BY = "Last modified by";
|
String LAST_MODIFIED_BY = "Last modified by";
|
||||||
String LAST_MODIFIED_AT = "Last modified at";
|
String LAST_MODIFIED_AT = "Last modified at";
|
||||||
|
String SECURITY_TOKEN = "Security Token";
|
||||||
|
|
||||||
// rollout
|
// rollout
|
||||||
String GROUP_COUNT = "Group Count";
|
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 createdAt = Utils.textField(Constants.CREATED_AT);
|
||||||
private final TextField lastModifiedBy = Utils.textField(Constants.LAST_MODIFIED_BY);
|
private final TextField lastModifiedBy = Utils.textField(Constants.LAST_MODIFIED_BY);
|
||||||
private final TextField lastModifiedAt = Utils.textField(Constants.LAST_MODIFIED_AT);
|
private final TextField lastModifiedAt = Utils.textField(Constants.LAST_MODIFIED_AT);
|
||||||
|
private final TextField securityToken = Utils.textField(Constants.SECURITY_TOKEN);
|
||||||
|
|
||||||
private TargetDetails() {
|
private TargetDetails() {
|
||||||
description.setMinLength(2);
|
description.setMinLength(2);
|
||||||
Stream.of(
|
Stream.of(
|
||||||
description,
|
description,
|
||||||
createdBy, createdAt,
|
createdBy, createdAt,
|
||||||
lastModifiedBy, lastModifiedAt)
|
lastModifiedBy, lastModifiedAt,
|
||||||
|
securityToken)
|
||||||
.forEach(field -> {
|
.forEach(field -> {
|
||||||
field.setReadOnly(true);
|
field.setReadOnly(true);
|
||||||
add(field);
|
add(field);
|
||||||
@@ -228,11 +230,12 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setItem(final MgmtTarget target) {
|
private void setItem(final MgmtTarget target) {
|
||||||
description.setValue(target.getDescription());
|
description.setValue(target.getDescription() == null ? "N/A" : target.getDescription());
|
||||||
createdBy.setValue(target.getCreatedBy());
|
createdBy.setValue(target.getCreatedBy());
|
||||||
createdAt.setValue(new Date(target.getCreatedAt()).toString());
|
createdAt.setValue(new Date(target.getCreatedAt()).toString());
|
||||||
lastModifiedBy.setValue(target.getLastModifiedBy());
|
lastModifiedBy.setValue(target.getLastModifiedBy());
|
||||||
lastModifiedAt.setValue(new Date(target.getLastModifiedAt()).toString());
|
lastModifiedAt.setValue(new Date(target.getLastModifiedAt()).toString());
|
||||||
|
securityToken.setValue(target.getSecurityToken());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user