Browse Source

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

pull/3811/head
deaflynx 6 years ago
parent
commit
4e8af4a15d
  1. 2
      ui-ngx/src/app/modules/home/pages/asset/asset.component.ts
  2. 5
      ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts

2
ui-ngx/src/app/modules/home/pages/asset/asset.component.ts

@ -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,

5
ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts

@ -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');
}

Loading…
Cancel
Save