[Library | Trunk]: Add view more related organizations

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58792 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-05-27 14:32:25 +00:00
parent a0abd21625
commit cb31df5c26
3 changed files with 13 additions and 152 deletions

View File

@ -297,11 +297,6 @@ export class OrganizationComponent {
);
}
/*public searchDataproviders(page: number = 1) {
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, page, 1, this.properties);
}*/
public downloadFile(url: string, filename: string) {
this.openLoading();
this.setMessageLoading("Downloading CSV file");

View File

@ -163,20 +163,22 @@
class="uk-margin-medium-bottom uk-width-2-3@m">
<div class="uk-text-muted">Related Organizations</div>
<ul class="uk-list organizations uk-margin-remove-top">
<li *ngFor="let organization of resultLandingInfo.organizations">
<div class="title" *ngIf="!organization.websiteUrl">
<li *ngFor="let organization of (showAll?resultLandingInfo.organizations:resultLandingInfo.organizations.slice(0,3))">
<a [routerLink]="'/search/organization'" [queryParams]="{organizationId: organization.id}">
{{(organization.name ? organization.name : organization.shortname)}}
<span *ngIf="organization.shortname">({{organization.shortname}})</span>
</div>
<a class="title" *ngIf="organization.websiteUrl" [href]="organization.websiteUrl"
target="_blank">
{{(organization.name ? organization.name : organization.shortname)}}
<span *ngIf="organization.shortname">({{organization.shortname}})</span>
<span class="custom-external custom-icon space"></span>
</a>
<div *ngIf="organization.country">{{organization.country}}</div>
</li>
</ul>
<div *ngIf="!showAll && resultLandingInfo.organizations.length > 3" class="uk-text-center">
<a (click)="showAll = !showAll;">
View more
</a>
</div>
<div *ngIf="showAll && resultLandingInfo.organizations.length > 3" class="uk-text-center">
<a (click)="showAll = !showAll;">View less</a>
</div>
</div>
</div>
<div *ngIf="hasSecondaryInfo"
@ -295,37 +297,6 @@
[totalResults]="resultLandingInfo.supplementedByResearchResults.length">
</no-load-paging>
</div>
<!--<div *ngIf="supplementaryResults">
<div *ngIf="supplementaryFilter" class="uk-margin-bottom" [formGroup]="supplementaryFilter">
<span>
<input formControlName="supplementary" type="checkbox"/>
<span class="space uk-text-bold">Ingoing</span>
</span>
<span class="uk-margin-small-left">
<input formControlName="supplementedBy" type="checkbox"/>
<span class="space uk-text-bold">Outgoing</span>
</span>
</div>
<no-load-paging *ngIf="supplementaryResults.length > pageSize" [type]="'research results'"
(pageChange)="updateSupplementaryPage($event)"
[page]="supplementaryPage" [pageSize]="pageSize"
[totalResults]="supplementaryResults.length">
</no-load-paging>
<ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let item of supplementaryResults.slice((supplementaryPage-1)*pageSize, supplementaryPage*pageSize)">
<result-preview [modal]="relationModal" [properties]="properties"
[result]="getResultPreview(item)"></result-preview>
</li>
</ul>
<no-load-paging *ngIf="supplementaryResults.length > pageSize" [type]="'research results'"
(pageChange)="updateSupplementaryPage($event)"
[page]="supplementaryPage" [pageSize]="pageSize"
[totalResults]="supplementaryResults.length">
</no-load-paging>
<div *ngIf="supplementaryResults.length === 0">
No results has been found
</div>
</div>-->
</div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div>
@ -378,37 +349,6 @@
[totalResults]="resultLandingInfo.similarResearchResults.length">
</no-load-paging>
</div>
<!--<div *ngIf="relatedResults">
<div *ngIf="relatedFilter" class="uk-margin-bottom" [formGroup]="relatedFilter">
<span>
<input formControlName="related" type="checkbox"/>
<span class="space uk-text-bold">Related</span>
</span>
<span class="uk-margin-small-left">
<input formControlName="similar" type="checkbox"/>
<span class="space uk-text-bold">Similar</span>
</span>
</div>
<no-load-paging *ngIf="relatedResults.length > pageSize" [type]="'research results'"
(pageChange)="updateRelatedPage($event)"
[page]="relatedPage" [pageSize]="pageSize"
[totalResults]="relatedResults.length">
</no-load-paging>
<ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let item of relatedResults.slice((relatedPage-1)*pageSize, relatedPage*pageSize)">
<result-preview [modal]="relationModal" [properties]="properties"
[result]="getResultPreview(item)"></result-preview>
</li>
</ul>
<no-load-paging *ngIf="relatedResults.length > pageSize" [type]="'research results'"
(pageChange)="updateRelatedPage($event)"
[page]="relatedPage" [pageSize]="pageSize"
[totalResults]="relatedResults.length">
</no-load-paging>
<div *ngIf="relatedResults.length === 0">
No results has been found
</div>
</div>-->
</div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div>

View File

@ -40,6 +40,9 @@ export class ResultLandingComponent {
public id: string;
public title: string;
/*Show all organizations*/
public showAll: boolean = false;
// Links for SEO
public linkToLandingPage: string = null;
public linkToSearchPage: string = null;
@ -67,10 +70,6 @@ export class ResultLandingComponent {
public openCitationsPage: number = 1;
public pageSize: number = 10;
// relation filters
public relatedFilter: FormGroup;
public supplementaryFilter: FormGroup;
// Map counting variables
public bioentitiesNum: number = 0;
public relatedResultsNum: number = 0;
@ -175,17 +174,6 @@ export class ResultLandingComponent {
"page_type": this.type
}
});
/*
this.warningMessage = "No valid ";
if(this.type == "publication" || this.type == "software") {
this.warningMessage += this.type + " ";
} else if(this.type == "dataset") {
this.warningMessage += "research data ";
} else if(this.type == "orp") {
this.warningMessage += "other research product ";
}
this.warningMessage += "id";
*/
}
this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":80,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
@ -346,7 +334,6 @@ export class ResultLandingComponent {
});
}
this.showLoading = false;
this.initFilters();
this.setActiveTab();
},
err => {
@ -369,67 +356,6 @@ export class ResultLandingComponent {
);
}
public initFilters() {
/*this.relatedFilter = this.fb.group({
related: this.fb.control(true),
similar: this.fb.control(true),
});
this.supplementaryFilter = this.fb.group({
supplementary: this.fb.control(true),
supplementedBy: this.fb.control(true),
});*/
this.filterRelatedResults();
this.filterSupplementaryResults();
/*this.relatedFilter.valueChanges.subscribe(value => {
this.filterRelatedResults(value.related, value.similar);
});
this.supplementaryFilter.valueChanges.subscribe(value => {
this.filterSupplementaryResults(value.supplementary, value.supplementedBy);
});*/
}
public filterRelatedResults(related: boolean = true, similar: boolean = true) {
this.relatedResults = [];
this.relatedResultsNum = 0;
if (this.resultLandingInfo.relatedResearchResults) {
this.relatedResultsNum += this.resultLandingInfo.relatedResearchResults.length;
/*if(related) {
this.resultLandingInfo.relatedResearchResults.forEach(result => {
this.relatedResults.push(result);
});
}*/
}
if (this.resultLandingInfo.similarResearchResults) {
this.relatedResultsNum += this.resultLandingInfo.similarResearchResults.length;
/*if(similar) {
this.resultLandingInfo.similarResearchResults.forEach(result => {
this.relatedResults.push(result);
});
}*/
}
}
public filterSupplementaryResults(supplementary: boolean = true, supplementedBy: boolean = true) {
this.supplementaryResults = [];
this.supplementaryResultsNum = 0;
if (this.resultLandingInfo.supplementaryResearchResults) {
this.supplementaryResultsNum += this.resultLandingInfo.supplementaryResearchResults.length;
/*if(supplementary) {
this.resultLandingInfo.supplementaryResearchResults.forEach(result => {
this.supplementaryResults.push(result);
});
}*/
}
if (this.resultLandingInfo.supplementedByResearchResults) {
this.supplementaryResultsNum += this.resultLandingInfo.supplementedByResearchResults.length;
/*if(supplementedBy) {
this.resultLandingInfo.supplementedByResearchResults.forEach(result => {
this.supplementaryResults.push(result);
});
}*/
}
}
public metricsResults($event) {
this.totalViews = $event.totalViews;
this.totalDownloads = $event.totalDownloads;