From 7fcbea2b5aecb5bb76a7037eb9c26a76e328f2ff Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 30 Sep 2019 11:02:06 +0000 Subject: [PATCH] [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 --- .../deletedByInference.component.ts | 9 ++---- .../deletedByInference.module.ts | 4 +-- .../deletedByInference.service.ts | 12 ++++---- .../result/resultLanding.component.html | 8 +++--- .../result/resultLanding.component.ts | 2 ++ landingPages/result/resultLanding.module.ts | 2 +- utils/entities/resultLandingInfo.ts | 28 +++++++++++-------- 7 files changed, 32 insertions(+), 33 deletions(-) rename landingPages/{landing-utils => result}/deletedByInference/deletedByInference.component.ts (97%) rename landingPages/{landing-utils => result}/deletedByInference/deletedByInference.module.ts (86%) rename landingPages/{landing-utils => result}/deletedByInference/deletedByInference.service.ts (95%) diff --git a/landingPages/landing-utils/deletedByInference/deletedByInference.component.ts b/landingPages/result/deletedByInference/deletedByInference.component.ts similarity index 97% rename from landingPages/landing-utils/deletedByInference/deletedByInference.component.ts rename to landingPages/result/deletedByInference/deletedByInference.component.ts index bfeccb11..a0113c16 100644 --- a/landingPages/landing-utils/deletedByInference/deletedByInference.component.ts +++ b/landingPages/result/deletedByInference/deletedByInference.component.ts @@ -2,18 +2,13 @@ import {Component, ViewChild} from '@angular/core'; import {ElementRef, Input} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; -import {Observable} from 'rxjs'; - 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 {ErrorCodes} from '../../../utils/properties/errorCodes'; import {DeletedByInferenceService} from './deletedByInference.service'; -import {zip} from 'rxjs'; - - @Component({ selector: 'deletedByInference', template: ` @@ -100,7 +95,7 @@ import {zip} from 'rxjs'; }) export class DeletedByInferenceComponent { - public results: DeletedByInferenceResult[] = []; + public results: ResultLandingInfo[] = []; @Input() id: string; @Input() ids: string[] = []; @Input() type: string; diff --git a/landingPages/landing-utils/deletedByInference/deletedByInference.module.ts b/landingPages/result/deletedByInference/deletedByInference.module.ts similarity index 86% rename from landingPages/landing-utils/deletedByInference/deletedByInference.module.ts rename to landingPages/result/deletedByInference/deletedByInference.module.ts index 1a5fc037..4779ca00 100644 --- a/landingPages/landing-utils/deletedByInference/deletedByInference.module.ts +++ b/landingPages/result/deletedByInference/deletedByInference.module.ts @@ -1,5 +1,3 @@ -/* This module contains all common components for all landing pages */ - import { NgModule} from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; @@ -7,7 +5,7 @@ import { FormsModule } from '@angular/forms'; import { DeletedByInferenceComponent } from './deletedByInference.component'; import { DeletedByInferenceService } from './deletedByInference.service'; -import {ResultLandingUtilsModule} from '../resultLandingUtils.module'; +import {ResultLandingUtilsModule} from '../../landing-utils/resultLandingUtils.module'; import {PagingModule} from '../../../utils/paging.module'; diff --git a/landingPages/landing-utils/deletedByInference/deletedByInference.service.ts b/landingPages/result/deletedByInference/deletedByInference.service.ts similarity index 95% rename from landingPages/landing-utils/deletedByInference/deletedByInference.service.ts rename to landingPages/result/deletedByInference/deletedByInference.service.ts index 455543b3..c95c865b 100644 --- a/landingPages/landing-utils/deletedByInference/deletedByInference.service.ts +++ b/landingPages/result/deletedByInference/deletedByInference.service.ts @@ -1,8 +1,8 @@ import {Injectable} from '@angular/core'; 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 {ParsingFunctions} from '../parsingFunctions.class'; +import {ParsingFunctions} from '../../landing-utils/parsingFunctions.class'; import {map} from "rxjs/operators"; @Injectable() @@ -25,19 +25,19 @@ export class DeletedByInferenceService { .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, collectedfrom (link pointing to the download url), access rights*/ - let results: DeletedByInferenceResult[] = []; + let results: ResultLandingInfo[] = []; if(_results) { - let result : DeletedByInferenceResult; + let result : ResultLandingInfo; let length = Array.isArray(_results) ? _results.length : 1; for(let i=0; i - - - - diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 7b9b3f73..83a2d590 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -28,6 +28,7 @@ export class ResultLandingComponent { @Input() activeTab: string = "References"; @ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference; + public deleteByInferenceOpened: boolean = false; public resultLandingInfo: ResultLandingInfo; public id: string; @@ -384,6 +385,7 @@ export class ResultLandingComponent { } openDeletedByInference() { + this.deleteByInferenceOpened = true; this.alertModalDeletedByInference.cancelButton = false; this.alertModalDeletedByInference.okButton = false; this.alertModalDeletedByInference.alertTitle = "Original sources"; diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index 9257aa63..9ae8cbc8 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -19,7 +19,7 @@ import {ResultLandingComponent} from './resultLanding.component'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.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 {HelperModule} from "../../utils/helper/helper.module"; import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts index d7179efb..a8a4b059 100644 --- a/utils/entities/resultLandingInfo.ts +++ b/utils/entities/resultLandingInfo.ts @@ -2,7 +2,7 @@ export class ResultLandingInfo { // PUBLICATION, DATASET, SOFTWARE, ORP record; - underCurationMessage: boolean; + // PUBLICATION, DATASET, SOFTWARE, ORP, DELETED_BY_INFERENCE title: string; accessMode: string; authors: {"fullName": string, "orcid": string}[]; @@ -10,23 +10,16 @@ export class ResultLandingInfo { dateofacceptance: string; embargoEndDate: string; types: string[]; + identifiers: Map; //key is the classname + languages: string[]; + countries: string[]; + description: string; hostedBy_collectedFrom: {"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}[]; - identifiers: Map; //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; - classifiedSubjects: Map; // - description: string; - projectsProvenanceVocabulary: { "sysimport:crosswalk:repository": string, "sysimport:crosswalk:entityregistry": string, "sysimport:crosswalk:datasetarchive": string, @@ -45,10 +38,21 @@ export class ResultLandingInfo { "user:claim:search": "User", "user:claim:datacite": "User" }; + fundedByProjects: { "id": string, "acronym": string, "title": string, "funderShortname": string, "funderName": string, "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; + classifiedSubjects: Map; // + researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} = {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};