From 87a97cb46211f3a5ce2c180f95a78cbd32a40c9b Mon Sep 17 00:00:00 2001 From: descipher Date: Mon, 18 Mar 2019 20:28:45 -0500 Subject: [PATCH 1/4] Add full Canadian postal code validation. --- ui/src/app/components/contact.directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/app/components/contact.directive.js b/ui/src/app/components/contact.directive.js index 93912882ed..cab6f52111 100644 --- a/ui/src/app/components/contact.directive.js +++ b/ui/src/app/components/contact.directive.js @@ -283,7 +283,7 @@ function Contact($compile, $templateCache) { "Austria": "[0-9]{4}", "Belgium": "[0-9]{4}", "Brazil": "[0-9]{5}[\\-]?[0-9]{3}", - "Canada": "[A-Za-z][0-9][A-Za-z] [0-9][A-Za-z][0-9]", + "Canada": "^(?!.*[DFIOQU])[A-VXY][0-9][A-Z][ -]?[0-9][A-Z][0-9]$", "Denmark": "[0-9]{3,4}", "Faroe Islands": "[0-9]{3,4}", "Netherlands": "[1-9][0-9]{3}\\s?[a-zA-Z]{2}", From 0285832bed0c83a89cb34917215dcc38ef63ebf4 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Thu, 21 Mar 2019 15:07:14 +0200 Subject: [PATCH 2/4] Fixed CORS mapping --- application/src/main/resources/thingsboard.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index 72b8159407..f52bfccabc 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -273,7 +273,7 @@ updates: spring.mvc.cors: mappings: # Intercept path - "/api/auth/**": + "[/api/auth/**]": #Comma-separated list of origins to allow. '*' allows all origins. When not set,CORS support is disabled. allowed-origins: "*" #Comma-separated list of methods to allow. '*' allows all methods. @@ -284,7 +284,7 @@ spring.mvc.cors: max-age: "1800" #Set whether credentials are supported. When not set, credentials are not supported. allow-credentials: "true" - "/api/v1/**": + "[/api/v1/**]": allowed-origins: "*" allowed-methods: "*" allowed-headers: "*" From 1a1e66fa56a7da37da17aa187cacc1f8a1a4c3d3 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Thu, 21 Mar 2019 17:38:27 +0200 Subject: [PATCH 3/4] Fixed CORS mapping --- application/src/main/resources/thingsboard.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index f52bfccabc..1069f9d6e6 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -273,23 +273,17 @@ updates: spring.mvc.cors: mappings: # Intercept path - "[/api/auth/**]": + "[/api/**]": #Comma-separated list of origins to allow. '*' allows all origins. When not set,CORS support is disabled. allowed-origins: "*" #Comma-separated list of methods to allow. '*' allows all methods. - allowed-methods: "POST,GET,OPTIONS" + allowed-methods: "*" #Comma-separated list of headers to allow in a request. '*' allows all headers. allowed-headers: "*" #How long, in seconds, the response from a pre-flight request can be cached by clients. max-age: "1800" #Set whether credentials are supported. When not set, credentials are not supported. allow-credentials: "true" - "[/api/v1/**]": - allowed-origins: "*" - allowed-methods: "*" - allowed-headers: "*" - max-age: "1800" - allow-credentials: "true" # spring serve gzip compressed static resources spring.resources.chain: From 13e1d60a7cb558040238958e4808a2262e21d644 Mon Sep 17 00:00:00 2001 From: Sergey Tarnavskiy Date: Tue, 26 Mar 2019 12:29:30 +0200 Subject: [PATCH 4/4] added feature for resetting debug-mode in all rule-nodes --- ui/src/app/locale/locale.constant-en_US.json | 3 ++- ui/src/app/locale/locale.constant-ru_RU.json | 3 ++- ui/src/app/rulechain/rulechain.controller.js | 16 ++++++++++++++++ ui/src/app/rulechain/rulechain.tpl.html | 9 +++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ui/src/app/locale/locale.constant-en_US.json b/ui/src/app/locale/locale.constant-en_US.json index dfef502f09..d1fe2c88c9 100644 --- a/ui/src/app/locale/locale.constant-en_US.json +++ b/ui/src/app/locale/locale.constant-en_US.json @@ -1295,7 +1295,8 @@ "metadata-required": "Metadata entries can't be empty.", "output": "Output", "test": "Test", - "help": "Help" + "help": "Help", + "reset-debug-mode": "Reset debug mode in all nodes" }, "tenant": { "tenant": "Tenant", diff --git a/ui/src/app/locale/locale.constant-ru_RU.json b/ui/src/app/locale/locale.constant-ru_RU.json index 3ad4371cc1..2d05051de8 100644 --- a/ui/src/app/locale/locale.constant-ru_RU.json +++ b/ui/src/app/locale/locale.constant-ru_RU.json @@ -1288,7 +1288,8 @@ "metadata-required": "Метаданные объекта не могут быть пустыми.", "output": "Выход", "test": "Протестировать", - "help": "Помощь" + "help": "Помощь", + "reset-debug-mode": "Сбросить режим отладки во всех правилах" }, "tenant": { "tenant": "Владелец", diff --git a/ui/src/app/rulechain/rulechain.controller.js b/ui/src/app/rulechain/rulechain.controller.js index 3744b63198..195dcffef5 100644 --- a/ui/src/app/rulechain/rulechain.controller.js +++ b/ui/src/app/rulechain/rulechain.controller.js @@ -108,6 +108,9 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time vm.objectsSelected = objectsSelected; vm.deleteSelected = deleteSelected; + vm.isDebugModeEnabled = isDebugModeEnabled; + vm.resetDebugModeInAllNodes = resetDebugModeInAllNodes; + vm.triggerResize = triggerResize; vm.openRuleChainContextMenu = openRuleChainContextMenu; @@ -1342,6 +1345,19 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time vm.modelservice.deleteSelected(); } + function isDebugModeEnabled() { + var res = $filter('filter')(vm.ruleChainModel.nodes, {debugMode: true}); + return (res && res.length); + } + + function resetDebugModeInAllNodes() { + vm.ruleChainModel.nodes.forEach((node) => { + if (node.component.type != types.ruleNodeType.INPUT.value && node.component.type != types.ruleNodeType.RULE_CHAIN.value) { + node.debugMode = false; + } + }); + } + function triggerResize() { var w = angular.element($window); w.triggerHandler('resize'); diff --git a/ui/src/app/rulechain/rulechain.tpl.html b/ui/src/app/rulechain/rulechain.tpl.html index 80425e59c8..4a20947497 100644 --- a/ui/src/app/rulechain/rulechain.tpl.html +++ b/ui/src/app/rulechain/rulechain.tpl.html @@ -223,6 +223,15 @@ + + + {{ 'rulenode.reset-debug-mode' | translate }} + + +