Browse Source

Merge branch 'master' of https://github.com/thingsboard/thingsboard into UITests

pull/7670/head
Seraphym-Tuhai 4 years ago
parent
commit
43a3fc7c6e
  1. 9
      dao/src/main/java/org/thingsboard/server/dao/service/ConstraintValidator.java
  2. 1
      ui-ngx/src/app/core/api/widget-subscription.ts

9
dao/src/main/java/org/thingsboard/server/dao/service/ConstraintValidator.java

@ -53,8 +53,13 @@ public class ConstraintValidator {
public static List<String> getConstraintsViolations(Object data) {
return fieldsValidator.validate(data).stream()
.map(constraintViolation -> {
Path propertyPath = constraintViolation.getPropertyPath();
String property = Iterators.getLast(propertyPath.iterator()).toString();
String property;
if (constraintViolation.getConstraintDescriptor().getAttributes().containsKey("fieldName")) {
property = constraintViolation.getConstraintDescriptor().getAttributes().get("fieldName").toString();
} else {
Path propertyPath = constraintViolation.getPropertyPath();
property = Iterators.getLast(propertyPath.iterator()).toString();
}
return property + " " + constraintViolation.getMessage();
})
.distinct()

1
ui-ngx/src/app/core/api/widget-subscription.ts

@ -204,6 +204,7 @@ export class WidgetSubscription implements IWidgetSubscription {
this.timeWindow = {};
this.useDashboardTimewindow = options.useDashboardTimewindow;
this.useTimewindow = true;
this.onTimewindowChangeFunction = options.onTimewindowChangeFunction || ((timewindow) => timewindow);
if (this.useDashboardTimewindow) {
this.timeWindowConfig = deepClone(options.dashboardTimewindow);
} else {

Loading…
Cancel
Save