[Trunk | Library]: original versions of results - deletedByInference:
1. Move 'landingPages/landing-utils/deletedByInference' folder to 'landingPages/result/deletedByInference'. 2. For original versions of results use 'ResultLandingInfo' entity instead of 'DeletedByInferenceResult' since the second is a subset. 3. Query original versions of results only on click. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57201 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
cdb337592a
commit
7fcbea2b5a
|
@ -2,18 +2,13 @@ import {Component, ViewChild} from '@angular/core';
|
||||||
import {ElementRef, Input} from '@angular/core';
|
import {ElementRef, Input} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
|
|
||||||
import {Observable} from 'rxjs';
|
|
||||||
|
|
||||||
import {EnvProperties} from '../../../utils/properties/env-properties';
|
import {EnvProperties} from '../../../utils/properties/env-properties';
|
||||||
import {DeletedByInferenceResult} from '../../../utils/entities/deletedByInferenceResult';
|
import {ResultLandingInfo} from '../../../utils/entities/resultLandingInfo';
|
||||||
import {RouterHelper} from '../../../utils/routerHelper.class';
|
import {RouterHelper} from '../../../utils/routerHelper.class';
|
||||||
import {ErrorCodes} from '../../../utils/properties/errorCodes';
|
import {ErrorCodes} from '../../../utils/properties/errorCodes';
|
||||||
|
|
||||||
import {DeletedByInferenceService} from './deletedByInference.service';
|
import {DeletedByInferenceService} from './deletedByInference.service';
|
||||||
|
|
||||||
import {zip} from 'rxjs';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'deletedByInference',
|
selector: 'deletedByInference',
|
||||||
template: `
|
template: `
|
||||||
|
@ -100,7 +95,7 @@ import {zip} from 'rxjs';
|
||||||
})
|
})
|
||||||
|
|
||||||
export class DeletedByInferenceComponent {
|
export class DeletedByInferenceComponent {
|
||||||
public results: DeletedByInferenceResult[] = [];
|
public results: ResultLandingInfo[] = [];
|
||||||
@Input() id: string;
|
@Input() id: string;
|
||||||
@Input() ids: string[] = [];
|
@Input() ids: string[] = [];
|
||||||
@Input() type: string;
|
@Input() type: string;
|
|
@ -1,5 +1,3 @@
|
||||||
/* This module contains all common components for all landing pages */
|
|
||||||
|
|
||||||
import { NgModule} from '@angular/core';
|
import { NgModule} from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
@ -7,7 +5,7 @@ import { FormsModule } from '@angular/forms';
|
||||||
import { DeletedByInferenceComponent } from './deletedByInference.component';
|
import { DeletedByInferenceComponent } from './deletedByInference.component';
|
||||||
import { DeletedByInferenceService } from './deletedByInference.service';
|
import { DeletedByInferenceService } from './deletedByInference.service';
|
||||||
|
|
||||||
import {ResultLandingUtilsModule} from '../resultLandingUtils.module';
|
import {ResultLandingUtilsModule} from '../../landing-utils/resultLandingUtils.module';
|
||||||
|
|
||||||
import {PagingModule} from '../../../utils/paging.module';
|
import {PagingModule} from '../../../utils/paging.module';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {HttpClient} from "@angular/common/http";
|
import {HttpClient} from "@angular/common/http";
|
||||||
import {DeletedByInferenceResult} from '../../../utils/entities/deletedByInferenceResult';
|
import {ResultLandingInfo} from '../../../utils/entities/resultLandingInfo';
|
||||||
import {EnvProperties} from '../../../utils/properties/env-properties';
|
import {EnvProperties} from '../../../utils/properties/env-properties';
|
||||||
import {ParsingFunctions} from '../parsingFunctions.class';
|
import {ParsingFunctions} from '../../landing-utils/parsingFunctions.class';
|
||||||
import {map} from "rxjs/operators";
|
import {map} from "rxjs/operators";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -25,19 +25,19 @@ export class DeletedByInferenceService {
|
||||||
.pipe(map(res => this.parseDeletedByInferenceResults(res, properties)));
|
.pipe(map(res => this.parseDeletedByInferenceResults(res, properties)));
|
||||||
}
|
}
|
||||||
|
|
||||||
parseDeletedByInferenceResults (_results: any, properties: EnvProperties): DeletedByInferenceResult[] {
|
parseDeletedByInferenceResults (_results: any, properties: EnvProperties): ResultLandingInfo[] {
|
||||||
/*title, authors, abstract, List of projects, PIDs,
|
/*title, authors, abstract, List of projects, PIDs,
|
||||||
collectedfrom (link pointing to the download url), access rights*/
|
collectedfrom (link pointing to the download url), access rights*/
|
||||||
|
|
||||||
let results: DeletedByInferenceResult[] = [];
|
let results: ResultLandingInfo[] = [];
|
||||||
if(_results) {
|
if(_results) {
|
||||||
let result : DeletedByInferenceResult;
|
let result : ResultLandingInfo;
|
||||||
|
|
||||||
let length = Array.isArray(_results) ? _results.length : 1;
|
let length = Array.isArray(_results) ? _results.length : 1;
|
||||||
for(let i=0; i<length; i++) {
|
for(let i=0; i<length; i++) {
|
||||||
var _result = Array.isArray(_results) ? _results[i]['result']['metadata']['oaf:entity'] : _results['result']['metadata']['oaf:entity'];
|
var _result = Array.isArray(_results) ? _results[i]['result']['metadata']['oaf:entity'] : _results['result']['metadata']['oaf:entity'];
|
||||||
|
|
||||||
result = new DeletedByInferenceResult();
|
result = new ResultLandingInfo();
|
||||||
|
|
||||||
if(_result) {
|
if(_result) {
|
||||||
if(_result['oaf:result']) {
|
if(_result['oaf:result']) {
|
|
@ -479,13 +479,13 @@
|
||||||
</div>
|
</div>
|
||||||
<modal-alert *ngIf="resultLandingInfo.deletedByInferenceIds"
|
<modal-alert *ngIf="resultLandingInfo.deletedByInferenceIds"
|
||||||
#AlertModalDeletedByInference classBody="uk-width-xxlarge">
|
#AlertModalDeletedByInference classBody="uk-width-xxlarge">
|
||||||
<deletedByInference *ngIf="type == 'publication'"
|
<deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference>
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'dataset'"
|
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference>
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'software'"
|
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference>
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'orp'"
|
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,6 +28,7 @@ export class ResultLandingComponent {
|
||||||
@Input() activeTab: string = "References";
|
@Input() activeTab: string = "References";
|
||||||
|
|
||||||
@ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
|
@ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
|
||||||
|
public deleteByInferenceOpened: boolean = false;
|
||||||
|
|
||||||
public resultLandingInfo: ResultLandingInfo;
|
public resultLandingInfo: ResultLandingInfo;
|
||||||
public id: string;
|
public id: string;
|
||||||
|
@ -384,6 +385,7 @@ export class ResultLandingComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
openDeletedByInference() {
|
openDeletedByInference() {
|
||||||
|
this.deleteByInferenceOpened = true;
|
||||||
this.alertModalDeletedByInference.cancelButton = false;
|
this.alertModalDeletedByInference.cancelButton = false;
|
||||||
this.alertModalDeletedByInference.okButton = false;
|
this.alertModalDeletedByInference.okButton = false;
|
||||||
this.alertModalDeletedByInference.alertTitle = "Original sources";
|
this.alertModalDeletedByInference.alertTitle = "Original sources";
|
||||||
|
|
|
@ -19,7 +19,7 @@ import {ResultLandingComponent} from './resultLanding.component';
|
||||||
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
||||||
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
||||||
|
|
||||||
import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module';
|
import {DeletedByInferenceModule} from './deletedByInference/deletedByInference.module';
|
||||||
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
|
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
|
||||||
import {HelperModule} from "../../utils/helper/helper.module";
|
import {HelperModule} from "../../utils/helper/helper.module";
|
||||||
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
|
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
|
||||||
|
|
|
@ -2,7 +2,7 @@ export class ResultLandingInfo {
|
||||||
// PUBLICATION, DATASET, SOFTWARE, ORP
|
// PUBLICATION, DATASET, SOFTWARE, ORP
|
||||||
record;
|
record;
|
||||||
|
|
||||||
underCurationMessage: boolean;
|
// PUBLICATION, DATASET, SOFTWARE, ORP, DELETED_BY_INFERENCE
|
||||||
title: string;
|
title: string;
|
||||||
accessMode: string;
|
accessMode: string;
|
||||||
authors: {"fullName": string, "orcid": string}[];
|
authors: {"fullName": string, "orcid": string}[];
|
||||||
|
@ -10,23 +10,16 @@ export class ResultLandingInfo {
|
||||||
dateofacceptance: string;
|
dateofacceptance: string;
|
||||||
embargoEndDate: string;
|
embargoEndDate: string;
|
||||||
types: string[];
|
types: string[];
|
||||||
|
identifiers: Map<string, string[]>; //key is the classname
|
||||||
|
languages: string[];
|
||||||
|
countries: string[];
|
||||||
|
description: string;
|
||||||
|
|
||||||
hostedBy_collectedFrom: {"downloadName": string, "downloadUrl": string[],
|
hostedBy_collectedFrom: {"downloadName": string, "downloadUrl": string[],
|
||||||
"collectedName": string, "collectedId": string,
|
"collectedName": string, "collectedId": string,
|
||||||
"accessMode": string[], "bestAccessMode": string,
|
"accessMode": string[], "bestAccessMode": string,
|
||||||
"type": string, "year":string}[];
|
"type": string, "year":string}[];
|
||||||
|
|
||||||
identifiers: Map<string, string[]>; //key is the classname
|
|
||||||
publisher: string;
|
|
||||||
journal: {"journal": string, "issn": string, "lissn": string, "eissn": string,
|
|
||||||
"issue": string, "volume": string, "start_page": string, "end_page": string};
|
|
||||||
languages: string[];
|
|
||||||
countries: string[];
|
|
||||||
subjects: string[];
|
|
||||||
otherSubjects: Map<string, string[]>;
|
|
||||||
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
projectsProvenanceVocabulary: { "sysimport:crosswalk:repository": string,
|
projectsProvenanceVocabulary: { "sysimport:crosswalk:repository": string,
|
||||||
"sysimport:crosswalk:entityregistry": string,
|
"sysimport:crosswalk:entityregistry": string,
|
||||||
"sysimport:crosswalk:datasetarchive": string,
|
"sysimport:crosswalk:datasetarchive": string,
|
||||||
|
@ -45,10 +38,21 @@ export class ResultLandingInfo {
|
||||||
"user:claim:search": "User",
|
"user:claim:search": "User",
|
||||||
"user:claim:datacite": "User"
|
"user:claim:datacite": "User"
|
||||||
};
|
};
|
||||||
|
|
||||||
fundedByProjects: { "id": string, "acronym": string, "title": string,
|
fundedByProjects: { "id": string, "acronym": string, "title": string,
|
||||||
"funderShortname": string, "funderName": string,
|
"funderShortname": string, "funderName": string,
|
||||||
"funding": string, "code": string, "provenanceAction": string, "inline": boolean}[];
|
"funding": string, "code": string, "provenanceAction": string, "inline": boolean}[];
|
||||||
|
|
||||||
|
// PUBLICATION, DATASET, SOFTWARE, ORP
|
||||||
|
underCurationMessage: boolean;
|
||||||
|
publisher: string;
|
||||||
|
journal: {"journal": string, "issn": string, "lissn": string, "eissn": string,
|
||||||
|
"issue": string, "volume": string, "start_page": string, "end_page": string};
|
||||||
|
|
||||||
|
subjects: string[];
|
||||||
|
otherSubjects: Map<string, string[]>;
|
||||||
|
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
|
||||||
|
|
||||||
researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} =
|
researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} =
|
||||||
{"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
|
{"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue