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