Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
argirok 2024-07-02 11:53:28 +03:00
commit 93897534dc
14 changed files with 370 additions and 130 deletions

View File

@ -228,11 +228,13 @@
class="uk-link-text" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? subSubItem.label : subSubItem.id)"> class="uk-link-text" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? subSubItem.label : subSubItem.id)">
</a> </a>
<div *ngFor="let level4 of subSubItem?.children" class="uk-margin-left"> <ng-container *ngIf="properties.environment == 'development'">
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(level4)" <div *ngFor="let level4 of subSubItem?.children" class="uk-margin-left">
class="uk-text-small uk-text-meta uk-margin-xsmall-bottom" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? level4.label : level4.id)"> <a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(level4)"
</a> class="uk-text-small uk-text-meta uk-margin-xsmall-bottom" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? level4.label : level4.id)">
</div> </a>
</div>
</ng-container>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,4 +1,9 @@
import {HostedByCollectedFrom, Project, RelationResult} from "../../utils/result-preview/result-preview"; import {
HostedByCollectedFrom,
Project,
RelationDatasource,
RelationResult
} from "../../utils/result-preview/result-preview";
import {Context, Measure, Metric, MetricPerDatasource, Reference} from "../../utils/entities/resultLandingInfo"; import {Context, Measure, Metric, MetricPerDatasource, Reference} from "../../utils/entities/resultLandingInfo";
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
@ -527,6 +532,56 @@ export class ParsingFunctions {
return researchResults; return researchResults;
} }
// publication & dataset & software & orp landing : for relatedResearchResults
parseDatasources(datasources: RelationDatasource[], relation, provenanceAction: string, relationName: string): RelationDatasource[] {
let datasource: RelationDatasource = {
name: "",
id: "",
percentage: null,
percentageName: null,
class: "",
provenanceAction: provenanceAction,
relationName: relationName,
openaireCompatibility: ""
};
datasource['id'] = relation['to'].content;
if(relation["officialname"])
datasource.name = relation.officialname;
else {
datasource['name'] = "[no title available]";
}
let percentageName: string;
if (relation.trust) {
percentageName = "trust";
} else if (relation.similarity) {
percentageName = "similarity";
}
if (percentageName) {
datasource['percentage'] = Math.round(relation[percentageName] * 100);
datasource['percentageName'] = percentageName;
}
// type
if(relation.hasOwnProperty('datasourcetype') && relation['datasourcetype'].hasOwnProperty("classname")) {
datasource.class = relation['datasourcetype'].classname;
}
// compatibility
if(relation.hasOwnProperty("openairecompatibility")) {
datasource.openaireCompatibility = relation['openairecompatibility'].classname;
}
if(datasource.class !== "service" || properties.adminToolsPortalType == "eosc") {
if (datasources == undefined) {
datasources = [];
}
datasources.push(datasource);
}
return datasources;
}
sortByPercentage(results: RelationResult[]): RelationResult[] { sortByPercentage(results: RelationResult[]): RelationResult[] {
if (results) { if (results) {
return results.sort(function (a, b) { return results.sort(function (a, b) {

View File

@ -19,28 +19,30 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
template: ` template: `
<div id="versions_container"> <div id="versions_container">
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages> <errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
<no-load-paging *ngIf="results.length > pageSize" [type]="type" <no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)" (pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize" [page]="page" [pageSize]="pageSize"
[totalResults]="results.length"> [totalResults]="resultsPreview.length">
</no-load-paging> </no-load-paging>
<ul class="uk-list uk-list-divider uk-margin"> <ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)"> <li *ngFor="let result of resultsPreview.slice((page-1)*pageSize, page*pageSize)">
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)" <result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="result"
[isCard]="false" [prevPath]="prevPath" [isDeletedByInferenceModal]="true"></result-preview> [isCard]="false" [prevPath]="prevPath" [isDeletedByInferenceModal]="true"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type" <no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)" (pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize" [page]="page" [pageSize]="pageSize"
[totalResults]="results.length"> [totalResults]="resultsPreview.length">
</no-load-paging> </no-load-paging>
</div> </div>
` `
}) })
export class OrganizationsDeletedByInferenceComponent { export class OrganizationsDeletedByInferenceComponent {
@Input() prevPath: string = ""; @Input() prevPath: string = "";
public results: OrganizationInfo[] = []; public resultsPreview: ResultPreview[] = [];
@Input() children = [];
@Input() id: string; @Input() id: string;
@Input() ids: string[] = []; @Input() ids: string[] = [];
@Input() type: string; @Input() type: string;
@ -67,10 +69,10 @@ export class OrganizationsDeletedByInferenceComponent {
this.properties = properties; this.properties = properties;
this.subscriptions.push(this.route.queryParams.subscribe(data => { this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.errorCodes = new ErrorCodes(); this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;
this.getDeletedByInference(); this.parseDeletedByInference();
})); }));
} }
@ -81,25 +83,36 @@ export class OrganizationsDeletedByInferenceComponent {
} }
}); });
} }
getDeletedByInference() {
this.results = [];
this.status = this.errorCodes.LOADING;
this.subscriptions.push(this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe( public parseDeletedByInference() {
data => { let length = Array.isArray(this.children) ? this.children.length : 1;
this.results = data; for (let i = 0; i < length; i++) {
this.status = this.errorCodes.DONE; let result = Array.isArray(this.children) ? this.children[i] : this.children;
}, let preview = new ResultPreview();
error => {
if(error.status == '404') { if(result.hasOwnProperty("websiteurl")) {
this.status = this.errorCodes.NOT_FOUND; preview.websiteURL = result.websiteurl;
} else if(error.status == '500') { }
this.status = this.errorCodes.ERROR; if(result.hasOwnProperty("legalshortname")) {
preview.title = result.legalshortname;
}
if(result.hasOwnProperty("legalname")) {
if(preview.title && preview.title != result.legalname) {
preview.title += "("+result.legalname+")";
} else { } else {
this.status = this.errorCodes.NOT_AVAILABLE; preview.title = result.legalname;
} }
} }
));
if(result.hasOwnProperty("country")) {
preview.countries = [result['country'].classname];
}
preview.resultType = 'organization';
this.resultsPreview.push(preview);
}
this.status = this.errorCodes.DONE;
} }
public getResultPreview(result: OrganizationInfo): ResultPreview { public getResultPreview(result: OrganizationInfo): ResultPreview {

View File

@ -370,7 +370,8 @@
[id]="organizationInfo.objIdentifier" [id]="organizationInfo.objIdentifier"
[ids]="organizationInfo.deletedByInferenceIds" [ids]="organizationInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[type]="'organizations'" [prevPath]="prevPath"> [type]="'organizations'" [prevPath]="prevPath"
[children]="organizationInfo.children">
</organizationsDeletedByInference> </organizationsDeletedByInference>
</modal-alert> </modal-alert>
@ -484,7 +485,8 @@
<organizationsDeletedByInference *ngIf="deleteByInferenceOpened" <organizationsDeletedByInference *ngIf="deleteByInferenceOpened"
[id]="organizationInfo.objIdentifier" [id]="organizationInfo.objIdentifier"
[ids]="organizationInfo.deletedByInferenceIds" [ids]="organizationInfo.deletedByInferenceIds"
[type]="'organizations'" [prevPath]="prevPath"> [type]="'organizations'" [prevPath]="prevPath"
[children]="organizationInfo.children">
</organizationsDeletedByInference> </organizationsDeletedByInference>
</fs-modal> </fs-modal>
<!-- Share --> <!-- Share -->

View File

@ -8,33 +8,36 @@ 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 {ResultPreview} from "../../../utils/result-preview/result-preview"; import {HostedByCollectedFrom, ResultPreview} from "../../../utils/result-preview/result-preview";
import {AlertModal} from "../../../utils/modal/alert"; import {AlertModal} from "../../../utils/modal/alert";
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {properties} from "../../../../../environments/environment"; import {properties} from "../../../../../environments/environment";
import {HelperFunctions} from "../../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../../utils/HelperFunctions.class";
import {Dates, StringUtils} from "../../../utils/string-utils.class";
import {ParsingFunctions} from "../../landing-utils/parsingFunctions.class";
@Component({ @Component({
selector: 'deletedByInference', selector: 'deletedByInference',
template: ` template: `
<div id="versions_container"> <div id="versions_container">
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages> <errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
<no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)" (pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize" [page]="page" [pageSize]="pageSize"
[totalResults]="results.length"> [totalResults]="resultsPreview.length">
</no-load-paging> </no-load-paging>
<ul class="uk-list uk-margin"> <ul class="uk-list uk-margin">
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)"> <li *ngFor="let result of resultsPreview.slice((page-1)*pageSize, page*pageSize)">
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)" <result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="result"
[showOrcid]="false" [prevPath]="prevPath" [showInline]="true" [showOrcid]="false" [prevPath]="prevPath" [showInline]="true"
[isDeletedByInferenceModal]="true" [isMobile]="isMobile"></result-preview> [isDeletedByInferenceModal]="true" [isMobile]="isMobile"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type" <no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)" (pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize" [page]="page" [pageSize]="pageSize"
[totalResults]="results.length"> [totalResults]="resultsPreview.length">
</no-load-paging> </no-load-paging>
</div> </div>
` `
@ -42,7 +45,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
export class DeletedByInferenceComponent { export class DeletedByInferenceComponent {
@Input() isMobile: boolean = false; @Input() isMobile: boolean = false;
@Input() prevPath: string = ""; @Input() prevPath: string = "";
public results: ResultLandingInfo[] = []; public resultsPreview: ResultPreview[] = [];
@Input() children = [];
@Input() id: string; @Input() id: string;
@Input() ids: string[] = []; @Input() ids: string[] = [];
@Input() type: string; @Input() type: string;
@ -74,7 +78,7 @@ export class DeletedByInferenceComponent {
this.errorCodes = new ErrorCodes(); this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;
this.getDeletedByInference(); this.parseDeletedByInference();
})); }));
} }
@ -86,24 +90,88 @@ export class DeletedByInferenceComponent {
}); });
} }
getDeletedByInference() { public parseDeletedByInference() {
this.results = []; let parsingFunctions: ParsingFunctions = new ParsingFunctions();
this.status = this.errorCodes.LOADING; let length = Array.isArray(this.children) ? this.children.length : 1;
this.subscriptions.push(this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe( for (let i = 0; i < length; i++) {
data => { let result = Array.isArray(this.children) ? this.children[i] : this.children;
this.results = data; let preview = new ResultPreview();
this.status = this.errorCodes.DONE; if(result.hasOwnProperty("creator")) {
}, preview.authors = [];
error => { let authorsLength = Array.isArray(result.creator) ? result.creator.length : 1;
if (error.status == '404') { for (let j = 0; j < authorsLength; j++) {
this.status = this.errorCodes.NOT_FOUND; let author = {"fullName": Array.isArray(result.creator) ? result.creator[j] : result.creator, "orcid": null, "orcid_pending": null};
} else if (error.status == '500') { preview.authors.push(author);
this.status = this.errorCodes.ERROR;
} else {
this.status = this.errorCodes.NOT_AVAILABLE;
} }
} }
)); if(result.hasOwnProperty("dateofacceptance")) {
preview.year = new Date(result.dateofacceptance).getFullYear().toString();
}
if(result.hasOwnProperty("title")) {
let titleLength = Array.isArray(result.title) ? result.title.length : 1;
for (let j = 0; j < titleLength; j++) {
let title = Array.isArray(result.title) ? result.title[j] : result.title;
if (!preview.title || title.classid == "main title") {
preview.title = StringUtils.HTMLToString(String(title.content));
}
}
}
if(result.hasOwnProperty("description")) {
preview.description = result.description;
}
preview.resultType = result?.resulttype?.classid ? result.resulttype.classid : this.resultType;
if (result.hasOwnProperty("instance")) {
preview.hostedBy_collectedFrom = new Array<HostedByCollectedFrom>();
preview.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let instanesLength = Array.isArray(result['instance']) ? result['instance'].length : 1;
for (let j = 0; j < instanesLength; j++) {
instance = Array.isArray(result['instance']) ? result['instance'][j] : result['instance'];
if(result.hasOwnProperty('collectedfrom')) {
if(Array.isArray(result['collectedfrom'])) {
// not sure if this is correct mapping
instance['collectedfrom'] = result['collectedfrom'].length >= j ? result['collectedfrom'][j] : result['collectedfrom'][result['collectedfrom'].length - 1];
} else {
instance['collectedfrom'] = result['collectedfrom'];
}
}
parsingFunctions.parseTypes(preview.types, types, instance);
if (instance.hasOwnProperty("webresource")) {
let url;
if (!Array.isArray(instance['webresource'])) {
url = instance['webresource'].url;
} else {
url = instance['webresource'][0].url;
}
if (url.includes('&amp;')) {
url = url.replace(/&amp;/gmu, '&');
}
/**********************************************************/
if (instance.hasOwnProperty("hostedby")) {
parsingFunctions.parseHostedBy_collectedFrom(preview.hostedBy_collectedFrom, instance, url, null);
}
/**********************************************************/
}
}
// /* Order Download from via openness*/
preview.hostedBy_collectedFrom.sort(parsingFunctions.compareHostedByCollectedFrom);
}
this.resultsPreview.push(preview);
}
this.status = this.errorCodes.DONE;
} }
public getResultPreview(result: ResultLandingInfo): ResultPreview { public getResultPreview(result: ResultLandingInfo): ResultPreview {

View File

@ -153,6 +153,10 @@
[tabTitle]="'Related research'" [tabId]="'all_related'" [tabTitle]="'Related research'" [tabId]="'all_related'"
[tabNumber]="resultLandingInfo.relatedResults.length"> [tabNumber]="resultLandingInfo.relatedResults.length">
</my-tab> </my-tab>
<my-tab *ngIf="resultLandingInfo.relatedServices?.length > 0"
[tabTitle]="openaireEntities.DATASOURCES" [tabId]="'dataProviders'"
[tabNumber]="resultLandingInfo.relatedServices.length">
</my-tab>
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0" <my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum"> [tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
</my-tab> </my-tab>
@ -179,9 +183,13 @@
</ng-container> </ng-container>
<ng-container *ngIf="resultLandingInfo.relatedResults?.length > 0"> <ng-container *ngIf="resultLandingInfo.relatedResults?.length > 0">
<div id="all_related" class="landing-section"> <div id="all_related" class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: filteredRelatedResults, header: ''}"></ng-container> <ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedResults, props: relatedResults, header: ''}"></ng-container>
</div> </div>
</ng-container> </ng-container>
<div *ngIf="resultLandingInfo.relatedServices?.length > 0"
id="dataProviders" class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: 'datasource', header: ''}"></ng-container>
</div>
<ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"> <ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0">
<div id="bioentities" class="landing-section"> <div id="bioentities" class="landing-section">
<ng-container *ngTemplateOutlet="bioentities_content"></ng-container> <ng-container *ngTemplateOutlet="bioentities_content"></ng-container>
@ -457,6 +465,14 @@
</div> </div>
<hr> <hr>
</ng-container> </ng-container>
<ng-container *ngIf="resultLandingInfo.relatedServices?.length > 0">
<div class="clickable uk-flex uk-flex-middle uk-flex-between"
(click)="openFsModal(servicesFsModal, openaireEntities.DATASOURCES); onSelectActiveTab('dataProviders')">
<span>{{openaireEntities.DATASOURCES}}</span>
<icon name="chevron_right" [ratio]="1.5" [flex]="true"></icon>
</div>
<hr>
</ng-container>
<ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"> <ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0">
<div class="clickable uk-flex uk-flex-middle uk-flex-between" (click)="openFsModal(bioentitiesFsModal, 'External Databases'); onSelectActiveTab('bioentities')"> <div class="clickable uk-flex uk-flex-middle uk-flex-between" (click)="openFsModal(bioentitiesFsModal, 'External Databases'); onSelectActiveTab('bioentities')">
<span>External Databases</span> <span>External Databases</span>
@ -638,7 +654,15 @@
<fs-modal #relatedResearchFsModal classTitle="uk-tile-default uk-border-bottom" <fs-modal #relatedResearchFsModal classTitle="uk-tile-default uk-border-bottom"
*ngIf="resultLandingInfo.relatedResults?.length > 0"> *ngIf="resultLandingInfo.relatedResults?.length > 0">
<div class="landing-section"> <div class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: filteredRelatedResults, header: ''}"></ng-container> <ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedResults, props: relatedResults, header: ''}"></ng-container>
</div>
</fs-modal>
<fs-modal *ngIf="isMobile" #servicesFsModal classTitle="uk-tile-default uk-border-bottom">
<div *ngIf="activeTab == 'dataProviders' && resultLandingInfo.relatedServices?.length > 0"
class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: 'datasource', header: ''}"></ng-container>
</div> </div>
</fs-modal> </fs-modal>
@ -700,22 +724,26 @@
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath"></deletedByInference> [resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath"></deletedByInference> [resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath"></deletedByInference> [resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath"></deletedByInference> [resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath"
[children]="resultLandingInfo.children"></deletedByInference>
</modal-alert> </modal-alert>
<modal-alert *ngIf="resultLandingInfo" #citeModal> <modal-alert *ngIf="resultLandingInfo" #citeModal>
<citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id" <citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id"
@ -763,34 +791,32 @@
</ul> </ul>
</ng-template> </ng-template>
<ng-template #relation_in_tab let-researchResults="researchResults" let-header="header"> <ng-template #relation_in_tab let-related="related" let-props="props" let-type="type" let-header="header">
<div <div *ngIf="related && related.length > 0" class="uk-margin-bottom">
*ngIf="researchResults && researchResults.length > 0"
class="uk-margin-bottom">
<h6 *ngIf="header">{{header}}</h6> <h6 *ngIf="header">{{header}}</h6>
<div *ngIf="relatedClassFilters?.length > 1" class="uk-margin-medium-bottom" <div *ngIf="props.classFilters?.length > 1" class="uk-margin-medium-bottom"
input type="select" placeholder="Filter by relation" inputClass="flat x-small" input type="select" placeholder="Filter by relation" inputClass="flat x-small"
[options]="relatedClassFilters" [(value)]="relatedClassSelected" [options]="props.classFilters" [(value)]="props.selectedClass"
(valueChange)="relatedClassChanged()"></div> (valueChange)="relatedClassChanged(type)"></div>
<results-and-pages <results-and-pages
[type]="openaireEntities.RESULTS" [type]="((type == 'datasource') ? openaireEntities.DATASOURCES : openaireEntities.RESULTS)"
[page]="relatedPage" [pageSize]="pageSize" [page]="props.page" [pageSize]="pageSize"
[totalResults]="researchResults.length"> [totalResults]="related.length">
</results-and-pages> </results-and-pages>
<ul class="uk-list uk-list-divider uk-margin"> <ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let item of researchResults.slice((relatedPage-1)*pageSize, relatedPage*pageSize)"> <li *ngFor="let item of related.slice((props.page-1)*pageSize, props.page*pageSize)">
<result-preview [properties]="properties" <result-preview [properties]="properties"
[result]="getResultPreview(item)" [provenanceActionVocabulary]="provenanceActionVocabulary" [result]="getResultPreview(item, type)" [provenanceActionVocabulary]="provenanceActionVocabulary"
[relationsVocabulary]="relationsVocabulary" [relationsVocabulary]="relationsVocabulary"
[isCard]="false" [prevPath]="prevPath"></result-preview> [isCard]="false" [prevPath]="prevPath"></result-preview>
</li> </li>
</ul> </ul>
<paging-no-load *ngIf="researchResults.length > pageSize" <paging-no-load *ngIf="related.length > pageSize"
class="uk-margin-top" class="uk-margin-top"
(pageChange)="updateRelatedPage($event)" (pageChange)="updateRelatedPage($event, type)"
[currentPage]="relatedPage" [size]="pageSize" [currentPage]="props.page" [size]="pageSize"
[totalResults]="researchResults.length"> [totalResults]="related.length">
</paging-no-load> </paging-no-load>
</div> </div>
</ng-template> </ng-template>
@ -1130,7 +1156,7 @@
</div> </div>
</ng-container> </ng-container>
</div> </div>
<div *ngIf="resultLandingInfo.measure.countsPerDatasource" class="uk-margin-medium-top uk-width-auto"> <div *ngIf="properties.environment != 'production' && resultLandingInfo.measure.countsPerDatasource" class="uk-margin-medium-top uk-width-auto">
<table class="uk-table uk-table-striped"> <table class="uk-table uk-table-striped">
<thead> <thead>
<tr> <tr>
@ -1173,25 +1199,29 @@
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="type" [type]="openaireEntities.PUBLICATIONS" [resultType]="type" [type]="openaireEntities.PUBLICATIONS"
[isMobile]="isMobile" [isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference> [modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="'dataset'" [type]="openaireEntities.DATASETS" [resultType]="'dataset'" [type]="openaireEntities.DATASETS"
[isMobile]="isMobile" [isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference> [modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="type" [type]="openaireEntities.SOFTWARE" [resultType]="type" [type]="openaireEntities.SOFTWARE"
[isMobile]="isMobile" [isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference> [modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="'other'" [type]="openaireEntities.OTHER" [resultType]="'other'" [type]="openaireEntities.OTHER"
[isMobile]="isMobile" [isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference> [modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
</fs-modal> </fs-modal>
<fs-modal *ngIf="resultLandingInfo" #citeFsModal classTitle="uk-tile-default uk-border-bottom"> <fs-modal *ngIf="resultLandingInfo" #citeFsModal classTitle="uk-tile-default uk-border-bottom">

View File

@ -13,7 +13,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {HelperService} from '../../utils/helper/helper.service'; import {HelperService} from '../../utils/helper/helper.service';
import {Location} from "@angular/common"; import {Location} from "@angular/common";
import {MetricsService} from "../../services/metrics.service"; import {MetricsService} from "../../services/metrics.service";
import {RelationResult, ResultPreview} from "../../utils/result-preview/result-preview"; import {RelationDatasource, RelationResult, ResultPreview} from "../../utils/result-preview/result-preview";
import {IndexInfoService} from "../../utils/indexInfo.service"; import {IndexInfoService} from "../../utils/indexInfo.service";
import {Identifier, StringUtils} from "../../utils/string-utils.class"; import {Identifier, StringUtils} from "../../utils/string-utils.class";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
@ -95,12 +95,7 @@ export class ResultLandingComponent {
// Custom tab paging variables // Custom tab paging variables
public referencesPage: number = 1; public referencesPage: number = 1;
public bioentitiesPage: number = 1; public bioentitiesPage: number = 1;
public relatedPage: number = 1;
public similarPage: number = 1;
public supplementaryPage: number = 1;
public supplementedByPage: number = 1;
public organizationsPage: number = 1;
public openCitationsPage: number = 1;
public pageSize: number = 10; public pageSize: number = 10;
// Map counting variables // Map counting variables
@ -139,9 +134,28 @@ export class ResultLandingComponent {
public pid: string; public pid: string;
public contextsWithLink: any; public contextsWithLink: any;
public relatedClassFilters: Option[]=[{"label": "All relations", "value": ""}]; public relatedResults: {
public relatedClassSelected: string = ""; classFilters: Option[],
public filteredRelatedResults: RelationResult[]; selectedClass: string,
page: number
} = {
classFilters: [{"label": "All relations", "value": ""}],
selectedClass: "",
page: 1,
};
filteredRelatedResults: RelationResult[];
public relatedServices: {
classFilters: Option[],
selectedClass: string,
page: number
} = {
classFilters: [{"label": "All relations", "value": ""}],
selectedClass: "",
page: 1
}
filteredRelatedServices: RelationDatasource[];
public provenanceActionVocabulary = null; public provenanceActionVocabulary = null;
public relationsVocabulary = null; public relationsVocabulary = null;
@ -168,6 +182,7 @@ export class ResultLandingComponent {
@ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent; @ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent;
@ViewChild('referencesFsModal') referencesFsModal: FullScreenModalComponent; @ViewChild('referencesFsModal') referencesFsModal: FullScreenModalComponent;
@ViewChild('relatedResearchFsModal') relatedResearchFsModal: FullScreenModalComponent; @ViewChild('relatedResearchFsModal') relatedResearchFsModal: FullScreenModalComponent;
@ViewChild('servicesFsModal') servicesFsModal: FullScreenModalComponent;
@ViewChild('bioentitiesFsModal') bioentitiesFsModal: FullScreenModalComponent; @ViewChild('bioentitiesFsModal') bioentitiesFsModal: FullScreenModalComponent;
@ViewChild('compatibleEOSCFsModal') compatibleEOSCFsModal: FullScreenModalComponent; @ViewChild('compatibleEOSCFsModal') compatibleEOSCFsModal: FullScreenModalComponent;
@ViewChild('fundedByFsModal') fundedByFsModal: FullScreenModalComponent; @ViewChild('fundedByFsModal') fundedByFsModal: FullScreenModalComponent;
@ -558,20 +573,34 @@ export class ResultLandingComponent {
} }
} }
} }
this.relatedClassFilters = [{"label": "All relations", "value": ""}]; this.relatedResults.classFilters = [{"label": "All relations", "value": ""}];
if (this.resultLandingInfo.relatedClassFilters.size > 1) { if (this.resultLandingInfo.relatedClassFilters.size > 1) {
for (let relClass of this.resultLandingInfo.relatedClassFilters) { for (let relClass of this.resultLandingInfo.relatedClassFilters) {
this.relatedClassFilters.push({ this.relatedResults.classFilters.push({
"label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary), "label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary),
"value": relClass "value": relClass
}); });
} }
} else { } else {
this.relatedClassFilters.pop(); this.relatedResults.classFilters.pop();
} }
this.relatedClassSelected = ""; this.relatedResults.selectedClass = "";
this.filteredRelatedResults = this.resultLandingInfo.relatedResults; this.filteredRelatedResults = this.resultLandingInfo.relatedResults;
this.relatedServices.classFilters = [{"label": "All relations", "value": ""}];
if (this.resultLandingInfo.relatedServicesClassFilters.size > 1) {
for (let relClass of this.resultLandingInfo.relatedServicesClassFilters) {
this.relatedServices.classFilters.push({
"label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary),
"value": relClass
});
}
} else {
this.relatedServices.classFilters.pop();
}
this.relatedServices.selectedClass = "";
this.filteredRelatedServices = this.resultLandingInfo.relatedServices
this.hasViews = false; this.hasViews = false;
this.hasDownloads = false; this.hasDownloads = false;
if (this.resultLandingInfo.measure && this.resultLandingInfo.measure.counts) { if (this.resultLandingInfo.measure && this.resultLandingInfo.measure.counts) {
@ -711,25 +740,14 @@ export class ResultLandingComponent {
this.scrollToTabTop('bioentities'); this.scrollToTabTop('bioentities');
} }
public updateRelatedPage($event) { public updateRelatedPage($event, type) {
this.relatedPage = $event.value; if(type == "datasource") {
this.scrollToTabTop('all_related'); this.relatedServices.page = $event.value;
} this.scrollToTabTop("dataProviders");
} else {
public updateSimilarPage($event) { this.relatedResults.page = $event.value;
this.similarPage = $event.value; this.scrollToTabTop('all_related');
} }
public updateSupplementaryPage($event) {
this.supplementaryPage = $event.value;
}
public updateSupplementedByPage($event) {
this.supplementedByPage = $event.value;
}
public updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
} }
scrollToTabTop(tabId:string){ scrollToTabTop(tabId:string){
@ -788,8 +806,11 @@ export class ResultLandingComponent {
this.alertModalDeletedByInference.open(); this.alertModalDeletedByInference.open();
} }
public getResultPreview(result: RelationResult): ResultPreview { public getResultPreview(result: RelationResult|RelationDatasource, type: string): ResultPreview {
return ResultPreview.relationResultConvert(result); if(type == "datasource") {
return ResultPreview.relationDatasourceConvert(<RelationDatasource>result);
}
return ResultPreview.relationResultConvert(<RelationResult>result);
} }
updateUrlWithType(pid) { updateUrlWithType(pid) {
@ -983,9 +1004,14 @@ export class ResultLandingComponent {
this.contextsWithLink = contextsWithLink; this.contextsWithLink = contextsWithLink;
} }
public relatedClassChanged() { public relatedClassChanged(type) {
this.relatedPage = 1; if(type == "datasource") {
this.filteredRelatedResults = this.resultLandingInfo.relatedResults.filter(result => !this.relatedClassSelected || result.relationName.toLowerCase() == this.relatedClassSelected.toLowerCase()); this.relatedServices.page = 1;
this.filteredRelatedServices = this.resultLandingInfo.relatedServices.filter(result => !this.relatedServices.selectedClass || result.relationName.toLowerCase() == this.relatedServices.selectedClass.toLowerCase());
} else {
this.relatedResults.page = 1;
this.filteredRelatedResults = this.resultLandingInfo.relatedResults.filter(result => !this.relatedResults.selectedClass || result.relationName.toLowerCase() == this.relatedResults.selectedClass.toLowerCase());
}
} }
public viewAllOrganizationsClick() { public viewAllOrganizationsClick() {

View File

@ -210,6 +210,19 @@ export class ResultLandingService {
this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName); this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName);
} else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") { } else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") {
this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation); this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation);
} else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations") {
let relationName: string = relation.to.class;
if (!this.resultLandingInfo.relatedServicesClassFilters.has(relationName)) {
this.resultLandingInfo.relatedServicesClassFilters.add(relationName);
}
let provenanceAction: string = relation.provenanceaction;
// this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName);
if (this.resultLandingInfo.relatedServices == undefined) {
this.resultLandingInfo.relatedServices = [];
}
this.resultLandingInfo.relatedServices = this.parsingFunctions.parseDatasources(this.resultLandingInfo.relatedServices, relation, provenanceAction, relationName);
} }
} }
} }
@ -225,6 +238,7 @@ export class ResultLandingService {
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result']; let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
this.resultLandingInfo.deletedByInferenceIds.push(result.objidentifier); this.resultLandingInfo.deletedByInferenceIds.push(result.objidentifier);
} }
this.resultLandingInfo.children = data[3]['result'];
} }

View File

@ -93,6 +93,7 @@ export class OrganizationService {
this.organizationInfo.deletedByInferenceIds.push(result.objidentifier); this.organizationInfo.deletedByInferenceIds.push(result.objidentifier);
} }
} }
this.organizationInfo.children = children['organization'];
} }
if(organization['pid']) { if(organization['pid']) {

View File

@ -11,8 +11,7 @@ export class DataproviderProvenance {
this.provenance.set("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"}); this.provenance.set("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"});
this.provenance.set("eosc________::", { this.provenance.set("eosc________::", {
"urlPrefix": properties.eoscMarketplaceURL, "urlPrefix": properties.eoscMarketplaceURL,
"name": "EOSC Service Catalogue" "name": "EOSC Resource Hub" });
});
} }
} }

View File

@ -28,6 +28,7 @@ export class OrganizationInfo {
// organizations: {name: string; url: string}[]}[]; // organizations: {name: string; url: string}[]}[];
deletedByInferenceIds: string[]; deletedByInferenceIds: string[];
children;
identifiers: Map<string, string[]>; //key is the classname identifiers: Map<string, string[]>; //key is the classname
belongsTo: boolean = true; belongsTo: boolean = true;
message: string; message: string;

View File

@ -3,7 +3,7 @@ import {
HostedByCollectedFrom, HostedByCollectedFrom,
Journal, OARoutes, Journal, OARoutes,
Organization, Organization,
Project, Project, RelationDatasource,
RelationResult RelationResult
} from "../result-preview/result-preview"; } from "../result-preview/result-preview";
import {isArray} from "rxjs/internal-compatibility"; import {isArray} from "rxjs/internal-compatibility";
@ -185,6 +185,7 @@ export class ResultLandingInfo {
contexts: Context[]; contexts: Context[];
deletedByInferenceIds: string[]; deletedByInferenceIds: string[];
children;
// PUBLICATION, DATASET, ORP // PUBLICATION, DATASET, ORP
references: Reference[]; references: Reference[];
@ -194,6 +195,9 @@ export class ResultLandingInfo {
organizations: Organization[]; organizations: Organization[];
openCitations: { "url": string, "title": string, "year": string, "doi": string, "authors": string[] }[]; openCitations: { "url": string, "title": string, "year": string, "doi": string, "authors": string[] }[];
relatedServices: RelationDatasource[];
relatedServicesClassFilters: Set<string> = new Set();
// DATASET // DATASET
subtitle: string; subtitle: string;

View File

@ -25,7 +25,7 @@ export let common: EnvProperties = {
wikiDataURL: "https://www.wikidata.org/wiki/", wikiDataURL: "https://www.wikidata.org/wiki/",
fundRefURL: "https://data.crossref.org/fundingdata/funder/", fundRefURL: "https://data.crossref.org/fundingdata/funder/",
fairSharingURL: "https://fairsharing.org/", fairSharingURL: "https://fairsharing.org/",
eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", eoscMarketplaceURL: "https://open-science-cloud.ec.europa.eu/resources/services/",
sherpaURL: "http://sherpa.ac.uk/romeo/issn/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/",
sherpaURLSuffix: "/", sherpaURLSuffix: "/",
zenodo: "https://zenodo.org/", zenodo: "https://zenodo.org/",

View File

@ -37,6 +37,17 @@ export interface RelationResult {
relationName?: string; relationName?: string;
} }
export interface RelationDatasource {
name: string;
id: string;
percentage: number;
percentageName?: string;
class: string
provenanceAction?: string;
relationName?: string;
openaireCompatibility: string;
}
export interface Project { export interface Project {
id: string; id: string;
acronym: string; acronym: string;
@ -271,6 +282,20 @@ export class ResultPreview {
return resultPreview; return resultPreview;
} }
public static relationDatasourceConvert(result: RelationDatasource): ResultPreview {
let resultPreview: ResultPreview = new ResultPreview();
resultPreview.id = result.id;
resultPreview.title = result.name;
resultPreview.resultType = "dataprovider";
resultPreview.types = [result.class];
resultPreview.relationName = result.relationName;
resultPreview.relation = result.percentageName;
resultPreview.percentage = result.percentage;
resultPreview.provenanceAction = result.provenanceAction;
resultPreview.compatibility = result.openaireCompatibility;
return resultPreview;
}
public static organizationConvert(result: Organization, relation: string = 'trust'): ResultPreview { public static organizationConvert(result: Organization, relation: string = 'trust'): ResultPreview {
let resultPreview: ResultPreview = new ResultPreview(); let resultPreview: ResultPreview = new ResultPreview();
resultPreview.id = result.id; resultPreview.id = result.id;