Commit c07fcf7ba5596b7dc02239a2fdb67d9e7d330230
1 parent
685e89ea
Added rule chain type to rule node
Showing
4 changed files
with
13 additions
and
3 deletions
@@ -292,6 +292,7 @@ export class ItemBufferService { | @@ -292,6 +292,7 @@ export class ItemBufferService { | ||
292 | y: origNode.y, | 292 | y: origNode.y, |
293 | name: origNode.name, | 293 | name: origNode.name, |
294 | componentClazz: origNode.component.clazz, | 294 | componentClazz: origNode.component.clazz, |
295 | + ruleChainType: origNode.ruleChainType | ||
295 | }; | 296 | }; |
296 | if (origNode.targetRuleChainId) { | 297 | if (origNode.targetRuleChainId) { |
297 | node.targetRuleChainId = origNode.targetRuleChainId; | 298 | node.targetRuleChainId = origNode.targetRuleChainId; |
@@ -537,7 +537,8 @@ export class RuleChainPageComponent extends PageComponent | @@ -537,7 +537,8 @@ export class RuleChainPageComponent extends PageComponent | ||
537 | nodeClass: descriptor.nodeClass, | 537 | nodeClass: descriptor.nodeClass, |
538 | icon, | 538 | icon, |
539 | iconUrl, | 539 | iconUrl, |
540 | - connectors: [] | 540 | + connectors: [], |
541 | + ruleChainType: this.ruleChainType | ||
541 | }; | 542 | }; |
542 | if (component.configurationDescriptor.nodeDefinition.inEnabled) { | 543 | if (component.configurationDescriptor.nodeDefinition.inEnabled) { |
543 | node.connectors.push( | 544 | node.connectors.push( |
@@ -626,7 +627,8 @@ export class RuleChainPageComponent extends PageComponent | @@ -626,7 +627,8 @@ export class RuleChainPageComponent extends PageComponent | ||
626 | type: FlowchartConstants.leftConnectorType, | 627 | type: FlowchartConstants.leftConnectorType, |
627 | id: (this.nextConnectorID++) + '' | 628 | id: (this.nextConnectorID++) + '' |
628 | } | 629 | } |
629 | - ] | 630 | + ], |
631 | + ruleChainType: this.ruleChainType | ||
630 | }; | 632 | }; |
631 | ruleChainNodesMap[ruleChainConnection.additionalInfo.ruleChainNodeId] = ruleChainNode; | 633 | ruleChainNodesMap[ruleChainConnection.additionalInfo.ruleChainNodeId] = ruleChainNode; |
632 | this.ruleChainModel.nodes.push(ruleChainNode); | 634 | this.ruleChainModel.nodes.push(ruleChainNode); |
@@ -19,6 +19,7 @@ import { Component, OnInit } from '@angular/core'; | @@ -19,6 +19,7 @@ import { Component, OnInit } from '@angular/core'; | ||
19 | import { FcNodeComponent } from 'ngx-flowchart/dist/ngx-flowchart'; | 19 | import { FcNodeComponent } from 'ngx-flowchart/dist/ngx-flowchart'; |
20 | import { FcRuleNode, RuleNodeType } from '@shared/models/rule-node.models'; | 20 | import { FcRuleNode, RuleNodeType } from '@shared/models/rule-node.models'; |
21 | import { Router } from '@angular/router'; | 21 | import { Router } from '@angular/router'; |
22 | +import { ruleChainType } from '@app/shared/models/rule-chain.models'; | ||
22 | 23 | ||
23 | @Component({ | 24 | @Component({ |
24 | // tslint:disable-next-line:component-selector | 25 | // tslint:disable-next-line:component-selector |
@@ -48,7 +49,12 @@ export class RuleNodeComponent extends FcNodeComponent implements OnInit { | @@ -48,7 +49,12 @@ export class RuleNodeComponent extends FcNodeComponent implements OnInit { | ||
48 | $event.stopPropagation(); | 49 | $event.stopPropagation(); |
49 | } | 50 | } |
50 | if (node.targetRuleChainId) { | 51 | if (node.targetRuleChainId) { |
51 | - this.router.navigateByUrl(`/ruleChains/${node.targetRuleChainId}`); | 52 | + if (node.ruleChainType === ruleChainType.edge) { |
53 | + this.router.navigateByUrl(`/edges/ruleChains/${node.targetRuleChainId}`); | ||
54 | + } else { | ||
55 | + this.router.navigateByUrl(`/ruleChains/${node.targetRuleChainId}`); | ||
56 | + } | ||
57 | + | ||
52 | } | 58 | } |
53 | } | 59 | } |
54 | } | 60 | } |
@@ -313,6 +313,7 @@ export interface FcRuleNode extends FcRuleNodeType { | @@ -313,6 +313,7 @@ export interface FcRuleNode extends FcRuleNodeType { | ||
313 | error?: string; | 313 | error?: string; |
314 | highlighted?: boolean; | 314 | highlighted?: boolean; |
315 | componentClazz?: string; | 315 | componentClazz?: string; |
316 | + ruleChainType?: string; | ||
316 | } | 317 | } |
317 | 318 | ||
318 | export interface FcRuleEdge extends FcEdge { | 319 | export interface FcRuleEdge extends FcEdge { |