fixed bug with undefined rule chain type
This commit is contained in:
		
							parent
							
								
									de11d1ce3d
								
							
						
					
					
						commit
						1f57524851
					
				@ -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.systemRuleChainType;
 | 
			
		||||
                vm.ruleChain.type = types.coreRuleChainType;
 | 
			
		||||
            }
 | 
			
		||||
            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.systemRuleChainType) {
 | 
			
		||||
                                if (vm.ruleChain.type === vm.types.coreRuleChainType) {
 | 
			
		||||
                                    $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.systemRuleChainType;
 | 
			
		||||
        var ruleChainType = vm.ruleChain.type ? vm.ruleChain.type : types.coreRuleChainType;
 | 
			
		||||
 | 
			
		||||
        vm.enableHotKeys = false;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -82,7 +82,7 @@ export default function RuleChainRoutes($stateProvider, NodeTemplatePathProvider
 | 
			
		||||
                ruleNodeComponents:
 | 
			
		||||
                /*@ngInject*/
 | 
			
		||||
                    function($stateParams, ruleChainService) {
 | 
			
		||||
                        return ruleChainService.getRuleNodeComponents(types.systemRuleChainType);
 | 
			
		||||
                        return ruleChainService.getRuleNodeComponents(types.coreRuleChainType);
 | 
			
		||||
                    }
 | 
			
		||||
            },
 | 
			
		||||
            data: {
 | 
			
		||||
 | 
			
		||||
@ -114,7 +114,7 @@ export default function RuleChainsController(ruleChainService, userService, edge
 | 
			
		||||
 | 
			
		||||
        if (vm.ruleChainsScope === 'tenant') {
 | 
			
		||||
            fetchRuleChainsFunction = function (pageLink) {
 | 
			
		||||
                return fetchRuleChains(pageLink, types.systemRuleChainType);
 | 
			
		||||
                return fetchRuleChains(pageLink, types.coreRuleChainType);
 | 
			
		||||
            };
 | 
			
		||||
            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.systemRuleChainType).then(
 | 
			
		||||
                    importExport.importRuleChain($event, types.coreRuleChainType).then(
 | 
			
		||||
                        function(ruleChainImport) {
 | 
			
		||||
                            $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.systemRuleChainType});
 | 
			
		||||
                            $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.coreRuleChainType});
 | 
			
		||||
                        }
 | 
			
		||||
                    );
 | 
			
		||||
                },
 | 
			
		||||
@ -385,7 +385,7 @@ export default function RuleChainsController(ruleChainService, userService, edge
 | 
			
		||||
            if (vm.ruleChainsScope === 'edges') {
 | 
			
		||||
                ruleChain.type = types.edgeRuleChainType;
 | 
			
		||||
            } else {
 | 
			
		||||
                ruleChain.type = types.systemRuleChainType;
 | 
			
		||||
                ruleChain.type = types.coreRuleChainType;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return ruleChainService.saveRuleChain(ruleChain);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user