diff --git a/application/pom.xml b/application/pom.xml
index 254c892f51..47d69d34dd 100644
--- a/application/pom.xml
+++ b/application/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
application
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/RuleChainsEdgeEventFetcher.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/RuleChainsEdgeEventFetcher.java
index 8d2a8adc51..91f453d3de 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/RuleChainsEdgeEventFetcher.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/RuleChainsEdgeEventFetcher.java
@@ -15,8 +15,10 @@
*/
package org.thingsboard.server.service.edge.rpc.fetch;
+import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.EdgeUtils;
import org.thingsboard.server.common.data.edge.Edge;
import org.thingsboard.server.common.data.edge.EdgeEvent;
@@ -28,6 +30,8 @@ import org.thingsboard.server.common.data.page.PageLink;
import org.thingsboard.server.common.data.rule.RuleChain;
import org.thingsboard.server.dao.rule.RuleChainService;
+import static org.thingsboard.server.service.edge.DefaultEdgeNotificationService.EDGE_IS_ROOT_BODY_KEY;
+
@Slf4j
@AllArgsConstructor
public class RuleChainsEdgeEventFetcher extends BasePageableEdgeEventFetcher {
@@ -41,7 +45,13 @@ public class RuleChainsEdgeEventFetcher extends BasePageableEdgeEventFetcher ruleChainUpdateMsgs = edgeImitator.findAllMessagesByType(RuleChainUpdateMsg.class);
+ assertThat(ruleChainUpdateMsgs).as("one msg during sync process, another from edge creation").hasSize(2);
assertThat(edgeImitator.findAllMessagesByType(DeviceProfileUpdateMsg.class)).as("one msg during sync process for 'default' device profile").hasSize(3);
assertThat(edgeImitator.findAllMessagesByType(DeviceUpdateMsg.class)).as("one msg once device assigned to edge").hasSize(2);
assertThat(edgeImitator.findAllMessagesByType(AssetProfileUpdateMsg.class)).as("two msgs during sync process for 'default' and 'test' asset profiles").hasSize(4);
assertThat(edgeImitator.findAllMessagesByType(AssetUpdateMsg.class)).as("two msgs - one during sync process, and one more once asset assigned to edge").hasSize(2);
assertThat(edgeImitator.findAllMessagesByType(UserUpdateMsg.class)).as("one msg during sync process for tenant admin user").hasSize(1);
assertThat(edgeImitator.findAllMessagesByType(AdminSettingsUpdateMsg.class)).as("admin setting update").hasSize(4);
+ verifyRuleChainMsgsAreRoot(ruleChainUpdateMsgs);
edgeImitator.expectMessageAmount(14);
doPost("/api/edge/sync/" + edge.getId());
assertThat(edgeImitator.waitForMessages()).as("await for messages after edge sync rest api call").isTrue();
assertThat(edgeImitator.findAllMessagesByType(QueueUpdateMsg.class)).as("queue msg").hasSize(1);
- assertThat(edgeImitator.findAllMessagesByType(RuleChainUpdateMsg.class)).as("rule chain msg").hasSize(1);
+ ruleChainUpdateMsgs = edgeImitator.findAllMessagesByType(RuleChainUpdateMsg.class);
+ assertThat(ruleChainUpdateMsgs).as("rule chain msg").hasSize(1);
assertThat(edgeImitator.findAllMessagesByType(DeviceProfileUpdateMsg.class)).as("device profile msg").hasSize(2);
assertThat(edgeImitator.findAllMessagesByType(AssetProfileUpdateMsg.class)).as("asset profile msg").hasSize(3);
assertThat(edgeImitator.findAllMessagesByType(AssetUpdateMsg.class)).as("asset update msg").hasSize(1);
assertThat(edgeImitator.findAllMessagesByType(UserUpdateMsg.class)).as("user update msg").hasSize(1);
assertThat(edgeImitator.findAllMessagesByType(AdminSettingsUpdateMsg.class)).as("admin setting update msg").hasSize(4);
assertThat(edgeImitator.findAllMessagesByType(DeviceUpdateMsg.class)).as("asset update msg").hasSize(1);
+ verifyRuleChainMsgsAreRoot(ruleChainUpdateMsgs);
edgeImitator.allowIgnoredTypes();
try {
@@ -860,6 +864,12 @@ public abstract class BaseEdgeControllerTest extends AbstractControllerTest {
.andExpect(status().isOk());
}
+ private void verifyRuleChainMsgsAreRoot(List ruleChainUpdateMsgs) {
+ for (RuleChainUpdateMsg ruleChainUpdateMsg : ruleChainUpdateMsgs) {
+ Assert.assertTrue(ruleChainUpdateMsg.getRoot());
+ }
+ }
+
@Test
public void testDeleteEdgeWithDeleteRelationsOk() throws Exception {
EdgeId edgeId = savedEdge("Edge for Test WithRelationsOk").getId();
diff --git a/common/actor/pom.xml b/common/actor/pom.xml
index 8f2c1e1b13..baab985d07 100644
--- a/common/actor/pom.xml
+++ b/common/actor/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/cache/pom.xml b/common/cache/pom.xml
index e48d232b16..8c7b3231c2 100644
--- a/common/cache/pom.xml
+++ b/common/cache/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/cluster-api/pom.xml b/common/cluster-api/pom.xml
index a8dfc522ce..74a89a4c8b 100644
--- a/common/cluster-api/pom.xml
+++ b/common/cluster-api/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/coap-server/pom.xml b/common/coap-server/pom.xml
index 57bb96d2c2..7d82d8344a 100644
--- a/common/coap-server/pom.xml
+++ b/common/coap-server/pom.xml
@@ -22,7 +22,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/dao-api/pom.xml b/common/dao-api/pom.xml
index cba811343a..749e704170 100644
--- a/common/dao-api/pom.xml
+++ b/common/dao-api/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/data/pom.xml b/common/data/pom.xml
index 9a95c08b65..4d18c99cc6 100644
--- a/common/data/pom.xml
+++ b/common/data/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/edge-api/pom.xml b/common/edge-api/pom.xml
index e09de1135f..71fc82184f 100644
--- a/common/edge-api/pom.xml
+++ b/common/edge-api/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/message/pom.xml b/common/message/pom.xml
index 5176e4af1a..b52053252b 100644
--- a/common/message/pom.xml
+++ b/common/message/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/pom.xml b/common/pom.xml
index c7b6d86eaf..20847853d7 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
common
diff --git a/common/queue/pom.xml b/common/queue/pom.xml
index 8485c2d63d..f4a72cc427 100644
--- a/common/queue/pom.xml
+++ b/common/queue/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/script/pom.xml b/common/script/pom.xml
index a849cf2684..7b22c4e0b0 100644
--- a/common/script/pom.xml
+++ b/common/script/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/script/remote-js-client/pom.xml b/common/script/remote-js-client/pom.xml
index 651eb153ed..cc2c129c3f 100644
--- a/common/script/remote-js-client/pom.xml
+++ b/common/script/remote-js-client/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.common
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
script
org.thingsboard.common.script
diff --git a/common/script/script-api/pom.xml b/common/script/script-api/pom.xml
index 01fef3059b..08b6490376 100644
--- a/common/script/script-api/pom.xml
+++ b/common/script/script-api/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.common
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
script
org.thingsboard.common.script
diff --git a/common/stats/pom.xml b/common/stats/pom.xml
index 2fcac6e059..f20e313725 100644
--- a/common/stats/pom.xml
+++ b/common/stats/pom.xml
@@ -22,7 +22,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/transport/coap/pom.xml b/common/transport/coap/pom.xml
index f4089d9a79..20665d1708 100644
--- a/common/transport/coap/pom.xml
+++ b/common/transport/coap/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.common
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.common.transport
diff --git a/common/transport/http/pom.xml b/common/transport/http/pom.xml
index c6c8f9869d..4da59fc93f 100644
--- a/common/transport/http/pom.xml
+++ b/common/transport/http/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.common
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.common.transport
diff --git a/common/transport/lwm2m/pom.xml b/common/transport/lwm2m/pom.xml
index 3c6fae874f..724b140d87 100644
--- a/common/transport/lwm2m/pom.xml
+++ b/common/transport/lwm2m/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.common
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.common.transport
diff --git a/common/transport/mqtt/pom.xml b/common/transport/mqtt/pom.xml
index 9442a66646..fa01fb61ad 100644
--- a/common/transport/mqtt/pom.xml
+++ b/common/transport/mqtt/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.common
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.common.transport
diff --git a/common/transport/pom.xml b/common/transport/pom.xml
index 47432f47f2..8c017fa757 100644
--- a/common/transport/pom.xml
+++ b/common/transport/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/transport/snmp/pom.xml b/common/transport/snmp/pom.xml
index 939eecb009..fcba445de8 100644
--- a/common/transport/snmp/pom.xml
+++ b/common/transport/snmp/pom.xml
@@ -21,7 +21,7 @@
org.thingsboard.common
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
diff --git a/common/transport/transport-api/pom.xml b/common/transport/transport-api/pom.xml
index 06fbfc5771..1221d42bcf 100644
--- a/common/transport/transport-api/pom.xml
+++ b/common/transport/transport-api/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.common
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.common.transport
diff --git a/common/util/pom.xml b/common/util/pom.xml
index 1a178b4c1e..b38f26abd1 100644
--- a/common/util/pom.xml
+++ b/common/util/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/common/version-control/pom.xml b/common/version-control/pom.xml
index 6ff68da760..0843494c49 100644
--- a/common/version-control/pom.xml
+++ b/common/version-control/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
common
org.thingsboard.common
diff --git a/dao/pom.xml b/dao/pom.xml
index 5335492759..563fc6b1e2 100644
--- a/dao/pom.xml
+++ b/dao/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
dao
diff --git a/msa/black-box-tests/pom.xml b/msa/black-box-tests/pom.xml
index eb7872ef7a..665650df89 100644
--- a/msa/black-box-tests/pom.xml
+++ b/msa/black-box-tests/pom.xml
@@ -21,7 +21,7 @@
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
msa
org.thingsboard.msa
diff --git a/msa/js-executor/package.json b/msa/js-executor/package.json
index e094dcc4e5..f9fde3328d 100644
--- a/msa/js-executor/package.json
+++ b/msa/js-executor/package.json
@@ -1,7 +1,7 @@
{
"name": "thingsboard-js-executor",
"private": true,
- "version": "3.4.3",
+ "version": "3.4.4",
"description": "ThingsBoard JavaScript Executor Microservice",
"main": "server.ts",
"bin": "server.js",
diff --git a/msa/js-executor/pom.xml b/msa/js-executor/pom.xml
index 860eb3891a..76edeee65c 100644
--- a/msa/js-executor/pom.xml
+++ b/msa/js-executor/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
msa
org.thingsboard.msa
diff --git a/msa/pom.xml b/msa/pom.xml
index 9e628b0f70..2542e0d1d0 100644
--- a/msa/pom.xml
+++ b/msa/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
msa
diff --git a/msa/tb-node/pom.xml b/msa/tb-node/pom.xml
index 7119da74d8..bb53c84a2f 100644
--- a/msa/tb-node/pom.xml
+++ b/msa/tb-node/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
msa
org.thingsboard.msa
diff --git a/msa/tb/pom.xml b/msa/tb/pom.xml
index fe79951126..b717881833 100644
--- a/msa/tb/pom.xml
+++ b/msa/tb/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
msa
org.thingsboard.msa
diff --git a/msa/transport/coap/pom.xml b/msa/transport/coap/pom.xml
index 82d7e02da6..80f316318a 100644
--- a/msa/transport/coap/pom.xml
+++ b/msa/transport/coap/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.msa
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.msa.transport
diff --git a/msa/transport/http/pom.xml b/msa/transport/http/pom.xml
index a596c5000f..a5e2a7d73d 100644
--- a/msa/transport/http/pom.xml
+++ b/msa/transport/http/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.msa
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.msa.transport
diff --git a/msa/transport/lwm2m/pom.xml b/msa/transport/lwm2m/pom.xml
index 0a43e7deb5..01a9fc5628 100644
--- a/msa/transport/lwm2m/pom.xml
+++ b/msa/transport/lwm2m/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.msa
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.msa.transport
diff --git a/msa/transport/mqtt/pom.xml b/msa/transport/mqtt/pom.xml
index 2fe358fe5d..82856357f6 100644
--- a/msa/transport/mqtt/pom.xml
+++ b/msa/transport/mqtt/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard.msa
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.msa.transport
diff --git a/msa/transport/pom.xml b/msa/transport/pom.xml
index 3339d93577..4df10d1b46 100644
--- a/msa/transport/pom.xml
+++ b/msa/transport/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
msa
org.thingsboard.msa
diff --git a/msa/transport/snmp/pom.xml b/msa/transport/snmp/pom.xml
index 1a352f47fb..f6cb54dfd2 100644
--- a/msa/transport/snmp/pom.xml
+++ b/msa/transport/snmp/pom.xml
@@ -21,7 +21,7 @@
org.thingsboard.msa
transport
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
org.thingsboard.msa.transport
diff --git a/msa/vc-executor-docker/pom.xml b/msa/vc-executor-docker/pom.xml
index 05884931d3..fbded58c33 100644
--- a/msa/vc-executor-docker/pom.xml
+++ b/msa/vc-executor-docker/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
msa
org.thingsboard.msa
diff --git a/msa/vc-executor/pom.xml b/msa/vc-executor/pom.xml
index 31c96c583c..9b6050e029 100644
--- a/msa/vc-executor/pom.xml
+++ b/msa/vc-executor/pom.xml
@@ -21,7 +21,7 @@
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
msa
org.thingsboard.msa
diff --git a/msa/web-ui/package.json b/msa/web-ui/package.json
index 035b8a3072..868215ad08 100644
--- a/msa/web-ui/package.json
+++ b/msa/web-ui/package.json
@@ -1,7 +1,7 @@
{
"name": "thingsboard-web-ui",
"private": true,
- "version": "3.4.3",
+ "version": "3.4.4",
"description": "ThingsBoard Web UI Microservice",
"main": "server.ts",
"bin": "server.js",
diff --git a/msa/web-ui/pom.xml b/msa/web-ui/pom.xml
index 5a0a444687..fe94b5bd40 100644
--- a/msa/web-ui/pom.xml
+++ b/msa/web-ui/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
msa
org.thingsboard.msa
diff --git a/netty-mqtt/pom.xml b/netty-mqtt/pom.xml
index 99d05fc583..fdc53f6b36 100644
--- a/netty-mqtt/pom.xml
+++ b/netty-mqtt/pom.xml
@@ -19,11 +19,11 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
netty-mqtt
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
jar
Netty MQTT Client
diff --git a/pom.xml b/pom.xml
index 7f8a99f027..92f13121d6 100755
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
pom
Thingsboard
diff --git a/rest-client/pom.xml b/rest-client/pom.xml
index 24f8453786..943466a411 100644
--- a/rest-client/pom.xml
+++ b/rest-client/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
rest-client
diff --git a/rule-engine/pom.xml b/rule-engine/pom.xml
index 126885cd22..fc27ede39e 100644
--- a/rule-engine/pom.xml
+++ b/rule-engine/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
rule-engine
diff --git a/rule-engine/rule-engine-api/pom.xml b/rule-engine/rule-engine-api/pom.xml
index 665158a44f..c696866004 100644
--- a/rule-engine/rule-engine-api/pom.xml
+++ b/rule-engine/rule-engine-api/pom.xml
@@ -22,7 +22,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
rule-engine
org.thingsboard.rule-engine
diff --git a/rule-engine/rule-engine-components/pom.xml b/rule-engine/rule-engine-components/pom.xml
index d32d8163a6..0c92fe9672 100644
--- a/rule-engine/rule-engine-components/pom.xml
+++ b/rule-engine/rule-engine-components/pom.xml
@@ -22,7 +22,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
rule-engine
org.thingsboard.rule-engine
diff --git a/tools/pom.xml b/tools/pom.xml
index d414a7a777..de23ae355d 100644
--- a/tools/pom.xml
+++ b/tools/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
tools
diff --git a/transport/coap/pom.xml b/transport/coap/pom.xml
index 2640d1d80d..64afdbfd66 100644
--- a/transport/coap/pom.xml
+++ b/transport/coap/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.transport
diff --git a/transport/http/pom.xml b/transport/http/pom.xml
index 7820c585ec..4f7ad8cd01 100644
--- a/transport/http/pom.xml
+++ b/transport/http/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.transport
diff --git a/transport/lwm2m/pom.xml b/transport/lwm2m/pom.xml
index b36c8372ef..e6970f8ac1 100644
--- a/transport/lwm2m/pom.xml
+++ b/transport/lwm2m/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.transport
diff --git a/transport/mqtt/pom.xml b/transport/mqtt/pom.xml
index 91ce12908b..1dd97ec2ea 100644
--- a/transport/mqtt/pom.xml
+++ b/transport/mqtt/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
org.thingsboard.transport
diff --git a/transport/pom.xml b/transport/pom.xml
index 26af07f6a2..be6eceaec1 100644
--- a/transport/pom.xml
+++ b/transport/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
transport
diff --git a/transport/snmp/pom.xml b/transport/snmp/pom.xml
index 0701f7aa57..6f9acc0d7c 100644
--- a/transport/snmp/pom.xml
+++ b/transport/snmp/pom.xml
@@ -21,7 +21,7 @@
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
transport
diff --git a/ui-ngx/package.json b/ui-ngx/package.json
index 6b8112adad..3edaefcf35 100644
--- a/ui-ngx/package.json
+++ b/ui-ngx/package.json
@@ -1,6 +1,6 @@
{
"name": "thingsboard",
- "version": "3.4.3",
+ "version": "3.4.4",
"scripts": {
"ng": "ng",
"start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --configuration development --host 0.0.0.0 --open",
diff --git a/ui-ngx/pom.xml b/ui-ngx/pom.xml
index f78d168144..a2640113e3 100644
--- a/ui-ngx/pom.xml
+++ b/ui-ngx/pom.xml
@@ -20,7 +20,7 @@
4.0.0
org.thingsboard
- 3.4.3-SNAPSHOT
+ 3.4.4-SNAPSHOT
thingsboard
org.thingsboard
diff --git a/ui-ngx/src/app/core/http/entity.service.ts b/ui-ngx/src/app/core/http/entity.service.ts
index b66399de6c..035381af69 100644
--- a/ui-ngx/src/app/core/http/entity.service.ts
+++ b/ui-ngx/src/app/core/http/entity.service.ts
@@ -869,8 +869,26 @@ export class EntityService {
};
aliasInfo.currentEntity = null;
if (!aliasInfo.resolveMultiple && aliasInfo.entityFilter) {
- return this.findSingleEntityInfoByEntityFilter(aliasInfo.entityFilter,
- {ignoreLoading: true, ignoreErrors: true}).pipe(
+ let currentEntity: EntityInfo = null;
+ if (result.stateEntity && aliasInfo.entityFilter.type === AliasFilterType.singleEntity) {
+ if (stateParams) {
+ let targetParams = stateParams;
+ if (result.entityParamName && result.entityParamName.length) {
+ targetParams = stateParams[result.entityParamName];
+ }
+ if (targetParams && targetParams.entityId) {
+ currentEntity = {
+ id: targetParams.entityId.id,
+ entityType: targetParams.entityId.entityType as EntityType,
+ name: targetParams.entityName,
+ label: targetParams.entityLabel
+ };
+ }
+ }
+ }
+ const entityInfoObservable = currentEntity ? of(currentEntity) : this.findSingleEntityInfoByEntityFilter(aliasInfo.entityFilter,
+ {ignoreLoading: true, ignoreErrors: true});
+ return entityInfoObservable.pipe(
map((entity) => {
aliasInfo.currentEntity = entity;
return aliasInfo;
diff --git a/ui-ngx/src/app/core/http/widget.service.ts b/ui-ngx/src/app/core/http/widget.service.ts
index 31788122a9..dd9449032e 100644
--- a/ui-ngx/src/app/core/http/widget.service.ts
+++ b/ui-ngx/src/app/core/http/widget.service.ts
@@ -16,7 +16,7 @@
import { Injectable } from '@angular/core';
import { defaultHttpOptionsFromConfig, RequestConfig } from './http-utils';
-import { Observable, of, ReplaySubject, Subject } from 'rxjs';
+import { Observable, of, ReplaySubject } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { PageLink } from '@shared/models/page/page-link';
import { PageData } from '@shared/models/page/page-data';
@@ -43,15 +43,14 @@ import { ActivationEnd, Router } from '@angular/router';
})
export class WidgetService {
- private widgetTypeUpdatedSubject = new Subject();
- private widgetsBundleDeletedSubject = new Subject();
-
private allWidgetsBundles: Array;
private systemWidgetsBundles: Array;
private tenantWidgetsBundles: Array;
private widgetTypeInfosCache = new Map>();
+ private widgetsInfoInMemoryCache = new Map();
+
private loadWidgetsBundleCacheSubject: ReplaySubject;
constructor(
@@ -117,7 +116,7 @@ export class WidgetService {
defaultHttpOptionsFromConfig(config)).pipe(
tap(() => {
this.invalidateWidgetsBundleCache();
- this.widgetsBundleDeletedSubject.next(widgetsBundle);
+ this.widgetsBundleDeleted(widgetsBundle);
})
);
}
@@ -217,7 +216,7 @@ export class WidgetService {
return this.http.post('/api/widgetType', widgetTypeDetails,
defaultHttpOptionsFromConfig(config)).pipe(
tap((savedWidgetType) => {
- this.widgetTypeUpdatedSubject.next(savedWidgetType);
+ this.widgetTypeUpdated(savedWidgetType);
}));
}
@@ -226,7 +225,7 @@ export class WidgetService {
return this.http.post('/api/widgetType', widgetTypeDetails,
defaultHttpOptionsFromConfig(config)).pipe(
tap((savedWidgetType) => {
- this.widgetTypeUpdatedSubject.next(savedWidgetType);
+ this.widgetTypeUpdated(savedWidgetType);
}));
}
@@ -237,7 +236,7 @@ export class WidgetService {
return this.http.delete(`/api/widgetType/${widgetTypeInstance.id.id}`,
defaultHttpOptionsFromConfig(config)).pipe(
tap(() => {
- this.widgetTypeUpdatedSubject.next(widgetTypeInstance);
+ this.widgetTypeUpdated(widgetTypeInstance);
})
);
}
@@ -263,12 +262,40 @@ export class WidgetService {
);
}
- public onWidgetTypeUpdated(): Observable {
- return this.widgetTypeUpdatedSubject.asObservable();
+ public createWidgetInfoCacheKey(bundleAlias: string, widgetTypeAlias: string, isSystem: boolean): string {
+ return `${isSystem ? 'sys_' : ''}${bundleAlias}_${widgetTypeAlias}`;
+ }
+
+ public getWidgetInfoFromCache(bundleAlias: string, widgetTypeAlias: string, isSystem: boolean): WidgetInfo | undefined {
+ const key = this.createWidgetInfoCacheKey(bundleAlias, widgetTypeAlias, isSystem);
+ return this.widgetsInfoInMemoryCache.get(key);
}
- public onWidgetBundleDeleted(): Observable {
- return this.widgetsBundleDeletedSubject.asObservable();
+ public putWidgetInfoToCache(widgetInfo: WidgetInfo, bundleAlias: string, widgetTypeAlias: string, isSystem: boolean) {
+ const key = this.createWidgetInfoCacheKey(bundleAlias, widgetTypeAlias, isSystem);
+ this.widgetsInfoInMemoryCache.set(key, widgetInfo);
+ }
+
+ private widgetTypeUpdated(updatedWidgetType: WidgetType): void {
+ this.deleteWidgetInfoFromCache(updatedWidgetType.bundleAlias, updatedWidgetType.alias, updatedWidgetType.tenantId.id === NULL_UUID);
+ }
+
+ private widgetsBundleDeleted(widgetsBundle: WidgetsBundle): void {
+ this.deleteWidgetsBundleFromCache(widgetsBundle.alias, widgetsBundle.tenantId.id === NULL_UUID);
+ }
+
+ private deleteWidgetInfoFromCache(bundleAlias: string, widgetTypeAlias: string, isSystem: boolean) {
+ const key = this.createWidgetInfoCacheKey(bundleAlias, widgetTypeAlias, isSystem);
+ this.widgetsInfoInMemoryCache.delete(key);
+ }
+
+ private deleteWidgetsBundleFromCache(bundleAlias: string, isSystem: boolean) {
+ const key = (isSystem ? 'sys_' : '') + bundleAlias;
+ this.widgetsInfoInMemoryCache.forEach((widgetInfo, cacheKey) => {
+ if (cacheKey.startsWith(key)) {
+ this.widgetsInfoInMemoryCache.delete(cacheKey);
+ }
+ });
}
private loadWidgetsBundleCache(config?: RequestConfig): Observable {
diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html
index ca1bae3de7..4c641ad1d7 100644
--- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html
+++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html
@@ -135,7 +135,7 @@
(click)="openDashboardSettings($event)">
settings
-
+ [ngStyle]="{width: mainLayoutSize.width,
+ height: mainLayoutSize.height}">
this.dashboard,
@@ -402,6 +410,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
.observe(MediaBreakpoints['gt-sm'])
.subscribe((state: BreakpointState) => {
this.isMobile = !state.matches;
+ this.updateLayoutSizes();
}
));
if (this.isMobileApp && this.syncStateWithQueryParam) {
@@ -414,6 +423,13 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
}
}
+ ngAfterViewInit() {
+ this.dashboardResize$ = new ResizeObserver(() => {
+ this.updateLayoutSizes();
+ });
+ this.dashboardResize$.observe(this.dashboardContainer.nativeElement);
+ }
+
private init(data: DashboardPageInitData) {
this.reset();
@@ -537,6 +553,9 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
subscription.unsubscribe();
});
this.rxSubscriptions.length = 0;
+ if (this.dashboardResize$) {
+ this.dashboardResize$.disconnect();
+ }
}
public runChangeDetection() {
@@ -679,28 +698,48 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
this.mobileService.onDashboardRightLayoutChanged(this.isRightLayoutOpened);
}
- public mainLayoutWidth(): string {
- if (this.isEditingWidget && this.editingLayoutCtx.id === 'main') {
- return '100%';
- } else {
- return this.layouts.right.show && !this.isMobile ? this.calculateWidth('main') : '100%';
+ private updateLayoutSizes() {
+ let changeMainLayoutSize = false;
+ let changeRightLayoutSize = false;
+ if (this.dashboardCtx.state) {
+ changeMainLayoutSize = this.updateMainLayoutSize();
+ changeRightLayoutSize = this.updateRightLayoutSize();
+ }
+ if (changeMainLayoutSize || changeRightLayoutSize) {
+ this.cd.markForCheck();
}
}
- public mainLayoutHeight(): string {
+ private updateMainLayoutSize(): boolean {
+ const prevMainLayoutWidth = this.mainLayoutSize.width;
+ const prevMainLayoutHeight = this.mainLayoutSize.height;
+ if (this.isEditingWidget && this.editingLayoutCtx.id === 'main') {
+ this.mainLayoutSize.width = '100%';
+ } else {
+ this.mainLayoutSize.width = this.layouts.right.show && !this.isMobile ? this.calculateWidth('main') : '100%';
+ }
if (!this.isEditingWidget || this.editingLayoutCtx.id === 'main') {
- return '100%';
+ this.mainLayoutSize.height = '100%';
} else {
- return '0px';
+ this.mainLayoutSize.height = '0px';
}
+ return prevMainLayoutWidth !== this.mainLayoutSize.width || prevMainLayoutHeight !== this.mainLayoutSize.height;
}
- public rightLayoutWidth(): string {
+ private updateRightLayoutSize(): boolean {
+ const prevRightLayoutWidth = this.rightLayoutSize.width;
+ const prevRightLayoutHeight = this.rightLayoutSize.height;
if (this.isEditingWidget && this.editingLayoutCtx.id === 'right') {
- return '100%';
+ this.rightLayoutSize.width = '100%';
+ } else {
+ this.rightLayoutSize.width = this.isMobile ? '100%' : this.calculateWidth('right');
+ }
+ if (!this.isEditingWidget || this.editingLayoutCtx.id === 'right') {
+ this.rightLayoutSize.height = '100%';
} else {
- return this.isMobile ? '100%' : this.calculateWidth('right');
+ this.rightLayoutSize.height = '0px';
}
+ return prevRightLayoutWidth !== this.rightLayoutSize.width || prevRightLayoutHeight !== this.rightLayoutSize.height;
}
private calculateWidth(layout: DashboardLayoutId): string {
@@ -743,14 +782,6 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
}
}
- public rightLayoutHeight(): string {
- if (!this.isEditingWidget || this.editingLayoutCtx.id === 'right') {
- return '100%';
- } else {
- return '0px';
- }
- }
-
public isPublicUser(): boolean {
return this.authUser.isPublic;
}
@@ -977,6 +1008,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
layout.layoutCtx.ctrl.reload();
}
layout.layoutCtx.ignoreLoading = true;
+ this.updateLayoutSizes();
}
private setEditMode(isEdit: boolean, revert: boolean) {
@@ -1191,6 +1223,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
this.editingLayoutCtx = null;
this.editingWidgetSubtitle = null;
this.isEditingWidget = false;
+ this.updateLayoutSizes();
this.resetHighlight();
this.forceDashboardMobileMode = false;
}
@@ -1216,6 +1249,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
this.editingWidgetSubtitle = this.widgetComponentService.getInstantWidgetInfo(this.editingWidget).widgetName;
this.forceDashboardMobileMode = true;
this.isEditingWidget = true;
+ this.updateLayoutSizes();
if (layoutCtx) {
const delayOffset = transition ? 350 : 0;
const delay = transition ? 400 : 300;
diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.ts
index 4d593a7c57..801238d602 100644
--- a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.ts
+++ b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.ts
@@ -297,6 +297,7 @@ export class ManageDashboardLayoutsDialogComponent extends DialogComponent();
-
private widgetsInfoFetchQueue = new Map>>();
private init$: Observable;
@@ -77,14 +74,6 @@ export class WidgetComponentService {
this.cssParser.testMode = false;
- this.widgetService.onWidgetTypeUpdated().subscribe((widgetType) => {
- this.deleteWidgetInfoFromCache(widgetType.bundleAlias, widgetType.alias, widgetType.tenantId.id === NULL_UUID);
- });
-
- this.widgetService.onWidgetBundleDeleted().subscribe((widgetsBundle) => {
- this.deleteWidgetsBundleFromCache(widgetsBundle.alias, widgetsBundle.tenantId.id === NULL_UUID);
- });
-
this.init();
}
@@ -223,7 +212,7 @@ export class WidgetComponentService {
}
public getInstantWidgetInfo(widget: Widget): WidgetInfo {
- const widgetInfo = this.getWidgetInfoFromCache(widget.bundleAlias, widget.typeAlias, widget.isSystemType);
+ const widgetInfo = this.widgetService.getWidgetInfoFromCache(widget.bundleAlias, widget.typeAlias, widget.isSystemType);
if (widgetInfo) {
return widgetInfo;
} else {
@@ -239,7 +228,7 @@ export class WidgetComponentService {
private getWidgetInfoInternal(bundleAlias: string, widgetTypeAlias: string, isSystem: boolean): Observable {
const widgetInfoSubject = new ReplaySubject();
- const widgetInfo = this.getWidgetInfoFromCache(bundleAlias, widgetTypeAlias, isSystem);
+ const widgetInfo = this.widgetService.getWidgetInfoFromCache(bundleAlias, widgetTypeAlias, isSystem);
if (widgetInfo) {
widgetInfoSubject.next(widgetInfo);
widgetInfoSubject.complete();
@@ -247,7 +236,7 @@ export class WidgetComponentService {
if (this.utils.widgetEditMode) {
this.loadWidget(this.editingWidgetType, bundleAlias, isSystem, widgetInfoSubject);
} else {
- const key = this.createWidgetInfoCacheKey(bundleAlias, widgetTypeAlias, isSystem);
+ const key = this.widgetService.createWidgetInfoCacheKey(bundleAlias, widgetTypeAlias, isSystem);
let fetchQueue = this.widgetsInfoFetchQueue.get(key);
if (fetchQueue) {
fetchQueue.push(widgetInfoSubject);
@@ -272,7 +261,7 @@ export class WidgetComponentService {
private loadWidget(widgetType: WidgetType, bundleAlias: string, isSystem: boolean, widgetInfoSubject: Subject) {
const widgetInfo = toWidgetInfo(widgetType);
- const key = this.createWidgetInfoCacheKey(bundleAlias, widgetInfo.alias, isSystem);
+ const key = this.widgetService.createWidgetInfoCacheKey(bundleAlias, widgetInfo.alias, isSystem);
let widgetControllerDescriptor: WidgetControllerDescriptor = null;
try {
widgetControllerDescriptor = this.createWidgetControllerDescriptor(widgetInfo, key);
@@ -297,7 +286,7 @@ export class WidgetComponentService {
widgetInfo.typeParameters = widgetControllerDescriptor.typeParameters;
widgetInfo.actionSources = widgetControllerDescriptor.actionSources;
widgetInfo.widgetTypeFunction = widgetControllerDescriptor.widgetTypeFunction;
- this.putWidgetInfoToCache(widgetInfo, bundleAlias, widgetInfo.alias, isSystem);
+ this.widgetService.putWidgetInfoToCache(widgetInfo, bundleAlias, widgetInfo.alias, isSystem);
if (widgetInfoSubject) {
widgetInfoSubject.next(widgetInfo);
widgetInfoSubject.complete();
@@ -331,7 +320,7 @@ export class WidgetComponentService {
(resource) => {
resourceTasks.push(
this.resources.loadResource(resource.url).pipe(
- catchError(e => of(`Failed to load widget resource: '${resource.url}'`))
+ catchError(() => of(`Failed to load widget resource: '${resource.url}'`))
)
);
}
@@ -586,34 +575,4 @@ export class WidgetComponentService {
this.widgetsInfoFetchQueue.delete(key);
}
}
-
- // Cache functions
-
- private createWidgetInfoCacheKey(bundleAlias: string, widgetTypeAlias: string, isSystem: boolean): string {
- return `${isSystem ? 'sys_' : ''}${bundleAlias}_${widgetTypeAlias}`;
- }
-
- private getWidgetInfoFromCache(bundleAlias: string, widgetTypeAlias: string, isSystem: boolean): WidgetInfo | undefined {
- const key = this.createWidgetInfoCacheKey(bundleAlias, widgetTypeAlias, isSystem);
- return this.widgetsInfoInMemoryCache.get(key);
- }
-
- private putWidgetInfoToCache(widgetInfo: WidgetInfo, bundleAlias: string, widgetTypeAlias: string, isSystem: boolean) {
- const key = this.createWidgetInfoCacheKey(bundleAlias, widgetTypeAlias, isSystem);
- this.widgetsInfoInMemoryCache.set(key, widgetInfo);
- }
-
- private deleteWidgetInfoFromCache(bundleAlias: string, widgetTypeAlias: string, isSystem: boolean) {
- const key = this.createWidgetInfoCacheKey(bundleAlias, widgetTypeAlias, isSystem);
- this.widgetsInfoInMemoryCache.delete(key);
- }
-
- private deleteWidgetsBundleFromCache(bundleAlias: string, isSystem: boolean) {
- const key = (isSystem ? 'sys_' : '') + bundleAlias;
- this.widgetsInfoInMemoryCache.forEach((widgetInfo, cacheKey) => {
- if (cacheKey.startsWith(key)) {
- this.widgetsInfoInMemoryCache.delete(cacheKey);
- }
- });
- }
}