diff --git a/dao/src/main/java/org/thingsboard/server/dao/service/ConstraintValidator.java b/dao/src/main/java/org/thingsboard/server/dao/service/ConstraintValidator.java index ee1e42f0dc..7f26c6e909 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/service/ConstraintValidator.java +++ b/dao/src/main/java/org/thingsboard/server/dao/service/ConstraintValidator.java @@ -53,8 +53,13 @@ public class ConstraintValidator { public static List 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() diff --git a/ui-ngx/src/app/core/api/widget-subscription.ts b/ui-ngx/src/app/core/api/widget-subscription.ts index d40dc95db7..332b8db14f 100644 --- a/ui-ngx/src/app/core/api/widget-subscription.ts +++ b/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 {