[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:
konstantina.galouni 2019-09-30 11:02:06 +00:00
parent cdb337592a
commit 7fcbea2b5a
7 changed files with 32 additions and 33 deletions

View File

@ -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;

View File

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

View File

@ -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<length; i++) {
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['oaf:result']) {

View File

@ -479,13 +479,13 @@
</div>
<modal-alert *ngIf="resultLandingInfo.deletedByInferenceIds"
#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>
<deletedByInference *ngIf="type == 'dataset'"
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[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>
<deletedByInference *ngIf="type == 'orp'"
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>
</modal-alert>
</div>

View File

@ -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";

View File

@ -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";

View File

@ -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<string, string[]>; //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<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,
"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<string, string[]>;
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} =
{"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};