added new R5 reports, added checboxes for new R5 metrics

This commit is contained in:
TheQuaker 2023-03-20 16:53:52 +02:00
parent 1329590012
commit 1d1963aeb6
5 changed files with 138 additions and 11 deletions

View File

@ -42,7 +42,7 @@
<div class="md-input-wrapper md-input-filled uk-margin-bottom">
<label>Release</label>
<input class="md-input label-fixed" type="text" value="4" disabled>
<input class="md-input label-fixed" type="text" value="{{reportType}}" disabled>
<span class="md-input-bar "></span>
</div>
@ -122,7 +122,32 @@
</div>
<div *ngIf="chosen_report == 'IR1' || chosen_report == 'RR1' || chosen_report == 'JR1'">
<div *ngIf="chosen_report == 'PR' || chosen_report == 'IR' || chosen_report == 'DSR'">
<h5>Metric Type</h5>
<div>
<label>
<input type="checkbox" class="uk-checkbox" value="Total_Item_Requests" (change)="updateTotalItemRequests($event)"> Total Item Requests
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" value="Total_Item_Investigations" (change)="updateTotalItemInvestigations($event)"> Total Item Investigations
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" value="Unique_Item_Requests" (change)="updateUniqueItemRequests($event)"> UniqueItem Requests
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" value="Unique_Item_Investigations" (change)="updateUniqueItemInvestigations($event)"> Unique Item Investigations
</label>
</div>
</div>
<div *ngIf="chosen_report == 'IR1' || chosen_report == 'RR1' || chosen_report == 'JR1'
|| chosen_report == 'PR' || chosen_report == 'IR'">
<div class="uk-text-italic uk-margin-top uk-margin-bottom">
<p>Optional filter to only show results for a single item type, e.g. article, book, etc.</p>
@ -130,7 +155,7 @@
<div class="md-input-wrapper md-input-filled">
<label class="">Item Data Type</label>
<select class="md-input" name="ItemDataType" (change)="updateItemDataType($event)">
<select class="md-input label-fixed" name="ItemDataType" (change)="updateItemDataType($event)">
<!-- TODO: get the list from api if it becomes available -->
<option value="">--- Select Item Data Type ---</option>
<option value="Annotation">Annotation</option>

View File

@ -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'], {

View File

@ -21,10 +21,73 @@
<h3>Supported Reports</h3>
<h2>R5 Reports</h2>
<div class="uk-grid-match" uk-grid>
<div class="uk-width-1-3">
<div class="uk-text-center md-card md-card-hover">
<a [routerLink]="['R5','PR']" class="uk-position-cover"></a>
<div class="uk-card-media-top">
<img class="" src="../../../../assets/imgs/Icons_Reports_wide_AR1.png" alt="" style="width: 100%;">
</div>
<div class="uk-card-body">
<h3 class="uk-margin uk-card-title uk-margin-small-bottom">
A report summarizing usage activity for the repository by month, metric type and item type
</h3>
</div>
</div>
</div>
<div class="uk-width-1-3">
<div class="uk-text-center md-card md-card-hover">
<a [routerLink]="['R5','PR_1']" class="uk-position-cover"></a>
<div class="uk-card-media-top">
<img class="" src="../../../../assets/imgs/Icons_Reports_wide_AR1.png" alt="" style="width: 100%;">
</div>
<div class="uk-card-body">
<h3 class="uk-margin uk-card-title uk-margin-small-bottom">
A report summarizing usage activity for the repository by month, broken down by metric type
</h3>
</div>
</div>
</div>
<div class="uk-width-1-3">
<div class="uk-text-center md-card md-card-hover">
<a [routerLink]="['R5','IR']" class="uk-position-cover"></a>
<div class="uk-card-media-top">
<img class="" src="../../../../assets/imgs/Icons_Reports_wide_AR1.png" alt="" style="width: 100%;">
</div>
<div class="uk-card-body">
<h3 class="uk-margin uk-card-title uk-margin-small-bottom">
A report for items requests by month metric_type, item type and repository
</h3>
</div>
</div>
</div>
</div>
<div class="uk-grid-match" uk-grid>
<div class="uk-width-1-3">
<div class="uk-text-center md-card md-card-hover">
<a [routerLink]="['R5','DSR']" class="uk-position-cover"></a>
<div class="uk-card-media-top">
<img class="" src="../../../../assets/imgs/Icons_Reports_wide_AR1.png" alt="" style="width: 100%;">
</div>
<div class="uk-card-body">
<h3 class="uk-margin uk-card-title uk-margin-small-bottom">
A report for datasets requests by month metric type and repository
</h3>
</div>
</div>
</div>
</div>
<hr>
<h2>R4 Reports</h2>
<div class="uk-grid uk-grid-match repositoryTypeSelection" data-uk-grid-margin="">
<div class="uk-width-1-3@m uk-row-first">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="">
<a [routerLink]="['AR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<a [routerLink]="['R4','AR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="uk-card-media-top">
<img class="el-image" src="../../../../assets/imgs/Icons_Reports_wide_AR1.png" alt="" style="width: 100%;">
</div>
@ -37,7 +100,7 @@
</div>
<div class="uk-width-1-3@m">
<div class="uk-margin uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="" data-id="" style="">
<a [routerLink]="['IR1']" class="el-link uk-position-cover uk-margin-remove-adjacent" href=""></a>
<a [routerLink]="['R4','IR1']" class="el-link uk-position-cover uk-margin-remove-adjacent" href=""></a>
<div class="uk-card-media-top">
<img class="el-image" src="../../../../assets/imgs/Icons_Reports_wide_IR1.png" alt="" style="width:100%;">
</div>
@ -50,7 +113,7 @@
</div>
<div class="uk-width-1-3@m">
<div class="uk-margin uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="" data-id="" style="">
<a [routerLink]="['RR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<a [routerLink]="['R4','RR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="uk-card-media-top">
<img class="el-image" src="../../../../assets/imgs/Icons_Reports_wide_RR1.png" alt="" style="width:100%;">
</div>
@ -62,10 +125,11 @@
</div>
</div>
</div>
<div class="uk-grid uk-grid-match repositoryTypeSelection" data-uk-grid-margin="">
<div class="uk-width-1-3@m uk-row-first">
<div class="uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="">
<a [routerLink]="['BR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<a [routerLink]="['R4','BR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="uk-card-media-top">
<img class="el-image" src="../../../../assets/imgs/Icons_Reports_wide_BR1.png" alt="" style="width: 100%;">
</div>
@ -78,7 +142,7 @@
</div>
<div class="uk-width-1-3@m">
<div class="uk-margin uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="" data-id="" style="">
<a [routerLink]="['BR2']" class="el-link uk-position-cover uk-margin-remove-adjacent" href=""></a>
<a [routerLink]="['R4','BR2']" class="el-link uk-position-cover uk-margin-remove-adjacent" href=""></a>
<div class="uk-card-media-top">
<img class="el-image" src="../../../../assets/imgs/Icons_Reports_wide_BR2.png" alt="" style="width:100%;">
</div>
@ -91,7 +155,7 @@
</div>
<div *ngIf="repo.eoscDatasourceType === 'journal'" class="uk-width-1-3@m">
<div class="uk-margin uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="" data-id="" style="">
<a [routerLink]="['JR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<a [routerLink]="['R4','JR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
<div class="uk-card-media-top">
<img class="el-image" src="../../../../assets/imgs/Icons_Reports_wide_JR1.png" alt="" style="width:100%;">
</div>

View File

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

View File

@ -36,7 +36,7 @@ const metricsRoutes: Routes = [
component: MetricsUsagestatsComponent
},
{
path: 'usagestats/:reportID',
path: 'usagestats/:reportType/:reportID',
component: MetricsUsagestatsReportComponent
},
{