From b6ff9369e4435846f9a6044868db54125047ec90 Mon Sep 17 00:00:00 2001 From: Samuel Date: Tue, 29 Sep 2020 14:14:28 +0200 Subject: [PATCH] Add statistics pages - move data service and add ds-loading --- .../usage-report-data.service.ts | 4 ++-- ...llection-statistics-page.component.spec.ts | 2 +- .../collection-statistics-page.component.ts | 2 +- ...ommunity-statistics-page.component.spec.ts | 2 +- .../community-statistics-page.component.ts | 2 +- .../item-statistics-page.component.spec.ts | 2 +- .../item-statistics-page.component.ts | 2 +- .../site-statistics-page.component.spec.ts | 2 +- .../site-statistics-page.component.ts | 2 +- .../statistics-page/statistics-page.module.ts | 2 +- .../statistics-page.component.html | 24 ++++++++++++------- .../statistics-page.component.ts | 2 +- 12 files changed, 28 insertions(+), 20 deletions(-) rename src/app/core/{submission => statistics}/usage-report-data.service.ts (93%) diff --git a/src/app/core/submission/usage-report-data.service.ts b/src/app/core/statistics/usage-report-data.service.ts similarity index 93% rename from src/app/core/submission/usage-report-data.service.ts rename to src/app/core/statistics/usage-report-data.service.ts index e59451d7dd..08dd111384 100644 --- a/src/app/core/submission/usage-report-data.service.ts +++ b/src/app/core/statistics/usage-report-data.service.ts @@ -10,8 +10,8 @@ import { HALEndpointService } from '../shared/hal-endpoint.service'; import { DataService } from '../data/data.service'; import { RequestService } from '../data/request.service'; import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service'; -import { USAGE_REPORT } from '../statistics/models/usage-report.resource-type'; -import { UsageReport } from '../statistics/models/usage-report.model'; +import { USAGE_REPORT } from './models/usage-report.resource-type'; +import { UsageReport } from './models/usage-report.model'; import { Observable } from 'rxjs'; import { getRemoteDataPayload, getSucceededRemoteData } from '../shared/operators'; import { map } from 'rxjs/operators'; diff --git a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts index c74ce7f492..110757670c 100644 --- a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts +++ b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts @@ -3,7 +3,7 @@ import { CollectionStatisticsPageComponent } from './collection-statistics-page. import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; import { TranslateModule } from '@ngx-translate/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { of as observableOf } from 'rxjs'; import { RemoteData } from '../../core/data/remote-data'; import { Collection } from '../../core/shared/collection.model'; diff --git a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts index 01bbe246a2..05f4641d81 100644 --- a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts +++ b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { ActivatedRoute , Router} from '@angular/router'; import { Collection } from '../../core/shared/collection.model'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; diff --git a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts index a796f6886b..a5771dfb38 100644 --- a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts +++ b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts @@ -3,7 +3,7 @@ import { CommunityStatisticsPageComponent } from './community-statistics-page.co import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; import { TranslateModule } from '@ngx-translate/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { of as observableOf } from 'rxjs'; import { RemoteData } from '../../core/data/remote-data'; import { Community } from '../../core/shared/community.model'; diff --git a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts index 4cd3a359bc..65d5fe88e5 100644 --- a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts +++ b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { ActivatedRoute, Router } from '@angular/router'; import { Community } from '../../core/shared/community.model'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; diff --git a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts index 404231930a..c0bf98ef19 100644 --- a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts +++ b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts @@ -3,7 +3,7 @@ import { ItemStatisticsPageComponent } from './item-statistics-page.component'; import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; import { TranslateModule } from '@ngx-translate/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { of as observableOf } from 'rxjs'; import { RemoteData } from '../../core/data/remote-data'; import { Item } from '../../core/shared/item.model'; diff --git a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts index 9b98f6f9e0..fb9ced4520 100644 --- a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts +++ b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { ActivatedRoute, Router } from '@angular/router'; import { Item } from '../../core/shared/item.model'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; diff --git a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts index 2980d6fff9..6f2247b433 100644 --- a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts +++ b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts @@ -3,7 +3,7 @@ import { SiteStatisticsPageComponent } from './site-statistics-page.component'; import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; import { TranslateModule } from '@ngx-translate/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { of as observableOf } from 'rxjs'; import { Site } from '../../core/shared/site.model'; import { DebugElement } from '@angular/core'; diff --git a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts index 43ddf61ed9..fd1319723c 100644 --- a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts +++ b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; import { SiteDataService } from '../../core/data/site-data.service'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { ActivatedRoute, Router } from '@angular/router'; import { Site } from '../../core/shared/site.model'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; diff --git a/src/app/statistics-page/statistics-page.module.ts b/src/app/statistics-page/statistics-page.module.ts index bdb3084388..068ded63aa 100644 --- a/src/app/statistics-page/statistics-page.module.ts +++ b/src/app/statistics-page/statistics-page.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { CoreModule } from '../core/core.module'; import { SharedModule } from '../shared/shared.module'; import { StatisticsModule } from '../statistics/statistics.module'; -import { UsageReportService } from '../core/submission/usage-report-data.service'; +import { UsageReportService } from '../core/statistics/usage-report-data.service'; import { SiteStatisticsPageComponent } from './site-statistics-page/site-statistics-page.component'; import { StatisticsTableComponent } from './statistics-table/statistics-table.component'; import { ItemStatisticsPageComponent } from './item-statistics-page/item-statistics-page.component'; diff --git a/src/app/statistics-page/statistics-page/statistics-page.component.html b/src/app/statistics-page/statistics-page/statistics-page.component.html index 5c3f67ac82..5cf1e9c8b5 100644 --- a/src/app/statistics-page/statistics-page/statistics-page.component.html +++ b/src/app/statistics-page/statistics-page/statistics-page.component.html @@ -8,14 +8,22 @@ - - - -
- {{ 'statistics.page.no-data' | translate }} -
+ + + + + + + + + +
+ {{ 'statistics.page.no-data' | translate }} +
+
+
diff --git a/src/app/statistics-page/statistics-page/statistics-page.component.ts b/src/app/statistics-page/statistics-page/statistics-page.component.ts index 07748ebd1f..e034a35dca 100644 --- a/src/app/statistics-page/statistics-page/statistics-page.component.ts +++ b/src/app/statistics-page/statistics-page/statistics-page.component.ts @@ -1,6 +1,6 @@ import { OnInit } from '@angular/core'; import { combineLatest, Observable } from 'rxjs'; -import { UsageReportService } from '../../core/submission/usage-report-data.service'; +import { UsageReportService } from '../../core/statistics/usage-report-data.service'; import { map, switchMap } from 'rxjs/operators'; import { UsageReport } from '../../core/statistics/models/usage-report.model'; import { RemoteData } from '../../core/data/remote-data';