Browse Source

Added rule chain type to rule node

pull/3811/head
Volodymyr Babak 6 years ago
parent
commit
c07fcf7ba5
  1. 1
      ui-ngx/src/app/core/services/item-buffer.service.ts
  2. 6
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts
  3. 8
      ui-ngx/src/app/modules/home/pages/rulechain/rulenode.component.ts
  4. 1
      ui-ngx/src/app/shared/models/rule-node.models.ts

1
ui-ngx/src/app/core/services/item-buffer.service.ts

@ -292,6 +292,7 @@ export class ItemBufferService {
y: origNode.y, y: origNode.y,
name: origNode.name, name: origNode.name,
componentClazz: origNode.component.clazz, componentClazz: origNode.component.clazz,
ruleChainType: origNode.ruleChainType
}; };
if (origNode.targetRuleChainId) { if (origNode.targetRuleChainId) {
node.targetRuleChainId = origNode.targetRuleChainId; node.targetRuleChainId = origNode.targetRuleChainId;

6
ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.ts

@ -537,7 +537,8 @@ export class RuleChainPageComponent extends PageComponent
nodeClass: descriptor.nodeClass, nodeClass: descriptor.nodeClass,
icon, icon,
iconUrl, iconUrl,
connectors: [] connectors: [],
ruleChainType: this.ruleChainType
}; };
if (component.configurationDescriptor.nodeDefinition.inEnabled) { if (component.configurationDescriptor.nodeDefinition.inEnabled) {
node.connectors.push( node.connectors.push(
@ -626,7 +627,8 @@ export class RuleChainPageComponent extends PageComponent
type: FlowchartConstants.leftConnectorType, type: FlowchartConstants.leftConnectorType,
id: (this.nextConnectorID++) + '' id: (this.nextConnectorID++) + ''
} }
] ],
ruleChainType: this.ruleChainType
}; };
ruleChainNodesMap[ruleChainConnection.additionalInfo.ruleChainNodeId] = ruleChainNode; ruleChainNodesMap[ruleChainConnection.additionalInfo.ruleChainNodeId] = ruleChainNode;
this.ruleChainModel.nodes.push(ruleChainNode); this.ruleChainModel.nodes.push(ruleChainNode);

8
ui-ngx/src/app/modules/home/pages/rulechain/rulenode.component.ts

@ -19,6 +19,7 @@ import { Component, OnInit } from '@angular/core';
import { FcNodeComponent } from 'ngx-flowchart/dist/ngx-flowchart'; import { FcNodeComponent } from 'ngx-flowchart/dist/ngx-flowchart';
import { FcRuleNode, RuleNodeType } from '@shared/models/rule-node.models'; import { FcRuleNode, RuleNodeType } from '@shared/models/rule-node.models';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ruleChainType } from '@app/shared/models/rule-chain.models';
@Component({ @Component({
// tslint:disable-next-line:component-selector // tslint:disable-next-line:component-selector
@ -48,7 +49,12 @@ export class RuleNodeComponent extends FcNodeComponent implements OnInit {
$event.stopPropagation(); $event.stopPropagation();
} }
if (node.targetRuleChainId) { if (node.targetRuleChainId) {
this.router.navigateByUrl(`/ruleChains/${node.targetRuleChainId}`); if (node.ruleChainType === ruleChainType.edge) {
this.router.navigateByUrl(`/edges/ruleChains/${node.targetRuleChainId}`);
} else {
this.router.navigateByUrl(`/ruleChains/${node.targetRuleChainId}`);
}
} }
} }
} }

1
ui-ngx/src/app/shared/models/rule-node.models.ts

@ -313,6 +313,7 @@ export interface FcRuleNode extends FcRuleNodeType {
error?: string; error?: string;
highlighted?: boolean; highlighted?: boolean;
componentClazz?: string; componentClazz?: string;
ruleChainType?: string;
} }
export interface FcRuleEdge extends FcEdge { export interface FcRuleEdge extends FcEdge {

Loading…
Cancel
Save