From e23d2c7465cb139b33649c3a7c0b3d57f4fdf708 Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Thu, 17 Dec 2020 05:40:42 +0200 Subject: [PATCH] Edge import finished --- ui/src/app/api/entity.service.js | 12 ++++++++---- .../table-columns-assignment.directive.js | 14 +++++++++----- ui/src/app/locale/locale.constant-en_US.json | 6 +++--- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ui/src/app/api/entity.service.js b/ui/src/app/api/entity.service.js index 7c94c4b574..df684c334e 100644 --- a/ui/src/app/api/entity.service.js +++ b/ui/src/app/api/entity.service.js @@ -1278,10 +1278,14 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device } if (entityType === types.entityType.edge) { - newEntity.edgeLicenseKey = entityParameters.edgeLicenseKey; - newEntity.cloudEndpoint = entityParameters.cloudEndpoint; - newEntity.routingKey = entityParameters.routingKey; - newEntity.secret = entityParameters.secret; + Object.assign(newEntity, + { + edgeLicenseKey: entityParameters.edgeLicenseKey, + cloudEndpoint: entityParameters.cloudEndpoint, + routingKey: entityParameters.routingKey, + secret: entityParameters.secret + } + ); } let saveEntityPromise = getEntitySavePromise(entityType, newEntity, config); diff --git a/ui/src/app/import-export/table-columns-assignment.directive.js b/ui/src/app/import-export/table-columns-assignment.directive.js index ebfa0c8af6..012f7afad5 100644 --- a/ui/src/app/import-export/table-columns-assignment.directive.js +++ b/ui/src/app/import-export/table-columns-assignment.directive.js @@ -133,15 +133,19 @@ function TableColumnsAssignmentController($scope, types, $timeout) { vm.columnTypes.name.disable = isSelectName; vm.columnTypes.type.disable = isSelectType; vm.columnTypes.label.disable = isSelectLabel; - vm.columnTypes.gateway.disable = isSelectGateway; + if (angular.isDefined(vm.columnTypes.gateway)) { + vm.columnTypes.gateway.disable = isSelectGateway; + } vm.columnTypes.description.disable = isSelectDescription; if (angular.isDefined(vm.columnTypes.accessToken)) { vm.columnTypes.accessToken.disable = isSelectCredentials; } - vm.columnTypes.edgeLicenseKey.disable = isSelectEdgeLicenseKey; - vm.columnTypes.cloudEndpoint.disable = isSelectCloudEndpoint; - vm.columnTypes.routingKey.disable = isSelectRoutingKey; - vm.columnTypes.secret.disable = isSelectSecret; + if (vm.entityType === types.entityType.edge) { + vm.columnTypes.edgeLicenseKey.disable = isSelectEdgeLicenseKey; + vm.columnTypes.cloudEndpoint.disable = isSelectCloudEndpoint; + vm.columnTypes.routingKey.disable = isSelectRoutingKey; + vm.columnTypes.secret.disable = isSelectSecret; + } }); } }, true); diff --git a/ui/src/app/locale/locale.constant-en_US.json b/ui/src/app/locale/locale.constant-en_US.json index cf553f23c2..fe63f6e96b 100644 --- a/ui/src/app/locale/locale.constant-en_US.json +++ b/ui/src/app/locale/locale.constant-en_US.json @@ -1405,9 +1405,9 @@ "access-token": "Access token", "isgateway": "Is Gateway", "description": "Description", - "edgeLicenseKey": "Edge license key", - "cloudEndpoint": "Cloud endpoint", - "routingKey": "Edge routing key", + "edgeLicenseKey": "License Key", + "cloudEndpoint": "Cloud Endpoint", + "routingKey": "Edge key", "secret": "Edge secret" }, "stepper-text":{