@@ -4,27 +4,11 @@ import {
44 Input ,
55 OnInit ,
66} from '@angular/core' ;
7- import {
8- TranslateModule ,
9- TranslateService ,
10- } from '@ngx-translate/core' ;
11- import {
12- Observable ,
13- of ,
14- } from 'rxjs' ;
15- import { map } from 'rxjs/operators' ;
7+ import { TranslateModule } from '@ngx-translate/core' ;
168
179import { DSONameService } from '../../core/breadcrumbs/dso-name.service' ;
1810import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service' ;
19- import {
20- getFinishedRemoteData ,
21- getRemoteDataPayload ,
22- } from '../../core/shared/operators' ;
23- import {
24- Point ,
25- UsageReport ,
26- } from '../../core/statistics/models/usage-report.model' ;
27- import { isEmpty } from '../../shared/empty.util' ;
11+ import { UsageReport } from '../../core/statistics/models/usage-report.model' ;
2812
2913/**
3014 * Component representing a statistics table for a given usage report.
@@ -57,7 +41,6 @@ export class StatisticsTableComponent implements OnInit {
5741 constructor (
5842 protected dsoService : DSpaceObjectDataService ,
5943 protected nameService : DSONameService ,
60- private translateService : TranslateService ,
6144 ) {
6245
6346 }
@@ -68,23 +51,4 @@ export class StatisticsTableComponent implements OnInit {
6851 this . headers = Object . keys ( this . report . points [ 0 ] . values ) ;
6952 }
7053 }
71-
72- /**
73- * Get the row label to display for a statistics point.
74- * @param point the statistics point to get the label for
75- */
76- getLabel ( point : Point ) : Observable < string > {
77- switch ( this . report . reportType ) {
78- case 'TotalVisits' :
79- return this . dsoService . findById ( point . id ) . pipe (
80- getFinishedRemoteData ( ) ,
81- getRemoteDataPayload ( ) ,
82- map ( ( item ) => ! isEmpty ( item ) ? this . nameService . getName ( item ) : this . translateService . instant ( 'statistics.table.no-name' ) ) ,
83- ) ;
84- case 'TopCities' :
85- case 'topCountries' :
86- default :
87- return of ( point . label ) ;
88- }
89- }
9054}
0 commit comments