Validator's History
-
+
+
+
No validated metadata record yet
-
+
0" class="uk-margin-large-top">
@@ -21,11 +23,11 @@
Guidelines |
Status |
- Actions |
+
-
+
{{result.baseUrl}} |
@@ -34,27 +36,52 @@
-
- {{result.status}}
-
-
- {{result.progress}}
-
- |
-
-
+
+
+
+
-
- View Results
-
+ View results
+
+
+ In progess
+
+
+ Stopped
+
+
+ Error
+
+
+ Errors
+
|
+
+
+
+
+
+
+
+
+
+
Please reload the page to get the updated status.
+
+
+
+
No errors available
+
+
+
+
diff --git a/src/app/pages/oaipmh-validator/validation-history/oaipmh-history.component.ts b/src/app/pages/oaipmh-validator/validation-history/oaipmh-history.component.ts
index 7ff02f8..af4943d 100644
--- a/src/app/pages/oaipmh-validator/validation-history/oaipmh-history.component.ts
+++ b/src/app/pages/oaipmh-validator/validation-history/oaipmh-history.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnInit} from '@angular/core';
+import {Component, OnInit, ViewChild} from '@angular/core';
import {OaipmhValidatorService} from "../../../services/oaipmh-validator.service";
import {JobResult, Progress, Status} from "../../entities/JobResult";
import {ActivatedRoute} from "@angular/router";
@@ -12,10 +12,16 @@ import {filter, repeat, take} from "rxjs/operators";
styleUrls: ['./oaipmh-history.component.less']
})
export class OaipmhHistoryComponent implements OnInit {
- public result: JobResult;
+ public warning: boolean = false;
+ public results: JobResult[];
public jobId: string = "";
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Validator\'s History'}];
protected readonly Progress = Progress;
+ protected readonly Status = Status;
+
+ @ViewChild('errorsModal') errorsModal;
+ public errorsModalOpen: boolean = false;
+ public error: string = null;
subscriptions = [];
@@ -24,11 +30,13 @@ export class OaipmhHistoryComponent implements OnInit {
ngOnInit(): void {
this.subscriptions.push(this.route.queryParams.subscribe(params => {
this.jobId = params['jobId'];
- this.result = null;
+ this.results = [];
+ this.warning = false;
if(!this.jobId) {
- this.jobId = "825";
+ this.getJobResults();
+ } else {
+ this.getJobResult();
}
- this.getJobResult();
}));
}
@@ -41,11 +49,18 @@ export class OaipmhHistoryComponent implements OnInit {
}
public getJobResult() {
+ let count: number = 0;
this.subscriptions.push(this.validator.getJobResult(this.jobId)
.pipe(
repeat({ delay: 5000 }),
filter((result: JobResult) => {
- this.result = result;
+ this.results = [];
+ this.results.push(result);
+ count++;
+ if(count == 120 && result.progress == Progress.IN_PROGRESS) {
+ this.warning = true;
+ return true;
+ }
return result.progress !== Progress.IN_PROGRESS
}),
take(1)
@@ -54,5 +69,25 @@ export class OaipmhHistoryComponent implements OnInit {
);
}
- protected readonly Status = Status;
+ public getJobResults() {
+ this.subscriptions.push(this.validator.getJobResults().subscribe(
+ (results: JobResult[]) => {
+ this.results = results;
+ }),
+ );
+ }
+
+ public viewErrors(error: string) {
+ this.error = error;
+ this.openErrorsModal();
+ this.errorsModalOpen = true;
+ }
+
+ public openErrorsModal() {
+ this.errorsModalOpen = true;
+ this.errorsModal.cancelButton = false;
+ this.errorsModal.okButton = false;
+ this.errorsModal.alertTitle = "Errors";
+ this.errorsModal.open();
+ }
}
diff --git a/src/app/pages/oaipmh-validator/validation-settings/oaipmh-validator.component.ts b/src/app/pages/oaipmh-validator/validation-settings/oaipmh-validator.component.ts
index 315a8b4..6fbd1b2 100644
--- a/src/app/pages/oaipmh-validator/validation-settings/oaipmh-validator.component.ts
+++ b/src/app/pages/oaipmh-validator/validation-settings/oaipmh-validator.component.ts
@@ -7,6 +7,8 @@ import {JobResult} from "../../entities/JobResult";
import {Router} from "@angular/router";
import {Subscriber} from "rxjs";
+declare var UIkit: any;
+
@Component({
selector: 'app-oaipmh-validator',
templateUrl: './oaipmh-validator.component.html',
@@ -18,7 +20,7 @@ export class OaipmhValidatorComponent implements OnInit {
@ViewChild("right_sidebar_footer") right_sidebar_footer;
public options: Option[] = [
- {label: 'OpenAIRE Guidelines for Data Archives Profile v2', value: 'OpenAIRE Guidelines for Data Archives Profile v2'},
+ {label: 'OpenAIRE Guidelines for Data Archives Profile v2 & OpenAIRE FAIR Guidelines for Data Repositories Profile', value: 'OpenAIRE Guidelines for Data Archives Profile v2'},
{label: 'OpenAIRE Guidelines for Literature Repositories Profile v3', value: 'OpenAIRE Guidelines for Literature Repositories Profile v3'},
{label: 'OpenAIRE Guidelines for Literature Repositories Profile v4', value: 'OpenAIRE Guidelines for Literature Repositories Profile v4'},
{label: 'OpenAIRE FAIR Guidelines for Data Repositories Profile', value: 'OpenAIRE FAIR Guidelines for Data Repositories Profile'}
@@ -40,7 +42,7 @@ export class OaipmhValidatorComponent implements OnInit {
private cdr: ChangeDetectorRef,
private validator: OaipmhValidatorService) {
this.form = this.fb.group({
- url: this.fb.control("", StringUtils.urlValidator()),//[Validators.required/*, Validators.email*/]),
+ url: this.fb.control("", [Validators.required, StringUtils.urlValidator()]),//[Validators.required/*, Validators.email*/]),
guidelines: this.fb.control("", Validators.required),
recordsNum: this.fb.control(null, Validators.required),
set: this.fb.control('all', Validators.required)
@@ -113,9 +115,21 @@ export class OaipmhValidatorComponent implements OnInit {
this.router.navigate(['/oaipmh-history'], {
queryParams: { 'jobId': result.id }
});
+ },
+ error => {
+ // if(error.status == 400) {
+ UIkit.notification((error.error && error.error.message) ? error.error.message: error.message, {
+ status: 'danger',
+ timeout: 4000,
+ pos: 'bottom-right'
+ });
+ // }
+ // if(error.status == 422) {
+ // this.router.navigate(['/oaipmh-history'], {
+ // queryParams: { 'jobId': error.error.id }
+ // })
+ // }
}
));
}
-
- protected readonly innerHeight = innerHeight;
}
diff --git a/src/app/services/oaipmh-validator.service.ts b/src/app/services/oaipmh-validator.service.ts
index 55cd26c..3a15be3 100644
--- a/src/app/services/oaipmh-validator.service.ts
+++ b/src/app/services/oaipmh-validator.service.ts
@@ -30,6 +30,11 @@ export class OaipmhValidatorService {
return this.http.get(url);
}
+ getJobResults(limit: number = 200) {
+ let url: string = environment.validatorAPI + "jobs/latest?limit="+limit;
+ return this.http.get(url);
+ }
+
getSets(baseUrl) {
let url: string = environment.validatorAPI + "getSets?baseUrl="+baseUrl;
return this.http.get(url).pipe(map(res => res['set']));
diff --git a/src/app/shared/topmenu/topmenu.component.html b/src/app/shared/topmenu/topmenu.component.html
index 7eca178..93dcbb2 100644
--- a/src/app/shared/topmenu/topmenu.component.html
+++ b/src/app/shared/topmenu/topmenu.component.html
@@ -106,7 +106,7 @@
Validate [demo]
- History [demo]
+ History [demo]
Analysis [demo]