diff --git a/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts index 05aeeda3c6..614c801653 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts @@ -51,7 +51,6 @@ import { AddEntitiesToCustomerDialogData } from '../../dialogs/add-entities-to-customer-dialog.component'; import { HomeDialogsService } from '@home/dialogs/home-dialogs.service'; - import { Edge, EdgeInfo } from "@shared/models/edge.models"; import { EdgeService } from "@core/http/edge.service"; import { EdgeComponent } from "@home/pages/edge/edge.component"; @@ -96,19 +95,15 @@ export class EdgesTableConfigResolver implements Resolve this.edgeService.getEdge(savedEdge.id.id) )); }; - this.config.onEntityAction = action => this.onEdgeAction(action); this.config.detailsReadonly = () => this.config.componentsData.edgeScope === 'customer_user'; - this.config.headerComponent = EdgeTableHeaderComponent; - } resolve(route: ActivatedRouteSnapshot): Observable> { const routeParams = route.params; this.config.componentsData = { - edgeScope: route.data.edgesType, - edgeType: '' + edgeScope: route.data.edgesType }; this.customerId = routeParams.customerId; return this.store.pipe(select(selectAuthUser), take(1)).pipe( @@ -166,12 +161,12 @@ export class EdgesTableConfigResolver implements Resolve - this.edgeService.getTenantEdgeInfos(pageLink, this.config.componentsData.edgeType); + this.edgeService.getTenantEdgeInfos(pageLink); this.config.deleteEntity = id => this.edgeService.deleteEdge(id.id); } if (edgeScope === 'customer') { this.config.entitiesFetchFunction = pageLink => - this.edgeService.getCustomerEdgeInfos(this.customerId, pageLink, this.config.componentsData.edgeType); + this.edgeService.getCustomerEdgeInfos(this.customerId, pageLink); this.config.deleteEntity = id => this.edgeService.unassignEdgeFromCustomer(id.id); } } diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts index 19cac32b21..280e4082ba 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts @@ -74,11 +74,11 @@ export class RuleChainsTableConfigResolver implements Resolve('name', 'rulechain.name', '100%'), new EntityTableColumn('root', 'rulechain.root', '60px', entity => { - if (this.config.componentsData.edgeId) { - return checkBoxCell((this.edge.rootRuleChainId.id == entity.id.id)); - } else { - return checkBoxCell(entity.root); - } + if (isDefined(this.config.componentsData.edgeId)) { + return checkBoxCell((this.config.componentsData.edge.rootRuleChainId.id == entity.id.id)); + } else { + return checkBoxCell(entity.root); + } }) ); this.config.deleteEntityTitle = ruleChain => this.translate.instant('rulechain.delete-rulechain-title', @@ -99,13 +99,14 @@ export class RuleChainsTableConfigResolver implements Resolve this.edge.rootRuleChainId.id != ruleChain.id.id; + this.config.entitySelectionEnabled = ruleChain => this.config.componentsData.edge.rootRuleChainId.id != ruleChain.id.id; this.config.deleteEnabled = () => false; this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(edge => { - this.edge = edge; - this.config.tableTitle = edge.name + ': ' + this.translate.instant('rulechain.edge-rulechains') + this.config.componentsData.edge = edge; + this.config.tableTitle = edge.name + ': ' + this.translate.instant('rulechain.edge-rulechains'); }); - } else { + } + else { this.config.entitySelectionEnabled = ruleChain => ruleChain && !ruleChain.root; this.config.deleteEnabled = (ruleChain) => ruleChain && !ruleChain.root; } @@ -235,7 +236,7 @@ export class RuleChainsTableConfigResolver implements Resolve entity.id.id != this.edge.rootRuleChainId.id, + isEnabled: (entity) => entity.id.id != this.config.componentsData.edge.rootRuleChainId.id, onAction: ($event, entity) => this.unassignFromEdge($event, entity) } ) @@ -295,7 +296,7 @@ export class RuleChainsTableConfigResolver implements Resolve { - this.edge = edge; + this.config.componentsData.edge = edge; this.config.table.updateData(); } ) @@ -465,7 +466,7 @@ export class RuleChainsTableConfigResolver implements Resolve