Code review: added 'edge' in AssetScope, refactored assets-table-config.resolver.ts for edge's assets title
This commit is contained in:
parent
aa14b0cb54
commit
4e8af4a15d
@ -35,7 +35,7 @@ export class AssetComponent extends EntityComponent<AssetInfo> {
|
|||||||
|
|
||||||
entityType = EntityType;
|
entityType = EntityType;
|
||||||
|
|
||||||
assetScope: 'tenant' | 'customer' | 'customer_user';
|
assetScope: 'tenant' | 'customer' | 'customer_user' | 'edge';
|
||||||
|
|
||||||
constructor(protected store: Store<AppState>,
|
constructor(protected store: Store<AppState>,
|
||||||
protected translate: TranslateService,
|
protected translate: TranslateService,
|
||||||
|
|||||||
@ -137,8 +137,9 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
|
|||||||
this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('asset.assets');
|
this.config.tableTitle = parentCustomer.title + ': ' + this.translate.instant('asset.assets');
|
||||||
}
|
}
|
||||||
} else if (this.config.componentsData.assetScope === 'edge') {
|
} else if (this.config.componentsData.assetScope === 'edge') {
|
||||||
this.edgeService.getEdge(this.edgeId).pipe(map(edge =>
|
this.edgeService.getEdge(this.edgeId).subscribe(
|
||||||
this.config.tableTitle = edge.name + ': ' + this.translate.instant('asset.assets'))).subscribe();
|
edge => this.config.tableTitle = edge.name + ': ' + this.translate.instant('asset.assets')
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.config.tableTitle = this.translate.instant('asset.assets');
|
this.config.tableTitle = this.translate.instant('asset.assets');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user