From 55fb4cfd9f844b25c61417807fe9ee10eb95759d Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Thu, 5 Feb 2026 13:01:43 +0200 Subject: [PATCH 1/2] Update echarts and ngx-flowchart versions --- ui-ngx/package.json | 4 ++-- ui-ngx/patches/echarts+5.5.1-TB.patch | 15 --------------- ui-ngx/yarn.lock | 12 ++++++------ 3 files changed, 8 insertions(+), 23 deletions(-) delete mode 100644 ui-ngx/patches/echarts+5.5.1-TB.patch diff --git a/ui-ngx/package.json b/ui-ngx/package.json index ef9b296bc2..738051f3d6 100644 --- a/ui-ngx/package.json +++ b/ui-ngx/package.json @@ -46,7 +46,7 @@ "canvas-gauges": "^2.1.7", "core-js": "^3.48.0", "dayjs": "1.11.19", - "echarts": "https://github.com/thingsboard/echarts/archive/5.5.1-TB.tar.gz", + "echarts": "https://github.com/thingsboard/echarts/archive/5.5.2-TB.tar.gz", "flot": "https://github.com/thingsboard/flot.git#0.9-work", "flot.curvedlines": "https://github.com/MichaelZinsmaier/CurvedLines.git#master", "font-awesome": "^4.7.0", @@ -71,7 +71,7 @@ "ngx-clipboard": "^16.0.0", "ngx-daterangepicker-material": "^6.0.4", "ngx-drag-drop": "^20.0.1", - "ngx-flowchart": "https://github.com/thingsboard/ngx-flowchart.git#release/3.0.0", + "ngx-flowchart": "https://github.com/thingsboard/ngx-flowchart.git#release/4.0.0", "ngx-hm-carousel": "^19.0.0", "ngx-markdown": "^20.1.0", "ngx-sharebuttons": "^17.0.0", diff --git a/ui-ngx/patches/echarts+5.5.1-TB.patch b/ui-ngx/patches/echarts+5.5.1-TB.patch deleted file mode 100644 index 0ca9ff80c0..0000000000 --- a/ui-ngx/patches/echarts+5.5.1-TB.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/node_modules/echarts/index.d.ts b/node_modules/echarts/index.d.ts -index 811908a..5f77c60 100644 ---- a/node_modules/echarts/index.d.ts -+++ b/node_modules/echarts/index.d.ts -@@ -17,7 +17,7 @@ - * under the License. - */ - --import * as echarts from './types/dist/echarts'; -+// import * as echarts from './types/dist/echarts'; - // Export for UMD module. - export as namespace echarts; --export = echarts; -\ No newline at end of file -+export * from './types/dist/echarts'; diff --git a/ui-ngx/yarn.lock b/ui-ngx/yarn.lock index ad057cd78b..d36c9c8684 100644 --- a/ui-ngx/yarn.lock +++ b/ui-ngx/yarn.lock @@ -5405,9 +5405,9 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -"echarts@https://github.com/thingsboard/echarts/archive/5.5.1-TB.tar.gz": - version "5.5.1-TB" - resolved "https://github.com/thingsboard/echarts/archive/5.5.1-TB.tar.gz#8cf0cbb1b4c6161f0b587a1a649ff4f8eecbbf42" +"echarts@https://github.com/thingsboard/echarts/archive/5.5.2-TB.tar.gz": + version "5.5.2-TB" + resolved "https://github.com/thingsboard/echarts/archive/5.5.2-TB.tar.gz#779494c24fb5448ecaf79315bf609bb52b431df9" dependencies: tslib "2.3.0" zrender "https://github.com/thingsboard/zrender/archive/5.5.0-TB.tar.gz" @@ -8098,9 +8098,9 @@ ngx-drag-drop@^20.0.1: dependencies: tslib "^2.3.0" -"ngx-flowchart@https://github.com/thingsboard/ngx-flowchart.git#release/3.0.0": - version "3.0.0" - resolved "https://github.com/thingsboard/ngx-flowchart.git#0160a1356129c2a3d4dcf7e064e4ba0a39ff668d" +"ngx-flowchart@https://github.com/thingsboard/ngx-flowchart.git#release/4.0.0": + version "4.0.0" + resolved "https://github.com/thingsboard/ngx-flowchart.git#735bc818ef218a169ac50e87edc6a093b3e97715" dependencies: tslib "^2.3.0" From 50ee9c4888bba9491387cf75acc7d4c50a7f3bbc Mon Sep 17 00:00:00 2001 From: Dmytro Skarzhynets Date: Sun, 8 Feb 2026 17:19:12 +0200 Subject: [PATCH 2/2] feat: add RestClient support for getCalculatedFields API Add getCalculatedFields method to RestClient that calls the /api/calculatedFields endpoint with filtering by types, entityType, entities, and names. Uses Apache URIBuilder to construct the URL. Co-Authored-By: Claude Opus 4.6 --- rest-client/pom.xml | 4 ++ .../thingsboard/rest/client/RestClient.java | 45 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/rest-client/pom.xml b/rest-client/pom.xml index c12ba7be2c..159ef826a0 100644 --- a/rest-client/pom.xml +++ b/rest-client/pom.xml @@ -51,6 +51,10 @@ com.auth0 java-jwt + + org.apache.httpcomponents.core5 + httpcore5 + diff --git a/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java b/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java index bd1d7b05c3..102fb90d1f 100644 --- a/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java +++ b/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java @@ -22,6 +22,7 @@ import com.google.common.base.Strings; import lombok.Getter; import lombok.SneakyThrows; import org.apache.commons.io.IOUtils; +import org.apache.hc.core5.net.URIBuilder; import org.apache.commons.lang3.concurrent.LazyInitializer; import org.springframework.core.ParameterizedTypeReference; import org.springframework.core.io.ByteArrayResource; @@ -93,6 +94,8 @@ import org.thingsboard.server.common.data.asset.AssetSearchQuery; import org.thingsboard.server.common.data.audit.ActionType; import org.thingsboard.server.common.data.audit.AuditLog; import org.thingsboard.server.common.data.cf.CalculatedField; +import org.thingsboard.server.common.data.cf.CalculatedFieldInfo; +import org.thingsboard.server.common.data.cf.CalculatedFieldType; import org.thingsboard.server.common.data.device.DeviceSearchQuery; import org.thingsboard.server.common.data.domain.Domain; import org.thingsboard.server.common.data.domain.DomainInfo; @@ -210,11 +213,13 @@ import org.thingsboard.server.common.data.widget.WidgetsBundle; import java.io.Closeable; import java.io.IOException; import java.net.URI; +import java.net.URISyntaxException; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -4309,6 +4314,46 @@ public class RestClient implements Closeable { } + @SneakyThrows(URISyntaxException.class) + public PageData getCalculatedFields(PageLink pageLink, + Set types, + EntityType entityType, + Set entities, + Set names) { + var urlBuilder = new URIBuilder(baseURL).appendPath("/api/calculatedFields"); + urlBuilder.addParameter("pageSize", String.valueOf(pageLink.getPageSize())); + urlBuilder.addParameter("page", String.valueOf(pageLink.getPage())); + if (!isEmpty(pageLink.getTextSearch())) { + urlBuilder.addParameter("textSearch", pageLink.getTextSearch()); + } + if (pageLink.getSortOrder() != null) { + urlBuilder.addParameter("sortProperty", pageLink.getSortOrder().getProperty()); + urlBuilder.addParameter("sortOrder", pageLink.getSortOrder().getDirection().name()); + } + if (!CollectionUtils.isEmpty(types)) { + for (CalculatedFieldType type : types) { + urlBuilder.addParameter("types", type.name()); + } + } + if (entityType != null) { + urlBuilder.addParameter("entityType", entityType.name()); + } + if (!CollectionUtils.isEmpty(entities)) { + for (UUID entity : entities) { + urlBuilder.addParameter("entities", entity.toString()); + } + } + if (!CollectionUtils.isEmpty(names)) { + for (String name : names) { + urlBuilder.addParameter("name", name); + } + } + return restTemplate.exchange( + urlBuilder.build(), + HttpMethod.GET, HttpEntity.EMPTY, + new ParameterizedTypeReference>() {}).getBody(); + } + public void deleteCalculatedField(CalculatedFieldId calculatedFieldId) { restTemplate.delete(baseURL + "/api/calculatedField/{calculatedFieldId}", calculatedFieldId.getId()); }