Commit 0be81ae7fea070059c086024b4e82471deb28bde

Authored by Artem Babak
1 parent 391d94a9

Refactored method get edge name for title in edge's assigned entities

@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 </envs> 9 </envs>
10 <option name="MAIN_CLASS_NAME" value="org.thingsboard.server.ThingsboardServerApplication" /> 10 <option name="MAIN_CLASS_NAME" value="org.thingsboard.server.ThingsboardServerApplication" />
11 <module name="application" /> 11 <module name="application" />
  12 + <option name="PROGRAM_PARAMETERS" value="$ContentRoot$" />
12 <extension name="coverage"> 13 <extension name="coverage">
13 <pattern> 14 <pattern>
14 <option name="PATTERN" value="org.thingsboard.server.*" /> 15 <option name="PATTERN" value="org.thingsboard.server.*" />
@@ -132,8 +132,9 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig< @@ -132,8 +132,9 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
132 this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('dashboard.dashboards'); 132 this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('dashboard.dashboards');
133 } 133 }
134 } else if (this.config.componentsData.dashboardScope === 'edge') { 134 } else if (this.config.componentsData.dashboardScope === 'edge') {
135 - this.edgeService.getEdge(this.config.componentsData.edgeId).pipe(map(edge =>  
136 - this.config.tableTitle = edge.name + ': ' + this.translate.instant('dashboard.dashboards'))).subscribe(); 135 + this.edgeService.getEdge(this.config.componentsData.edgeId).subscribe(
  136 + edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('dashboard.dashboards')
  137 + );
137 } else { 138 } else {
138 this.config.tableTitle = this.translate.instant('dashboard.dashboards'); 139 this.config.tableTitle = this.translate.instant('dashboard.dashboards');
139 } 140 }
@@ -142,8 +142,9 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev @@ -142,8 +142,9 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
142 this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('device.devices'); 142 this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('device.devices');
143 } 143 }
144 } else if (this.config.componentsData.deviceScope === 'edge') { 144 } else if (this.config.componentsData.deviceScope === 'edge') {
145 - this.edgeService.getEdge(this.edgeId).pipe(map(edge =>  
146 - this.config.tableTitle = edge.name + ': ' + this.translate.instant('device.devices'))).subscribe(); 145 + this.edgeService.getEdge(this.edgeId).subscribe(
  146 + edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('device.devices')
  147 + );
147 } else { 148 } else {
148 this.config.tableTitle = this.translate.instant('device.devices'); 149 this.config.tableTitle = this.translate.instant('device.devices');
149 } 150 }
@@ -137,8 +137,9 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig @@ -137,8 +137,9 @@ export class EntityViewsTableConfigResolver implements Resolve<EntityTableConfig
137 this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('entity-view.entity-views'); 137 this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('entity-view.entity-views');
138 } 138 }
139 } else if (this.config.componentsData.entityViewScope === 'edge') { 139 } else if (this.config.componentsData.entityViewScope === 'edge') {
140 - this.edgeService.getEdge(this.edgeId).pipe(map(edge =>  
141 - this.config.tableTitle = edge.name + ': ' + this.translate.instant('entity-view.entity-views'))).subscribe(); 140 + this.edgeService.getEdge(this.edgeId).subscribe(
  141 + edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('entity-view.entity-views')
  142 + );
142 } 143 }
143 else { 144 else {
144 this.config.tableTitle = this.translate.instant('entity-view.entity-views'); 145 this.config.tableTitle = this.translate.instant('entity-view.entity-views');
@@ -155,11 +155,11 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig< @@ -155,11 +155,11 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
155 this.config.entitiesFetchFunction = pageLink => this.fetchEdgeRuleChains(pageLink); 155 this.config.entitiesFetchFunction = pageLink => this.fetchEdgeRuleChains(pageLink);
156 } else if (ruleChainScope === 'edge') { 156 } else if (ruleChainScope === 'edge') {
157 if (isDefined(this.edgeId) && this.edgeId != null) { 157 if (isDefined(this.edgeId) && this.edgeId != null) {
158 - this.edgeService.getEdge(this.edgeId)  
159 - .pipe(map(edge => { 158 + this.edgeService.getEdge(this.edgeId).subscribe(
  159 + edge => {
160 this.edge = edge; 160 this.edge = edge;
161 this.config.tableTitle = edge.name + ': ' + this.translate.instant('rulechain.edge-rulechains') 161 this.config.tableTitle = edge.name + ': ' + this.translate.instant('rulechain.edge-rulechains')
162 - })).subscribe(); 162 + });
163 } 163 }
164 this.config.entitiesFetchFunction = pageLink => this.ruleChainService.getEdgeRuleChains(this.edgeId, pageLink); 164 this.config.entitiesFetchFunction = pageLink => this.ruleChainService.getEdgeRuleChains(this.edgeId, pageLink);
165 } 165 }