diff --git a/ui/src/app/api/component-descriptor.service.js b/ui/src/app/api/component-descriptor.service.js index b4cacf4991..1069eef33d 100644 --- a/ui/src/app/api/component-descriptor.service.js +++ b/ui/src/app/api/component-descriptor.service.js @@ -28,31 +28,31 @@ function ComponentDescriptorService($http, $q) { return service; - function getComponentDescriptorsByTypes(componentTypes, ruleChainType) { + function getComponentDescriptorsByTypes(componentTypes, type) { var deferred = $q.defer(); var result = []; - if (!componentsByType[ruleChainType]) { - componentsByType[ruleChainType] = {}; + if (!componentsByType[type]) { + componentsByType[type] = {}; } for (var i=componentTypes.length-1;i>=0;i--) { var componentType = componentTypes[i]; - if (componentsByType[ruleChainType][componentType]) { - result = result.concat(componentsByType[ruleChainType][componentType]); + if (componentsByType[type][componentType]) { + result = result.concat(componentsByType[type][componentType]); componentTypes.splice(i, 1); } } if (!componentTypes.length) { deferred.resolve(result); } else { - var url = '/api/components?componentTypes=' + componentTypes.join(',') + '&ruleChainType=' + ruleChainType; + var url = '/api/components?componentTypes=' + componentTypes.join(',') + '&ruleChainType=' + type; $http.get(url, null).then(function success(response) { var components = response.data; for (var i = 0; i < components.length; i++) { var component = components[i]; - var componentsList = componentsByType[ruleChainType][component.type]; + var componentsList = componentsByType[type][component.type]; if (!componentsList) { componentsList = []; - componentsByType[ruleChainType][component.type] = componentsList; + componentsByType[type][component.type] = componentsList; } componentsList.push(component); componentsByClazz[component.clazz] = component; diff --git a/ui/src/app/api/rule-chain.service.js b/ui/src/app/api/rule-chain.service.js index 78c891ba06..af9cfe436a 100644 --- a/ui/src/app/api/rule-chain.service.js +++ b/ui/src/app/api/rule-chain.service.js @@ -311,7 +311,7 @@ function RuleChainService($http, $q, $filter, $ocLazyLoad, $translate, types, co } function getEdgesRuleChains(pageLink, config) { - return getRuleChains(pageLink, config, types.edgeRuleChainType); + return getRuleChains(pageLink, config, types.ruleChainType.edge); } function getEdgeRuleChains(edgeId, pageLink, config) { diff --git a/ui/src/app/common/types.constant.js b/ui/src/app/common/types.constant.js index 969042bbd4..2f3f42c2ad 100644 --- a/ui/src/app/common/types.constant.js +++ b/ui/src/app/common/types.constant.js @@ -393,7 +393,15 @@ export default angular.module('thingsboard.types', []) edge: "EDGE", user: "USER", customer: "CUSTOMER", - relation: "RELATION" + relation: "RELATION", + entityGroup: "ENTITY_GROUP", + schedulerEvent: "SCHEDULER_EVENT", + whiteLabeling: "WHITE_LABELING", + loginWhiteLabeling: "LOGIN_WHITE_LABELING", + customTranslation: "CUSTOM_TRANSLATION", + widgetsBundle: "WIDGETS_BUNDLE", + widgetType: "WIDGET_TYPE", + adminSettings: "ADMIN_SETTINGS" }, edgeEventAction: { updated: "UPDATED", @@ -786,8 +794,10 @@ export default angular.module('thingsboard.types', []) clientSide: false } }, - coreRuleChainType: "CORE", - edgeRuleChainType: "EDGE", + ruleChainType: { + core: "CORE", + edge: "EDGE" + }, ruleNodeTypeComponentTypes: ["FILTER", "ENRICHMENT", "TRANSFORMATION", "ACTION", "EXTERNAL"], ruleChainNodeComponent: { type: 'RULE_CHAIN', diff --git a/ui/src/app/dashboard/add-dashboards-to-edge.controller.js b/ui/src/app/dashboard/add-dashboards-to-edge.controller.js index ff579d492f..e5dcc00b33 100644 --- a/ui/src/app/dashboard/add-dashboards-to-edge.controller.js +++ b/ui/src/app/dashboard/add-dashboards-to-edge.controller.js @@ -53,13 +53,7 @@ export default function AddDashboardsToEdgeController(dashboardService, types, $ fetchMoreItems_: function () { if (vm.dashboards.hasNext && !vm.dashboards.pending) { vm.dashboards.pending = true; - var fetchDashboardsPromise; - if (edgeCustomerId === vm.types.id.nullUid) { - fetchDashboardsPromise = dashboardService.getTenantDashboards(vm.dashboards.nextPageLink); - } else { - fetchDashboardsPromise = dashboardService.getCustomerDashboards(edgeCustomerId, vm.dashboards.nextPageLink); - } - fetchDashboardsPromise.then( + dashboardService.getTenantDashboards(vm.dashboards.nextPageLink).then( function success(dashboards) { vm.dashboards.data = vm.dashboards.data.concat(dashboards.data); vm.dashboards.nextPageLink = dashboards.nextPageLink; diff --git a/ui/src/app/dashboard/dashboards.controller.js b/ui/src/app/dashboard/dashboards.controller.js index 6d61029b84..12a4d1cee0 100644 --- a/ui/src/app/dashboard/dashboards.controller.js +++ b/ui/src/app/dashboard/dashboards.controller.js @@ -708,14 +708,7 @@ export function DashboardsController(userService, dashboardService, customerServ $event.stopPropagation(); } var pageSize = 10; - var fetchDashboardsPromise; - if (vm.edgeCustomerId.id === vm.types.id.nullUid) { - fetchDashboardsPromise = dashboardService.getTenantDashboards({limit: pageSize, textSearch: ''}); - } else { - fetchDashboardsPromise = dashboardService.getCustomerDashboards(vm.edgeCustomerId.id, {limit: pageSize, textSearch: ''}); - } - - fetchDashboardsPromise.then( + dashboardService.getTenantDashboards({limit: pageSize, textSearch: ''}).then( function success(_dashboards) { var dashboards = { pageSize: pageSize, diff --git a/ui/src/app/edge/edge.routes.js b/ui/src/app/edge/edge.routes.js index e3443d1211..bcba2cffe1 100644 --- a/ui/src/app/edge/edge.routes.js +++ b/ui/src/app/edge/edge.routes.js @@ -21,6 +21,8 @@ import devicesTemplate from "../device/devices.tpl.html"; import assetsTemplate from "../asset/assets.tpl.html"; import dashboardsTemplate from "../dashboard/dashboards.tpl.html"; import dashboardTemplate from "../dashboard/dashboard.tpl.html"; +import ruleChainsTemplate from "../rulechain/rulechains.tpl.html"; +import ruleChainTemplate from "../rulechain/rulechain.tpl.html"; /* eslint-enable import/no-unresolved, import/default */ @@ -49,8 +51,7 @@ export default function EdgeRoutes($stateProvider, types) { ncyBreadcrumb: { label: '{"icon": "transform", "label": "edge.edges"}' } - }) - .state('home.edges.entityViews', { + }).state('home.edges.entityViews', { url: '/:edgeId/entityViews', params: {'topIndex': 0}, module: 'private', @@ -72,8 +73,7 @@ export default function EdgeRoutes($stateProvider, types) { ncyBreadcrumb: { label: '{"icon": "view_quilt", "label": "edge.entity-views"}' } - }) - .state('home.edges.devices', { + }).state('home.edges.devices', { url: '/:edgeId/devices', params: {'topIndex': 0}, module: 'private', @@ -95,8 +95,7 @@ export default function EdgeRoutes($stateProvider, types) { ncyBreadcrumb: { label: '{"icon": "devices_other", "label": "edge.devices"}' } - }) - .state('home.edges.assets', { + }).state('home.edges.assets', { url: '/:edgeId/assets', params: {'topIndex': 0}, module: 'private', @@ -118,29 +117,27 @@ export default function EdgeRoutes($stateProvider, types) { ncyBreadcrumb: { label: '{"icon": "domain", "label": "edge.assets"}' } - }) - .state('home.edges.dashboards', { - url: '/:edgeId/dashboards', - params: {'topIndex': 0}, - module: 'private', - auth: ['TENANT_ADMIN'], - views: { - "content@home": { - templateUrl: dashboardsTemplate, - controllerAs: 'vm', - controller: 'DashboardsController' + }).state('home.edges.dashboards', { + url: '/:edgeId/dashboards', + params: {'topIndex': 0}, + module: 'private', + auth: ['TENANT_ADMIN'], + views: { + "content@home": { + templateUrl: dashboardsTemplate, + controllerAs: 'vm', + controller: 'DashboardsController' + } + }, + data: { + dashboardsType: 'edge', + searchEnabled: true, + pageTitle: 'edge.dashboards' + }, + ncyBreadcrumb: { + label: '{"icon": "dashboard", "label": "edge.dashboards"}' } - }, - data: { - dashboardsType: 'edge', - searchEnabled: true, - pageTitle: 'edge.dashboards' - }, - ncyBreadcrumb: { - label: '{"icon": "dashboard", "label": "edge.dashboards"}' - } - }) - .state('home.edges.dashboards.dashboard', { + }).state('home.edges.dashboards.dashboard', { url: '/:dashboardId?state', reloadOnSearch: false, module: 'private', @@ -161,8 +158,7 @@ export default function EdgeRoutes($stateProvider, types) { ncyBreadcrumb: { label: '{"icon": "dashboard", "label": "{{ vm.dashboard.title }}", "translate": "false"}' } - }) - .state('home.customers.edges', { + }).state('home.customers.edges', { url: '/:customerId/edges', params: {'topIndex': 0}, module: 'private', @@ -184,5 +180,62 @@ export default function EdgeRoutes($stateProvider, types) { ncyBreadcrumb: { label: '{"icon": "router", "label": "{{ vm.customerEdgesTitle }}", "translate": "false"}' } + }).state('home.edges.ruleChains', { + url: '/:edgeId/ruleChains', + params: {'topIndex': 0}, + module: 'private', + auth: ['TENANT_ADMIN'], + views: { + "content@home": { + templateUrl: ruleChainsTemplate, + controllerAs: 'vm', + controller: 'RuleChainsController' + } + }, + data: { + searchEnabled: true, + pageTitle: 'edge.rulechains', + ruleChainsType: 'edge' + }, + ncyBreadcrumb: { + label: '{"icon": "settings_ethernet", "label": "rulechain.edge-rulechains"}' + } + }).state('home.edges.ruleChains.ruleChain', { + url: '/:ruleChainId', + reloadOnSearch: false, + module: 'private', + auth: ['SYS_ADMIN', 'TENANT_ADMIN'], + views: { + "content@home": { + templateUrl: ruleChainTemplate, + controller: 'RuleChainController', + controllerAs: 'vm' + } + }, + resolve: { + ruleChain: + /*@ngInject*/ + function($stateParams, ruleChainService) { + return ruleChainService.getRuleChain($stateParams.ruleChainId); + }, + ruleChainMetaData: + /*@ngInject*/ + function($stateParams, ruleChainService) { + return ruleChainService.getRuleChainMetaData($stateParams.ruleChainId); + }, + ruleNodeComponents: + /*@ngInject*/ + function($stateParams, ruleChainService) { + return ruleChainService.getRuleNodeComponents(types.ruleChainType.edge); + } + }, + data: { + import: false, + searchEnabled: false, + pageTitle: 'edge.rulechain' + }, + ncyBreadcrumb: { + label: '{"icon": "settings_ethernet", "label": "{{ vm.ruleChain.name }}", "translate": "false"}' + } }); } diff --git a/ui/src/app/event/event-row-edge-event.tpl.html b/ui/src/app/event/event-row-edge-event.tpl.html index d47ca55b81..6cc06d0cc3 100644 --- a/ui/src/app/event/event-row-edge-event.tpl.html +++ b/ui/src/app/event/event-row-edge-event.tpl.html @@ -16,12 +16,12 @@ -->
{{ event.createdTime | date : 'yyyy-MM-dd HH:mm:ss' }}
-
{{ event.edgeEventType }}
-
{{ event.edgeEventAction }}
+
{{ event.type }}
+
{{ event.action }}
{{ event.entityId }}
{{ updateStatus(event.createdTime) | translate }}
- diff --git a/ui/src/app/event/event-row.directive.js b/ui/src/app/event/event-row.directive.js index e1266323ed..39f3f46622 100644 --- a/ui/src/app/event/event-row.directive.js +++ b/ui/src/app/event/event-row.directive.js @@ -106,9 +106,9 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ contentType = null; } var content = ''; - switch(scope.event.edgeEventType) { + switch(scope.event.type) { case types.edgeEventType.relation: - content = angular.toJson(scope.event.entityBody); + content = angular.toJson(scope.event.body); showDialog(); break; case types.edgeEventType.ruleChainMetaData: @@ -121,7 +121,7 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ }); break; default: - content = entityService.getEntity(scope.event.edgeEventType, scope.event.entityId, {ignoreErrors: true}).then( + content = entityService.getEntity(scope.event.type, scope.event.entityId, {ignoreErrors: true}).then( function success(info) { showDialog(); return angular.toJson(info); @@ -150,6 +150,12 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ } } + scope.checkEdgeEventType = function (type) { + return !(type === types.edgeEventType.widgetType || + type === types.edgeEventType.adminSettings || + type === types.edgeEventType.widgetsBundle ); + } + scope.checkTooltip = function($event) { var el = $event.target; var $el = angular.element(el); diff --git a/ui/src/app/import-export/import-export.service.js b/ui/src/app/import-export/import-export.service.js index 04aa8805a1..dc0fbf1ea7 100644 --- a/ui/src/app/import-export/import-export.service.js +++ b/ui/src/app/import-export/import-export.service.js @@ -257,9 +257,6 @@ export default function ImportExport($log, $translate, $q, $mdDialog, $document, ruleChain.firstRuleNodeId = null; } ruleChain.root = false; - delete ruleChain.assignedEdgesText; - delete ruleChain.assignedEdges; - delete ruleChain.assignedEdgesIds; return ruleChain; } diff --git a/ui/src/app/locale/locale.constant-de_DE.json b/ui/src/app/locale/locale.constant-de_DE.json index 62f0bc5156..9e822188ee 100644 --- a/ui/src/app/locale/locale.constant-de_DE.json +++ b/ui/src/app/locale/locale.constant-de_DE.json @@ -67,7 +67,7 @@ "general-settings": "Allgemeine Einstellungen", "outgoing-mail": "E-Mail Versand", "outgoing-mail-settings": "Konfiguration des Postausgangsservers", - "system-settings": "Systeminstellungen", + "system-settings": "Systemeinstellungen", "test-mail-sent": "Test E-Mail wurde erfolgreich versendet!", "base-url": "Basis-URL", "base-url-required": "Basis-URL ist erforderlich.", diff --git a/ui/src/app/rulechain/add-rulechains-to-edge.controller.js b/ui/src/app/rulechain/add-rulechains-to-edge.controller.js index 236c44b091..df05c47eee 100644 --- a/ui/src/app/rulechain/add-rulechains-to-edge.controller.js +++ b/ui/src/app/rulechain/add-rulechains-to-edge.controller.js @@ -54,7 +54,7 @@ export default function AddRuleChainsToEdgeController(ruleChainService, $mdDialo vm.ruleChains.pending = true; ruleChainService.getEdgesRuleChains(vm.ruleChains.nextPageLink).then( function success(ruleChains) { - vm.ruleChains.data = ruleChains.data; + vm.ruleChains.data = vm.ruleChains.data.concat(ruleChains.data); vm.ruleChains.nextPageLink = ruleChains.nextPageLink; vm.ruleChains.hasNext = ruleChains.hasNext; if (vm.ruleChains.hasNext) { diff --git a/ui/src/app/rulechain/rulechain-fieldset.tpl.html b/ui/src/app/rulechain/rulechain-fieldset.tpl.html index a85a423358..4afd6ee96e 100644 --- a/ui/src/app/rulechain/rulechain-fieldset.tpl.html +++ b/ui/src/app/rulechain/rulechain-fieldset.tpl.html @@ -36,11 +36,6 @@
- - - -
diff --git a/ui/src/app/rulechain/rulechain.controller.js b/ui/src/app/rulechain/rulechain.controller.js index ba7c76cc55..51f82108c2 100644 --- a/ui/src/app/rulechain/rulechain.controller.js +++ b/ui/src/app/rulechain/rulechain.controller.js @@ -1180,7 +1180,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time var saveRuleChainPromise; if (vm.isImport) { if (angular.isUndefined(vm.ruleChain.type)) { - vm.ruleChain.type = types.coreRuleChainType; + vm.ruleChain.type = types.ruleChainType.core; } saveRuleChainPromise = ruleChainService.saveRuleChain(vm.ruleChain); } else { @@ -1269,7 +1269,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time vm.isDirty = false; vm.isImport = false; $mdUtil.nextTick(() => { - if (vm.ruleChain.type === vm.types.coreRuleChainType) { + if (vm.ruleChain.type === vm.types.ruleChainType.core) { $state.go('home.ruleChains.core.ruleChain', {ruleChainId: vm.ruleChain.id.id}); } else { $state.go('home.ruleChains.edge.ruleChain', {ruleChainId: vm.ruleChain.id.id}); @@ -1293,7 +1293,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time ruleNode.configuration = angular.copy(ruleNode.component.configurationDescriptor.nodeDefinition.defaultConfiguration); var ruleChainId = vm.ruleChain.id ? vm.ruleChain.id.id : null; - var ruleChainType = vm.ruleChain.type ? vm.ruleChain.type : types.coreRuleChainType; + var ruleChainType = vm.ruleChain.type ? vm.ruleChain.type : types.ruleChainType.core; vm.enableHotKeys = false; diff --git a/ui/src/app/rulechain/rulechain.directive.js b/ui/src/app/rulechain/rulechain.directive.js index dd6405c1c9..105c888063 100644 --- a/ui/src/app/rulechain/rulechain.directive.js +++ b/ui/src/app/rulechain/rulechain.directive.js @@ -22,8 +22,8 @@ import ruleChainFieldsetTemplate from './rulechain-fieldset.tpl.html'; /*@ngInject*/ export default function RuleChainDirective($compile, $templateCache, $mdDialog, $document, $q, $translate, types, toast) { var linker = function (scope, element) { - var template = $templateCache.get(ruleChainFieldsetTemplate); + element.html(template); scope.onRuleChainIdCopied = function() { diff --git a/ui/src/app/rulechain/rulechain.routes.js b/ui/src/app/rulechain/rulechain.routes.js index a3f533eb57..faad077e79 100644 --- a/ui/src/app/rulechain/rulechain.routes.js +++ b/ui/src/app/rulechain/rulechain.routes.js @@ -82,7 +82,7 @@ export default function RuleChainRoutes($stateProvider, NodeTemplatePathProvider ruleNodeComponents: /*@ngInject*/ function($stateParams, ruleChainService) { - return ruleChainService.getRuleNodeComponents(types.coreRuleChainType); + return ruleChainService.getRuleNodeComponents(types.ruleChainType.core); } }, data: { @@ -180,64 +180,7 @@ export default function RuleChainRoutes($stateProvider, NodeTemplatePathProvider ruleNodeComponents: /*@ngInject*/ function($stateParams, ruleChainService) { - return ruleChainService.getRuleNodeComponents(types.edgeRuleChainType); - } - }, - data: { - import: false, - searchEnabled: false, - pageTitle: 'edge.rulechain' - }, - ncyBreadcrumb: { - label: '{"icon": "settings_ethernet", "label": "{{ vm.ruleChain.name }}", "translate": "false"}' - } - }).state('home.edges.ruleChains', { - url: '/:edgeId/ruleChains', - params: {'topIndex': 0}, - module: 'private', - auth: ['TENANT_ADMIN'], - views: { - "content@home": { - templateUrl: ruleChainsTemplate, - controllerAs: 'vm', - controller: 'RuleChainsController' - } - }, - data: { - searchEnabled: true, - pageTitle: 'edge.rulechains', - ruleChainsType: 'edge' - }, - ncyBreadcrumb: { - label: '{"icon": "settings_ethernet", "label": "rulechain.edge-rulechains"}' - } - }).state('home.edges.ruleChains.ruleChain', { - url: '/:ruleChainId', - reloadOnSearch: false, - module: 'private', - auth: ['SYS_ADMIN', 'TENANT_ADMIN'], - views: { - "content@home": { - templateUrl: ruleChainTemplate, - controller: 'RuleChainController', - controllerAs: 'vm' - } - }, - resolve: { - ruleChain: - /*@ngInject*/ - function($stateParams, ruleChainService) { - return ruleChainService.getRuleChain($stateParams.ruleChainId); - }, - ruleChainMetaData: - /*@ngInject*/ - function($stateParams, ruleChainService) { - return ruleChainService.getRuleChainMetaData($stateParams.ruleChainId); - }, - ruleNodeComponents: - /*@ngInject*/ - function($stateParams, ruleChainService) { - return ruleChainService.getRuleNodeComponents(types.edgeRuleChainType); + return ruleChainService.getRuleNodeComponents(types.ruleChainType.edge); } }, data: { diff --git a/ui/src/app/rulechain/rulechains.controller.js b/ui/src/app/rulechain/rulechains.controller.js index 5a032a2f84..16ee29bd1a 100644 --- a/ui/src/app/rulechain/rulechains.controller.js +++ b/ui/src/app/rulechain/rulechains.controller.js @@ -22,8 +22,8 @@ import addRuleChainsToEdgeTemplate from "./add-rulechains-to-edge.tpl.html"; /* eslint-enable import/no-unresolved, import/default */ /*@ngInject*/ -export default function RuleChainsController(ruleChainService, userService, edgeService, importExport, $state, - $stateParams, $filter, $translate, $mdDialog, $document, $q, types) { +export default function RuleChainsController(ruleChainService, userService, importExport, $state, $stateParams, $filter, $translate, $mdDialog, types, + $document, $q, edgeService) { var vm = this; var edgeId = $stateParams.edgeId; @@ -114,7 +114,7 @@ export default function RuleChainsController(ruleChainService, userService, edge if (vm.ruleChainsScope === 'tenant') { fetchRuleChainsFunction = function (pageLink) { - return fetchRuleChains(pageLink, types.coreRuleChainType); + return fetchRuleChains(pageLink, types.ruleChainType.core); }; deleteRuleChainFunction = function (ruleChainId) { return deleteRuleChain(ruleChainId); @@ -162,9 +162,9 @@ export default function RuleChainsController(ruleChainService, userService, edge }); vm.ruleChainGridConfig.addItemActions.push({ onAction: function ($event) { - importExport.importRuleChain($event, types.coreRuleChainType).then( + importExport.importRuleChain($event, types.ruleChainType.core).then( function(ruleChainImport) { - $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.coreRuleChainType}); + $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.ruleChainType.core}); } ); }, @@ -175,7 +175,7 @@ export default function RuleChainsController(ruleChainService, userService, edge } else if (vm.ruleChainsScope === 'edges') { fetchRuleChainsFunction = function (pageLink) { - return fetchRuleChains(pageLink, types.edgeRuleChainType); + return fetchRuleChains(pageLink, types.ruleChainType.edge); }; deleteRuleChainFunction = function (ruleChainId) { return deleteRuleChain(ruleChainId); @@ -203,21 +203,21 @@ export default function RuleChainsController(ruleChainService, userService, edge ruleChainActionsList.push({ onAction: function ($event, item) { - vm.grid.deleteItem($event, item); + setDefaultRootEdgeRuleChain($event, item); }, - name: function() { return $translate.instant('action.delete') }, - details: function() { return $translate.instant('rulechain.delete') }, - icon: "delete", + name: function() { return $translate.instant('rulechain.set-default-root-edge') }, + details: function() { return $translate.instant('rulechain.set-default-root-edge') }, + icon: "flag", isEnabled: isNonRootRuleChain }); ruleChainActionsList.push({ onAction: function ($event, item) { - setDefaultRootEdgeRuleChain($event, item); + vm.grid.deleteItem($event, item); }, - name: function() { return $translate.instant('rulechain.set-default-root-edge') }, - details: function() { return $translate.instant('rulechain.set-default-root-edge') }, - icon: "flag", + name: function() { return $translate.instant('action.delete') }, + details: function() { return $translate.instant('rulechain.delete') }, + icon: "delete", isEnabled: isNonRootRuleChain }); @@ -243,9 +243,9 @@ export default function RuleChainsController(ruleChainService, userService, edge }); vm.ruleChainGridConfig.addItemActions.push({ onAction: function ($event) { - importExport.importRuleChain($event, types.edgeRuleChainType).then( + importExport.importRuleChain($event, types.ruleChainType.edge).then( function(ruleChainImport) { - $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.edgeRuleChainType}); + $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.ruleChainType.edge}); } ); }, @@ -383,9 +383,9 @@ export default function RuleChainsController(ruleChainService, userService, edge function saveRuleChain(ruleChain) { if (angular.isUndefined(ruleChain.type)) { if (vm.ruleChainsScope === 'edges') { - ruleChain.type = types.edgeRuleChainType; + ruleChain.type = types.ruleChainType.edge; } else { - ruleChain.type = types.coreRuleChainType; + ruleChain.type = types.ruleChainType.core; } } return ruleChainService.saveRuleChain(ruleChain); @@ -395,13 +395,13 @@ export default function RuleChainsController(ruleChainService, userService, edge if ($event) { $event.stopPropagation(); } - + var ruleChainParams = {ruleChainId: ruleChain.id.id}; if (vm.ruleChainsScope === 'edge') { - $state.go('home.edges.ruleChains.ruleChain', {ruleChainId: ruleChain.id.id, edgeId: vm.edge.id.id}); + $state.go('home.edges.ruleChains.ruleChain', Object.assign(ruleChainParams, edgeId = vm.edge.id.id)); } else if (vm.ruleChainsScope === 'edges') { - $state.go('home.ruleChains.edge.ruleChain', {ruleChainId: ruleChain.id.id}); + $state.go('home.ruleChains.edge.ruleChain', ruleChainParams); } else { - $state.go('home.ruleChains.core.ruleChain', {ruleChainId: ruleChain.id.id}); + $state.go('home.ruleChains.core.ruleChain', ruleChainParams); } } diff --git a/ui/src/app/rulechain/rulechains.tpl.html b/ui/src/app/rulechain/rulechains.tpl.html index fae3e8d63d..9880ac0213 100644 --- a/ui/src/app/rulechain/rulechains.tpl.html +++ b/ui/src/app/rulechain/rulechains.tpl.html @@ -24,7 +24,6 @@