From c5d93d17f4799ad94ba8e58ffacf78d56b6ecdd6 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Wed, 23 Dec 2020 18:24:41 +0200 Subject: [PATCH] Naming conventions update --- .../server/controller/EdgeController.java | 2 +- .../controller/RuleChainController.java | 25 ++-- .../service/edge/rpc/EdgeGrpcSession.java | 5 +- .../update/DefaultDataUpdateService.java | 2 +- .../server/dao/rule/RuleChainService.java | 10 +- .../data/relation/RelationTypeGroup.java | 2 +- .../server/dao/edge/EdgeServiceImpl.java | 2 +- .../server/dao/rule/BaseRuleChainService.java | 38 +++--- .../server/dao/rule/RuleChainDao.java | 4 +- .../server/dao/sql/rule/JpaRuleChainDao.java | 6 +- .../dao/service/BaseRuleChainServiceTest.java | 24 ++-- .../thingsboard/rest/client/RestClient.java | 10 +- ui-ngx/src/app/core/http/entity.service.ts | 2 + .../src/app/core/http/rule-chain.service.ts | 16 +-- .../alias/entity-aliases-dialog.component.ts | 2 +- .../components/entity/entity.component.ts | 3 +- .../import-export/import-export.service.ts | 9 +- .../dashboard/dashboard-page.component.ts | 9 +- .../home/pages/edge/edge-routing.module.ts | 2 +- .../home/pages/edge/edge.component.html | 18 +-- .../modules/home/pages/edge/edge.component.ts | 24 ++-- .../pages/rulechain/rulechain.component.html | 30 ++++- .../pages/rulechain/rulechain.component.ts | 22 +++- .../rulechains-table-config.resolver.ts | 120 ++++++++++-------- ui-ngx/src/app/shared/models/constants.ts | 2 +- ui-ngx/src/app/shared/models/edge.models.ts | 68 +++++----- .../assets/locale/locale.constant-de_DE.json | 14 +- .../assets/locale/locale.constant-en_US.json | 92 ++++++++------ .../assets/locale/locale.constant-es_ES.json | 14 +- .../assets/locale/locale.constant-fr_FR.json | 14 +- 30 files changed, 334 insertions(+), 257 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/controller/EdgeController.java b/application/src/main/java/org/thingsboard/server/controller/EdgeController.java index 6b4899f378..7449d18181 100644 --- a/application/src/main/java/org/thingsboard/server/controller/EdgeController.java +++ b/application/src/main/java/org/thingsboard/server/controller/EdgeController.java @@ -108,7 +108,7 @@ public class EdgeController extends BaseController { RuleChain defaultRootEdgeRuleChain = null; if (created) { - defaultRootEdgeRuleChain = ruleChainService.getDefaultRootEdgeRuleChain(tenantId); + defaultRootEdgeRuleChain = ruleChainService.getEdgeTemplateRootRuleChain(tenantId); if (defaultRootEdgeRuleChain == null) { throw new DataValidationException("Root edge rule chain is not available!"); } diff --git a/application/src/main/java/org/thingsboard/server/controller/RuleChainController.java b/application/src/main/java/org/thingsboard/server/controller/RuleChainController.java index 8eb30e3fba..9e51ec06b4 100644 --- a/application/src/main/java/org/thingsboard/server/controller/RuleChainController.java +++ b/application/src/main/java/org/thingsboard/server/controller/RuleChainController.java @@ -50,7 +50,6 @@ import org.thingsboard.server.common.data.id.RuleNodeId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; -import org.thingsboard.server.common.data.page.TimePageLink; import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; import org.thingsboard.server.common.data.rule.DefaultRuleChainCreateRequest; import org.thingsboard.server.common.data.rule.RuleChain; @@ -556,14 +555,14 @@ public class RuleChainController extends BaseController { } @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") - @RequestMapping(value = "/ruleChain/{ruleChainId}/defaultRootEdge", method = RequestMethod.POST) + @RequestMapping(value = "/ruleChain/{ruleChainId}/edgeTemplateRoot", method = RequestMethod.POST) @ResponseBody - public RuleChain setDefaultRootEdgeRuleChain(@PathVariable(RULE_CHAIN_ID) String strRuleChainId) throws ThingsboardException { + public RuleChain setEdgeTemplateRootRuleChain(@PathVariable(RULE_CHAIN_ID) String strRuleChainId) throws ThingsboardException { checkParameter(RULE_CHAIN_ID, strRuleChainId); try { RuleChainId ruleChainId = new RuleChainId(toUUID(strRuleChainId)); RuleChain ruleChain = checkRuleChain(ruleChainId, Operation.WRITE); - ruleChainService.setDefaultRootEdgeRuleChain(getTenantId(), ruleChainId); + ruleChainService.setEdgeTemplateRootRuleChain(getTenantId(), ruleChainId); return ruleChain; } catch (Exception e) { logEntityAction(emptyId(EntityType.RULE_CHAIN), @@ -575,14 +574,14 @@ public class RuleChainController extends BaseController { } @PreAuthorize("hasAuthority('TENANT_ADMIN')") - @RequestMapping(value = "/ruleChain/{ruleChainId}/defaultEdge", method = RequestMethod.POST) + @RequestMapping(value = "/ruleChain/{ruleChainId}/autoAssignToEdge", method = RequestMethod.POST) @ResponseBody - public RuleChain addDefaultEdgeRuleChain(@PathVariable(RULE_CHAIN_ID) String strRuleChainId) throws ThingsboardException { + public RuleChain setAutoAssignToEdgeRuleChain(@PathVariable(RULE_CHAIN_ID) String strRuleChainId) throws ThingsboardException { checkParameter(RULE_CHAIN_ID, strRuleChainId); try { RuleChainId ruleChainId = new RuleChainId(toUUID(strRuleChainId)); RuleChain ruleChain = checkRuleChain(ruleChainId, Operation.WRITE); - ruleChainService.addDefaultEdgeRuleChain(getTenantId(), ruleChainId); + ruleChainService.setAutoAssignToEdgeRuleChain(getTenantId(), ruleChainId); return ruleChain; } catch (Exception e) { logEntityAction(emptyId(EntityType.RULE_CHAIN), @@ -594,14 +593,14 @@ public class RuleChainController extends BaseController { } @PreAuthorize("hasAuthority('TENANT_ADMIN')") - @RequestMapping(value = "/ruleChain/{ruleChainId}/defaultEdge", method = RequestMethod.DELETE) + @RequestMapping(value = "/ruleChain/{ruleChainId}/autoAssignToEdge", method = RequestMethod.DELETE) @ResponseBody - public RuleChain removeDefaultEdgeRuleChain(@PathVariable(RULE_CHAIN_ID) String strRuleChainId) throws ThingsboardException { + public RuleChain unsetAutoAssignToEdgeRuleChain(@PathVariable(RULE_CHAIN_ID) String strRuleChainId) throws ThingsboardException { checkParameter(RULE_CHAIN_ID, strRuleChainId); try { RuleChainId ruleChainId = new RuleChainId(toUUID(strRuleChainId)); RuleChain ruleChain = checkRuleChain(ruleChainId, Operation.WRITE); - ruleChainService.removeDefaultEdgeRuleChain(getTenantId(), ruleChainId); + ruleChainService.unsetAutoAssignToEdgeRuleChain(getTenantId(), ruleChainId); return ruleChain; } catch (Exception e) { logEntityAction(emptyId(EntityType.RULE_CHAIN), @@ -613,12 +612,12 @@ public class RuleChainController extends BaseController { } @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") - @RequestMapping(value = "/ruleChain/defaultEdgeRuleChains", method = RequestMethod.GET) + @RequestMapping(value = "/ruleChain/autoAssignToEdgeRuleChains", method = RequestMethod.GET) @ResponseBody - public List getDefaultEdgeRuleChains() throws ThingsboardException { + public List getAutoAssignToEdgeRuleChains() throws ThingsboardException { try { TenantId tenantId = getCurrentUser().getTenantId(); - return checkNotNull(ruleChainService.findDefaultEdgeRuleChainsByTenantId(tenantId)).get(); + return checkNotNull(ruleChainService.findAutoAssignToEdgeRuleChainsByTenantId(tenantId)).get(); } catch (Exception e) { throw handleException(e); } diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java index 9484e91d68..c31a900cb3 100644 --- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java +++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java @@ -165,10 +165,11 @@ public final class EdgeGrpcSession implements Closeable { .build()); if (ConnectResponseCode.ACCEPTED != responseMsg.getResponseCode()) { outputStream.onError(new RuntimeException(responseMsg.getErrorMsg())); + } else { + connected = true; } } - if (!connected && requestMsg.getMsgType().equals(RequestMsgType.SYNC_REQUEST_RPC_MESSAGE)) { - connected = true; + if (connected && requestMsg.getMsgType().equals(RequestMsgType.SYNC_REQUEST_RPC_MESSAGE)) { ctx.getSyncEdgeService().sync(edge); } if (connected) { diff --git a/application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java b/application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java index 20231cb01a..23eda0f5ff 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java @@ -128,7 +128,7 @@ public class DefaultDataUpdateService implements DataUpdateService { @Override protected void updateEntity(Tenant tenant) { try { - RuleChain defaultEdgeRuleChain = ruleChainService.getDefaultRootEdgeRuleChain(tenant.getId()); + RuleChain defaultEdgeRuleChain = ruleChainService.getEdgeTemplateRootRuleChain(tenant.getId()); if (defaultEdgeRuleChain == null) { installScripts.createDefaultEdgeRuleChains(tenant.getId()); } diff --git a/common/dao-api/src/main/java/org/thingsboard/server/dao/rule/RuleChainService.java b/common/dao-api/src/main/java/org/thingsboard/server/dao/rule/RuleChainService.java index d11ebe6d58..93a321dfef 100644 --- a/common/dao-api/src/main/java/org/thingsboard/server/dao/rule/RuleChainService.java +++ b/common/dao-api/src/main/java/org/thingsboard/server/dao/rule/RuleChainService.java @@ -79,14 +79,14 @@ public interface RuleChainService { PageData findRuleChainsByTenantIdAndEdgeId(TenantId tenantId, EdgeId edgeId, PageLink pageLink); - RuleChain getDefaultRootEdgeRuleChain(TenantId tenantId); + RuleChain getEdgeTemplateRootRuleChain(TenantId tenantId); - boolean setDefaultRootEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId); + boolean setEdgeTemplateRootRuleChain(TenantId tenantId, RuleChainId ruleChainId); - boolean addDefaultEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId); + boolean setAutoAssignToEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId); - boolean removeDefaultEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId); + boolean unsetAutoAssignToEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId); - ListenableFuture> findDefaultEdgeRuleChainsByTenantId(TenantId tenantId); + ListenableFuture> findAutoAssignToEdgeRuleChainsByTenantId(TenantId tenantId); } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java b/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java index 07315428e3..07901c5cbf 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java @@ -23,6 +23,6 @@ public enum RelationTypeGroup { RULE_CHAIN, RULE_NODE, EDGE, - EDGE_DEFAULT_RULE_CHAIN + EDGE_AUTO_ASSIGN_RULE_CHAIN } diff --git a/dao/src/main/java/org/thingsboard/server/dao/edge/EdgeServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/edge/EdgeServiceImpl.java index 7545af4950..795d3e63c6 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/edge/EdgeServiceImpl.java +++ b/dao/src/main/java/org/thingsboard/server/dao/edge/EdgeServiceImpl.java @@ -373,7 +373,7 @@ public class EdgeServiceImpl extends AbstractEntityService implements EdgeServic @Override public void assignDefaultRuleChainsToEdge(TenantId tenantId, EdgeId edgeId) { log.trace("Executing assignDefaultRuleChainsToEdge, tenantId [{}], edgeId [{}]", tenantId, edgeId); - ListenableFuture> future = ruleChainService.findDefaultEdgeRuleChainsByTenantId(tenantId); + ListenableFuture> future = ruleChainService.findAutoAssignToEdgeRuleChainsByTenantId(tenantId); Futures.addCallback(future, new FutureCallback>() { @Override public void onSuccess(List ruleChains) { diff --git a/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleChainService.java b/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleChainService.java index 78685d6bf9..cb17f4a3de 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleChainService.java +++ b/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleChainService.java @@ -624,21 +624,21 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC } @Override - public RuleChain getDefaultRootEdgeRuleChain(TenantId tenantId) { + public RuleChain getEdgeTemplateRootRuleChain(TenantId tenantId) { return getRootRuleChainByType(tenantId, RuleChainType.EDGE); } @Override - public boolean setDefaultRootEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId) { + public boolean setEdgeTemplateRootRuleChain(TenantId tenantId, RuleChainId ruleChainId) { RuleChain ruleChain = ruleChainDao.findById(tenantId, ruleChainId.getId()); - RuleChain previousDefaultRootEdgeRuleChain = getDefaultRootEdgeRuleChain(ruleChain.getTenantId()); - if (previousDefaultRootEdgeRuleChain == null || !previousDefaultRootEdgeRuleChain.getId().equals(ruleChain.getId())) { + RuleChain previousEdgeTemplateRootRuleChain = getEdgeTemplateRootRuleChain(ruleChain.getTenantId()); + if (previousEdgeTemplateRootRuleChain == null || !previousEdgeTemplateRootRuleChain.getId().equals(ruleChain.getId())) { try { - if (previousDefaultRootEdgeRuleChain != null) { - deleteRelation(tenantId, new EntityRelation(previousDefaultRootEdgeRuleChain.getTenantId(), previousDefaultRootEdgeRuleChain.getId(), + if (previousEdgeTemplateRootRuleChain != null) { + deleteRelation(tenantId, new EntityRelation(previousEdgeTemplateRootRuleChain.getTenantId(), previousEdgeTemplateRootRuleChain.getId(), EntityRelation.CONTAINS_TYPE, RelationTypeGroup.RULE_CHAIN)); - previousDefaultRootEdgeRuleChain.setRoot(false); - ruleChainDao.save(tenantId, previousDefaultRootEdgeRuleChain); + previousEdgeTemplateRootRuleChain.setRoot(false); + ruleChainDao.save(tenantId, previousEdgeTemplateRootRuleChain); } createRelation(tenantId, new EntityRelation(ruleChain.getTenantId(), ruleChain.getId(), EntityRelation.CONTAINS_TYPE, RelationTypeGroup.RULE_CHAIN)); @@ -646,7 +646,7 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC ruleChainDao.save(tenantId, ruleChain); return true; } catch (Exception e) { - log.warn("Failed to set default root edge rule chain, ruleChainId: [{}]", ruleChainId, e); + log.warn("Failed to set edge template root rule chain, ruleChainId: [{}]", ruleChainId, e); throw new RuntimeException(e); } } @@ -654,34 +654,34 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC } @Override - public boolean addDefaultEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId) { + public boolean setAutoAssignToEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId) { try { createRelation(tenantId, new EntityRelation(tenantId, ruleChainId, - EntityRelation.CONTAINS_TYPE, RelationTypeGroup.EDGE_DEFAULT_RULE_CHAIN)); + EntityRelation.CONTAINS_TYPE, RelationTypeGroup.EDGE_AUTO_ASSIGN_RULE_CHAIN)); return true; } catch (Exception e) { - log.warn("Failed to add default edge rule chain, ruleChainId: [{}]", ruleChainId, e); + log.warn("Failed to set auto assign to edge rule chain, ruleChainId: [{}]", ruleChainId, e); throw new RuntimeException(e); } } @Override - public boolean removeDefaultEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId) { + public boolean unsetAutoAssignToEdgeRuleChain(TenantId tenantId, RuleChainId ruleChainId) { try { deleteRelation(tenantId, new EntityRelation(tenantId, ruleChainId, - EntityRelation.CONTAINS_TYPE, RelationTypeGroup.EDGE_DEFAULT_RULE_CHAIN)); + EntityRelation.CONTAINS_TYPE, RelationTypeGroup.EDGE_AUTO_ASSIGN_RULE_CHAIN)); return true; } catch (Exception e) { - log.warn("Failed to remove default edge rule chain, ruleChainId: [{}]", ruleChainId, e); + log.warn("Failed to unset auto assign to edge rule chain, ruleChainId: [{}]", ruleChainId, e); throw new RuntimeException(e); } } @Override - public ListenableFuture> findDefaultEdgeRuleChainsByTenantId(TenantId tenantId) { - log.trace("Executing findDefaultEdgeRuleChainsByTenantId, tenantId [{}]", tenantId); + public ListenableFuture> findAutoAssignToEdgeRuleChainsByTenantId(TenantId tenantId) { + log.trace("Executing findAutoAssignToEdgeRuleChainsByTenantId, tenantId [{}]", tenantId); validateId(tenantId, INCORRECT_TENANT_ID + tenantId); - return ruleChainDao.findDefaultEdgeRuleChainsByTenantId(tenantId.getId()); + return ruleChainDao.findAutoAssignToEdgeRuleChainsByTenantId(tenantId.getId()); } @@ -749,7 +749,7 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC } } if (ruleChain.isRoot() && RuleChainType.EDGE.equals(ruleChain.getType())) { - RuleChain defaultRootEdgeRuleChain = getDefaultRootEdgeRuleChain(ruleChain.getTenantId()); + RuleChain defaultRootEdgeRuleChain = getEdgeTemplateRootRuleChain(ruleChain.getTenantId()); if (defaultRootEdgeRuleChain != null && !defaultRootEdgeRuleChain.getId().equals(ruleChain.getId())) { throw new DataValidationException("Another default root edge rule chain is present in scope of current tenant!"); } diff --git a/dao/src/main/java/org/thingsboard/server/dao/rule/RuleChainDao.java b/dao/src/main/java/org/thingsboard/server/dao/rule/RuleChainDao.java index 26ec1c990c..34bded4c5b 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/rule/RuleChainDao.java +++ b/dao/src/main/java/org/thingsboard/server/dao/rule/RuleChainDao.java @@ -61,10 +61,10 @@ public interface RuleChainDao extends Dao, TenantEntityDao { PageData findRuleChainsByTenantIdAndEdgeId(UUID tenantId, UUID edgeId, PageLink pageLink); /** - * Find default edge rule chains by tenantId. + * Find auto assign to edge rule chains by tenantId. * * @param tenantId the tenantId * @return the list of rule chain objects */ - ListenableFuture> findDefaultEdgeRuleChainsByTenantId(UUID tenantId); + ListenableFuture> findAutoAssignToEdgeRuleChainsByTenantId(UUID tenantId); } diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaRuleChainDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaRuleChainDao.java index 13511693d0..44755d6631 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaRuleChainDao.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaRuleChainDao.java @@ -95,10 +95,10 @@ public class JpaRuleChainDao extends JpaAbstractSearchTextDao> findDefaultEdgeRuleChainsByTenantId(UUID tenantId) { - log.debug("Try to find default edge rule chains by tenantId [{}]", tenantId); + public ListenableFuture> findAutoAssignToEdgeRuleChainsByTenantId(UUID tenantId) { + log.debug("Try to find auto assign to edge rule chains by tenantId [{}]", tenantId); ListenableFuture> relations = - relationDao.findAllByFromAndType(new TenantId(tenantId), new TenantId(tenantId), EntityRelation.CONTAINS_TYPE, RelationTypeGroup.EDGE_DEFAULT_RULE_CHAIN); + relationDao.findAllByFromAndType(new TenantId(tenantId), new TenantId(tenantId), EntityRelation.CONTAINS_TYPE, RelationTypeGroup.EDGE_AUTO_ASSIGN_RULE_CHAIN); return Futures.transformAsync(relations, input -> { if (input != null && !input.isEmpty()) { List> ruleChainsFutures = new ArrayList<>(input.size()); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java index b870c9763a..2affcc58db 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java @@ -331,24 +331,24 @@ public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { @Test public void testGetDefaultEdgeRuleChains() throws Exception { - RuleChainId ruleChainId = saveRuleChainAndSetDefaultEdge("Default Edge Rule Chain 1"); - saveRuleChainAndSetDefaultEdge("Default Edge Rule Chain 2"); - List result = ruleChainService.findDefaultEdgeRuleChainsByTenantId(tenantId).get(); + RuleChainId ruleChainId = saveRuleChainAndSetAutoAssignToEdge("Default Edge Rule Chain 1"); + saveRuleChainAndSetAutoAssignToEdge("Default Edge Rule Chain 2"); + List result = ruleChainService.findAutoAssignToEdgeRuleChainsByTenantId(tenantId).get(); Assert.assertEquals(2, result.size()); - ruleChainService.removeDefaultEdgeRuleChain(tenantId, ruleChainId); + ruleChainService.unsetAutoAssignToEdgeRuleChain(tenantId, ruleChainId); - result = ruleChainService.findDefaultEdgeRuleChainsByTenantId(tenantId).get(); + result = ruleChainService.findAutoAssignToEdgeRuleChainsByTenantId(tenantId).get(); Assert.assertEquals(1, result.size()); } @Test - public void setDefaultRootEdgeRuleChain() throws Exception { - RuleChainId ruleChainId1 = saveRuleChainAndSetDefaultEdge("Default Edge Rule Chain 1"); - RuleChainId ruleChainId2 = saveRuleChainAndSetDefaultEdge("Default Edge Rule Chain 2"); + public void setEdgeTemplateRootRuleChain() throws Exception { + RuleChainId ruleChainId1 = saveRuleChainAndSetAutoAssignToEdge("Default Edge Rule Chain 1"); + RuleChainId ruleChainId2 = saveRuleChainAndSetAutoAssignToEdge("Default Edge Rule Chain 2"); - ruleChainService.setDefaultRootEdgeRuleChain(tenantId, ruleChainId1); - ruleChainService.setDefaultRootEdgeRuleChain(tenantId, ruleChainId2); + ruleChainService.setEdgeTemplateRootRuleChain(tenantId, ruleChainId1); + ruleChainService.setEdgeTemplateRootRuleChain(tenantId, ruleChainId2); RuleChain ruleChainById = ruleChainService.findRuleChainById(tenantId, ruleChainId1); Assert.assertFalse(ruleChainById.isRoot()); @@ -357,13 +357,13 @@ public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { Assert.assertTrue(ruleChainById.isRoot()); } - private RuleChainId saveRuleChainAndSetDefaultEdge(String name) { + private RuleChainId saveRuleChainAndSetAutoAssignToEdge(String name) { RuleChain edgeRuleChain = new RuleChain(); edgeRuleChain.setTenantId(tenantId); edgeRuleChain.setType(RuleChainType.EDGE); edgeRuleChain.setName(name); RuleChain savedEdgeRuleChain = ruleChainService.saveRuleChain(edgeRuleChain); - ruleChainService.addDefaultEdgeRuleChain(tenantId, savedEdgeRuleChain.getId()); + ruleChainService.setAutoAssignToEdgeRuleChain(tenantId, savedEdgeRuleChain.getId()); return savedEdgeRuleChain.getId(); } 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 915e705f72..2dcba0d7b5 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 @@ -2676,7 +2676,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { }, params).getBody(); } - public Optional addDefaultEdgeRuleChain(RuleChainId ruleChainId) { + public Optional setAutoAssignToEdgeRuleChain(RuleChainId ruleChainId) { try { ResponseEntity ruleChain = restTemplate.postForEntity(baseURL + "/api/ruleChain/{ruleChainId}/defaultEdge", null, RuleChain.class, ruleChainId.getId()); return Optional.ofNullable(ruleChain.getBody()); @@ -2689,7 +2689,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { } } - public Optional removeDefaultEdgeRuleChain(RuleChainId ruleChainId) { + public Optional unsetAutoAssignToEdgeRuleChain(RuleChainId ruleChainId) { try { ResponseEntity ruleChain = restTemplate.exchange(baseURL + "/api/ruleChain/{ruleChainId}/defaultEdge", HttpMethod.DELETE, HttpEntity.EMPTY, RuleChain.class, ruleChainId.getId()); return Optional.ofNullable(ruleChain.getBody()); @@ -2702,7 +2702,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { } } - public List getDefaultEdgeRuleChains() { + public List getAutoAssignToEdgeRuleChains() { return restTemplate.exchange(baseURL + "/api/ruleChain/defaultEdgeRuleChains", HttpMethod.GET, HttpEntity.EMPTY, @@ -2710,9 +2710,9 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { }).getBody(); } - public Optional setDefaultRootEdgeRuleChain(RuleChainId ruleChainId) { + public Optional setRootEdgeTemplateRuleChain(RuleChainId ruleChainId) { try { - ResponseEntity ruleChain = restTemplate.postForEntity(baseURL + "/api/ruleChain/{ruleChainId}/defaultRootEdge", null, RuleChain.class, ruleChainId.getId()); + ResponseEntity ruleChain = restTemplate.postForEntity(baseURL + "/api/ruleChain/{ruleChainId}/edgeTemplateRoot", null, RuleChain.class, ruleChainId.getId()); return Optional.ofNullable(ruleChain.getBody()); } catch (HttpClientErrorException exception) { if (exception.getStatusCode() == HttpStatus.NOT_FOUND) { diff --git a/ui-ngx/src/app/core/http/entity.service.ts b/ui-ngx/src/app/core/http/entity.service.ts index e0b1fc04bc..60d47cc4a5 100644 --- a/ui-ngx/src/app/core/http/entity.service.ts +++ b/ui-ngx/src/app/core/http/entity.service.ts @@ -565,6 +565,8 @@ export class EntityService { return entityType === EntityType.ENTITY_VIEW; case AliasFilterType.relationsQuery: return true; + case AliasFilterType.apiUsageState: + return true; case AliasFilterType.assetSearchQuery: return entityType === EntityType.ASSET; case AliasFilterType.deviceSearchQuery: diff --git a/ui-ngx/src/app/core/http/rule-chain.service.ts b/ui-ngx/src/app/core/http/rule-chain.service.ts index 9db728f105..f4b5d8b0e7 100644 --- a/ui-ngx/src/app/core/http/rule-chain.service.ts +++ b/ui-ngx/src/app/core/http/rule-chain.service.ts @@ -313,20 +313,20 @@ export class RuleChainService { return this.http.delete(`/api/edge/${edgeId}/ruleChain/${ruleChainId}`, defaultHttpOptionsFromConfig(config)); } - public setDefaultRootEdgeRuleChain(ruleChainId: string, config?: RequestConfig): Observable { - return this.http.post(`/api/ruleChain/${ruleChainId}/defaultRootEdge`, defaultHttpOptionsFromConfig(config)); + public setEdgeTemplateRootRuleChain(ruleChainId: string, config?: RequestConfig): Observable { + return this.http.post(`/api/ruleChain/${ruleChainId}/edgeTemplateRoot`, defaultHttpOptionsFromConfig(config)); } - public addDefaultEdgeRuleChain(ruleChainId: string, config?: RequestConfig): Observable { - return this.http.post(`/api/ruleChain/${ruleChainId}/defaultEdge`, defaultHttpOptionsFromConfig(config)); + public setAutoAssignToEdgeRuleChain(ruleChainId: string, config?: RequestConfig): Observable { + return this.http.post(`/api/ruleChain/${ruleChainId}/autoAssignToEdge`, defaultHttpOptionsFromConfig(config)); } - public removeDefaultEdgeRuleChain(ruleChainId: string, config?: RequestConfig): Observable { - return this.http.delete(`/api/ruleChain/${ruleChainId}/defaultEdge`, defaultHttpOptionsFromConfig(config)); + public unsetAutoAssignToEdgeRuleChain(ruleChainId: string, config?: RequestConfig): Observable { + return this.http.delete(`/api/ruleChain/${ruleChainId}/autoAssignToEdge`, defaultHttpOptionsFromConfig(config)); } - public getDefaultEdgeRuleChains(config?: RequestConfig): Observable> { - return this.http.get>(`/api/ruleChain/defaultEdgeRuleChains`, defaultHttpOptionsFromConfig(config)); + public getAutoAssignToEdgeRuleChains(config?: RequestConfig): Observable> { + return this.http.get>(`/api/ruleChain/autoAssignToEdgeRuleChains`, defaultHttpOptionsFromConfig(config)); } public setEdgeRootRuleChain(edgeId: string, ruleChainId: string, config?: RequestConfig): Observable { diff --git a/ui-ngx/src/app/modules/home/components/alias/entity-aliases-dialog.component.ts b/ui-ngx/src/app/modules/home/components/alias/entity-aliases-dialog.component.ts index f6133314c8..66b6c302d7 100644 --- a/ui-ngx/src/app/modules/home/components/alias/entity-aliases-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/alias/entity-aliases-dialog.component.ts @@ -46,7 +46,7 @@ export interface EntityAliasesDialogData { widgets: Array; isSingleEntityAlias?: boolean; isSingleWidget?: boolean; - allowedEntityTypes?: Array; + allowedEntityTypes?: Array; disableAdd?: boolean; singleEntityAlias?: EntityAlias; customTitle?: string; diff --git a/ui-ngx/src/app/modules/home/components/entity/entity.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity.component.ts index b1509029d5..c6b8a7abbf 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity.component.ts @@ -81,8 +81,7 @@ export abstract class EntityComponent, protected constructor(protected store: Store, protected fb: FormBuilder, protected entityValue: T, - protected entitiesTableConfigValue: C, - @Inject(WINDOW) protected window?: Window) { + protected entitiesTableConfigValue: C) { super(store); this.entityForm = this.buildForm(this.entityValue); } diff --git a/ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts b/ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts index e8a94a52a7..4c81748eba 100644 --- a/ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts +++ b/ui-ngx/src/app/modules/home/components/import-export/import-export.service.ts @@ -45,7 +45,7 @@ import { } from '@home/components/alias/entity-aliases-dialog.component'; import { ItemBufferService, WidgetItem } from '@core/services/item-buffer.service'; import { FileType, ImportWidgetResult, JSON_TYPE, WidgetsBundleItem, ZIP_TYPE } from './import-export.models'; -import { EntityType } from '@shared/models/entity-type.models'; +import { AliasEntityType, EntityType } from '@shared/models/entity-type.models'; import { UtilsService } from '@core/services/utils.service'; import { WidgetService } from '@core/http/widget.service'; import { NULL_UUID } from '@shared/models/id/has-uuid'; @@ -603,6 +603,10 @@ export class ImportExportService { private editMissingAliases(widgets: Array, isSingleWidget: boolean, customTitle: string, missingEntityAliases: EntityAliases): Observable { + // TODO: voba - double check with Igor/Vlad regarding this approach to hide aliases + let allowedEntityTypes: Array = + this.entityService.prepareAllowedEntityTypesList(null, true); + return this.dialog.open(EntityAliasesDialogComponent, { disableClose: true, @@ -612,7 +616,8 @@ export class ImportExportService { widgets, customTitle, isSingleWidget, - disableAdd: true + disableAdd: true, + allowedEntityTypes: allowedEntityTypes } }).afterClosed().pipe( map((updatedEntityAliases) => { diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-page.component.ts index 5348f53abd..c40562bc9c 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-page.component.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-page.component.ts @@ -99,6 +99,7 @@ import { ImportExportService } from '@home/components/import-export/import-expor import { AuthState } from '@app/core/auth/auth.models'; import { FiltersDialogComponent, FiltersDialogData } from '@home/components/filter/filters-dialog.component'; import { Filters } from '@shared/models/query/query.models'; +import { AliasEntityType, EntityType } from "@shared/models/entity-type.models"; // @dynamic @Component({ @@ -142,6 +143,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC isToolbarOpenedAnimate = false; isRightLayoutOpened = false; + allowedEntityTypes: Array = null; + editingWidget: Widget = null; editingWidgetLayout: WidgetLayout = null; editingWidgetOriginal: Widget = null; @@ -309,6 +312,9 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC }; this.window.parent.postMessage(JSON.stringify(message), '*'); } + + // TODO: voba - double check with Igor/Vlad regarding this approach to hide aliases + this.allowedEntityTypes = this.entityService.prepareAllowedEntityTypesList(null, true); } private reset() { @@ -514,7 +520,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC data: { entityAliases: deepClone(this.dashboard.configuration.entityAliases), widgets: this.dashboardUtils.getWidgetsArray(this.dashboard), - isSingleEntityAlias: false + isSingleEntityAlias: false, + allowedEntityTypes: this.allowedEntityTypes } }).afterClosed().subscribe((entityAliases) => { if (entityAliases) { diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts b/ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts index cf7014d601..be6227c5dd 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/edge/edge-routing.module.ts @@ -65,7 +65,7 @@ const routes: Routes = [ auth: [Authority.TENANT_ADMIN], ruleChainsType: 'edge', breadcrumb: { - label: 'edge.rulechain-templates', + label: 'edge.edge-rulechains', icon: 'settings_ethernet' }, }, diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge.component.html b/ui-ngx/src/app/modules/home/pages/edge/edge.component.html index 3a75e752a7..61bd12eb7a 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge.component.html +++ b/ui-ngx/src/app/modules/home/pages/edge/edge.component.html @@ -134,22 +134,24 @@
+
- edge.cloud-endpoint - - - {{ 'edge.cloud-endpoint-required' | translate }} + edge.edge-license-key + + + {{ 'edge.edge-license-key-required' | translate }}
+
edge.cloud-endpoint-hint
- edge.edge-license-key - - - {{ 'edge.edge-license-key-required' | translate }} + edge.cloud-endpoint + + + {{ 'edge.cloud-endpoint-required' | translate }}
diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge.component.ts b/ui-ngx/src/app/modules/home/pages/edge/edge.component.ts index 0d98a5829a..59dfd5ea0b 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge.component.ts +++ b/ui-ngx/src/app/modules/home/pages/edge/edge.component.ts @@ -44,13 +44,15 @@ export class EdgeComponent extends EntityComponent { @Inject('entity') protected entityValue: EdgeInfo, @Inject('entitiesTableConfig') protected entitiesTableConfigValue: EntityTableConfig, public fb: FormBuilder, - // TODO: voba - discuss with Vlad how properly add window to subclass @Inject(WINDOW) protected window: Window) { - super(store, fb, entityValue, entitiesTableConfigValue, window); + super(store, fb, entityValue, entitiesTableConfigValue); } ngOnInit() { this.edgeScope = this.entitiesTableConfig.componentsData.edgeScope; + this.entityForm.patchValue({ + cloudEndpoint:this.window.location.origin + }); super.ngOnInit(); } @@ -70,9 +72,9 @@ export class EdgeComponent extends EntityComponent { return this.fb.group( { name: [entity ? entity.name : '', [Validators.required]], - type: [entity ? entity.type : null, [Validators.required]], + type: [entity?.type ? entity.type : 'default', [Validators.required]], label: [entity ? entity.label : ''], - cloudEndpoint: [this.window.location.origin, [Validators.required]], + cloudEndpoint: [null, [Validators.required]], edgeLicenseKey: ['', [Validators.required]], routingKey: guid(), secret: this.generateSecret(20), @@ -86,14 +88,14 @@ export class EdgeComponent extends EntityComponent { } updateForm(entity: EdgeInfo) { - this.entityForm.patchValue({name: entity.name}); - this.entityForm.patchValue({type: entity.type}); - this.entityForm.patchValue({label: entity.label}); - this.entityForm.patchValue({cloudEndpoint: entity.cloudEndpoint}); - this.entityForm.patchValue({edgeLicenseKey: entity.edgeLicenseKey}); - this.entityForm.patchValue({routingKey: entity.routingKey}); - this.entityForm.patchValue({secret: entity.secret}); this.entityForm.patchValue({ + name: entity.name, + type: entity.type, + label: entity.label, + cloudEndpoint: entity.cloudEndpoint ? entity.cloudEndpoint : this.window.location.origin, + edgeLicenseKey: entity.edgeLicenseKey, + routingKey: entity.routingKey, + secret: entity.secret, additionalInfo: { description: entity.additionalInfo ? entity.additionalInfo.description : '' } diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.html b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.html index 710a17576f..1235b5f85a 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.html +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.html @@ -19,13 +19,13 @@ + + +
diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts index c447bf1b54..21befdb9d4 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts @@ -86,9 +86,27 @@ export class RuleChainComponent extends EntityComponent { })); } - isRootRuleChain() { + isEdgeRootRuleChain() { if (this.entitiesTableConfig && this.entityValue) { - return this.entitiesTableConfig.componentsData.rootRuleChainId == this.entityValue.id.id; + return this.entitiesTableConfig.componentsData.edge?.rootRuleChainId?.id == this.entityValue.id.id; + } else { + return false; + } + } + + isAutoAssignToEdgeRuleChain() { + if (this.entitiesTableConfig && this.entityValue) { + return !this.entityValue.root && + this.entitiesTableConfig.componentsData?.autoAssignToEdgeRuleChainIds?.includes(this.entityValue.id.id); + } else { + return false; + } + } + + isNotAutoAssignToEdgeRuleChain() { + if (this.entitiesTableConfig && this.entityValue) { + return !this.entityValue.root && + !this.entitiesTableConfig.componentsData?.autoAssignToEdgeRuleChainIds?.includes(this.entityValue.id.id); } else { return false; } diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts index 6e0f592b5e..f21ca25fab 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts @@ -14,9 +14,9 @@ /// limitations under the License. /// -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; -import {ActivatedRouteSnapshot, Resolve, Router} from '@angular/router'; +import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router'; import { CellActionDescriptor, checkBoxCell, @@ -27,27 +27,28 @@ import { GroupActionDescriptor, HeaderActionDescriptor } from '@home/models/entity/entities-table-config.models'; -import {TranslateService} from '@ngx-translate/core'; -import {DatePipe} from '@angular/common'; -import {EntityType, entityTypeResources, entityTypeTranslations} from '@shared/models/entity-type.models'; -import {EntityAction} from '@home/models/entity/entity-component.models'; -import {RuleChain, ruleChainType} from '@shared/models/rule-chain.models'; -import {RuleChainService} from '@core/http/rule-chain.service'; -import {RuleChainComponent} from '@modules/home/pages/rulechain/rulechain.component'; -import {DialogService} from '@core/services/dialog.service'; -import {RuleChainTabsComponent} from '@home/pages/rulechain/rulechain-tabs.component'; -import {ImportExportService} from '@home/components/import-export/import-export.service'; -import {ItemBufferService} from '@core/services/item-buffer.service'; -import {EdgeService} from "@core/http/edge.service"; -import {forkJoin, Observable} from "rxjs"; +import { TranslateService } from '@ngx-translate/core'; +import { DatePipe } from '@angular/common'; +import { EntityType, entityTypeResources, entityTypeTranslations } from '@shared/models/entity-type.models'; +import { EntityAction } from '@home/models/entity/entity-component.models'; +import { RuleChain, ruleChainType } from '@shared/models/rule-chain.models'; +import { RuleChainService } from '@core/http/rule-chain.service'; +import { RuleChainComponent } from '@modules/home/pages/rulechain/rulechain.component'; +import { DialogService } from '@core/services/dialog.service'; +import { RuleChainTabsComponent } from '@home/pages/rulechain/rulechain-tabs.component'; +import { ImportExportService } from '@home/components/import-export/import-export.service'; +import { ItemBufferService } from '@core/services/item-buffer.service'; +import { EdgeService } from "@core/http/edge.service"; +import { forkJoin, Observable } from "rxjs"; import { AddEntitiesToEdgeDialogComponent, AddEntitiesToEdgeDialogData } from "@home/dialogs/add-entities-to-edge-dialog.component"; -import {MatDialog} from "@angular/material/dialog"; -import {isUndefined} from "@core/utils"; -import {PageLink} from "@shared/models/page/page-link"; -import {Edge} from "@shared/models/edge.models"; +import { MatDialog } from "@angular/material/dialog"; +import { isUndefined } from "@core/utils"; +import { PageLink } from "@shared/models/page/page-link"; +import { Edge } from "@shared/models/edge.models"; +import { map, mergeMap } from "rxjs/operators"; @Injectable() export class RuleChainsTableConfigResolver implements Resolve> { @@ -96,12 +97,11 @@ export class RuleChainsTableConfigResolver implements Resolve ruleChain && !ruleChain.root; this.config.deleteEnabled = (ruleChain) => ruleChain && !ruleChain.root; this.config.entitiesDeleteEnabled = true; - } - else if (this.config.componentsData.ruleChainScope === 'edge') { + } else if (this.config.componentsData.ruleChainScope === 'edge') { this.config.entitySelectionEnabled = ruleChain => this.config.componentsData.edge.rootRuleChainId.id != ruleChain.id.id; this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(edge => { this.config.componentsData.edge = edge; - this.config.tableTitle = edge.name + ': ' + this.translate.instant('edge.rulechain-templates'); + this.config.tableTitle = edge.name + ': ' + this.translate.instant('edge.rulechains'); }); this.config.entitiesDeleteEnabled = false; } @@ -128,9 +128,13 @@ export class RuleChainsTableConfigResolver implements Resolve('createdTime', 'common.created-time', this.datePipe, '150px'), new EntityTableColumn('name', 'rulechain.name', '100%'), - new EntityTableColumn('root', 'rulechain.root', '60px', + new EntityTableColumn('root', 'rulechain.edge-template-root', '60px', entity => { return checkBoxCell(entity.root); + }), + new EntityTableColumn('assignToEdge', 'rulechain.assign-to-edge', '60px', + entity => { + return checkBoxCell(this.isAutoAssignToEdgeRuleChain(entity)); }) ); } @@ -226,22 +230,22 @@ export class RuleChainsTableConfigResolver implements Resolve this.isNonRootRuleChain(entity), - onAction: ($event, entity) => this.setDefaultRootEdgeRuleChain($event, entity) + onAction: ($event, entity) => this.setEdgeTemplateRootRuleChain($event, entity) }, { name: this.translate.instant('rulechain.set-auto-assign-to-edge'), icon: 'bookmark_outline', - isEnabled: (entity) => this.isNonDefaultEdgeRuleChain(entity), - onAction: ($event, entity) => this.setDefaultEdgeRuleChain($event, entity) + isEnabled: (entity) => this.isNotAutoAssignToEdgeRuleChain(entity), + onAction: ($event, entity) => this.setAutoAssignToEdgeRuleChain($event, entity) }, { - name: this.translate.instant('rulechain.remove-default-edge'), + name: this.translate.instant('rulechain.unset-auto-assign-to-edge'), icon: 'bookmark', - isEnabled: (entity) => this.isDefaultEdgeRuleChain(entity), - onAction: ($event, entity) => this.removeDefaultEdgeRuleChain($event, entity) + isEnabled: (entity) => this.isAutoAssignToEdgeRuleChain(entity), + onAction: ($event, entity) => this.unsetAutoAssignToEdgeRuleChain($event, entity) } ) } @@ -344,26 +348,35 @@ export class RuleChainsTableConfigResolver implements Resolve { if (res) { - this.ruleChainService.setDefaultRootEdgeRuleChain(ruleChain.id.id).subscribe( + this.ruleChainService.setEdgeTemplateRootRuleChain(ruleChain.id.id).subscribe( () => { this.config.table.updateData(); } @@ -444,7 +457,7 @@ export class RuleChainsTableConfigResolver implements Resolve { if (res) { - this.ruleChainService.addDefaultEdgeRuleChain(ruleChain.id.id).subscribe( + this.ruleChainService.setAutoAssignToEdgeRuleChain(ruleChain.id.id).subscribe( () => { this.config.table.updateData(); } @@ -466,19 +479,19 @@ export class RuleChainsTableConfigResolver implements Resolve { if (res) { - this.ruleChainService.removeDefaultEdgeRuleChain(ruleChain.id.id).subscribe( + this.ruleChainService.unsetAutoAssignToEdgeRuleChain(ruleChain.id.id).subscribe( () => { this.config.table.updateData(); } @@ -490,17 +503,18 @@ export class RuleChainsTableConfigResolver implements Resolve { - ruleChains.map(ruleChain => this.config.componentsData.defaultEdgeRuleChainIds.push(ruleChain.id.id)); - }); - return this.ruleChainService.getRuleChains(pageLink, ruleChainType.edge); + return this.ruleChainService.getAutoAssignToEdgeRuleChains().pipe( + mergeMap((ruleChains) => { + this.config.componentsData.autoAssignToEdgeRuleChainIds = []; + ruleChains.map(ruleChain => this.config.componentsData.autoAssignToEdgeRuleChainIds.push(ruleChain.id.id)); + return this.ruleChainService.getRuleChains(pageLink, ruleChainType.edge); + }) + ); } } diff --git a/ui-ngx/src/app/shared/models/constants.ts b/ui-ngx/src/app/shared/models/constants.ts index 4fc29582c4..da1fa8dedc 100644 --- a/ui-ngx/src/app/shared/models/constants.ts +++ b/ui-ngx/src/app/shared/models/constants.ts @@ -115,7 +115,7 @@ export const HelpLinks = { users: helpBaseUrl + '/docs/user-guide/ui/users', devices: helpBaseUrl + '/docs/user-guide/ui/devices', deviceProfiles: helpBaseUrl + '/docs/user-guide/ui/device-profiles', - edges: helpBaseUrl + 'docs/user-guide/ui/edges', + edges: helpBaseUrl + '/docs/user-guide/ui/edges', assets: helpBaseUrl + '/docs/user-guide/ui/assets', entityViews: helpBaseUrl + '/docs/user-guide/ui/entity-views', entitiesImport: helpBaseUrl + '/docs/user-guide/bulk-provisioning', diff --git a/ui-ngx/src/app/shared/models/edge.models.ts b/ui-ngx/src/app/shared/models/edge.models.ts index 78f2f3e261..bf09216df9 100644 --- a/ui-ngx/src/app/shared/models/edge.models.ts +++ b/ui-ngx/src/app/shared/models/edge.models.ts @@ -93,45 +93,45 @@ export enum EdgeEventStatus { export const edgeEventTypeTranslations = new Map( [ - [EdgeEventType.DASHBOARD, 'edge.edge-event-type-dashboard'], - [EdgeEventType.ASSET, 'edge.edge-event-type-asset'], - [EdgeEventType.DEVICE, 'edge.edge-event-type-device'], - [EdgeEventType.DEVICE_PROFILE, 'edge.edge-event-type-device-profile'], - [EdgeEventType.ENTITY_VIEW, 'edge.edge-event-type-entity-view'], - [EdgeEventType.ALARM, 'edge.edge-event-type-alarm'], - [EdgeEventType.RULE_CHAIN, 'edge.edge-event-type-rule-chain'], - [EdgeEventType.RULE_CHAIN_METADATA, 'edge.edge-event-type-rule-chain-metadata'], - [EdgeEventType.EDGE, 'edge.edge-event-type-edge'], - [EdgeEventType.USER, 'edge.edge-event-type-user'], - [EdgeEventType.CUSTOMER, 'edge.edge-event-type-customer'], - [EdgeEventType.RELATION, 'edge.edge-event-type-relation'], - [EdgeEventType.WIDGETS_BUNDLE, 'edge.edge-event-type-widgets-bundle'], - [EdgeEventType.WIDGET_TYPE, 'edge.edge-event-type-widgets-type'], - [EdgeEventType.ADMIN_SETTINGS, 'edge.edge-event-type-admin-settings'] + [EdgeEventType.DASHBOARD, 'edge-event.type-dashboard'], + [EdgeEventType.ASSET, 'edge-event.type-asset'], + [EdgeEventType.DEVICE, 'edge-event.type-device'], + [EdgeEventType.DEVICE_PROFILE, 'edge-event.type-device-profile'], + [EdgeEventType.ENTITY_VIEW, 'edge-event.type-entity-view'], + [EdgeEventType.ALARM, 'edge-event.type-alarm'], + [EdgeEventType.RULE_CHAIN, 'edge-event.type-rule-chain'], + [EdgeEventType.RULE_CHAIN_METADATA, 'edge-event.type-rule-chain-metadata'], + [EdgeEventType.EDGE, 'edge-event.type-edge'], + [EdgeEventType.USER, 'edge-event.type-user'], + [EdgeEventType.CUSTOMER, 'edge-event.type-customer'], + [EdgeEventType.RELATION, 'edge-event.type-relation'], + [EdgeEventType.WIDGETS_BUNDLE, 'edge-event.type-widgets-bundle'], + [EdgeEventType.WIDGET_TYPE, 'edge-event.type-widgets-type'], + [EdgeEventType.ADMIN_SETTINGS, 'edge-event.type-admin-settings'] ] ); export const edgeEventActionTypeTranslations = new Map( [ - [EdgeEventActionType.ADDED, 'edge.edge-event-action-type-added'], - [EdgeEventActionType.DELETED, 'edge.edge-event-action-type-deleted'], - [EdgeEventActionType.UPDATED, 'edge.edge-event-action-type-updated'], - [EdgeEventActionType.POST_ATTRIBUTES, 'edge.edge-event-action-type-post-attributes'], - [EdgeEventActionType.ATTRIBUTES_UPDATED, 'edge.edge-event-action-type-attributes-updated'], - [EdgeEventActionType.ATTRIBUTES_DELETED, 'edge.edge-event-action-type-attributes-deleted'], - [EdgeEventActionType.TIMESERIES_UPDATED, 'edge.edge-event-action-type-timeseries-updated'], - [EdgeEventActionType.CREDENTIALS_UPDATED, 'edge.edge-event-action-type-credentials-updated'], - [EdgeEventActionType.ASSIGNED_TO_CUSTOMER, 'edge.edge-event-action-type-assigned-to-customer'], - [EdgeEventActionType.UNASSIGNED_FROM_CUSTOMER, 'edge.edge-event-action-type-unassigned-from-customer'], - [EdgeEventActionType.RELATION_ADD_OR_UPDATE, 'edge.edge-event-action-type-relation-add-or-update'], - [EdgeEventActionType.RELATION_DELETED, 'edge.edge-event-action-type-relation-deleted'], - [EdgeEventActionType.RPC_CALL, 'edge.edge-event-action-type-rpc-call'], - [EdgeEventActionType.ALARM_ACK, 'edge.edge-event-action-type-alarm-ack'], - [EdgeEventActionType.ALARM_CLEAR, 'edge.edge-event-action-type-alarm-clear'], - [EdgeEventActionType.ASSIGNED_TO_EDGE, 'edge.edge-event-action-type-assigned-to-edge'], - [EdgeEventActionType.UNASSIGNED_FROM_EDGE, 'edge.edge-event-action-type-unassigned-from-edge'], - [EdgeEventActionType.CREDENTIALS_REQUEST, 'edge.edge-event-action-type-credentials-request'], - [EdgeEventActionType.ENTITY_MERGE_REQUEST, 'edge.edge-event-action-type-entity-merge-request'] + [EdgeEventActionType.ADDED, 'edge-event.action-type-added'], + [EdgeEventActionType.DELETED, 'edge-event.action-type-deleted'], + [EdgeEventActionType.UPDATED, 'edge-event.action-type-updated'], + [EdgeEventActionType.POST_ATTRIBUTES, 'edge-event.action-type-post-attributes'], + [EdgeEventActionType.ATTRIBUTES_UPDATED, 'edge-event.action-type-attributes-updated'], + [EdgeEventActionType.ATTRIBUTES_DELETED, 'edge-event.action-type-attributes-deleted'], + [EdgeEventActionType.TIMESERIES_UPDATED, 'edge-event.action-type-timeseries-updated'], + [EdgeEventActionType.CREDENTIALS_UPDATED, 'edge-event.action-type-credentials-updated'], + [EdgeEventActionType.ASSIGNED_TO_CUSTOMER, 'edge-event.action-type-assigned-to-customer'], + [EdgeEventActionType.UNASSIGNED_FROM_CUSTOMER, 'edge-event.action-type-unassigned-from-customer'], + [EdgeEventActionType.RELATION_ADD_OR_UPDATE, 'edge-event.action-type-relation-add-or-update'], + [EdgeEventActionType.RELATION_DELETED, 'edge-event.action-type-relation-deleted'], + [EdgeEventActionType.RPC_CALL, 'edge-event.action-type-rpc-call'], + [EdgeEventActionType.ALARM_ACK, 'edge-event.action-type-alarm-ack'], + [EdgeEventActionType.ALARM_CLEAR, 'edge-event.action-type-alarm-clear'], + [EdgeEventActionType.ASSIGNED_TO_EDGE, 'edge-event.action-type-assigned-to-edge'], + [EdgeEventActionType.UNASSIGNED_FROM_EDGE, 'edge-event.action-type-unassigned-from-edge'], + [EdgeEventActionType.CREDENTIALS_REQUEST, 'edge-event.action-type-credentials-request'], + [EdgeEventActionType.ENTITY_MERGE_REQUEST, 'edge-event.action-type-entity-merge-request'] ] ); diff --git a/ui-ngx/src/assets/locale/locale.constant-de_DE.json b/ui-ngx/src/assets/locale/locale.constant-de_DE.json index 09aebf31c8..3b2eade5e5 100644 --- a/ui-ngx/src/assets/locale/locale.constant-de_DE.json +++ b/ui-ngx/src/assets/locale/locale.constant-de_DE.json @@ -1395,16 +1395,16 @@ "unassign-rulechains-from-edge-text": "Nach der Bestätigung wird die Zuordnung aller ausgewählten Regelketten aufgehoben und sie sind für den Rand nicht mehr zugänglich.", "assign-rulechain-to-edge-title": "Regelkette(n) dem Rand zuordnen", "assign-rulechain-to-edge-text": "Bitte wählen Sie die Regelketten aus, die Sie dem Rand zuordnen möchten", - "set-default-root-edge": "Machen Sie Randregelkette zur Wurzel Standard", - "set-default-root-edge-rulechain-title": "Sind Sie sicher, dass Sie die Randregelkette '{{ruleChainName}}' zur Wurzel machen Standard?", - "set-default-root-edge-rulechain-text": "Nach der Bestätigung wird die Randregelkette zur Wurzel Standard und behandelt alle eingehenden Transportnachrichten.", + "set-edge-template-root-rulechain": "Erstellen Sie den Stamm der Regelkettenkantenvorlage", + "set-edge-template-root-rulechain-title": "Möchten Sie die Kantenvorlage der Regelkette '{{ruleChainName}}' wirklich als Root festlegen?", + "set-edge-template-root-rulechain-text": "Nach der Bestätigung wird die Regelkette zum Stamm der Kantenvorlage und zur Stammregelkette für neu erstellte Kanten.", "invalid-rulechain-type-error": "Regelkette konnte nicht importiert werden: Ungültige Regelkettentyp. Erwarteter Typ ist {{expectedRuleChainType}}.", - "set-auto-assign-to-edge": "Ordnen Sie die Regelkette bei der Erstellung automatisch den Kanten zu", + "set-auto-assign-to-edge": "Weisen Sie bei der Erstellung den Kanten die Regelkette zu", "set-auto-assign-to-edge-title": "Möchten Sie die Kantenregelkette '{{ruleChainName}}' bei der Erstellung automatisch den Kanten zuweisen?", "set-auto-assign-to-edge-text": "Nach der Bestätigung wird die Kantenregelkette bei der Erstellung automatisch den Kanten zugewiesen.", - "remove-default-edge": "Randregelkette Standard entfernen", - "remove-default-edge-title": "Sind Sie sicher, dass Sie die Randregelkette '{{ruleChainName}}' aus der Standardliste entfernen?", - "remove-default-edge-text": "Nach der Bestätigung wird die Randregelkette nicht für neu erstellte Rand vergeben." + "unset-auto-assign-to-edge": "Deaktiviert die Zuordnung der Regelkette zu Kanten bei der Erstellung", + "unset-auto-assign-to-edge-title": "Möchten Sie die Kantenregelkette '{{ruleChainName}}' bei der Erstellung unbedingt den Kanten zuweisen?", + "unset-auto-assign-to-edge-text": "Nach der Bestätigung wird die Kantenregelkette bei der Erstellung nicht mehr automatisch den Kanten zugewiesen." }, "rulenode": { "details": "Details", diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 0a1bcf153e..ee094b6bb2 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -1117,6 +1117,8 @@ "management": "Edge management", "no-edges-matching": "No edges matching '{{entity}}' were found.", "rulechain-templates": "Rule chain templates", + "rulechains": "Rule chains", + "edge-rulechains": "Edge Rule chains", "add": "Add Edge", "view": "View Edge", "no-edges-text": "No edges found", @@ -1133,8 +1135,10 @@ "name-required": "Name is required.", "edge-license-key": "Edge License Key", "edge-license-key-required": "Edge License Key is required.", + "edge-license-key-hint": "To obtain your license please navigate to the pricing page and select the best license option for your case.", "cloud-endpoint": "Cloud Endpoint", "cloud-endpoint-required": "Cloud Endpoint is required.", + "cloud-endpoint-hint": "Edge requires HTTP(s) access to Cloud (ThingsBoard CE/PE) to verify the license key. Please specify Cloud URL that Edge is able to connect to.", "description": "Description", "entity-info": "Entity info", "details": "Details", @@ -1206,42 +1210,44 @@ "pending": "Pending", "downlinks": "Downlinks", "no-downlinks-prompt": "No downlinks found", - "edge-event-type-dashboard": "Dashboard", - "edge-event-type-asset": "Asset", - "edge-event-type-device": "Device", - "edge-event-type-device-profile": "Device Profile", - "edge-event-type-entity-view": "Entity View", - "edge-event-type-alarm": "Alar", - "edge-event-type-rule-chain": "Rule Chain", - "edge-event-type-rule-chain-metadata": "Rule Chain Metadata", - "edge-event-type-edge": "Edge", - "edge-event-type-user": "User", - "edge-event-type-customer": "Customer", - "edge-event-type-relation": "Relation", - "edge-event-type-widgets-bundle": "Widgets Bundle", - "edge-event-type-widgets-type": "Widgets Type", - "edge-event-type-admin-settings": "Admin Settings", - "edge-event-action-type-added": "Added", - "edge-event-action-type-deleted": "Deleted", - "edge-event-action-type-updated": "Updated", - "edge-event-action-type-post-attributes": "Post Attributes", - "edge-event-action-type-attributes-updated": "Attributes Updated", - "edge-event-action-type-attributes-deleted": "Attributes Deleted", - "edge-event-action-type-timeseries-updated": "Timeseries Updated", - "edge-event-action-type-credentials-updated": "Credentials Updated", - "edge-event-action-type-assigned-to-customer": "Assigned to Customer", - "edge-event-action-type-unassigned-from-customer": "Unassigned from Customer", - "edge-event-action-type-relation-add-or-update": "Relation Add or Update", - "edge-event-action-type-relation-deleted": "Relation Deleted", - "edge-event-action-type-rpc-call": "RPC Call", - "edge-event-action-type-alarm-ack": "Alarm Ack", - "edge-event-action-type-alarm-clear": "Alarm Clear", - "edge-event-action-type-assigned-to-edge": "Assigned to Edge", - "edge-event-action-type-unassigned-from-edge": "Unassigned from Edge", - "edge-event-action-type-credentials-request": "Credentials Request", - "edge-event-action-type-entity-merge-request": "Entity Merge Request", "sync-process-started-successfully": "Sync process started successfully!" }, + "edge-event": { + "type-dashboard": "Dashboard", + "type-asset": "Asset", + "type-device": "Device", + "type-device-profile": "Device Profile", + "type-entity-view": "Entity View", + "type-alarm": "Alar", + "type-rule-chain": "Rule Chain", + "type-rule-chain-metadata": "Rule Chain Metadata", + "type-edge": "Edge", + "type-user": "User", + "type-customer": "Customer", + "type-relation": "Relation", + "type-widgets-bundle": "Widgets Bundle", + "type-widgets-type": "Widgets Type", + "type-admin-settings": "Admin Settings", + "action-type-added": "Added", + "action-type-deleted": "Deleted", + "action-type-updated": "Updated", + "action-type-post-attributes": "Post Attributes", + "action-type-attributes-updated": "Attributes Updated", + "action-type-attributes-deleted": "Attributes Deleted", + "action-type-timeseries-updated": "Timeseries Updated", + "action-type-credentials-updated": "Credentials Updated", + "action-type-assigned-to-customer": "Assigned to Customer", + "action-type-unassigned-from-customer": "Unassigned from Customer", + "action-type-relation-add-or-update": "Relation Add or Update", + "action-type-relation-deleted": "Relation Deleted", + "action-type-rpc-call": "RPC Call", + "action-type-alarm-ack": "Alarm Ack", + "action-type-alarm-clear": "Alarm Clear", + "action-type-assigned-to-edge": "Assigned to Edge", + "action-type-unassigned-from-edge": "Unassigned from Edge", + "action-type-credentials-request": "Credentials Request", + "action-type-entity-merge-request": "Entity Merge Request" + }, "error": { "unable-to-connect": "Unable to connect to the server! Please check your internet connection.", "unhandled-error-code": "Unhandled error code: {{errorCode}}", @@ -2073,22 +2079,24 @@ "selected-rulechains": "{ count, plural, 1 {1 rule chain} other {# rule chains} } selected", "open-rulechain": "Open rule chain", "assign-new-rulechain": "Assign new rulechain", + "edge-template-root": "Template Root", + "assign-to-edge": "Assign to Edge", "edge-rulechain": "Edge Rule chain", "unassign-rulechain-from-edge-text": "After the confirmation the rulechain will be unassigned and won't be accessible by the edge.", "unassign-rulechains-from-edge-title": "Are you sure you want to unassign { count, plural, 1 {1 rulechain} other {# rulechains} }?", "unassign-rulechains-from-edge-text": "After the confirmation all selected rulechains will be unassigned and won't be accessible by the edge.", "assign-rulechain-to-edge-title": "Assign Rule Chain(s) To Edge", "assign-rulechain-to-edge-text": "Please select the rulechains to assign to the edge", - "set-default-root-edge": "Make rule chain default root", - "set-default-root-edge-rulechain-title": "Are you sure you want to make the rule chain '{{ruleChainName}}' default edge root?", - "set-default-root-edge-rulechain-text": "After the confirmation the rule chain will become default edge root and will handle all incoming transport messages.", + "set-edge-template-root-rulechain": "Make rule chain edge template root", + "set-edge-template-root-rulechain-title": "Are you sure you want to make the rule chain '{{ruleChainName}}' edge template root?", + "set-edge-template-root-rulechain-text": "After the confirmation the rule chain will become edge template root and will be root rule chain for a newly created edges.", "invalid-rulechain-type-error": "Unable to import rule chain: Invalid rule chain type. Expected type is {{expectedRuleChainType}}.", - "set-auto-assign-to-edge": "Auto-assign rule chain to edge(s) on creation", - "set-auto-assign-to-edge-title": "Are you sure you want to auto-assign the edge rule chain '{{ruleChainName}}' to edge(s) on creation?", + "set-auto-assign-to-edge": "Assign rule chain to edge(s) on creation", + "set-auto-assign-to-edge-title": "Are you sure you want to assign the edge rule chain '{{ruleChainName}}' to edge(s) on creation?", "set-auto-assign-to-edge-text": "After the confirmation the edge rule chain will be automatically assigned to edge(s) on creation.", - "remove-default-edge": "Remove rule chain from defaults", - "remove-default-edge-title": "Are you sure you want to remove the edge rule chain '{{ruleChainName}}' from default list?", - "remove-default-edge-text": "After the confirmation the edge rule chain will not be assigned for a newly created edges.", + "unset-auto-assign-to-edge": "Unset assign rule chain to edge(s) on creation", + "unset-auto-assign-to-edge-title": "Are you sure you want to unset assign the edge rule chain '{{ruleChainName}}' to edge(s) on creation?", + "unset-auto-assign-to-edge-text": "After the confirmation the edge rule chain will no longer be automatically assigned to edge(s) on creation.", "unassign-rulechain-title": "Are you sure you want to unassign the rulechain '{{ruleChainName}}'?", "unassign-rulechains": "Unassign rulechains" }, diff --git a/ui-ngx/src/assets/locale/locale.constant-es_ES.json b/ui-ngx/src/assets/locale/locale.constant-es_ES.json index fea7e9bcca..7c2118fd3d 100644 --- a/ui-ngx/src/assets/locale/locale.constant-es_ES.json +++ b/ui-ngx/src/assets/locale/locale.constant-es_ES.json @@ -1566,16 +1566,16 @@ "unassign-rulechains-from-edge-text": "Después de la confirmación, todas las cadenas de reglas seleccionadas quedarán sin asignar y el borde no podrá acceder a ellas", "assign-rulechain-to-edge-title": "Asignar cadena (s) de reglas a borde", "assign-rulechain-to-edge-text": "Seleccione las cadenas de reglas para asignar al borde", - "set-default-root-edge": "Hacer que la cadena de reglas sea la raíz predeterminada", - "set-default-root-edge-rulechain-title": "¿Está seguro de que desea hacer que la cadena de reglas '{{ruleChainName}}' sea la raíz de borde predeterminada?", - "set-default-root-edge-rulechain-text": "Después de la confirmación, la cadena de reglas se convertirá en raíz raíz predeterminada y manejará todos los mensajes de transporte entrantes", + "set-edge-template-root-rulechain": "Hacer raíz de plantilla de borde de cadena de reglas", + "set-edge-template-root-rulechain-title": "¿Está seguro de que desea que la cadena de reglas '{{ruleChainName}}' sea la raíz de la plantilla de borde?", + "set-edge-template-root-rulechain-text": "Después de la confirmación, la cadena de reglas se convertirá en la raíz de la plantilla de borde y será la cadena de reglas raíz para los bordes recién creados.", "invalid-rulechain-type-error": "No se puede importar la cadena de reglas: Tipo de cadena de reglas no válido. El tipo esperado es {{expectedRuleChainType}}", - "set-auto-assign-to-edge": "Asignar automáticamente la cadena de reglas a los bordes en la creación", + "set-auto-assign-to-edge": "Asignar cadena de reglas a los bordes en la creación", "set-auto-assign-to-edge-title": "¿Está seguro de que desea asignar automáticamente la cadena de reglas de borde '{{ruleChainName}}' a los bordes en la creación?", "set-auto-assign-to-edge-text": "Después de la confirmación, la cadena de reglas de borde se asignará automáticamente a los bordes en la creación.", - "remove-default-edge": "Eliminar la cadena de regla de borde de los valores predeterminados", - "remove-default-edge-title": "¿Está seguro de que desea eliminar la cadena de reglas de borde '{{ruleChainName}}' de la lista predeterminada?", - "remove-default-edge-text": "Después de la confirmación, la cadena de reglas de borde no se asignará a los bordes recién creados" + "unset-auto-assign-to-edge": "Desmarcar asignar cadena de reglas a los bordes en la creación", + "unset-auto-assign-to-edge-title": "¿Está seguro de que desea anular la asignación de la cadena de reglas de borde '{{ruleChainName}}' a los bordes en la creación?", + "unset-auto-assign-to-edge-text": "Después de la confirmación, la cadena de reglas de borde ya no se asignará automáticamente a los bordes en la creación." }, "rulenode": { "details": "Detalles", diff --git a/ui-ngx/src/assets/locale/locale.constant-fr_FR.json b/ui-ngx/src/assets/locale/locale.constant-fr_FR.json index 63726967bc..e44a333d32 100644 --- a/ui-ngx/src/assets/locale/locale.constant-fr_FR.json +++ b/ui-ngx/src/assets/locale/locale.constant-fr_FR.json @@ -1440,16 +1440,16 @@ "unassign-rulechains-from-edge-text": "Après la confirmation, tous les chaînes de règles sélectionnés ne seront pas attribués et ne seront pas accessibles a la bordure.", "assign-rulechain-to-edge-title": "Attribuer les chaînes de règles a la bordure", "assign-rulechain-to-edge-text": "Veuillez sélectionner la bordure pour attribuer le ou les chaînes de règles", - "set-default-root-edge": "Définir la racine par défaut de la chaîne de règles", - "set-default-root-edge-rulechain-title": "AVoulez-vous vraiment créer de chaînes de règles par défaut '{{ruleChainName}}'?", - "set-default-root-edge-rulechain-text": "Après la confirmation, la chaîne de règles deviendra la racine de la bordure par défaut et gérera tous les messages de transport entrants.", + "set-edge-template-root-rulechain": "Rendre le modèle de bord de chaîne de règles racine", + "set-edge-template-root-rulechain-title": "Voulez-vous vraiment définir la racine du modèle d'arête de la chaîne de règles '{{ruleChainName}}'?", + "set-edge-template-root-rulechain-text": "Après la confirmation, la chaîne de règles deviendra la racine du modèle d'arête et sera la chaîne de règles racine pour les arêtes nouvellement créées.", "invalid-rulechain-type-error": "Impossible d'importer la chaîne de règles: type de chaîne de règles non valide. Le type attendu est {{attenduRuleChainType}}.", - "set-auto-assign-to-edge": "Assigner automatiquement la chaîne de règles aux arêtes lors de la création", + "set-auto-assign-to-edge": "Attribuer une chaîne de règles aux arêtes lors de la création", "set-auto-assign-to-edge-title": "Voulez-vous vraiment attribuer automatiquement la chaîne de règles d'arête '{{ruleChainName}}' à l'arête (s) lors de la création?", "set-auto-assign-to-edge-text": "Après la confirmation, la chaîne de règles d'arête sera automatiquement affectée à l'arête (s) lors de la création.", - "remove-default-edge": "Supprimer la chaîne de règles de la bordure des valeurs par défaut", - "remove-default-edge-title": "Voulez-vous vraiment supprimer la chaîne de règles de la bordure '{{ruleChainName}}' de la liste par défaut", - "remove-default-edge-text": "Après la confirmation, la chaîne de règles d'arête ne sera pas affectée aux arêtes nouvellement créées." + "unset-auto-assign-to-edge": "Non défini, attribuer une chaîne de règles aux arêtes lors de la création", + "unset-auto-assign-to-edge-title": "Voulez-vous vraiment annuler l'attribution de la chaîne de règles d'arête \"{{ruleChainName}}\" aux arêtes lors de la création?", + "unset-auto-assign-to-edge-text": "Après la confirmation, la chaîne de règles d'arêtes ne sera plus automatiquement affectée aux arêtes lors de la création." }, "rulenode": { "add": "Ajouter un noeud de règle",