Commit 3e67a9ad0eb47c943a9f27cc61a7ff8903a84976

Authored by Artem Babak
1 parent 4d4e4d02

Fix for setDefaultRoot button - only for edges scope

... ... @@ -36,6 +36,12 @@
36 36 </button>
37 37 <button mat-raised-button color="primary"
38 38 [disabled]="(isLoading$ | async)"
  39 + (click)="onEntityAction($event, 'setDefaultRoot')"
  40 + [fxShow]="!isEdit && !entity?.root && isEdgesRuleChainScope()">
  41 + {{'rulechain.set-default-root-edge' | translate }}
  42 + </button>
  43 + <button mat-raised-button color="primary"
  44 + [disabled]="(isLoading$ | async)"
39 45 (click)="onEntityAction($event, 'delete')"
40 46 [fxShow]="!hideDelete() && !isEdit">
41 47 {{'rulechain.delete' | translate }}
... ...
... ... @@ -78,4 +78,12 @@ export class RuleChainComponent extends EntityComponent<RuleChain> {
78 78 horizontalPosition: 'right'
79 79 }));
80 80 }
  81 +
  82 + isEdgesRuleChainScope() {
  83 + if (this.entitiesTableConfig) {
  84 + return this.entitiesTableConfig.componentsData.ruleChainScope == 'edges';
  85 + } else {
  86 + return false;
  87 + }
  88 + }
81 89 }
... ...
... ... @@ -339,6 +339,9 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
339 339 case 'setRoot':
340 340 this.setRootRuleChain(action.event, action.entity);
341 341 return true;
  342 + case 'setDefaultRoot':
  343 + this.setDefaultRootEdgeRuleChain(action.event, action.entity);
  344 + return true;
342 345 }
343 346 return false;
344 347 }
... ...