[Library]: Altmetrics bug fix (more checks for previous commit) (from landing page with identifiers to landing page without: ERROR) | Updated parsing of relations in result landing page #7231.
1. result-preview.component.ts: Display relationName (added in beforeTitlte). 2. resultLandingInfo.ts: Added field "relatedResults" (replaced other structures for relations) and "relatedClassFilters". 3. resultLanding.component.html: a. In tab "Related research" show all relations. b. [Bug fix] Added check when accessing resultLandingInfo.identifiers for altmetrics. 4. resultLanding.module.ts: Import MatFormFieldModule and MatSelectModule for filtering relations in tab which shows all relations. 5. result-preview.ts: a. Added in class RelationResult "percentageName" (e.g. trust) and "relationName" (e.g. IsSupplementedBy) fields. b. Added in class ResultPreview "relationName" field (e.g. IsSupplementedBy). c. In method "relationResultConvert()", removed "relation" from parameters (included in RelationResult). 6. resultLanding.service.ts: a. Updated parsing of relations (parse all relations for research results). b. Updated sorting of relations. 7. resultLanding.component.ts: Handle updated relations and show them in one tab all together. 8. parsingFunctions.class.ts: Updated parsing of relations - parse all relations for results and keep the relationName and the percentageName.
This commit is contained in:
parent
8140beb701
commit
e1c520d65f
|
@ -426,6 +426,68 @@ export class ParsingFunctions {
|
|||
return similarResearchResults;
|
||||
}
|
||||
|
||||
parseResults(researchResults: RelationResult[], relation, provenanceAction: string): RelationResult[] {
|
||||
if (researchResults == undefined) {
|
||||
researchResults = [];
|
||||
}
|
||||
|
||||
let researchResult: RelationResult = {
|
||||
name: "",
|
||||
id: "",
|
||||
date: "",
|
||||
percentage: null,
|
||||
percentageName: null,
|
||||
class: "",
|
||||
provenanceAction: provenanceAction,
|
||||
relationName: ""
|
||||
};
|
||||
|
||||
researchResult.relationName = relation.to.class;
|
||||
|
||||
if(relation['resulttype']) {
|
||||
if (relation['resulttype'].classname == "publication") {
|
||||
researchResult['class'] = "publication";
|
||||
} else if (relation['resulttype'].classname == "dataset") {
|
||||
researchResult['class'] = "dataset";
|
||||
} else if (relation['resulttype'].classname == "software") {
|
||||
researchResult['class'] = "software";
|
||||
} else if (relation['resulttype'].classname == "other") {
|
||||
researchResult['class'] = "other";
|
||||
}
|
||||
}
|
||||
researchResult['id'] = relation['to'].content;
|
||||
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : (relation['title']?relation['title'].content:null);
|
||||
researchResult['name'] = titleName;
|
||||
if(!researchResult['name']) {
|
||||
researchResult['name'] = "[no title available]";
|
||||
}
|
||||
if (relation.hasOwnProperty("dateofacceptance")) {
|
||||
var date: string = ((Array.isArray(relation.dateofacceptance)) ? (relation.dateofacceptance[0]) : (relation.dateofacceptance)) + ""; // transform to string in case it is an integer
|
||||
researchResult['date'] = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
|
||||
}
|
||||
//researchResult['date'] = relation.dateofacceptance.substring(0,4);;
|
||||
let percentageName: string;
|
||||
if(relation.trust) {
|
||||
percentageName = "trust";
|
||||
} else if(relation.similarity) {
|
||||
percentageName = "similarity";
|
||||
}
|
||||
if(percentageName) {
|
||||
researchResult['percentage'] = Math.round(relation[percentageName] * 100);
|
||||
researchResult['percentageName'] = percentageName;
|
||||
}
|
||||
researchResults.push(researchResult);
|
||||
return researchResults;
|
||||
}
|
||||
|
||||
parseResearchResults(researchResults: RelationResult[], relation: any, percentageName: string = "trust"): RelationResult[] {
|
||||
if (researchResults == undefined) {
|
||||
researchResults = [];
|
||||
}
|
||||
researchResults.push(this.parseRelatedOrSimilarResearchResult(relation, percentageName));
|
||||
return researchResults;
|
||||
}
|
||||
|
||||
// publication & dataset & software & orp landing : for relatedResearchResults and similarResearchResults
|
||||
parseRelatedOrSimilarResearchResult(relation: any, percentageName: string, provenanceAction: string = null): RelationResult {
|
||||
let researchResult: RelationResult = {
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
</metrics>
|
||||
</div>
|
||||
<div *ngIf="hasAltMetrics">
|
||||
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers.get('doi')[0]}}" type="doi">
|
||||
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers?.get('doi')[0]}}" type="doi">
|
||||
</altmetrics>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -291,108 +291,185 @@
|
|||
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #supplementary_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<!-- <ng-template #supplementary_tab>-->
|
||||
<!-- <div class="uk-grid uk-margin-remove">-->
|
||||
<!-- <div class="uk-width-expand uk-padding">-->
|
||||
<!-- <div-->
|
||||
<!-- *ngIf="resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0"-->
|
||||
<!-- class="uk-margin-bottom">-->
|
||||
<!-- <h6>Supplementary Outcomes</h6>-->
|
||||
<!-- <no-load-paging *ngIf="resultLandingInfo.supplementaryResearchResults.length > pageSize"-->
|
||||
<!-- [type]="'research outcomes'"-->
|
||||
<!-- (pageChange)="updateSupplementaryPage($event)"-->
|
||||
<!-- [page]="supplementaryPage" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="resultLandingInfo.supplementaryResearchResults.length">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- <ul class="uk-list uk-list-divider uk-margin">-->
|
||||
<!-- <li *ngFor="let item of resultLandingInfo.supplementaryResearchResults.slice((supplementaryPage-1)*pageSize, supplementaryPage*pageSize)">-->
|
||||
<!-- <result-preview [modal]="relationModal" [properties]="properties"-->
|
||||
<!-- [result]="getResultPreview(item)"></result-preview>-->
|
||||
<!-- </li>-->
|
||||
<!-- </ul>-->
|
||||
<!-- <no-load-paging *ngIf="resultLandingInfo.supplementaryResearchResults.length > pageSize"-->
|
||||
<!-- [type]="'research outcomes'"-->
|
||||
<!-- (pageChange)="updateSupplementaryPage($event)"-->
|
||||
<!-- [page]="supplementaryPage" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="resultLandingInfo.supplementaryResearchResults.length">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div-->
|
||||
<!-- *ngIf="resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0">-->
|
||||
<!-- <h6>Outcomes Supplemented by this {{getTypeName()}}</h6>-->
|
||||
<!-- <no-load-paging *ngIf="resultLandingInfo.supplementedByResearchResults.length > pageSize"-->
|
||||
<!-- [type]="'research outcomes'"-->
|
||||
<!-- (pageChange)="updateSupplementedByPage($event)"-->
|
||||
<!-- [page]="supplementedByPage" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="resultLandingInfo.supplementedByResearchResults.length">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- <ul class="uk-list uk-list-divider uk-margin">-->
|
||||
<!-- <li *ngFor="let item of resultLandingInfo.supplementedByResearchResults.slice((supplementedByPage-1)*pageSize, supplementedByPage*pageSize)">-->
|
||||
<!-- <result-preview [modal]="relationModal" [properties]="properties"-->
|
||||
<!-- [result]="getResultPreview(item)"></result-preview>-->
|
||||
<!-- </li>-->
|
||||
<!-- </ul>-->
|
||||
<!-- <no-load-paging *ngIf="resultLandingInfo.supplementedByResearchResults.length > pageSize"-->
|
||||
<!-- [type]="'research outcomes'"-->
|
||||
<!-- (pageChange)="updateSupplementedByPage($event)"-->
|
||||
<!-- [page]="supplementedByPage" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="resultLandingInfo.supplementedByResearchResults.length">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <!–<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>–>-->
|
||||
<!-- </div>-->
|
||||
<!-- </ng-template>-->
|
||||
|
||||
<ng-template #relation_in_tab let-researchResults="researchResults" let-header="header" let-relatedClassFilters="relatedClassFilters">
|
||||
<div
|
||||
*ngIf="resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0"
|
||||
*ngIf="researchResults && researchResults.length > 0"
|
||||
class="uk-margin-bottom">
|
||||
<h6>Supplementary Outcomes</h6>
|
||||
<no-load-paging *ngIf="resultLandingInfo.supplementaryResearchResults.length > pageSize"
|
||||
<h6 *ngIf="header">{{header}}</h6>
|
||||
<mat-form-field *ngIf="relatedClassFilters?.size > 1" class="matSelectionFormField">
|
||||
<mat-label>Filter by relation:</mat-label>
|
||||
<mat-select [(ngModel)]="relatedClassSelected" (ngModelChange)="relatedClassChanged()"
|
||||
[disableOptionCentering]="true"
|
||||
panelClass="matSelectionPanel"
|
||||
class="uk-text-bold matSelection">
|
||||
<mat-option [value]="">All relations</mat-option>
|
||||
<mat-option *ngFor="let relatedClass of relatedClassFilters" [value]="relatedClass">{{relatedClass}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<!-- <div class="uk-margin-right uk-padding">-->
|
||||
<!-- <span *ngFor="let relatedClass of relatedClassFilters">-->
|
||||
<!-- <span [class]="'uk-margin-small-bottom uk-margin-small-right uk-label '+getRelatedClass(relatedClass)"-->
|
||||
<!-- (click)="relatedClassChanged(relatedClass)" style="cursor:pointer;">-->
|
||||
<!-- <a>-->
|
||||
<!-- {{relatedClass}}-->
|
||||
<!-- </a>-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
<no-load-paging
|
||||
[type]="'research outcomes'"
|
||||
(pageChange)="updateSupplementaryPage($event)"
|
||||
[page]="supplementaryPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.supplementaryResearchResults.length">
|
||||
(pageChange)="updateRelatedPage($event)"
|
||||
[page]="relatedPage" [pageSize]="pageSize"
|
||||
[totalResults]="researchResults.length">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let item of resultLandingInfo.supplementaryResearchResults.slice((supplementaryPage-1)*pageSize, supplementaryPage*pageSize)">
|
||||
<li *ngFor="let item of researchResults.slice((relatedPage-1)*pageSize, relatedPage*pageSize)">
|
||||
<result-preview [modal]="relationModal" [properties]="properties"
|
||||
[result]="getResultPreview(item)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="resultLandingInfo.supplementaryResearchResults.length > pageSize"
|
||||
<no-load-paging *ngIf="researchResults.length > pageSize"
|
||||
[type]="'research outcomes'"
|
||||
(pageChange)="updateSupplementaryPage($event)"
|
||||
[page]="supplementaryPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.supplementaryResearchResults.length">
|
||||
(pageChange)="updateRelatedPage($event)"
|
||||
[page]="relatedPage" [pageSize]="pageSize"
|
||||
[totalResults]="researchResults.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
<div
|
||||
*ngIf="resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0">
|
||||
<h6>Outcomes Supplemented by this {{getTypeName()}}</h6>
|
||||
<no-load-paging *ngIf="resultLandingInfo.supplementedByResearchResults.length > pageSize"
|
||||
[type]="'research outcomes'"
|
||||
(pageChange)="updateSupplementedByPage($event)"
|
||||
[page]="supplementedByPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.supplementedByResearchResults.length">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let item of resultLandingInfo.supplementedByResearchResults.slice((supplementedByPage-1)*pageSize, supplementedByPage*pageSize)">
|
||||
<result-preview [modal]="relationModal" [properties]="properties"
|
||||
[result]="getResultPreview(item)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="resultLandingInfo.supplementedByResearchResults.length > pageSize"
|
||||
[type]="'research outcomes'"
|
||||
(pageChange)="updateSupplementedByPage($event)"
|
||||
[page]="supplementedByPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.supplementedByResearchResults.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #related_tab>
|
||||
|
||||
<!-- <ng-template #related_tab>-->
|
||||
<!-- <div class="uk-grid uk-margin-remove">-->
|
||||
<!-- <div class="uk-width-expand uk-padding">-->
|
||||
<!-- <div-->
|
||||
<!-- *ngIf="resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0"-->
|
||||
<!-- class="uk-margin-bottom">-->
|
||||
<!-- <h6>Related research</h6>-->
|
||||
<!-- <no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize"-->
|
||||
<!-- [type]="'research outcomes'"-->
|
||||
<!-- (pageChange)="updateRelatedPage($event)"-->
|
||||
<!-- [page]="relatedPage" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="resultLandingInfo.relatedResearchResults.length">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- <ul class="uk-list uk-list-divider uk-margin">-->
|
||||
<!-- <li *ngFor="let item of resultLandingInfo.relatedResearchResults.slice((relatedPage-1)*pageSize, relatedPage*pageSize)">-->
|
||||
<!-- <result-preview [modal]="relationModal" [properties]="properties"-->
|
||||
<!-- [result]="getResultPreview(item)"></result-preview>-->
|
||||
<!-- </li>-->
|
||||
<!-- </ul>-->
|
||||
<!-- <no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize"-->
|
||||
<!-- [type]="'research outcomes'"-->
|
||||
<!-- (pageChange)="updateRelatedPage($event)"-->
|
||||
<!-- [page]="relatedPage" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="resultLandingInfo.relatedResearchResults.length">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div-->
|
||||
<!-- *ngIf="resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0">-->
|
||||
<!-- <h6>Similar Outcomes</h6>-->
|
||||
<!-- <no-load-paging *ngIf="resultLandingInfo.similarResearchResults.length > pageSize"-->
|
||||
<!-- [type]="'research outcomes'"-->
|
||||
<!-- (pageChange)="updateSimilarPage($event)"-->
|
||||
<!-- [page]="similarPage" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="resultLandingInfo.similarResearchResults.length">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- <ul class="uk-list uk-list-divider uk-margin">-->
|
||||
<!-- <li *ngFor="let item of resultLandingInfo.similarResearchResults.slice((similarPage-1)*pageSize, similarPage*pageSize)">-->
|
||||
<!-- <result-preview [modal]="relationModal" [properties]="properties"-->
|
||||
<!-- [result]="getResultPreview(item)"></result-preview>-->
|
||||
<!-- </li>-->
|
||||
<!-- </ul>-->
|
||||
<!-- <no-load-paging *ngIf="resultLandingInfo.similarResearchResults.length > pageSize"-->
|
||||
<!-- [type]="'research outcomes'"-->
|
||||
<!-- (pageChange)="updateSimilarPage($event)"-->
|
||||
<!-- [page]="similarPage" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="resultLandingInfo.similarResearchResults.length">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- </div>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.parentResearchResults, header: 'Parent'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.childrenResearchResults, header: 'Children'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.reviewedByResearchResults, header: 'Reviewed by'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.reviewerResearchResults, header: 'Reviewer'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.referencedByResearchResults, header: 'Referenced by'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.refererResearchResults, header: 'Referer'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.identicalResearchResults, header: 'Identical'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.continuatorResearchResults, header: 'Continuator'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.continuedByResearchResults, header: 'Continued by'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.documentaryResearchResults, header: 'Documentary'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.documentedByResearchResults, header: 'Documented by'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.compilerResearchResults, header: 'Compiler'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.compiledByResearchResults, header: 'Compiled by'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.newerResearchResults, header: 'Newer'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.previousResearchResults, header: 'Previous'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.versionedByResearchResults, header: 'Versioned by'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.isVersionResearchResults, header: 'Is version of'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.derivedResearchResults, header: 'Derived'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.sourceResearchResults, header: 'Source'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.originalResearchResults, header: 'Original'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.variantResearchResults, header: 'Variant'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.obsoleteResearchResults, header: 'Obsolete'}"></ng-container>-->
|
||||
<!-- <ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: resultLandingInfo.obsoletedByResearchResults, header: 'Obsoleted by'}"></ng-container>-->
|
||||
<!-- </div>-->
|
||||
<!-- <!–<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>–>-->
|
||||
<!-- </div>-->
|
||||
<!-- </ng-template>-->
|
||||
<ng-template #all_related_tab>
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<div
|
||||
*ngIf="resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0"
|
||||
class="uk-margin-bottom">
|
||||
<h6>Related research</h6>
|
||||
<no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize"
|
||||
[type]="'research outcomes'"
|
||||
(pageChange)="updateRelatedPage($event)"
|
||||
[page]="relatedPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.relatedResearchResults.length">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let item of resultLandingInfo.relatedResearchResults.slice((relatedPage-1)*pageSize, relatedPage*pageSize)">
|
||||
<result-preview [modal]="relationModal" [properties]="properties"
|
||||
[result]="getResultPreview(item)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize"
|
||||
[type]="'research outcomes'"
|
||||
(pageChange)="updateRelatedPage($event)"
|
||||
[page]="relatedPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.relatedResearchResults.length">
|
||||
</no-load-paging>
|
||||
<ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: filteredRelatedResults, header: '', relatedClassFilters: resultLandingInfo.relatedClassFilters}"></ng-container>
|
||||
</div>
|
||||
<div
|
||||
*ngIf="resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0">
|
||||
<h6>Similar Outcomes</h6>
|
||||
<no-load-paging *ngIf="resultLandingInfo.similarResearchResults.length > pageSize"
|
||||
[type]="'research outcomes'"
|
||||
(pageChange)="updateSimilarPage($event)"
|
||||
[page]="similarPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.similarResearchResults.length">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let item of resultLandingInfo.similarResearchResults.slice((similarPage-1)*pageSize, similarPage*pageSize)">
|
||||
<result-preview [modal]="relationModal" [properties]="properties"
|
||||
[result]="getResultPreview(item)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="resultLandingInfo.similarResearchResults.length > pageSize"
|
||||
[type]="'research outcomes'"
|
||||
(pageChange)="updateSimilarPage($event)"
|
||||
[page]="similarPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.similarResearchResults.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #bioentities_tab>
|
||||
|
@ -476,18 +553,36 @@
|
|||
<ng-container *ngTemplateOutlet="references_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(activeTab === 'supplementary')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0) ||
|
||||
(resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)"
|
||||
[tabTitle]="'Supplementary outcomes'" [tabId]="'supplementary'"
|
||||
[tabNumber]="supplementaryResults">
|
||||
<ng-container *ngTemplateOutlet="supplementary_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(activeTab === 'related')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||
|
||||
(resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)"
|
||||
[tabTitle]="'Related research'" [tabId]="'related'"
|
||||
[tabNumber]="relatedResultsNum">
|
||||
<ng-container *ngTemplateOutlet="related_tab;"></ng-container>
|
||||
<!-- <my-tab *ngIf="(resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0) ||-->
|
||||
<!-- (resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)"-->
|
||||
<!-- [tabTitle]="'Supplementary outcomes'" [tabId]="'supplementary'"-->
|
||||
<!-- [tabNumber]="supplementaryResults">-->
|
||||
<!-- <ng-container *ngTemplateOutlet="supplementary_tab;"></ng-container>-->
|
||||
<!-- </my-tab>-->
|
||||
<!--<!– [class]="(activeTab === 'related')?'uk-active':''"–>-->
|
||||
|
||||
<!-- <my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||-->
|
||||
<!-- (resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0) ||-->
|
||||
<!-- resultLandingInfo.parentResearchResults?.length > 0 || resultLandingInfo.childrenResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.reviewedByResearchResults?.length > 0 || resultLandingInfo.reviewerResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.referencedByResearchResults?.length > 0 || resultLandingInfo.refererResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.identicalResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.continuatorResearchResults?.length > 0 || resultLandingInfo.continuedByResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.documentaryResearchResults?.length > 0 || resultLandingInfo.documentedByResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.compilerResearchResults?.length > 0 || resultLandingInfo.compiledByResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.newerResearchResults?.length > 0 || resultLandingInfo.previousResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.versionedByResearchResults?.length > 0 || resultLandingInfo.isVersionResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.derivedResearchResults?.length > 0 || resultLandingInfo.sourceResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.originalResearchResults?.length > 0 || resultLandingInfo.variantResearchResults?.length > 0 ||-->
|
||||
<!-- resultLandingInfo.obsoleteResearchResults?.length > 0 || resultLandingInfo.obsoletedByResearchResults?.length > 0"-->
|
||||
<!-- [tabTitle]="'Related research'" [tabId]="'related'"-->
|
||||
<!-- [tabNumber]="relatedResultsNum">-->
|
||||
<!-- <ng-container *ngTemplateOutlet="related_tab;"></ng-container>-->
|
||||
<!-- </my-tab>-->
|
||||
<my-tab *ngIf="resultLandingInfo.relatedResults?.length > 0"
|
||||
[tabTitle]="'Related research'" [tabId]="'all_related'"
|
||||
[tabNumber]="resultLandingInfo.relatedResults.length">
|
||||
<ng-container *ngTemplateOutlet="all_related_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(activeTab === 'bioentities')?'uk-active':''"-->
|
||||
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"
|
||||
|
@ -514,18 +609,23 @@
|
|||
<ng-container *ngTemplateOutlet="references_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(activeTab === 'supplementary')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0) ||
|
||||
(resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)"
|
||||
[tabTitle]="'Supplementary outcomes'" [tabId]="'supplementary'"
|
||||
[tabNumber]="supplementaryResults">
|
||||
<ng-container *ngTemplateOutlet="supplementary_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(activeTab === 'related')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||
|
||||
(resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)"
|
||||
[tabTitle]="'Related research'" [tabId]="'related'"
|
||||
[tabNumber]="relatedResultsNum">
|
||||
<ng-container *ngTemplateOutlet="related_tab;"></ng-container>
|
||||
<!-- <my-tab *ngIf="(resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0) ||-->
|
||||
<!-- (resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)"-->
|
||||
<!-- [tabTitle]="'Supplementary outcomes'" [tabId]="'supplementary'"-->
|
||||
<!-- [tabNumber]="supplementaryResults">-->
|
||||
<!-- <ng-container *ngTemplateOutlet="supplementary_tab;"></ng-container>-->
|
||||
<!-- </my-tab>-->
|
||||
<!-- <!– [class]="(activeTab === 'related')?'uk-active':''"–>-->
|
||||
<!-- <my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||-->
|
||||
<!-- (resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)"-->
|
||||
<!-- [tabTitle]="'Related research'" [tabId]="'related'"-->
|
||||
<!-- [tabNumber]="relatedResultsNum">-->
|
||||
<!-- <ng-container *ngTemplateOutlet="related_tab;"></ng-container>-->
|
||||
<!-- </my-tab>-->
|
||||
<my-tab *ngIf="resultLandingInfo.relatedResults?.length > 0"
|
||||
[tabTitle]="'Related research'" [tabId]="'all_related'"
|
||||
[tabNumber]="resultLandingInfo.relatedResults.length">
|
||||
<ng-container *ngTemplateOutlet="all_related_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<!-- [class]="(activeTab === 'bioentities')?'uk-active':''"-->
|
||||
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"
|
||||
|
|
|
@ -116,6 +116,9 @@ export class ResultLandingComponent {
|
|||
@ViewChild("annotation") annotation: AnnotationComponent;
|
||||
public contextsWithLink: any;
|
||||
|
||||
public relatedClassSelected: string = "";
|
||||
public filteredRelatedResults: RelationResult[];
|
||||
|
||||
constructor(private _resultLandingService: ResultLandingService,
|
||||
private _vocabulariesService: ISVocabulariesService,
|
||||
private _piwikService: PiwikService,
|
||||
|
@ -317,12 +320,14 @@ export class ResultLandingComponent {
|
|||
this.activeTab = 'summary';
|
||||
} else if (this.resultLandingInfo.references && this.resultLandingInfo.references.length > 0) {
|
||||
this.activeTab = 'references';
|
||||
} else if ((this.resultLandingInfo.supplementaryResearchResults && this.resultLandingInfo.supplementaryResearchResults.length > 0) ||
|
||||
(this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0)) {
|
||||
this.activeTab = 'supplementary';
|
||||
} else if ((this.resultLandingInfo.relatedResearchResults && this.resultLandingInfo.relatedResearchResults.length > 0) ||
|
||||
(this.resultLandingInfo.similarResearchResults && this.resultLandingInfo.similarResearchResults.length > 0)) {
|
||||
this.activeTab = 'related';
|
||||
// } else if ((this.resultLandingInfo.supplementaryResearchResults && this.resultLandingInfo.supplementaryResearchResults.length > 0) ||
|
||||
// (this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0)) {
|
||||
// this.activeTab = 'supplementary';
|
||||
// } else if ((this.resultLandingInfo.relatedResearchResults && this.resultLandingInfo.relatedResearchResults.length > 0) ||
|
||||
// (this.resultLandingInfo.similarResearchResults && this.resultLandingInfo.similarResearchResults.length > 0)) {
|
||||
// this.activeTab = 'related';
|
||||
} else if (this.resultLandingInfo.relatedResults && this.resultLandingInfo.relatedResults.length > 0) {
|
||||
this.activeTab = "all_related";
|
||||
} else if (this.resultLandingInfo.bioentities && this.bioentitiesNum > 0) {
|
||||
this.activeTab = 'bioentities';
|
||||
} else if(this.enermapsId && this.properties.enermapsURL) {
|
||||
|
@ -417,6 +422,10 @@ export class ResultLandingComponent {
|
|||
if(this.communityId && this.communityId == "enermaps" && properties.enermapsURL){
|
||||
this.enermapsId = ParsingFunctions.getEnermapsConceptId(this.resultLandingInfo.contexts);
|
||||
}
|
||||
|
||||
this.relatedClassSelected = "";
|
||||
this.filteredRelatedResults = this.resultLandingInfo.relatedResults;
|
||||
|
||||
this.showLoading = false;
|
||||
this.setActiveTab();
|
||||
},
|
||||
|
@ -579,7 +588,7 @@ export class ResultLandingComponent {
|
|||
}
|
||||
|
||||
public getResultPreview(result: RelationResult): ResultPreview {
|
||||
return ResultPreview.relationResultConvert(result, this.relation);
|
||||
return ResultPreview.relationResultConvert(result);
|
||||
}
|
||||
|
||||
updateUrlWithType(pid) {
|
||||
|
@ -675,10 +684,11 @@ export class ResultLandingComponent {
|
|||
|
||||
|| (resultLandingInfo.organizations && resultLandingInfo.organizations.length > 0)
|
||||
|| resultLandingInfo.bioentities || (resultLandingInfo.references && resultLandingInfo.references.length > 0)
|
||||
|| (resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0)
|
||||
|| (resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)
|
||||
|| (resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0)
|
||||
|| (resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)
|
||||
// || (resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0)
|
||||
// || (resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)
|
||||
// || (resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0)
|
||||
// || (resultLandingInfo.supplementedByResearchResults &&
|
||||
|| (resultLandingInfo.relatedResults && resultLandingInfo.relatedResults.length > 0)
|
||||
)
|
||||
);
|
||||
// console.log("rich content " + allow)
|
||||
|
@ -754,4 +764,9 @@ export class ResultLandingComponent {
|
|||
public enrichContexts(contextsWithLink: any) {
|
||||
this.contextsWithLink = contextsWithLink;
|
||||
}
|
||||
|
||||
public relatedClassChanged() {
|
||||
this.relatedPage = 1;
|
||||
this.filteredRelatedResults = this.resultLandingInfo.relatedResults.filter(result => !this.relatedClassSelected || result.relationName.toLowerCase() == this.relatedClassSelected.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ import {FeedbackModule} from "../feedback/feedback.module";
|
|||
import {TabsModule} from "../../utils/tabs/tabs.module";
|
||||
import {LoadingModule} from "../../utils/loading/loading.module";
|
||||
import {OrcidModule} from "../../orcid/orcid.module";
|
||||
import {MatFormFieldModule} from "@angular/material/form-field";
|
||||
import {MatSelectModule} from "@angular/material/select";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -37,7 +39,7 @@ import {OrcidModule} from "../../orcid/orcid.module";
|
|||
MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
|
||||
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule,
|
||||
AnnotationModule, LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule, TabsModule, LoadingModule,
|
||||
OrcidModule
|
||||
OrcidModule, MatFormFieldModule, MatSelectModule
|
||||
],
|
||||
declarations: [
|
||||
ResultLandingComponent
|
||||
|
|
|
@ -187,21 +187,19 @@ export class ResultLandingService {
|
|||
if(relation.hasOwnProperty("to")) {
|
||||
if(relation['to'].class && relation['to'].class.toLowerCase() == "isproducedby") {
|
||||
this.resultLandingInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.resultLandingInfo.fundedByProjects, relation, provenanceActionVocabulary);
|
||||
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "isrelatedto") {
|
||||
}
|
||||
if(relation['to'].scheme && relation['to'].scheme == "dnet:result_result_relations") {
|
||||
let relationName = relation.to.class;
|
||||
if(!this.resultLandingInfo.relatedClassFilters.has(relationName)) {
|
||||
this.resultLandingInfo.relatedClassFilters.add(relationName);
|
||||
}
|
||||
|
||||
let provenanceAction: string = "";
|
||||
if(provenanceActionVocabulary != null && relation.provenanceaction in provenanceActionVocabulary) {
|
||||
provenanceAction = provenanceActionVocabulary[relation.provenanceaction];
|
||||
}
|
||||
|
||||
this.resultLandingInfo.relatedResearchResults = this.parsingFunctions.parseRelatedResearchResults(this.resultLandingInfo.relatedResearchResults, relation, provenanceAction);
|
||||
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "hasamongtopnsimilardocuments") {
|
||||
this.resultLandingInfo.similarResearchResults = this.parsingFunctions.parseSimilarResearchResults(this.resultLandingInfo.similarResearchResults, relation);
|
||||
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") {
|
||||
this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation);
|
||||
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "issupplementedby") {
|
||||
this.resultLandingInfo.supplementaryResearchResults = this.parsingFunctions.parseSupplementaryResearchResults(this.resultLandingInfo.supplementaryResearchResults, relation);
|
||||
} else if(relation['to'].class && relation['to'].class.toLowerCase() == "issupplementto") {
|
||||
this.resultLandingInfo.supplementedByResearchResults = this.parsingFunctions.parseSupplementedByResearchResults(this.resultLandingInfo.supplementedByResearchResults, relation);
|
||||
this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -395,10 +393,8 @@ export class ResultLandingService {
|
|||
return (item != undefined && item.fullName != undefined);
|
||||
});
|
||||
}
|
||||
this.resultLandingInfo.relatedResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.relatedResearchResults);
|
||||
this.resultLandingInfo.similarResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.similarResearchResults);
|
||||
this.resultLandingInfo.supplementaryResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.supplementaryResearchResults);
|
||||
this.resultLandingInfo.supplementedByResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.supplementedByResearchResults);
|
||||
|
||||
this.resultLandingInfo.relatedResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.relatedResults);
|
||||
|
||||
return this.resultLandingInfo;
|
||||
}
|
||||
|
|
|
@ -51,14 +51,64 @@ export class ResultLandingInfo {
|
|||
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
|
||||
showEgiNotebookButton: boolean = false;
|
||||
|
||||
// percentage is for trust
|
||||
relatedResearchResults: RelationResult[];
|
||||
// percentage is for similarity
|
||||
similarResearchResults: RelationResult[];
|
||||
//isSupplementedBy
|
||||
supplementaryResearchResults: RelationResult[];
|
||||
//isSupplementTo
|
||||
supplementedByResearchResults: RelationResult[];
|
||||
// // percentage is for trust
|
||||
// relatedResearchResults: RelationResult[];
|
||||
// // percentage is for similarity
|
||||
// similarResearchResults: RelationResult[];
|
||||
// //isSupplementedBy
|
||||
// supplementaryResearchResults: RelationResult[];
|
||||
// //isSupplementTo
|
||||
// supplementedByResearchResults: RelationResult[];
|
||||
//
|
||||
// // IsPartOf
|
||||
// parentResearchResults: RelationResult[];
|
||||
// // HasPart
|
||||
// childrenResearchResults: RelationResult[];
|
||||
// // Reviews
|
||||
// reviewedByResearchResults: RelationResult[];
|
||||
// // IsReviewedBy
|
||||
// reviewerResearchResults: RelationResult[];
|
||||
// // References
|
||||
// referencedByResearchResults: RelationResult[];
|
||||
// // IsReferencedBy
|
||||
// refererResearchResults: RelationResult[];
|
||||
// // IsIdenticalTo
|
||||
// identicalResearchResults: RelationResult[];
|
||||
// // IsContinuedBy
|
||||
// continuatorResearchResults: RelationResult[];
|
||||
// // Continues
|
||||
// continuedByResearchResults: RelationResult[];
|
||||
// // IsDocumentedBy
|
||||
// documentaryResearchResults: RelationResult[];
|
||||
// // Documents
|
||||
// documentedByResearchResults: RelationResult[];
|
||||
// // IsCompiledBy
|
||||
// compilerResearchResults: RelationResult[];
|
||||
// // Compiles
|
||||
// compiledByResearchResults: RelationResult[];
|
||||
// // IsPreviousVersionOf
|
||||
// newerResearchResults: RelationResult[];
|
||||
// // IsNewVersionOf
|
||||
// previousResearchResults: RelationResult[];
|
||||
// // IsVersionOf
|
||||
// versionedByResearchResults: RelationResult[];
|
||||
// // HasVersion
|
||||
// isVersionResearchResults: RelationResult[];
|
||||
// // IsSourceOf
|
||||
// derivedResearchResults: RelationResult[];
|
||||
// // IsDerivedFrom
|
||||
// sourceResearchResults: RelationResult[];
|
||||
// // IsVariantFormOf
|
||||
// originalResearchResults: RelationResult[];
|
||||
// // IsOriginalFormOf
|
||||
// variantResearchResults: RelationResult[];
|
||||
// // IsObsoletedBy
|
||||
// obsoleteResearchResults: RelationResult[];
|
||||
// // Obsolete
|
||||
// obsoletedByResearchResults: RelationResult[];
|
||||
|
||||
relatedResults: RelationResult[];
|
||||
relatedClassFilters: Set<string> = new Set();
|
||||
|
||||
contexts: { "labelContext": string, "idContext": string,
|
||||
"labelCategory": string, "idCategory": string,
|
||||
|
|
|
@ -112,6 +112,12 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
|
|||
if(this.result.provenanceAction) {
|
||||
this.beforeTitle.push(this.result.provenanceAction);
|
||||
}
|
||||
if(this.result.relationName) {
|
||||
this.beforeTitle.push(this.result.relationName);
|
||||
}
|
||||
// if(this.result.percentage) {
|
||||
// this.beforeTitle.push((this.result.relation ? this.result.relation+": " : "") + this.result.percentage.toString() + "%");
|
||||
// }
|
||||
}
|
||||
|
||||
public getTypeName(type: string): string {
|
||||
|
|
|
@ -28,8 +28,10 @@ export interface RelationResult {
|
|||
id: string;
|
||||
date: string;
|
||||
percentage: number;
|
||||
percentageName?: string;
|
||||
class: string
|
||||
provenanceAction?: string;
|
||||
relationName?: string;
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
|
@ -131,6 +133,7 @@ export class ResultPreview {
|
|||
types: string[];
|
||||
|
||||
// Relation result
|
||||
relationName: string;
|
||||
relation: string;
|
||||
percentage: number;
|
||||
provenanceAction: string;
|
||||
|
@ -217,7 +220,7 @@ export class ResultPreview {
|
|||
return resultPreview;
|
||||
}
|
||||
|
||||
public static relationResultConvert(result: RelationResult, relation: string = 'trust'): ResultPreview {
|
||||
public static relationResultConvert(result: RelationResult): ResultPreview {
|
||||
let resultPreview: ResultPreview = new ResultPreview();
|
||||
resultPreview.id = result.id;
|
||||
resultPreview.title = result.name;
|
||||
|
@ -225,7 +228,8 @@ export class ResultPreview {
|
|||
if(result.date) {
|
||||
resultPreview.year = result.date.toString();
|
||||
}
|
||||
resultPreview.relation = relation;
|
||||
resultPreview.relationName = result.relationName;
|
||||
resultPreview.relation = result.percentageName;
|
||||
resultPreview.percentage = result.percentage;
|
||||
resultPreview.provenanceAction = result.provenanceAction;
|
||||
return resultPreview;
|
||||
|
|
Loading…
Reference in New Issue