From 1d1963aeb6d787e42a054b221b931740b6a2f7ae Mon Sep 17 00:00:00 2001 From: TheQuaker Date: Mon, 20 Mar 2023 16:53:52 +0200 Subject: [PATCH] added new R5 reports, added checboxes for new R5 metrics --- .../metrics-usagestats-report.component.html | 31 +++++++- .../metrics-usagestats-report.component.ts | 38 ++++++++++ .../metrics/metrics-usagestats.component.html | 76 +++++++++++++++++-- .../metrics/metrics-usagestats.component.ts | 2 +- .../repository/metrics/metrics.routing.ts | 2 +- 5 files changed, 138 insertions(+), 11 deletions(-) diff --git a/src/app/pages/repository/metrics/metrics-usagestats-report.component.html b/src/app/pages/repository/metrics/metrics-usagestats-report.component.html index d8d4fdfd5..60b5f5f95 100755 --- a/src/app/pages/repository/metrics/metrics-usagestats-report.component.html +++ b/src/app/pages/repository/metrics/metrics-usagestats-report.component.html @@ -42,7 +42,7 @@
- +
@@ -122,7 +122,32 @@ -
+
+
Metric Type
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +

Optional filter to only show results for a single item type, e.g. article, book, etc.

@@ -130,7 +155,7 @@
- diff --git a/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts b/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts index c54d30312..1b58d5129 100755 --- a/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts +++ b/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts @@ -26,9 +26,14 @@ export class MetricsUsagestatsReportComponent implements OnInit { chosen_report: string; userEmail: string; + reportType: string; beginDate = ''; endDate = ''; itemIdentifier = ''; + totalItemRequests = null; + totalItemInvestigations = null; + uniqueItemRequests = null; + uniqueItemInvestigations = null; itemDataType = ''; granularity = 'Monthly'; @@ -73,6 +78,7 @@ export class MetricsUsagestatsReportComponent implements OnInit { getParams() { // this.repoId = this.route.snapshot.paramMap.get('id'); + this.reportType = this.route.snapshot.paramMap.get('reportType').slice(1, 2); this.chosen_report = this.route.snapshot.paramMap.get('reportID'); this.shownRepoId = this.convertToDisplayedFormat(this.repo.id); console.log(`shownRepoId is ${this.repo.id}`); @@ -137,6 +143,38 @@ export class MetricsUsagestatsReportComponent implements OnInit { this.useCurrentRepo = event.target.value; } + updateTotalItemRequests(event: any) { + if (event.target.checked) { + this.totalItemRequests = event.target.value; + } else { + this.totalItemRequests = null; + } + } + + updateUniqueItemRequests(event: any) { + if (event.target.checked) { + this.uniqueItemRequests = event.target.value; + } else { + this.uniqueItemRequests = null; + } + } + + updateTotalItemInvestigations(event: any) { + if (event.target.checked) { + this.totalItemInvestigations = event.target.value; + } else { + this.totalItemInvestigations = null; + } + } + + updateUniqueItemInvestigations(event: any) { + if (event.target.checked) { + this.uniqueItemInvestigations = event.target.value; + } else { + this.uniqueItemInvestigations = null; + } + } + goToReport() { if (!this.useCurrentRepo) { this.shownRepoId = ''; } this.router.navigate(['usagestats-report-results'], { diff --git a/src/app/pages/repository/metrics/metrics-usagestats.component.html b/src/app/pages/repository/metrics/metrics-usagestats.component.html index 6fa530e35..1c13caf4d 100755 --- a/src/app/pages/repository/metrics/metrics-usagestats.component.html +++ b/src/app/pages/repository/metrics/metrics-usagestats.component.html @@ -21,10 +21,73 @@

Supported Reports

+

R5 Reports

+ +
+
+
+ +
+ +
+
+

+ A report summarizing usage activity for the repository by month, metric type and item type +

+
+
+
+
+
+ +
+ +
+
+

+ A report summarizing usage activity for the repository by month, broken down by metric type +

+
+
+
+
+
+ +
+ +
+
+

+ A report for items requests by month metric_type, item type and repository +

+
+
+
+
+ +
+
+
+ +
+ +
+
+

+ A report for datasets requests by month metric type and repository +

+
+
+
+
+ +
+

R4 Reports

+
- +
@@ -37,7 +100,7 @@
- +
@@ -50,7 +113,7 @@
- +
@@ -62,10 +125,11 @@
+
- +
@@ -78,7 +142,7 @@
- +
@@ -91,7 +155,7 @@
- +
diff --git a/src/app/pages/repository/metrics/metrics-usagestats.component.ts b/src/app/pages/repository/metrics/metrics-usagestats.component.ts index c9bc243e7..b22a535e2 100755 --- a/src/app/pages/repository/metrics/metrics-usagestats.component.ts +++ b/src/app/pages/repository/metrics/metrics-usagestats.component.ts @@ -3,7 +3,7 @@ import { Repository } from '../../../domain/typeScriptClasses'; import { RepositoryService } from '../../../services/repository.service'; import { AuthenticationService } from '../../../services/authentication.service'; import { ActivatedRoute, Router } from '@angular/router'; -import { SharedService } from "../../../services/shared.service"; +import { SharedService } from '../../../services/shared.service'; @Component({ selector: 'metrics-usagestats', diff --git a/src/app/pages/repository/metrics/metrics.routing.ts b/src/app/pages/repository/metrics/metrics.routing.ts index 987e16883..bba9ec08e 100755 --- a/src/app/pages/repository/metrics/metrics.routing.ts +++ b/src/app/pages/repository/metrics/metrics.routing.ts @@ -36,7 +36,7 @@ const metricsRoutes: Routes = [ component: MetricsUsagestatsComponent }, { - path: 'usagestats/:reportID', + path: 'usagestats/:reportType/:reportID', component: MetricsUsagestatsReportComponent }, {