[Library | Trunk]: Remove active from tabs. Change tabs, authos and funded by to work on js disable.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58778 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-05-25 18:58:13 +00:00
parent 895a28162d
commit 1fe05f52d6
11 changed files with 492 additions and 420 deletions

View File

@ -24,7 +24,7 @@ import {Project} from "../../utils/result-preview/result-preview";
*ngIf="item['acronym'] || item['title']">| {{ item['acronym'] ? item['acronym'] : item['title']}}</span> *ngIf="item['acronym'] || item['title']">| {{ item['acronym'] ? item['acronym'] : item['title']}}</span>
</span> </span>
</a> </a>
<div class="default-dropdown uk-margin-remove-top uk-padding-small" <div class="default-dropdown uk-margin-remove-top uk-padding-small uk-dropdown"
uk-dropdown="pos: bottom-left; mode:click"> uk-dropdown="pos: bottom-left; mode:click">
<span class="uk-text-small">Project</span> <span class="uk-text-small">Project</span>
<div class="uk-margin-bottom"> <div class="uk-margin-bottom">

View File

@ -1,5 +1,5 @@
<div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle"> <div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle">
<div *ngIf="!showFeedback" uk-grid> <div *ngIf="!showFeedback" class="uk-grid">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-container-large uk-margin-medium-top organization"> <div class="uk-container uk-container-large uk-margin-medium-top organization">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
@ -12,20 +12,22 @@
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper> [texts]="pageContents['top']"></helper>
<div *ngIf="organizationInfo != null" class="uk-grid"> <div *ngIf="organizationInfo != null" class="uk-grid">
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom"> <div
class="uk-width-2-3@m uk-width-1-1@s uk-padding uk-padding-remove-left uk-padding-remove-vertical uk-margin-bottom">
<schema2jsonld *ngIf="organizationInfo" [data]=organizationInfo <schema2jsonld *ngIf="organizationInfo" [data]=organizationInfo
[URL]="properties.baseLink+'/search/organization?organizationId='+organizationId" [URL]="properties.baseLink+'/search/organization?organizationId='+organizationId"
type="organization"></schema2jsonld> type="organization"></schema2jsonld>
<landing-header [properties]="properties" [title]="organizationInfo.title.name" <landing-header [properties]="properties" [title]="organizationInfo.title.name"
titleClass="uk-margin-remove-bottom"
[subTitle]="(organizationInfo.name [subTitle]="(organizationInfo.name
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null" && organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[entityType]="'organization'"></landing-header> [entityType]="'organization'"></landing-header>
<div *ngIf="organizationInfo.deletedByInferenceIds" <div *ngIf="organizationInfo.deletedByInferenceIds"
class="uk-text-muted uk-text-small uk-text-right"> class="uk-text-small">
<a (click)="openDeletedByInference()">View all {{organizationInfo.deletedByInferenceIds.length}} <a (click)="openDeletedByInference()">View all {{organizationInfo.deletedByInferenceIds.length}}
versions</a> versions</a>
</div> </div>
<ul class="uk-list"> <ul class="uk-list basic-info">
<!-- Web Page --> <!-- Web Page -->
<li *ngIf="organizationInfo.title && organizationInfo.title.url"> <li *ngIf="organizationInfo.title && organizationInfo.title.url">
<span class="uk-text-muted">Web page: </span> <span class="uk-text-muted">Web page: </span>
@ -39,7 +41,7 @@
<span class="uk-text-muted">Country: </span>{{organizationInfo.country}} <span class="uk-text-muted">Country: </span>{{organizationInfo.country}}
</li> </li>
</ul> </ul>
<div class="uk-margin-medium-top"> <!-- <div class="uk-margin-medium-top">
<div *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0" <div *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0"
class="uk-margin-top simple-buttons uk-flex uk-flex-middle"> class="uk-margin-top simple-buttons uk-flex uk-flex-middle">
<div *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0" (click)="openProjectsModal()" <div *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0" (click)="openProjectsModal()"
@ -54,10 +56,11 @@
uk-grid> uk-grid>
<div *ngIf="total.publications > 0"> <div *ngIf="total.publications > 0">
<div class="uk-position-relative"> <div class="uk-position-relative">
<!-- <a [queryParams]="routerHelper.createQueryParams(['organization', 'og', 'type'], [organizationId, 'and', 'publications'])"--> &lt;!&ndash; <a [queryParams]="routerHelper.createQueryParams(['organization', 'og', 'type'], [organizationId, 'and', 'publications'])"&ndash;&gt;
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'publications', 'false'])" <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'publications', 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank"> [routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span> <span
class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span>
<div class="header target uk-text-bold">Publications</div> <div class="header target uk-text-bold">Publications</div>
<div class="icon uk-position-center" uk-icon="icon: search;"></div> <div class="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative"> <div class="footer target uk-position-relative">
@ -70,7 +73,8 @@
<div class="uk-position-relative"> <div class="uk-position-relative">
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'datasets', 'false'])" <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'datasets', 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank"> [routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span> <span
class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span>
<div class="header target uk-text-bold">Research Data</div> <div class="header target uk-text-bold">Research Data</div>
<div class="icon uk-position-center" uk-icon="icon: search;"></div> <div class="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative"> <div class="footer target uk-position-relative">
@ -83,7 +87,8 @@
<div class="uk-position-relative"> <div class="uk-position-relative">
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'software', 'false'])" <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'software', 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank"> [routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span> <span
class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span>
<div class="header target uk-text-bold">Software</div> <div class="header target uk-text-bold">Software</div>
<div class="icon uk-position-center" uk-icon="icon: search;"></div> <div class="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative"> <div class="footer target uk-position-relative">
@ -96,7 +101,8 @@
<div class="uk-position-relative"> <div class="uk-position-relative">
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'other', 'false'])" <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'other', 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank"> [routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span> <span
class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span>
<div class="header target uk-text-bold">Other Research Products</div> <div class="header target uk-text-bold">Other Research Products</div>
<div class="icon uk-position-center" uk-icon="icon: search;"></div> <div class="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative"> <div class="footer target uk-position-relative">
@ -109,7 +115,8 @@
<div class="uk-position-relative"> <div class="uk-position-relative">
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0'], ['relorganizationid', organizationId])" <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0'], ['relorganizationid', organizationId])"
[routerLink]="properties.searchLinkToAdvancedDataProviders" target="_blank"> [routerLink]="properties.searchLinkToAdvancedDataProviders" target="_blank">
<span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span> <span
class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span>
<div class="header target uk-text-bold">Content Providers</div> <div class="header target uk-text-bold">Content Providers</div>
<div class="icon uk-position-center" uk-icon="icon: search;"></div> <div class="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative"> <div class="footer target uk-position-relative">
@ -119,86 +126,77 @@
</div> </div>
</div> </div>
</div> </div>
</div>-->
</div> </div>
<div class="uk-margin-small-top uk-flex uk-flex-bottom"> <div class="uk-width-1-3@m uk-width-1-1@s uk-padding-remove">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4"> <ul class="user-actions uk-list uk-card uk-card-default uk-padding">
<span <!-- Share -->
class="uk-margin-small-left uk-text-small uk-text-baseline uk-text-muted">Powered by OpenAIRE Open Research Graph</span>
</div>
</div>
<div class="uk-width-1-3@m uk-width-1-1@s">
<div class="uk-card uk-card-default uk-padding-small">
<div>
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
<addThis></addThis>
</div>
<div class="uk-margin-top">
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">
Download report - based on the affiliation information
</div>
<div class="app-box uk-padding-small uk-margin-small-left uk-margin-small-right">
<div class="uk-animation-slide-top-small uk-padding-small uk-padding-remove-vertical">
<ul *ngIf="total.results > 0" class="uk-margin-remove-bottom uk-list">
<ng-container *ngFor="let contentType of contentTypes">
<li [attr.uk-tooltip]="total[contentType[0]] > 0 ? 'cls: uk-invisible' : 'cls: uk-active'"
title="No report available">
<a [class]="total[contentType[0]] > 0 ? 'clickable' : 'uk-disabled uk-link-muted'"
(click)="downloadFile(getCSVAffiliated(contentType[0]), contentType[0] + '-report')">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">{{contentType[1]}} (CSV)</span>
</a>
</li>
</ng-container>
</ul>
<div *ngIf="total.results == 0"
class="uk-text-muted">
No reports available
</div>
</div>
</div>
</div>
<div *ngIf="fetchProjects && fetchProjects.funders && fetchProjects.funders.length > 0"
class="uk-margin-top">
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">
Funder report
</div>
<div class="app-box uk-padding-small uk-margin-small-left uk-margin-small-right">
<div class="uk-padding-small uk-padding-remove-vertical">
<div>
<mat-select [(value)]="funder"
[disableOptionCentering]="true"
class="matSelection" panelClass="matSelectionPanel">
<mat-option value="">Specify by Funder</mat-option>
<mat-option *ngFor="let element of fetchProjects.funders"
[value]="element">{{element.name}}
</mat-option>
</mat-select>
</div>
<div *ngIf="funder && funder != ''"
class="uk-animation-slide-top-small uk-margin-top">
<ul class="uk-margin-remove-bottom uk-list">
<li> <li>
<a class="clickable" <addThis></addThis>
(click)="downloadFile(getFunderProjects(), funder.name + '-projects-report')"> </li>
<span uk-icon="download"></span> <li>
<span class="uk-text-capitalize uk-margin-small-left">projects (CSV)</span> <a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openDownloadReportModal()">
<span class="uk-icon-button uk-button-primary uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
data-svg="download"><polyline fill="none" stroke="#000"
points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
width="13"
height="1"></rect><line
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line>
</svg>
</span>
<span class="uk-margin-small-left">Download content lists</span>
</a> </a>
</li> </li>
<li *ngFor="let contentType of contentTypes"> <li *ngIf="fetchProjects && fetchProjects.funders && fetchProjects.funders.length > 0">
<a class="clickable" <a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openDownloadFunderReportModal()">
(click)="confirmOpenApplyAll(contentType[0])"> <span class="uk-icon-button uk-button-primary uk-icon">
<span uk-icon="download"></span> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
<span class="uk-text-capitalize uk-margin-small-left">{{contentType[1]}} (CSV)</span> data-svg="download"><polyline fill="none" stroke="#000"
points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
width="13"
height="1"></rect><line
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line>
</svg>
</span>
<span class="uk-margin-small-left">Download project lists</span>
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
<div class="uk-padding-remove-left uk-width-1-1 uk-margin-large-top">
<div class="main-tabs-div">
<my-tabs *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0">
<my-tab *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0"
[tabTitle]="'Funding / Projects'"
[tabId]="'projects'">
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<projectsInModal [fetchProjects]="fetchProjects"
[organizationId]="organizationId"
[properties]=properties>
</projectsInModal>
</div> </div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
</my-tab>
</my-tabs>
</div> </div>
</div> <div class="uk-margin-small-top uk-flex">
<div class="uk-margin-small-top uk-text-muted uk-text-small uk-text-right"> <!-- Last Index Info-->
<div class="uk-flex uk-flex-bottom uk-width-2-3">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4">
<span class="uk-margin-small-left uk-text-small uk-text-baseline uk-text-muted">Powered by OpenAIRE Open Research Graph</span>
<span class="uk-margin-small-left uk-text-small uk-text-baseline uk-text-muted">
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
</span>
</div>
<!--Feedback-->
<div class="uk-width-1-3 uk-text-right uk-text-small">
<span class="uk-text-muted">Any information missing or wrong?</span>
<a (click)="showFeedback = true; scroll()" class="portal-link space">Report an Issue</a>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -206,7 +204,6 @@
[texts]="pageContents['bottom']"></helper> [texts]="pageContents['bottom']"></helper>
</div> </div>
</div> </div>
</div>
<feedback *ngIf="organizationInfo" [organizationInfo]="organizationInfo" <feedback *ngIf="organizationInfo" [organizationInfo]="organizationInfo"
[properties]="properties" [entityType]="'organization'" [fields]="feedbackFields" [properties]="properties" [entityType]="'organization'" [fields]="feedbackFields"
[showForm]="showFeedback" (show)="showFeedback = $event"></feedback> [showForm]="showFeedback" (show)="showFeedback = $event"></feedback>
@ -227,6 +224,69 @@
</organizationsDeletedByInference> </organizationsDeletedByInference>
</div> </div>
</modal-alert> </modal-alert>
<!-- Download report -->
<modal-alert #downloadReportModal [classTitle]="'landing-modal-header uk-padding-small'"
[classBody]="'uk-padding-remove landing-modal'">
<div class="uk-padding">
<div class="uk-animation-slide-top-small">
<ul *ngIf="total.results > 0" class="uk-margin-remove-bottom uk-list">
<ng-container *ngFor="let contentType of contentTypes">
<li [attr.uk-tooltip]="total[contentType[0]] > 0 ? 'cls: uk-invisible' : 'cls: uk-active'"
title="No report available">
<a [class]="total[contentType[0]] > 0 ? 'clickable' : 'uk-disabled uk-link-muted'"
(click)="downloadFile(getCSVAffiliated(contentType[0]), contentType[0] + '-report')">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">{{contentType[1]}} (CSV)</span>
</a>
</li>
</ng-container>
</ul>
<div *ngIf="total.results == 0"
class="uk-text-muted">
No reports available
</div>
</div>
</div>
</modal-alert>
<!-- Download Funder report -->
<modal-alert #downloadFunderReportModal [classTitle]="'landing-modal-header uk-padding-small'"
[classBody]="'uk-padding-remove landing-modal'">
<div *ngIf="fetchProjects.funders && fetchProjects.funders.length > 0" class="uk-padding">
<div class="uk-animation-slide-top-small">
<div>
<mat-form-field class="matSelectionFormField uk-width-1-1">
<mat-label>Select a funder to download report</mat-label>
<mat-select [(value)]="funder" #matSelect modal-select [matSelect]="matSelect"
[disableOptionCentering]="true"
class="matSelection" panelClass="matSelectionPanel">
<mat-option *ngFor="let element of fetchProjects.funders"
[value]="element">{{element.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div *ngIf="funder && funder != ''"
class="uk-animation-slide-top-small uk-margin-top">
<ul class="uk-margin-remove-bottom uk-list">
<li>
<a class="clickable"
(click)="downloadFile(getFunderProjects(), funder.name + '-projects-report')">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">projects (CSV)</span>
</a>
</li>
<li *ngFor="let contentType of contentTypes">
<a class="clickable"
(click)="confirmOpenApplyAll(contentType[0])">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">{{contentType[1]}} (CSV)</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</modal-alert>
<!-- Projects --> <!-- Projects -->
<modal-alert *ngIf="organizationInfo && fetchProjects && fetchProjects.results" <modal-alert *ngIf="organizationInfo && fetchProjects && fetchProjects.results"
#projectsModal classBody="uk-width-xxlarge uk-padding-remove-right"> #projectsModal classBody="uk-width-xxlarge uk-padding-remove-right">

View File

@ -65,6 +65,8 @@ export class OrganizationComponent {
dataproviders: 0 dataproviders: 0
}; };
public fetchProjects: FetchProjects; public fetchProjects: FetchProjects;
@ViewChild('downloadReportModal') downloadReportModal;
@ViewChild('downloadFunderReportModal') downloadFunderReportModal;
// Variables for projects query (query results only if projects tab is clicked) // Variables for projects query (query results only if projects tab is clicked)
@ViewChild(ProjectsInModalComponent) projectsInModalComponent: ProjectsInModalComponent; @ViewChild(ProjectsInModalComponent) projectsInModalComponent: ProjectsInModalComponent;
@ -558,4 +560,23 @@ export class OrganizationComponent {
open(value: any) { open(value: any) {
console.log(value); console.log(value);
} }
openDownloadReportModal() {
this.downloadReportModal.cancelButton = false;
this.downloadReportModal.okButton = false;
this.downloadReportModal.alertTitle = "Download content report";
this.downloadReportModal.open();
}
openDownloadFunderReportModal() {
this.funder = this.fetchProjects.funders[0];
this.downloadFunderReportModal.cancelButton = false;
this.downloadFunderReportModal.okButton = false;
this.downloadFunderReportModal.alertTitle = "Download funder report";
this.downloadFunderReportModal.open();
}
public scroll() {
HelperFunctions.scroll();
}
} }

View File

@ -26,6 +26,8 @@ import {OrganizationsDeletedByInferenceModule} from "./deletedByInference/delete
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module"; import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
import {FeedbackModule} from "../feedback/feedback.module"; import {FeedbackModule} from "../feedback/feedback.module";
import {MatSelectModule} from "@angular/material/select"; import {MatSelectModule} from "@angular/material/select";
import {TabsModule} from "../../utils/tabs/tabs.module";
import {ModalSelectModule} from "../../utils/modal-select/modal-select.module";
@NgModule({ @NgModule({
@ -42,7 +44,7 @@ import {MatSelectModule} from "@angular/material/select";
SearchResearchResultsServiceModule, SearchResearchResultsServiceModule,
ProjectsServiceModule, ProjectsServiceModule,
Schema2jsonldModule, SEOServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, HelperModule,
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, MatSelectModule OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, MatSelectModule, TabsModule, ModalSelectModule
], ],
declarations: [ declarations: [
OrganizationComponent, OrganizationComponent,

View File

@ -1,5 +1,5 @@
<div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle"> <div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle">
<div *ngIf="!showFeedback" uk-grid> <div *ngIf="!showFeedback" class="uk-grid">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-container-large uk-margin-medium-top publication"> <div class="uk-container uk-container-large uk-margin-medium-top publication">
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top" <div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
@ -69,14 +69,32 @@
<!-- Link to --> <!-- Link to -->
<li *ngIf="isRouteAvailable('participate/direct-claim')"> <li *ngIf="isRouteAvailable('participate/direct-claim')">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openLinkModal()"> <a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openLinkModal()">
<span class="uk-icon-button portal-button" uk-icon="link"></span> <span class="uk-icon-button portal-button uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="link"><path
fill="none" stroke="#000" stroke-width="1.1"
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"></path><path
fill="none" stroke="#000" stroke-width="1.1"
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"></path><path
fill="none" stroke="#000" stroke-width="1.1"
d="M7.925,11.875 L11.925,7.975"></path>
</svg>
</span>
<span class="uk-margin-small-left">Link this {{getTypeName()}} to...</span> <span class="uk-margin-small-left">Link this {{getTypeName()}} to...</span>
</a> </a>
</li> </li>
<!-- Cite this --> <!-- Cite this -->
<li *ngIf="isRouteAvailable('participate/direct-claim')"> <li *ngIf="isRouteAvailable('participate/direct-claim')">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openCiteModal()"> <a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openCiteModal()">
<span class="uk-icon-button uk-button-primary" uk-icon="quote-right"></span> <span class="uk-icon-button uk-button-primary uk-icon">
<svg width="20"
height="20"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
data-svg="quote-right">
<path d="M17.27,7.79 C17.27,9.45 16.97,10.43 15.99,12.02 C14.98,13.64 13,15.23 11.56,15.97 L11.1,15.08 C12.34,14.2 13.14,13.51 14.02,11.82 C14.27,11.34 14.41,10.92 14.49,10.54 C14.3,10.58 14.09,10.6 13.88,10.6 C12.06,10.6 10.59,9.12 10.59,7.3 C10.59,5.48 12.06,4 13.88,4 C15.39,4 16.67,5.02 17.05,6.42 C17.19,6.82 17.27,7.27 17.27,7.79 L17.27,7.79 Z"></path>
<path d="M8.68,7.79 C8.68,9.45 8.38,10.43 7.4,12.02 C6.39,13.64 4.41,15.23 2.97,15.97 L2.51,15.08 C3.75,14.2 4.55,13.51 5.43,11.82 C5.68,11.34 5.82,10.92 5.9,10.54 C5.71,10.58 5.5,10.6 5.29,10.6 C3.47,10.6 2,9.12 2,7.3 C2,5.48 3.47,4 5.29,4 C6.8,4 8.08,5.02 8.46,6.42 C8.6,6.82 8.68,7.27 8.68,7.79 L8.68,7.79 Z"></path>
</svg>
</span>
<span class="uk-margin-small-left">Cite this {{getTypeName()}}</span> <span class="uk-margin-small-left">Cite this {{getTypeName()}}</span>
</a> </a>
</li> </li>
@ -101,9 +119,9 @@
</div> </div>
<div class="uk-padding-remove-left uk-width-1-1 uk-margin-large-top"> <div class="uk-padding-remove-left uk-width-1-1 uk-margin-large-top">
<div class="main-tabs-div"> <div class="main-tabs-div">
<my-tabs> <my-tabs *ngIf="activeTab">
<my-tab *ngIf="hasPrimaryInfo || hasSecondaryInfo" [tabTitle]="getTypeName() + ' Summary'" <my-tab *ngIf="hasPrimaryInfo || hasSecondaryInfo" [tabTitle]="getTypeName() + ' Summary'"
[tabId]="'summary'" [active]="true"> [tabId]="'summary'" [class]="(activeTab === 'summary')?'uk-active':''">
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div *ngIf="hasPrimaryInfo" class="uk-width-expand uk-padding"> <div *ngIf="hasPrimaryInfo" class="uk-width-expand uk-padding">
<!-- Description --> <!-- Description -->
@ -143,16 +161,18 @@
</showSubjects> </showSubjects>
</div> </div>
<!-- Related Organizations--> <!-- Related Organizations-->
<div *ngIf="resultLandingInfo.organizations && resultLandingInfo.organizations.length > 0" class="uk-margin-medium-bottom uk-width-2-3@m"> <div *ngIf="resultLandingInfo.organizations && resultLandingInfo.organizations.length > 0"
class="uk-margin-medium-bottom uk-width-2-3@m">
<div class="uk-text-muted uk-text-small">Related Organizations</div> <div class="uk-text-muted uk-text-small">Related Organizations</div>
<ul class="uk-list organizations uk-margin-remove-top"> <ul class="uk-list organizations uk-margin-remove-top">
<li *ngFor="let organization of resultLandingInfo.organizations"> <li *ngFor="let organization of resultLandingInfo.organizations">
<div class="title" *ngIf="!organization.websiteUrl"> <div class="title" *ngIf="!organization.websiteUrl">
{{(organization.name?organization.name:organization.shortname)}} {{(organization.name ? organization.name : organization.shortname)}}
<span *ngIf="organization.shortname">({{organization.shortname}})</span> <span *ngIf="organization.shortname">({{organization.shortname}})</span>
</div> </div>
<a class="title" *ngIf="organization.websiteUrl" [href]="organization.websiteUrl" target="_blank"> <a class="title" *ngIf="organization.websiteUrl" [href]="organization.websiteUrl"
{{(organization.name?organization.name:organization.shortname)}} target="_blank">
{{(organization.name ? organization.name : organization.shortname)}}
<span *ngIf="organization.shortname">({{organization.shortname}})</span> <span *ngIf="organization.shortname">({{organization.shortname}})</span>
<span class="custom-external custom-icon space"></span> <span class="custom-external custom-icon space"></span>
</a> </a>
@ -162,7 +182,7 @@
</div> </div>
</div> </div>
<div *ngIf="hasSecondaryInfo" <div *ngIf="hasSecondaryInfo"
[class]="hasPrimaryInfo?'uk-width-1-3 right-column uk-padding-remove':'uk-padding-remove uk-width-expand'"> [class]="hasPrimaryInfo?'uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove':'uk-padding-remove uk-width-expand'">
<div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0 || <div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0 ||
resultLandingInfo.contexts && resultLandingInfo.contexts.length >0" resultLandingInfo.contexts && resultLandingInfo.contexts.length >0"
class="uk-padding uk-padding-remove-bottom"> class="uk-padding uk-padding-remove-bottom">
@ -178,7 +198,8 @@
</div> </div>
</div> </div>
<!-- Download From --> <!-- Download From -->
<div *ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0" <div
*ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0"
class="uk-margin-medium-bottom"> class="uk-margin-medium-bottom">
<div class="sideInfoTitle uk-margin-small-bottom uk-flex"> <div class="sideInfoTitle uk-margin-small-bottom uk-flex">
<span class="uk-width-1-2">Download from</span> <span class="uk-width-1-2">Download from</span>
@ -195,7 +216,7 @@
</div> </div>
</my-tab> </my-tab>
<my-tab *ngIf="resultLandingInfo.references && resultLandingInfo.references.length > 0" <my-tab *ngIf="resultLandingInfo.references && resultLandingInfo.references.length > 0"
[tabTitle]="'references'" [tabId]="'references'" [tabTitle]="'references'" [tabId]="'references'" [class]="(activeTab === 'references')?'uk-active':''"
[tabNumber]="resultLandingInfo.references.length"> [tabNumber]="resultLandingInfo.references.length">
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
@ -227,18 +248,21 @@
</no-load-paging> </no-load-paging>
</div> </div>
</div> </div>
<!--<div class="uk-width-1-3 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
</my-tab> </my-tab>
<my-tab *ngIf="(resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0) || <my-tab *ngIf="(resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0) ||
(resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)" (resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)"
[tabTitle]="'Supplementary outcomes'" [tabId]="'supplementary'" [tabTitle]="'Supplementary outcomes'" [tabId]="'supplementary'" [class]="(activeTab === 'supplementary')?'uk-active':''"
[tabNumber]="supplementaryResults"> [tabNumber]="supplementaryResults">
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<div *ngIf="resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0" class="uk-margin-bottom"> <div
*ngIf="resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0"
class="uk-margin-bottom">
<h5>Supplementary Outcomes</h5> <h5>Supplementary Outcomes</h5>
<no-load-paging *ngIf="resultLandingInfo.supplementaryResearchResults.length > pageSize" [type]="'research outcomes'" <no-load-paging *ngIf="resultLandingInfo.supplementaryResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateSupplementaryPage($event)" (pageChange)="updateSupplementaryPage($event)"
[page]="supplementaryPage" [pageSize]="pageSize" [page]="supplementaryPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.supplementaryResearchResults.length"> [totalResults]="resultLandingInfo.supplementaryResearchResults.length">
@ -249,15 +273,18 @@
[result]="getResultPreview(item)"></result-preview> [result]="getResultPreview(item)"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="resultLandingInfo.supplementaryResearchResults.length > pageSize" [type]="'research outcomes'" <no-load-paging *ngIf="resultLandingInfo.supplementaryResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateSupplementaryPage($event)" (pageChange)="updateSupplementaryPage($event)"
[page]="supplementaryPage" [pageSize]="pageSize" [page]="supplementaryPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.supplementaryResearchResults.length"> [totalResults]="resultLandingInfo.supplementaryResearchResults.length">
</no-load-paging> </no-load-paging>
</div> </div>
<div *ngIf="resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0"> <div
*ngIf="resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0">
<h5>Outcomes Supplemented by this {{getTypeName()}}</h5> <h5>Outcomes Supplemented by this {{getTypeName()}}</h5>
<no-load-paging *ngIf="resultLandingInfo.supplementedByResearchResults.length > pageSize" [type]="'research outcomes'" <no-load-paging *ngIf="resultLandingInfo.supplementedByResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateSupplementedByPage($event)" (pageChange)="updateSupplementedByPage($event)"
[page]="supplementedByPage" [pageSize]="pageSize" [page]="supplementedByPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.supplementedByResearchResults.length"> [totalResults]="resultLandingInfo.supplementedByResearchResults.length">
@ -268,7 +295,8 @@
[result]="getResultPreview(item)"></result-preview> [result]="getResultPreview(item)"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="resultLandingInfo.supplementedByResearchResults.length > pageSize" [type]="'research outcomes'" <no-load-paging *ngIf="resultLandingInfo.supplementedByResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateSupplementedByPage($event)" (pageChange)="updateSupplementedByPage($event)"
[page]="supplementedByPage" [pageSize]="pageSize" [page]="supplementedByPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.supplementedByResearchResults.length"> [totalResults]="resultLandingInfo.supplementedByResearchResults.length">
@ -306,18 +334,21 @@
</div> </div>
</div>--> </div>-->
</div> </div>
<!--<div class="uk-width-1-3 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
</my-tab> </my-tab>
<my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) || <my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||
(resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)" (resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)"
[tabTitle]="'Related outcomes'" [tabId]="'related'" [tabTitle]="'Related outcomes'" [tabId]="'related'" [class]="(activeTab === 'related')?'uk-active':''"
[tabNumber]="relatedResultsNum"> [tabNumber]="relatedResultsNum">
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<div *ngIf="resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0" class="uk-margin-bottom"> <div
*ngIf="resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0"
class="uk-margin-bottom">
<h5>Related Outcomes</h5> <h5>Related Outcomes</h5>
<no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize" [type]="'research outcomes'" <no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateRelatedPage($event)" (pageChange)="updateRelatedPage($event)"
[page]="relatedPage" [pageSize]="pageSize" [page]="relatedPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.relatedResearchResults.length"> [totalResults]="resultLandingInfo.relatedResearchResults.length">
@ -328,15 +359,18 @@
[result]="getResultPreview(item)"></result-preview> [result]="getResultPreview(item)"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize" [type]="'research outcomes'" <no-load-paging *ngIf="resultLandingInfo.relatedResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateRelatedPage($event)" (pageChange)="updateRelatedPage($event)"
[page]="relatedPage" [pageSize]="pageSize" [page]="relatedPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.relatedResearchResults.length"> [totalResults]="resultLandingInfo.relatedResearchResults.length">
</no-load-paging> </no-load-paging>
</div> </div>
<div *ngIf="resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0"> <div
*ngIf="resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0">
<h5>Similar Outcomes</h5> <h5>Similar Outcomes</h5>
<no-load-paging *ngIf="resultLandingInfo.similarResearchResults.length > pageSize" [type]="'research outcomes'" <no-load-paging *ngIf="resultLandingInfo.similarResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateSimilarPage($event)" (pageChange)="updateSimilarPage($event)"
[page]="similarPage" [pageSize]="pageSize" [page]="similarPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.similarResearchResults.length"> [totalResults]="resultLandingInfo.similarResearchResults.length">
@ -347,7 +381,8 @@
[result]="getResultPreview(item)"></result-preview> [result]="getResultPreview(item)"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="resultLandingInfo.similarResearchResults.length > pageSize" [type]="'research outcomes'" <no-load-paging *ngIf="resultLandingInfo.similarResearchResults.length > pageSize"
[type]="'research outcomes'"
(pageChange)="updateSimilarPage($event)" (pageChange)="updateSimilarPage($event)"
[page]="similarPage" [pageSize]="pageSize" [page]="similarPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.similarResearchResults.length"> [totalResults]="resultLandingInfo.similarResearchResults.length">
@ -385,10 +420,10 @@
</div> </div>
</div>--> </div>-->
</div> </div>
<!--<div class="uk-width-1-3 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
</my-tab> </my-tab>
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0" <my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0" [class]="(activeTab === 'bioentities')?'uk-active':''"
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum"> [tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
@ -422,7 +457,7 @@
</no-load-paging> </no-load-paging>
</div> </div>
</div> </div>
<!--<div class="uk-width-1-3 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
</my-tab> </my-tab>
</my-tabs> </my-tabs>
@ -458,8 +493,9 @@
<feedback *ngIf="resultLandingInfo" [resultLandingInfo]="resultLandingInfo" <feedback *ngIf="resultLandingInfo" [resultLandingInfo]="resultLandingInfo"
[properties]="properties" [entityType]="getTypeName()" [fields]="feedbackFields" [properties]="properties" [entityType]="getTypeName()" [fields]="feedbackFields"
[showForm]="showFeedback" (show)="showFeedback = $event;"></feedback> [showForm]="showFeedback" (show)="showFeedback = $event;"></feedback>
<!-- Other versions --> </div>
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.deletedByInferenceIds" <!-- Other versions -->
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.deletedByInferenceIds"
#AlertModalDeletedByInference classBody="uk-width-xxlarge uk-padding-remove-right"> #AlertModalDeletedByInference classBody="uk-width-xxlarge uk-padding-remove-right">
<landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="AlertModalDeletedByInference" <landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="AlertModalDeletedByInference"
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false" [subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
@ -489,35 +525,7 @@
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="'other'" [type]="'other research products'"></deletedByInference> [resultType]="'other'" [type]="'other research products'"></deletedByInference>
</div> </div>
</modal-alert> </modal-alert>
<!-- Related Organizations-->
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.organizations"
classBody="uk-width-xxlarge uk-padding-remove-right" #organizationModal>
<landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="organizationModal"
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
[entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
</landing-header>
<div class="uk-margin-medium-top uk-margin-medium-right">
<no-load-paging *ngIf="resultLandingInfo.organizations.length > pageSize" [type]="'organizations'"
(pageChange)="updateOrganizationsPage($event)"
[page]="relatedPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.organizations.length">
</no-load-paging>
<ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let item of resultLandingInfo.organizations.slice((relatedPage-1)*pageSize, relatedPage*pageSize)">
<result-preview [modal]="organizationModal" [properties]="properties"
[result]="getResultPreviewFromOrg(item)"></result-preview>
</li>
</ul>
<no-load-paging *ngIf="resultLandingInfo.organizations.length > pageSize" [type]="'organizations'"
(pageChange)="updateOrganizationsPage($event)"
[page]="relatedPage" [pageSize]="pageSize"
[totalResults]="resultLandingInfo.organizations.length">
</no-load-paging>
</div>
</modal-alert>
</div>
<modal-alert #linkModal [classTitle]="'landing-modal-header uk-padding-small'" <modal-alert #linkModal [classTitle]="'landing-modal-header uk-padding-small'"
[classBody]="'uk-padding-remove landing-modal'"> [classBody]="'uk-padding-remove landing-modal'">
<div class="uk-grid uk-child-width-1-3 uk-flex uk-flex-middle"> <div class="uk-grid uk-child-width-1-3 uk-flex uk-flex-middle">

View File

@ -13,9 +13,9 @@ 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 {Organization, RelationResult, ResultPreview} from "../../utils/result-preview/result-preview"; import {RelationResult, ResultPreview} from "../../utils/result-preview/result-preview";
import {IndexInfoService} from "../../utils/indexInfo.service"; import {IndexInfoService} from "../../utils/indexInfo.service";
import {FormArray, FormBuilder, FormControl, FormGroup} from "@angular/forms"; import {FormBuilder, FormGroup} from "@angular/forms";
@Component({ @Component({
@ -26,9 +26,6 @@ export class ResultLandingComponent {
@Input() type: string = "publication"; @Input() type: string = "publication";
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null; @Input() communityId = null;
// Active tab variable for responsiveness
@Input() activeTab: string = "References";
@ViewChild('linkModal') linkModal; @ViewChild('linkModal') linkModal;
@ViewChild('citeModal') citeModal; @ViewChild('citeModal') citeModal;
@ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference; @ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
@ -85,9 +82,8 @@ export class ResultLandingComponent {
public showLoading: boolean = true; public showLoading: boolean = true;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public activeTab: string = null;
private doi: string; private doi: string;
public doiURL: string;
sub: any; sub: any;
piwiksub: any; piwiksub: any;
infoSub: any; infoSub: any;
@ -130,7 +126,6 @@ export class ResultLandingComponent {
}); });
//this.getDivContents(); //this.getDivContents();
this.getPageContents(); this.getPageContents();
this.doiURL = this.properties.doiURL;
this.updateUrl(data.envSpecific.baseLink + this._router.url); this.updateUrl(data.envSpecific.baseLink + this._router.url);
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
this.resultLandingInfo = null; this.resultLandingInfo = null;
@ -277,6 +272,22 @@ export class ResultLandingComponent {
} }
private setActiveTab() {
if(this.hasPrimaryInfo || this.hasSecondaryInfo) {
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.bioentities && this.bioentitiesNum > 0) {
this.activeTab = 'bioentities';
}
}
private getResultLandingInfo(provenanceActionVocabulary: any) { private getResultLandingInfo(provenanceActionVocabulary: any) {
this.infoSub = this._resultLaningService.getResultLandingInfo(this.id, this.type, provenanceActionVocabulary, this.properties).subscribe( this.infoSub = this._resultLaningService.getResultLandingInfo(this.id, this.type, provenanceActionVocabulary, this.properties).subscribe(
data => { data => {
@ -314,6 +325,7 @@ export class ResultLandingComponent {
} }
this.showLoading = false; this.showLoading = false;
this.initFilters(); this.initFilters();
this.setActiveTab();
}, },
err => { err => {
this.handleError("Error getting " + this.type + " for id: " + this.id, err); this.handleError("Error getting " + this.type + " for id: " + this.id, err);
@ -533,23 +545,10 @@ export class ResultLandingComponent {
this.alertModalDeletedByInference.open(); this.alertModalDeletedByInference.open();
} }
openOrganizations() {
this.relation = 'trust';
this.organizationModal.cancelButton = false;
this.organizationModal.okButton = false;
this.organizationModal.alertTitle = 'Related organizations of';
this.organizationsPage = 1;
this.organizationModal.open();
}
public getResultPreview(result: RelationResult): ResultPreview { public getResultPreview(result: RelationResult): ResultPreview {
return ResultPreview.relationResultConvert(result, this.relation); return ResultPreview.relationResultConvert(result, this.relation);
} }
public getResultPreviewFromOrg(result: Organization): ResultPreview {
return ResultPreview.organizationConvert(result, this.relation);
}
updateUrlWithType() { updateUrlWithType() {
this.type = this.resultLandingInfo.resultType; this.type = this.resultLandingInfo.resultType;
if (this.type == "publication") { if (this.type == "publication") {

View File

@ -23,7 +23,7 @@ import {AlertModal} from "../modal/alert";
</span> </span>
</a> </a>
<div *ngIf="author.orcid && (properties.environment != 'production')" <div *ngIf="author.orcid && (properties.environment != 'production')"
class="default-dropdown uk-margin-remove-top uk-padding-medium" class="default-dropdown uk-margin-remove-top uk-padding-medium uk-dropdown"
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;"> uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;">
<b class="uk-margin-top">{{author.fullName}}</b> <b class="uk-margin-top">{{author.fullName}}</b>
<div> <div>

View File

@ -2,24 +2,25 @@ import {SearchProjectsService} from '../../services/searchProjects.service';
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class';
import{EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {StringUtils} from '../../utils/string-utils.class'; import {StringUtils} from '../../utils/string-utils.class';
import {SearchResult} from "../entities/searchResult"; import {SearchResult} from "../entities/searchResult";
export class FetchProjects{
export class FetchProjects {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
public results: SearchResult[] =[]; public results: SearchResult[] = [];
public filters; // for getResultsForOrganizations public filters; // for getResultsForOrganizations
public funders:any = []; // for getResultsForOrganizations // this is filled with the initial query - before filtering public funders: any = []; // for getResultsForOrganizations // this is filled with the initial query - before filtering
public sub: any; public sub: any;
public subResults: any; public subResults: any;
public searchUtils:SearchUtilsClass = new SearchUtilsClass(); public searchUtils: SearchUtilsClass = new SearchUtilsClass();
constructor (private _searchProjectsService: SearchProjectsService) { constructor(private _searchProjectsService: SearchProjectsService) {
this.errorCodes = new ErrorCodes(); this.errorCodes = new ErrorCodes();
this.errorMessages = new ErrorMessagesComponent(); this.errorMessages = new ErrorMessagesComponent();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
@ -27,25 +28,25 @@ export class FetchProjects{
} }
public ngOnDestroy() { public ngOnDestroy() {
if(this.sub){ if (this.sub) {
this.sub.unsubscribe(); this.sub.unsubscribe();
} }
if(this.subResults){ if (this.subResults) {
this.subResults.unsubscribe(); this.subResults.unsubscribe();
} }
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, customFilter:SearchCustomFilter=null){ public getResultsByKeyword(keyword: string, page: number, size: number, properties: EnvProperties, customFilter: SearchCustomFilter = null) {
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if (keyword.length > 0) {
parameters = "q=" + StringUtils.URIEncode(keyword); parameters = "q=" + StringUtils.URIEncode(keyword);
} }
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = null; var refineParams = null;
if(customFilter){ if (customFilter) {
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId ))); refineParams = (refineParams ? (refineParams + '&') : '') + "&fq=" + StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId)));
} }
this.subResults = this._searchProjectsService.searchProjects(parameters, refineParams, page, size, [], properties).subscribe( this.subResults = this._searchProjectsService.searchProjects(parameters, refineParams, page, size, [], properties).subscribe(
data => { data => {
@ -55,7 +56,7 @@ export class FetchProjects{
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.DONE; this.searchUtils.status = this.errorCodes.DONE;
if(this.searchUtils.totalResults == 0 ){ if (this.searchUtils.totalResults == 0) {
this.searchUtils.status = this.errorCodes.NONE; this.searchUtils.status = this.errorCodes.NONE;
} }
}, },
@ -74,13 +75,13 @@ export class FetchProjects{
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
}*/ }*/
this.handleError("Error getting projects for keyword: "+keyword, err); this.handleError("Error getting projects for keyword: " + keyword, err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
); );
} }
public getResultsForDataproviders(id:string, page: number, size: number, properties:EnvProperties){ public getResultsForDataproviders(id: string, page: number, size: number, properties: EnvProperties) {
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
@ -92,7 +93,7 @@ export class FetchProjects{
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.DONE; this.searchUtils.status = this.errorCodes.DONE;
if(this.searchUtils.totalResults == 0 ){ if (this.searchUtils.totalResults == 0) {
this.searchUtils.status = this.errorCodes.NONE; this.searchUtils.status = this.errorCodes.NONE;
} }
}, },
@ -111,25 +112,25 @@ export class FetchProjects{
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
}*/ }*/
this.handleError("Error getting projects for content provider with id: "+id, err); this.handleError("Error getting projects for content provider with id: " + id, err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
); );
} }
public getNumForEntity(entity: string, id:string, properties:EnvProperties) { public getNumForEntity(entity: string, id: string, properties: EnvProperties) {
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
if(id != "" && entity != "") { if (id != "" && entity != "") {
this._searchProjectsService.numOfEntityProjects(id, entity, properties ).subscribe( this._searchProjectsService.numOfEntityProjects(id, entity, properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data; this.searchUtils.totalResults = data;
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.DONE; this.searchUtils.status = this.errorCodes.DONE;
if(this.searchUtils.totalResults == 0 ){ if (this.searchUtils.totalResults == 0) {
this.searchUtils.status = this.errorCodes.NONE; this.searchUtils.status = this.errorCodes.NONE;
} }
}, },
@ -149,44 +150,44 @@ export class FetchProjects{
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
}*/ }*/
this.handleError("Error getting number of projects for "+entity+" with id: "+id, err); this.handleError("Error getting number of projects for " + entity + " with id: " + id, err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
); );
} }
} }
public getResultsForOrganizations(organizationId:string, filterquery:string, page: number, size: number, refineFields:string[], properties:EnvProperties){ public getResultsForOrganizations(organizationId: string, filterquery: string, page: number, size: number, refineFields: string[], properties: EnvProperties) {
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
this._searchProjectsService.getProjectsForOrganizations(organizationId, filterquery, page, size, refineFields, properties).subscribe(
this._searchProjectsService.getProjectsForOrganizations(organizationId,filterquery, page, size,refineFields, properties).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; // the results can be filtered so this number can be no total results this.searchUtils.totalResults = data[0]; // the results can be filtered so this number can be no total results
//console.info("search Projects for Organization: [Id:"+organizationId+" ] [total results:"+this.searchUtils.totalResults+"]"); //console.info("search Projects for Organization: [Id:"+organizationId+" ] [total results:"+this.searchUtils.totalResults+"]");
this.results = data[1]; this.results = data[1];
if(refineFields && refineFields.length > 0){ if (refineFields && refineFields.length > 0) {
this.filters = data[2]; this.filters = data[2];
filterquery = decodeURIComponent(filterquery); filterquery = decodeURIComponent(filterquery);
for(var i = 0; i < this.filters.length; i++){ for (var i = 0; i < this.filters.length; i++) {
if(filterquery.indexOf(this.filters[i].filterId) !== -1){ if (filterquery.indexOf(this.filters[i].filterId) !== -1) {
//console.log("this.filters[i].filterId:"+this.filters[i].filterId); //console.log("this.filters[i].filterId:"+this.filters[i].filterId);
for(var j = 0; j < this.filters[i].values.length; j++){ for (var j = 0; j < this.filters[i].values.length; j++) {
//console.log("this.filters[i].values[j].id:"+this.filters[i].values[j].id); //console.log("this.filters[i].values[j].id:"+this.filters[i].values[j].id);
if(filterquery.indexOf(this.filters[i].values[j].id) !== -1){ if (filterquery.indexOf(this.filters[i].values[j].id) !== -1) {
this.filters[i].values[j].selected = true; this.filters[i].values[j].selected = true;
} }
} }
} }
} }
} }
if(filterquery == ""){ if (filterquery == "") {
this.searchUtils.totalResultsNoFilters = this.searchUtils.totalResults; this.searchUtils.totalResultsNoFilters = this.searchUtils.totalResults;
this.funders = []; this.funders = [];
for(var i = 0; i < this.filters.length; i++){ for (var i = 0; i < this.filters.length; i++) {
//console.log("this.filters[i].filterId:"+this.filters[i].filterId); //console.log("this.filters[i].filterId:"+this.filters[i].filterId);
if(this.filters[i].filterId == "funder"){ if (this.filters[i].filterId == "funder") {
this.funders = (this.filters[i].values); this.funders = (this.filters[i].values);
} }
} }
//console.log(" this.funders:"+ this.funders); //console.log(" this.funders:"+ this.funders);
@ -194,7 +195,7 @@ export class FetchProjects{
} }
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.DONE; this.searchUtils.status = this.errorCodes.DONE;
if(this.searchUtils.totalResults == 0 ){ if (this.searchUtils.totalResults == 0) {
this.searchUtils.status = this.errorCodes.NONE; this.searchUtils.status = this.errorCodes.NONE;
} }
}, },
@ -213,13 +214,13 @@ export class FetchProjects{
} else { } else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE; this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
}*/ }*/
this.handleError("Error getting projects for organization with id: "+organizationId, err); this.handleError("Error getting projects for organization with id: " + organizationId, err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status); this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
} }
); );
} }
private handleError(message: string, error) { private handleError(message: string, error) {
console.error("Fetch Projects (class): "+message, error); console.error("Fetch Projects (class): " + message, error);
} }
} }

View File

@ -175,8 +175,10 @@ export class ResultPreview {
resultPreview.subjects = result.subjects; resultPreview.subjects = result.subjects;
resultPreview.resultType = type; resultPreview.resultType = type;
//impact factor; //impact factor;
if(result.DOIs && result.DOIs.length > 0) {
resultPreview.identifiers = new Map(); resultPreview.identifiers = new Map();
resultPreview.identifiers.set("doi", result.DOIs); resultPreview.identifiers.set("doi", result.DOIs);
}
return resultPreview; return resultPreview;
} }

View File

@ -18,7 +18,7 @@ import { Component, Input } from '@angular/core';
template: ` template: `
<!-- [class]="active ? 'uk-active' : ''" [hidden]="!active"--> <!-- [class]="active ? 'uk-active' : ''" [hidden]="!active"-->
<!-- <div [class]="active ? 'uk-active' : ''" [hidden]="!active">--> <!-- <div [class]="active ? 'uk-active' : ''" [hidden]="!active">-->
<div [hidden]="!active" class="pane"> <div class="pane">
<ng-content></ng-content> <ng-content></ng-content>
</div> </div>

View File

@ -16,7 +16,7 @@ import { TabComponent } from './tab.component';
selector: 'my-tabs', selector: 'my-tabs',
template: ` template: `
<ul uk-tab class="uk-tab main-tabs uk-margin-remove uk-child-width-expand" uk-switcher="connect: .tabs-content" uk-height-match="target: .tab-header"> <ul uk-tab class="uk-tab main-tabs uk-margin-remove uk-child-width-expand" uk-switcher="connect: .tabs-content" uk-height-match="target: .tab-header">
<li *ngFor="let tab of tabs" (click)="selectTab(tab)" [class.active]="tab.active" [class]="'uk-padding-remove '+(tab.statistics ? ' statistics ' : '')"> <li *ngFor="let tab of tabs; let i=index" [class]="'uk-padding-remove'+(tab.statistics ? ' statistics ' : '') + (i == 0?' uk-active':'')">
<a class="uk-width-1-1 uk-height-1-1"> <a class="uk-width-1-1 uk-height-1-1">
<div class="tab-header">{{tab.title}}</div> <div class="tab-header">{{tab.title}}</div>
<div *ngIf="tab.num" class="number">{{tab.num | number}}</div> <div *ngIf="tab.num" class="number">{{tab.num | number}}</div>
@ -29,34 +29,13 @@ import { TabComponent } from './tab.component';
</a> </a>
</li> </li>
</ul> </ul>
<div class="uk-switcher tabs-content main-tabs-content"> <div class="uk-switcher tabs-content main-tabs-content">
<ng-content></ng-content> <ng-content></ng-content>
</div> </div>
` `
}) })
export class TabsComponent implements AfterContentInit { export class TabsComponent {
@ContentChildren(TabComponent) tabs: QueryList<TabComponent>; @ContentChildren(TabComponent) tabs: QueryList<TabComponent>;
@Output() public selectedActiveTab: EventEmitter<any> = new EventEmitter(); @Output() public selectedActiveTab: EventEmitter<any> = new EventEmitter();
// contentChildren are set
ngAfterContentInit() {
// get all active tabs
let activeTabs = this.tabs.filter((tab)=>tab.active);
// if there is no active tab set, activate the first
if(activeTabs.length === 0) {
this.selectTab(this.tabs.first);
}
}
selectTab(tab: TabComponent){
// deactivate all tabs
this.tabs.toArray().forEach(tab => tab.active = false);
// activate the tab the user has clicked on.
tab.active = true;
this.selectedActiveTab.emit(tab.tabId);
}
} }