Showing
4 changed files
with
25 additions
and
9 deletions
@@ -34,6 +34,7 @@ | @@ -34,6 +34,7 @@ | ||
34 | [ruleNode]="ruleNode" | 34 | [ruleNode]="ruleNode" |
35 | [ruleChainId]="ruleChainId" | 35 | [ruleChainId]="ruleChainId" |
36 | [isEdit]="true" | 36 | [isEdit]="true" |
37 | + [isAdd]="true" | ||
37 | [isReadOnly]="false"> | 38 | [isReadOnly]="false"> |
38 | </tb-rule-node> | 39 | </tb-rule-node> |
39 | </fieldset> | 40 | </fieldset> |
@@ -15,6 +15,12 @@ | @@ -15,6 +15,12 @@ | ||
15 | limitations under the License. | 15 | limitations under the License. |
16 | 16 | ||
17 | --> | 17 | --> |
18 | +<div class="tb-details-buttons" *ngIf="!isAdd && ruleNode.component.type === ruleNodeType.RULE_CHAIN"> | ||
19 | + <button mat-raised-button color="primary" | ||
20 | + (click)="openRuleChain($event)"> | ||
21 | + {{'rulechain.open-rulechain' | translate }} | ||
22 | + </button> | ||
23 | +</div> | ||
18 | <div class="mat-padding" fxLayout="column"> | 24 | <div class="mat-padding" fxLayout="column"> |
19 | <form [formGroup]="ruleNodeFormGroup"> | 25 | <form [formGroup]="ruleNodeFormGroup"> |
20 | <fieldset [disabled]="(isLoading$ | async) || !isEdit || isReadOnly"> | 26 | <fieldset [disabled]="(isLoading$ | async) || !isEdit || isReadOnly"> |
@@ -44,14 +50,6 @@ | @@ -44,14 +50,6 @@ | ||
44 | </div> | 50 | </div> |
45 | </section> | 51 | </section> |
46 | <section *ngIf="ruleNode.component.type === ruleNodeType.RULE_CHAIN"> | 52 | <section *ngIf="ruleNode.component.type === ruleNodeType.RULE_CHAIN"> |
47 | - <div class="tb-details-buttons" fxLayout.xs="column"> | ||
48 | - <button mat-raised-button color="primary" | ||
49 | - [disabled]="(isLoading$ | async)" | ||
50 | - (click)="onEntityAction($event, 'disableAccount')" | ||
51 | - [fxShow]="!isEdit && isUserCredentialsEnabled()"> | ||
52 | - {{'user.disable-account' | translate }} | ||
53 | - </button> | ||
54 | - </div> | ||
55 | <tb-entity-autocomplete required | 53 | <tb-entity-autocomplete required |
56 | [excludeEntityIds]="[ruleChainId]" | 54 | [excludeEntityIds]="[ruleChainId]" |
57 | [entityType]="entityType.RULE_CHAIN" | 55 | [entityType]="entityType.RULE_CHAIN" |
@@ -24,6 +24,7 @@ import { EntityType } from '@shared/models/entity-type.models'; | @@ -24,6 +24,7 @@ import { EntityType } from '@shared/models/entity-type.models'; | ||
24 | import { Subscription } from 'rxjs'; | 24 | import { Subscription } from 'rxjs'; |
25 | import { RuleChainService } from '@core/http/rule-chain.service'; | 25 | import { RuleChainService } from '@core/http/rule-chain.service'; |
26 | import { RuleNodeConfigComponent } from './rule-node-config.component'; | 26 | import { RuleNodeConfigComponent } from './rule-node-config.component'; |
27 | +import { Router } from '@angular/router'; | ||
27 | 28 | ||
28 | @Component({ | 29 | @Component({ |
29 | selector: 'tb-rule-node', | 30 | selector: 'tb-rule-node', |
@@ -46,6 +47,9 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O | @@ -46,6 +47,9 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O | ||
46 | @Input() | 47 | @Input() |
47 | isReadOnly: boolean; | 48 | isReadOnly: boolean; |
48 | 49 | ||
50 | + @Input() | ||
51 | + isAdd = false; | ||
52 | + | ||
49 | ruleNodeType = RuleNodeType; | 53 | ruleNodeType = RuleNodeType; |
50 | entityType = EntityType; | 54 | entityType = EntityType; |
51 | 55 | ||
@@ -55,7 +59,8 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O | @@ -55,7 +59,8 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O | ||
55 | 59 | ||
56 | constructor(protected store: Store<AppState>, | 60 | constructor(protected store: Store<AppState>, |
57 | private fb: FormBuilder, | 61 | private fb: FormBuilder, |
58 | - private ruleChainService: RuleChainService) { | 62 | + private ruleChainService: RuleChainService, |
63 | + private router: Router) { | ||
59 | super(store); | 64 | super(store); |
60 | this.ruleNodeFormGroup = this.fb.group({}); | 65 | this.ruleNodeFormGroup = this.fb.group({}); |
61 | } | 66 | } |
@@ -133,4 +138,13 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O | @@ -133,4 +138,13 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O | ||
133 | this.ruleNodeConfigComponent.validate(); | 138 | this.ruleNodeConfigComponent.validate(); |
134 | } | 139 | } |
135 | } | 140 | } |
141 | + | ||
142 | + openRuleChain($event: Event) { | ||
143 | + if ($event) { | ||
144 | + $event.stopPropagation(); | ||
145 | + } | ||
146 | + if (this.ruleNode.targetRuleChainId) { | ||
147 | + this.router.navigateByUrl(`/ruleChains/${this.ruleNode.targetRuleChainId}`); | ||
148 | + } | ||
149 | + } | ||
136 | } | 150 | } |
@@ -321,6 +321,8 @@ export class RuleChainPageComponent extends PageComponent | @@ -321,6 +321,8 @@ export class RuleChainPageComponent extends PageComponent | ||
321 | if (this.ruleChainCanvas) { | 321 | if (this.ruleChainCanvas) { |
322 | this.ruleChainCanvas.adjustCanvasSize(true); | 322 | this.ruleChainCanvas.adjustCanvasSize(true); |
323 | } | 323 | } |
324 | + this.isEditingRuleNode = false; | ||
325 | + this.isEditingRuleNodeLink = false; | ||
324 | this.updateRuleNodesHighlight(); | 326 | this.updateRuleNodesHighlight(); |
325 | } | 327 | } |
326 | 328 | ||
@@ -1423,6 +1425,7 @@ export class RuleChainPageComponent extends PageComponent | @@ -1423,6 +1425,7 @@ export class RuleChainPageComponent extends PageComponent | ||
1423 | scroll: true | 1425 | scroll: true |
1424 | }, | 1426 | }, |
1425 | side: 'right', | 1427 | side: 'right', |
1428 | + distance: 12, | ||
1426 | trackOrigin: true | 1429 | trackOrigin: true |
1427 | } | 1430 | } |
1428 | ); | 1431 | ); |