Code review: added 'edge' in AssetScope, refactored assets-table-config.resolver.ts for edge's assets title

This commit is contained in:
deaflynx 2020-11-04 06:47:16 +02:00
parent aa14b0cb54
commit 4e8af4a15d
2 changed files with 4 additions and 3 deletions

View File

@ -35,7 +35,7 @@ export class AssetComponent extends EntityComponent<AssetInfo> {
entityType = EntityType;
assetScope: 'tenant' | 'customer' | 'customer_user';
assetScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
constructor(protected store: Store<AppState>,
protected translate: TranslateService,

View File

@ -137,8 +137,9 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('asset.assets');
}
} else if (this.config.componentsData.assetScope === 'edge') {
this.edgeService.getEdge(this.edgeId).pipe(map(edge =>
this.config.tableTitle = edge.name + ': ' + this.translate.instant('asset.assets'))).subscribe();
this.edgeService.getEdge(this.edgeId).subscribe(
edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('asset.assets')
);
} else {
this.config.tableTitle = this.translate.instant('asset.assets');
}