Browse Source

Fix for setDefaultRoot button - only for edges scope

pull/3811/head
Artem Babak 6 years ago
parent
commit
3e67a9ad0e
  1. 6
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.html
  2. 8
      ui-ngx/src/app/modules/home/pages/rulechain/rulechain.component.ts
  3. 3
      ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts

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

@ -34,6 +34,12 @@
[fxShow]="!isEdit && !entity?.root">
{{'rulechain.set-root' | translate }}
</button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'setDefaultRoot')"
[fxShow]="!isEdit && !entity?.root && isEdgesRuleChainScope()">
{{'rulechain.set-default-root-edge' | translate }}
</button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'delete')"

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

@ -78,4 +78,12 @@ export class RuleChainComponent extends EntityComponent<RuleChain> {
horizontalPosition: 'right'
}));
}
isEdgesRuleChainScope() {
if (this.entitiesTableConfig) {
return this.entitiesTableConfig.componentsData.ruleChainScope == 'edges';
} else {
return false;
}
}
}

3
ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts

@ -339,6 +339,9 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
case 'setRoot':
this.setRootRuleChain(action.event, action.entity);
return true;
case 'setDefaultRoot':
this.setDefaultRootEdgeRuleChain(action.event, action.entity);
return true;
}
return false;
}

Loading…
Cancel
Save