diff --git a/ui/src/app/components/gateway/gateway-config-select.directive.js b/ui/src/app/components/gateway/gateway-config-select.directive.js index 05dc11b31a..79ff454475 100644 --- a/ui/src/app/components/gateway/gateway-config-select.directive.js +++ b/ui/src/app/components/gateway/gateway-config-select.directive.js @@ -48,7 +48,6 @@ function GatewayConfigSelect($compile, $templateCache, $mdConstant, $translate, function startWatchers() { scope.$watch('gateway', function (newVal, prevVal) { if (!angular.equals(newVal, prevVal) && newVal !== null) { - console.log("select startWatchers", "newVal", newVal, "prevVal", prevVal); //eslint-disable-line scope.updateView(); } }); diff --git a/ui/src/app/components/gateway/gateway-config.directive.js b/ui/src/app/components/gateway/gateway-config.directive.js index 4c361fdc56..766c14e19e 100644 --- a/ui/src/app/components/gateway/gateway-config.directive.js +++ b/ui/src/app/components/gateway/gateway-config.directive.js @@ -84,6 +84,9 @@ function GatewayConfigController($scope, $document, $mdDialog, $mdUtil, $window, multiple: true, }).then(function (config) { if (config && index > -1) { + if (!angular.equals(vm.gatewayConfig[index].config, config)) { + $scope.gatewayConfiguration.$setDirty(); + } vm.gatewayConfig[index].config = config; } }); diff --git a/ui/src/app/components/gateway/gateway-form.directive.js b/ui/src/app/components/gateway/gateway-form.directive.js index e558e20e38..d31a51d46d 100644 --- a/ui/src/app/components/gateway/gateway-form.directive.js +++ b/ui/src/app/components/gateway/gateway-form.directive.js @@ -32,6 +32,7 @@ function GatewayForm() { bindToController: { formId: '=', ctx: '=', + isStateForm: '=', deviceName: '=', isReadOnly: '=', isState: '=' @@ -54,9 +55,6 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, vm.types = types; vm.deviceNameForm = (vm.deviceName) ? vm.deviceName : null; - // vm.isReadOnlyForm = (vm.isReadOnly) ? vm.isReadOnly : false; - // vm.isStateForm = (vm.isState) ? vm.isState : false; - vm.isStateForm = true; vm.idForm = Math.random().toString(36).replace(/^0\.[0-9]*/, ''); vm.configurations = { gateway: '', @@ -100,6 +98,7 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, $scope.$watch('vm.ctx', function () { if (vm.ctx) { + vm.isStateForm = $scope.isStateForm; vm.settings = vm.ctx.settings; vm.widgetConfig = vm.ctx.widgetConfig; if (vm.ctx.datasources && vm.ctx.datasources.length) { @@ -174,7 +173,6 @@ function GatewayFormController($scope, $injector, $document, $mdExpansionPanel, } vm.createDevice = (deviceObj) => { - // console.log("vm.createDevice deviceObj", deviceObj); //eslint-disable-line deviceService.findByName(deviceObj.name, {ignoreErrors: true}) .then( function () { diff --git a/ui/src/app/layout/index.js b/ui/src/app/layout/index.js index 993163e03a..a00baa5199 100644 --- a/ui/src/app/layout/index.js +++ b/ui/src/app/layout/index.js @@ -30,7 +30,6 @@ import thingsboardSideMenu from '../components/side-menu.directive'; import thingsboardNavTree from '../components/nav-tree.directive'; import thingsboardDashboardAutocomplete from '../components/dashboard-autocomplete.directive'; import thingsboardKvMap from '../components/kv-map.directive'; -import thingsboardStateGatewayForm from '../components/gateway/state-gateway-form.directive'; import thingsboardGatewayConfig from '../components/gateway/gateway-config.directive'; import thingsboardGatewayConfigSelect from '../components/gateway/gateway-config-select.directive'; import thingsboardGatewayForm from '../components/gateway/gateway-form.directive'; @@ -97,7 +96,6 @@ export default angular.module('thingsboard.home', [ thingsboardNavTree, thingsboardDashboardAutocomplete, thingsboardKvMap, - thingsboardStateGatewayForm, thingsboardGatewayConfig, thingsboardGatewayConfigSelect, thingsboardGatewayForm,