[Library | Trunk]: Add organization tabs. Add small tabs on results too

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58790 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-05-27 10:47:40 +00:00
parent 797401f7c1
commit a0abd21625
6 changed files with 747 additions and 493 deletions

View File

@ -55,7 +55,7 @@ export class ProjectsInModalComponent {
@Input() properties: EnvProperties;
@Input() modal: AlertModal;
public page: number = 1;
public size: number = 10;
public size: number = 5;
public routerHelper: RouterHelper = new RouterHelper();
public errorCodes: ErrorCodes = new ErrorCodes();

View File

@ -1,3 +1,25 @@
<ng-template #search_tab let-fetch="fetch" let-type="type">
<errorMessages [status]="[fetch.searchUtils.status]" [type]="getEntityName(type, true, true)"
tab_error_class=true></errorMessages>
<div *ngIf="fetch.searchUtils.status == errorCodes.DONE">
<div *ngIf="fetch.searchUtils.totalResults > searchNumber" class="uk-inline uk-flex uk-flex-right">
<span class="uk-text-uppercase uk-position-left uk-text-middle uk-flex-middle uk-flex">
<span>Top {{searchNumber}}</span><span class="space uk-text-muted">{{getEntityName(type, true, true)}}</span>
</span>
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, getEntityName(type, true, false), 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults">
<button class="uk-button uk-button-small portal-button">
<span uk-icon="search"></span>
View all
</button>
</a>
</div>
<search-result [results]="fetch.results" [status]="fetch.searchUtils.status"
[type]="getEntityName(type, false, true)" [showLoading]="true" [properties]="properties">
</search-result>
</div>
</ng-template>
<div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle">
<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 ">
@ -11,9 +33,8 @@
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div *ngIf="organizationInfo != null" class="uk-grid">
<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">
<div *ngIf="organizationInfo != null" class="uk-grid uk-margin-remove">
<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
[URL]="properties.baseLink+'/search/organization?organizationId='+organizationId"
type="organization"></schema2jsonld>
@ -22,8 +43,7 @@
[subTitle]="(organizationInfo.name
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[entityType]="'organization'"></landing-header>
<div *ngIf="organizationInfo.deletedByInferenceIds"
class="uk-text-small">
<div *ngIf="organizationInfo.deletedByInferenceIds">
<a (click)="openDeletedByInference()">View all {{organizationInfo.deletedByInferenceIds.length}}
versions</a>
</div>
@ -41,92 +61,6 @@
<span class="uk-text-muted">Country: </span>{{organizationInfo.country}}
</li>
</ul>
<!-- <div class="uk-margin-medium-top">
<div *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0"
class="uk-margin-top simple-buttons uk-flex uk-flex-middle">
<div *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0" (click)="openProjectsModal()"
class="clickable uk-margin-right">
<span class="uk-text-bold">{{fetchProjects.searchUtils.totalResults | number}}</span> Projects
</div>
</div>
<div
*ngIf="total.publications > 0 || total.datasets > 0 || total.software > 0 || total.other > 0 || total.dataproviders > 0"
class="uk-margin-top advanced-buttons uk-grid-small uk-child-width-1-4@s uk-child-width-1-2"
uk-height-match="target: .target; row: false"
uk-grid>
<div *ngIf="total.publications > 0">
<div class="uk-position-relative">
&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'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<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="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative">
<span class="uk-text-bold uk-position-center">{{total.publications | number}}</span>
</div>
</a>
</div>
</div>
<div *ngIf="total.datasets > 0">
<div class="uk-position-relative">
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'datasets', 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<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="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative">
<span class="uk-text-bold uk-position-center">{{total.datasets | number}}</span>
</div>
</a>
</div>
</div>
<div *ngIf="total.software > 0">
<div class="uk-position-relative">
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'software', 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<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="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative">
<span class="uk-text-bold uk-position-center">{{total.software | number}}</span>
</div>
</a>
</div>
</div>
<div *ngIf="total.other > 0">
<div class="uk-position-relative">
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'other', 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<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="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative">
<span class="uk-text-bold uk-position-center">{{total.other | number}}</span>
</div>
</a>
</div>
</div>
<div *ngIf="total.dataproviders > 0">
<div class="uk-position-relative">
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0'], ['relorganizationid', organizationId])"
[routerLink]="properties.searchLinkToAdvancedDataProviders" target="_blank">
<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="icon uk-position-center" uk-icon="icon: search;"></div>
<div class="footer target uk-position-relative">
<span class="uk-text-bold uk-position-center">{{total.dataproviders | number}}</span>
</div>
</a>
</div>
</div>
</div>
</div>-->
</div>
<div class="uk-width-1-3@m uk-width-1-1@s uk-padding-remove">
<ul class="user-actions uk-list uk-card uk-card-default uk-padding">
@ -165,23 +99,169 @@
</ul>
</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">
<ng-template #loadingBlock>
<div *ngIf="!tabsAreInitialized" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
<span class="loading-gif uk-align-center"></span>
</div>
</ng-template>
<div *ngIf="numberOfTabs > 0; else loadingBlock" class="main-tabs-div">
<!--Tab Templates-->
<ng-template #projects_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<projectsInModal [fetchProjects]="fetchProjects"
[organizationId]="organizationId"
[properties]=properties>
</projectsInModal>
</div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div>
</ng-template>
<ng-template #data_providers_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE">
<div *ngIf="fetchDataproviders.searchUtils.totalResults > searchNumber"
class="uk-inline uk-flex uk-flex-right">
<span class="uk-text-uppercase uk-position-left uk-text-middle uk-flex-middle uk-flex">
<span>Top {{searchNumber}}</span><span class="space uk-text-muted">content providers</span>
</span>
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0'], ['relorganizationid', organizationId])"
[routerLink]="properties.searchLinkToAdvancedDataProviders">
<button class="uk-button uk-button-small portal-button">
<span uk-icon="search"></span>
View all
</button>
</a>
</div>
<search-result [results]="fetchDataproviders.results"
[status]="fetchDataproviders.searchUtils.status"
[type]="'content provider'" [showLoading]="true" [properties]="properties">
</search-result>
</div>
</div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div>
</ng-template>
<ng-template #publications_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab;
context: { fetch: fetchPublications, type: 'publication'}">
</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 #datasets_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab;
context: { fetch: fetchDatasets, type: 'dataset'}">
</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 #software_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab;
context: { fetch: fetchSoftware, type: 'software'}">
</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 #other_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab;
context: { fetch: fetchOrps, type: 'other'}">
</ng-container>
</div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div>
</ng-template>
<my-tabs [class]="numberOfTabs > 2 ? 'uk-visible@m' : ''" (selectedActiveTab)="onSelectActiveTab($event)">
<my-tab *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0"
[tabNumber]="fetchProjects.searchUtils.totalResults"
[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 class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div>
[tabId]="'projects'" [class]="(firstTab === 'projects')?'uk-active':''">
<ng-container *ngTemplateOutlet="projects_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchDataproviders && fetchDataproviders.searchUtils.totalResults > 0"
[tabNumber]="fetchDataproviders.searchUtils.totalResults"
[tabTitle]="'Content Providers'"
[tabId]="'dataProviders'" [class]="(firstTab === 'dataProviders')?'uk-active':''">
<ng-container *ngTemplateOutlet="data_providers_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchPublications && fetchPublications.searchUtils.totalResults > 0"
[tabNumber]="fetchPublications.searchUtils.totalResults"
[tabTitle]="'Publications'"
[tabId]="'publications'" [class]="(firstTab === 'publications')?'uk-active':''">
<ng-container *ngTemplateOutlet="publications_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchDatasets && fetchDatasets.searchUtils.totalResults > 0"
[tabNumber]="fetchDatasets.searchUtils.totalResults"
[tabTitle]="'Research Data'"
[tabId]="'datasets'" [class]="(firstTab === 'datasets')?'uk-active':''">
<ng-container *ngTemplateOutlet="datasets_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchSoftware && fetchSoftware.searchUtils.totalResults > 0"
[tabNumber]="fetchSoftware.searchUtils.totalResults"
[tabTitle]="'Software'"
[tabId]="'software'" [class]="(firstTab === 'software')?'uk-active':''">
<ng-container *ngTemplateOutlet="software_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchOrps && fetchOrps.searchUtils.totalResults > 0"
[tabNumber]="fetchOrps.searchUtils.totalResults"
[tabTitle]="'Other Research'"
[tabId]="'other'" [class]="(firstTab === 'other')?'uk-active':''">
<ng-container *ngTemplateOutlet="other_tab;"></ng-container>
</my-tab>
</my-tabs>
<my-small-tabs *ngIf="numberOfTabs > 2" class="uk-hidden@m"
(selectedActiveTab)="onSelectActiveTab($event)">
<my-tab *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0"
[tabNumber]="fetchProjects.searchUtils.totalResults"
[tabTitle]="'Funding / Projects'"
[tabId]="'projects'" [class]="(firstTab === 'projects')?'uk-active':''">
<ng-container *ngTemplateOutlet="projects_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchDataproviders && fetchDataproviders.searchUtils.totalResults > 0"
[tabNumber]="fetchDataproviders.searchUtils.totalResults"
[tabTitle]="'Content Providers'"
[tabId]="'dataProviders'" [class]="(firstTab === 'dataProviders')?'uk-active':''">
<ng-container *ngTemplateOutlet="data_providers_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchPublications && fetchPublications.searchUtils.totalResults > 0"
[tabNumber]="fetchPublications.searchUtils.totalResults"
[tabTitle]="'Publications'"
[tabId]="'publications'" [class]="(firstTab === 'publications')?'uk-active':''">
<ng-container *ngTemplateOutlet="publications_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchDatasets && fetchDatasets.searchUtils.totalResults > 0"
[tabNumber]="fetchDatasets.searchUtils.totalResults"
[tabTitle]="'Research Data'"
[tabId]="'datasets'" [class]="(firstTab === 'datasets')?'uk-active':''">
<ng-container *ngTemplateOutlet="projects_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchSoftware && fetchSoftware.searchUtils.totalResults > 0"
[tabNumber]="fetchSoftware.searchUtils.totalResults"
[tabTitle]="'Software'"
[tabId]="'software'" [class]="(firstTab === 'software')?'uk-active':''">
<ng-container *ngTemplateOutlet="software_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="fetchOrps && fetchOrps.searchUtils.totalResults > 0"
[tabNumber]="fetchOrps.searchUtils.totalResults"
[tabTitle]="'Other Research'"
[tabId]="'other'" [class]="(firstTab === 'other')?'uk-active':''">
<ng-container *ngTemplateOutlet="projects_tab;"></ng-container>
</my-tab>
</my-small-tabs>
</div>
<div class="uk-margin-small-top uk-flex">
<!-- Last Index Info-->
@ -230,19 +310,49 @@
[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 *ngIf="total > 0" class="uk-margin-remove-bottom uk-list">
<li [attr.uk-tooltip]="total > 0 ? 'cls: uk-invisible' : 'cls: uk-active'"
title="No report available">
<a [class]="total > 0 ? 'clickable' : 'uk-disabled uk-link-muted'"
(click)="downloadFile(getCSVAffiliated('results'), 'results' + '-report')">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">all research outcomes (CSV)</span>
</a>
</li>
<li [attr.uk-tooltip]="fetchPublications.searchUtils.totalResults > 0 ? 'cls: uk-invisible' : 'cls: uk-active'"
title="No report available">
<a [class]="fetchPublications.searchUtils.totalResults > 0 ? 'clickable' : 'uk-disabled uk-link-muted'"
(click)="downloadFile(getCSVAffiliated('publications'), 'publications' + '-report')">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">publications (CSV)</span>
</a>
</li>
<li [attr.uk-tooltip]="fetchDatasets.searchUtils.totalResults > 0 ? 'cls: uk-invisible' : 'cls: uk-active'"
title="No report available">
<a [class]="fetchDatasets.searchUtils.totalResults > 0 ? 'clickable' : 'uk-disabled uk-link-muted'"
(click)="downloadFile(getCSVAffiliated('datasets'), 'datasets' + '-report')">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">research data (CSV)</span>
</a>
</li>
<li [attr.uk-tooltip]="fetchSoftware.searchUtils.totalResults > 0 ? 'cls: uk-invisible' : 'cls: uk-active'"
title="No report available">
<a [class]="fetchSoftware.searchUtils.totalResults > 0 ? 'clickable' : 'uk-disabled uk-link-muted'"
(click)="downloadFile(getCSVAffiliated('software'), 'software' + '-report')">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">software (CSV)</span>
</a>
</li>
<li [attr.uk-tooltip]="fetchOrps.searchUtils.totalResults > 0 ? 'cls: uk-invisible' : 'cls: uk-active'"
title="No report available">
<a [class]="fetchOrps.searchUtils.totalResults > 0 ? 'clickable' : 'uk-disabled uk-link-muted'"
(click)="downloadFile(getCSVAffiliated('other'), 'other' + '-report')">
<span uk-icon="download"></span>
<span class="uk-text-capitalize uk-margin-small-left">other research products (CSV)</span>
</a>
</li>
</ul>
<div *ngIf="total.results == 0"
<div *ngIf="total == 0"
class="uk-text-muted">
No reports available
</div>
@ -288,22 +398,6 @@
</div>
</div>
</modal-alert>
<!-- Projects -->
<modal-alert *ngIf="organizationInfo && fetchProjects && fetchProjects.results"
#projectsModal classBody="uk-width-xxlarge uk-padding-remove-right">
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
[subTitle]="(organizationInfo.name
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[entityType]="'organization'">
</landing-header>
<div class="uk-margin-medium-top uk-margin-medium-right">
<projectsInModal [fetchProjects]="fetchProjects"
[modal]="projectsModal"
[organizationId]="organizationId"
[properties]=properties>
</projectsInModal>
</div>
</modal-alert>
<modal-loading></modal-loading>
<modal-alert #AlertModalApplyAll (alertOutput)="confirmCloseApplyAll()"></modal-alert>
<modal-alert #AlertModalCsvError></modal-alert>

View File

@ -22,15 +22,6 @@ import {Location} from "@angular/common";
import {FetchResearchResults} from "../../utils/fetchEntitiesClasses/fetchResearchResults.class";
import {FetchDataproviders} from "../../utils/fetchEntitiesClasses/fetchDataproviders.class";
interface Total {
publications: number;
datasets: number;
software: number;
other: number;
results: number;
dataproviders: number;
}
@Component({
selector: 'organization',
templateUrl: 'organization.component.html',
@ -52,18 +43,7 @@ export class OrganizationComponent {
public csvProjectParamsHead: string;
public csvParamsTail: string;
// Active tab variable for responsiveness
public activeTab: string = "Publications";
// Variables for publications, research data, projects, dataproviders tabs
public total: Total = {
publications: 0,
datasets: 0,
software: 0,
other: 0,
results: 0,
dataproviders: 0
};
public fetchProjects: FetchProjects;
public fetchPublications: FetchResearchResults;
public fetchDatasets: FetchResearchResults;
@ -72,6 +52,12 @@ export class OrganizationComponent {
public fetchDataproviders: FetchDataproviders
public searchNumber: number = 5;
// Active tab variable for responsiveness
public activeTab: string = "";
public firstTab: string = "";
public _numberOfTabs: number = 0;
public tabsAreInitialized: boolean = false;
@ViewChild('downloadReportModal') downloadReportModal;
@ViewChild('downloadFunderReportModal') downloadFunderReportModal;
@ -88,7 +74,7 @@ export class OrganizationComponent {
public divContents = null;
// Helper variables to specify funder in downloadPublicationsFile function
public contentTypes: [string,string][] =[
public contentTypes: [string, string][] = [
['results', 'all research outcomes'],
['publications', 'publications'],
['datasets', 'research data'],
@ -125,7 +111,6 @@ export class OrganizationComponent {
private _searchDataprovidersService: SearchDataprovidersService,
private _reportsService: ReportsService,
private _searchResearchResultsService: SearchResearchResultsService,
// private _searchDatasetsService: SearchDatasetsService,
private _searchProjectsService: SearchProjectsService,
private _meta: Meta,
private _title: Title,
@ -134,13 +119,18 @@ export class OrganizationComponent {
private seoService: SEOService,
private _location: Location) {
this.fetchProjects = new FetchProjects(this._searchProjectsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService);
this.fetchDatasets = new FetchResearchResults(this._searchResearchResultsService);
this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService);
this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService);
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
if(this.properties.lastIndexUpdate) {
if (this.properties.lastIndexUpdate) {
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
}
//this.getDivContents();
@ -153,7 +143,7 @@ export class OrganizationComponent {
this.updateDescription("");
this.organizationId = params['organizationId'];
if (this.organizationId) {
this.getOrganizationInfo();
} else {
@ -225,34 +215,34 @@ export class OrganizationComponent {
}
private getTotalResearchResults() {
this._searchResearchResultsService.numOfEntityResults('publication',
this.organizationInfo.objIdentifier, 'organization', this.properties).subscribe(total => {
this.total.publications = total;
this.total.results += total;
});
this._searchResearchResultsService.numOfEntityResults('dataset',
this.organizationInfo.objIdentifier, 'organization', this.properties).subscribe(total => {
this.total.datasets = total;
this.total.results += total;
});
this._searchResearchResultsService.numOfEntityResults('software',
this.organizationInfo.objIdentifier, 'organization', this.properties).subscribe(total => {
this.total.software = total;
this.total.results += total;
});
this._searchResearchResultsService.numOfEntityResults('other',
this.organizationInfo.objIdentifier, 'organization', this.properties).subscribe(total => {
this.total.other = total;
this.total.results += total;
});
this.fetchPublications.getNumForEntity('publication', 'organization', this.organizationId, this.properties);
this.fetchDatasets.getNumForEntity('dataset', 'organization', this.organizationId, this.properties);
this.fetchSoftware.getNumForEntity('software', 'organization', this.organizationId, this.properties);
this.fetchOrps.getNumForEntity('other', 'organization', this.organizationId, this.properties);
}
private getTotalDataproviders() {
this._searchDataprovidersService.numOfEntityDataproviders(
this.organizationInfo.objIdentifier,'organization', this.properties).subscribe(
total => {
this.total.dataproviders = total;
});
this.fetchDataproviders.getNumForEntity('organization', this.organizationId, this.properties);
}
private searchContentProviders() {
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, this.searchNumber, this.properties);
}
private searchPublications() {
this.fetchPublications.getResultsForEntity("publication", "organization", this.organizationId, 1, this.searchNumber, this.properties);
}
private searchDatasets() {
this.fetchDatasets.getResultsForEntity("dataset", "organization", this.organizationId, 1, this.searchNumber, this.properties);
}
private searchSoftware() {
this.fetchSoftware.getResultsForEntity("software", "organization", this.organizationId, 1, this.searchNumber, this.properties);
}
private searchOrps() {
this.fetchOrps.getResultsForEntity("other", "organization", this.organizationId, 1, this.searchNumber, this.properties);
}
private getOrganizationInfo() {
@ -282,7 +272,6 @@ export class OrganizationComponent {
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, this.organizationInfo.title.name, this.piwikSiteId).subscribe();
}
console.log(this.organizationInfo);
var refineFields: string [] = ["funder"];
this.getTotalResearchResults();
this.getTotalDataproviders();
@ -401,9 +390,9 @@ export class OrganizationComponent {
if (!title) {
title_index = index;
//console.info(title_index);
url = this.downloadURLAPI + '?format=csv-special&' + this.getTypeParam(this.funderContentType)+ '&fq=((relprojectid exact "' + projects[index].id + '"))';
url = this.downloadURLAPI + '?format=csv-special&' + this.getTypeParam(this.funderContentType) + '&fq=((relprojectid exact "' + projects[index].id + '"))';
} else {
url = this.downloadURLAPI + '?format=csv-special-notitle&' + this.getTypeParam(this.funderContentType)+ '&fq=((relprojectid exact "' + projects[index].id + '"))';
url = this.downloadURLAPI + '?format=csv-special-notitle&' + this.getTypeParam(this.funderContentType) + '&fq=((relprojectid exact "' + projects[index].id + '"))';
}
title = true;
@ -541,10 +530,10 @@ export class OrganizationComponent {
}
public getTypeParam(type: string): string {
if(type == 'results') {
if (type == 'results') {
type = 'publications&type=datasets&type=software&type=other';
}
return 'type='+type;
return 'type=' + type;
}
getCSVAffiliated(contentType: string): string {
@ -552,7 +541,7 @@ export class OrganizationComponent {
}
getFunderProjects(): string {
return this.downloadURLAPI + '?'+this.csvProjectParamsHead+encodeURI(this.funder.id)+this.csvParamsTail;
return this.downloadURLAPI + '?' + this.csvProjectParamsHead + encodeURI(this.funder.id) + this.csvParamsTail;
}
open(value: any) {
@ -574,6 +563,112 @@ export class OrganizationComponent {
this.downloadFunderReportModal.open();
}
public onSelectActiveTab(activeTabId) {
if (this.activeTab != activeTabId) { // tab really changed
if (activeTabId == 'projects') {
this.activeTab = 'projects';
} else if (activeTabId == 'dataProviders') {
this.activeTab = 'dataProviders';
this.searchContentProviders();
} else if (activeTabId == 'publications') {
this.activeTab = 'publications';
this.searchPublications();
} else if (activeTabId == 'datasets') {
this.activeTab = 'datasets';
this.searchDatasets();
} else if (activeTabId == 'software') {
this.activeTab = 'software';
this.searchSoftware();
} else if (activeTabId == 'other') {
this.activeTab = "other";
this.searchOrps();
}
}
}
public get total(): number {
let total = this.fetchPublications.searchUtils.totalResults;
total += this.fetchDatasets.searchUtils.totalResults;
total += this.fetchSoftware.searchUtils.totalResults;
total += this.fetchOrps.searchUtils.totalResults;
return total;
}
public get numberOfTabs(): number {
if (this.tabsAreInitialized) {
return this._numberOfTabs;
}
if (!this.organizationInfo
|| this.fetchProjects.searchUtils.status === this.errorCodes.LOADING
|| this.fetchDataproviders.searchUtils.status === this.errorCodes.LOADING
|| this.fetchPublications.searchUtils.status == this.errorCodes.LOADING
|| this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING
|| this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING
|| this.fetchOrps.searchUtils.status == this.errorCodes.LOADING) {
return 0;
}
if (this.fetchProjects.searchUtils.totalResults > 0) {
if (this._numberOfTabs == 0) {
this.firstTab = 'projects';
}
this._numberOfTabs++;
}
if (this.fetchDataproviders.searchUtils.totalResults > 0) {
if (this._numberOfTabs == 0) {
this.firstTab = 'dataProviders';
this.searchContentProviders();
}
this._numberOfTabs++;
}
if (this.fetchPublications.searchUtils.totalResults > 0) {
if (this._numberOfTabs == 0) {
this.firstTab = 'publications';
this.searchPublications();
}
this._numberOfTabs++;
}
if (this.fetchDatasets.searchUtils.totalResults > 0) {
if (this._numberOfTabs == 0) {
this.firstTab = 'datasets';
this.searchDatasets();
}
this._numberOfTabs++;
}
if (this.fetchSoftware.searchUtils.totalResults > 0) {
if (this._numberOfTabs == 0) {
this.firstTab = 'software';
this.searchSoftware();
}
this._numberOfTabs++;
}
if (this.fetchOrps.searchUtils.totalResults > 0) {
if (this._numberOfTabs == 0) {
this.firstTab = 'other';
this.searchOrps();
}
this._numberOfTabs++;
}
this.activeTab = this.firstTab;
this.tabsAreInitialized = true;
return this._numberOfTabs;
}
private getEntityName(entityType: string, plural: boolean, full: boolean): string {
if (entityType == "publication") {
return "publication" + (plural ? "s" : "");
} else if (entityType == "dataset") {
return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
} else if (entityType == "software") {
return "software";
} else if (entityType == "other") {
return (full ? ("other research product" + (plural ? "s" : "")) : "other");
} else if (entityType == "dataprovider") {
return (full ? ("content provider" + (plural ? "s" : "")) : "dataprovider" + (plural ? "s" : ""));
} else {
return entityType + (plural ? "s" : "");
}
}
public scroll() {
HelperFunctions.scroll();
}

View File

@ -28,6 +28,7 @@ import {FeedbackModule} from "../feedback/feedback.module";
import {MatSelectModule} from "@angular/material/select";
import {TabsModule} from "../../utils/tabs/tabs.module";
import {ModalSelectModule} from "../../utils/modal-select/modal-select.module";
import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.module";
@NgModule({
@ -44,7 +45,7 @@ import {ModalSelectModule} from "../../utils/modal-select/modal-select.module";
SearchResearchResultsServiceModule,
ProjectsServiceModule,
Schema2jsonldModule, SEOServiceModule, HelperModule,
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, MatSelectModule, TabsModule, ModalSelectModule
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, MatSelectModule, TabsModule, ModalSelectModule, SearchResultsModule
],
declarations: [
OrganizationComponent,

View File

@ -117,120 +117,116 @@
</li>
</ul>
</div>
<div class="uk-padding-remove-left uk-width-1-1 uk-margin-large-top">
<div *ngIf="numberOfTabs > 0" class="uk-padding-remove-left uk-width-1-1 uk-margin-large-top">
<div class="main-tabs-div">
<my-tabs *ngIf="activeTab">
<my-tab *ngIf="hasPrimaryInfo || hasSecondaryInfo" [tabTitle]="getTypeName() + ' Summary'"
[tabId]="'summary'" [class]="(activeTab === 'summary')?'uk-active':''">
<div class="uk-grid uk-margin-remove">
<div *ngIf="hasPrimaryInfo" class="uk-width-expand uk-padding">
<!-- Description -->
<div *ngIf="resultLandingInfo.description" class="uk-margin-medium-bottom">
<div class="uk-text-justify uk-height-max-medium uk-overflow-auto">
<div class="uk-text-muted">Abstract</div>
<span>{{resultLandingInfo.description.substring(0, showNumDescription)}}</span>
<span *ngIf="showNumDescription == thresholdDescription &&
<ng-template #summary_tab>
<div class="uk-grid uk-margin-remove">
<div *ngIf="hasPrimaryInfo" class="uk-width-expand uk-padding">
<!-- Description -->
<div *ngIf="resultLandingInfo.description" class="uk-margin-medium-bottom">
<div class="uk-text-justify uk-height-max-medium uk-overflow-auto">
<div class="uk-text-muted">Abstract</div>
<span>{{resultLandingInfo.description.substring(0, showNumDescription)}}</span>
<span *ngIf="showNumDescription == thresholdDescription &&
resultLandingInfo.description.length > thresholdDescription">...</span>
</div>
<div *ngIf="showNumDescription == thresholdDescription &&
</div>
<div *ngIf="showNumDescription == thresholdDescription &&
resultLandingInfo.description.length > thresholdDescription" class="uk-text-right">
<a (click)="showNumDescription = resultLandingInfo.description.length;">
Read more
</a>
</div>
<div *ngIf="resultLandingInfo.description && showNumDescription > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = thresholdDescription;">
Read less
</a>
</div>
<a (click)="showNumDescription = resultLandingInfo.description.length;">
Read more
</a>
</div>
<!-- Identifiers -->
<div *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0"
class="uk-margin-medium-bottom">
<showIdentifiers [identifiers]="resultLandingInfo.identifiers"
[properties]="properties">
</showIdentifiers>
</div>
<!-- Subjects -->
<div *ngIf="resultLandingInfo.subjects || resultLandingInfo.otherSubjects ||
resultLandingInfo.classifiedSubjects" class="uk-margin-medium-bottom">
<showSubjects [subjects]="resultLandingInfo.subjects"
[otherSubjects]="resultLandingInfo.otherSubjects"
[classifiedSubjects]="resultLandingInfo.classifiedSubjects">
</showSubjects>
</div>
<!-- Related Organizations-->
<div *ngIf="resultLandingInfo.organizations && resultLandingInfo.organizations.length > 0"
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">
{{(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="resultLandingInfo.description && showNumDescription > thresholdDescription"
class="uk-text-right">
<a (click)="showNumDescription = thresholdDescription;">
Read less
</a>
</div>
</div>
<div *ngIf="hasSecondaryInfo"
[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 ||
<!-- Identifiers -->
<div *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0"
class="uk-margin-medium-bottom">
<showIdentifiers [identifiers]="resultLandingInfo.identifiers"
[properties]="properties">
</showIdentifiers>
</div>
<!-- Subjects -->
<div *ngIf="resultLandingInfo.subjects || resultLandingInfo.otherSubjects ||
resultLandingInfo.classifiedSubjects" class="uk-margin-medium-bottom">
<showSubjects [subjects]="resultLandingInfo.subjects"
[otherSubjects]="resultLandingInfo.otherSubjects"
[classifiedSubjects]="resultLandingInfo.classifiedSubjects">
</showSubjects>
</div>
<!-- Related Organizations-->
<div *ngIf="resultLandingInfo.organizations && resultLandingInfo.organizations.length > 0"
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">
{{(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>
</div>
<div *ngIf="hasSecondaryInfo"
[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 ||
resultLandingInfo.contexts && resultLandingInfo.contexts.length >0"
class="uk-padding uk-padding-remove-bottom">
<!-- Funded By -->
<div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0"
class="uk-margin-medium-bottom">
<fundedBy [fundedByProjects]="resultLandingInfo.fundedByProjects"></fundedBy>
</div>
<!-- Communities -->
<div *ngIf="resultLandingInfo.contexts && resultLandingInfo.contexts.length >0"
class="uk-margin-medium-bottom">
<relatedTo [contexts]="resultLandingInfo.contexts"></relatedTo>
</div>
class="uk-padding uk-padding-remove-bottom">
<!-- Funded By -->
<div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0"
class="uk-margin-medium-bottom">
<fundedBy [fundedByProjects]="resultLandingInfo.fundedByProjects"></fundedBy>
</div>
<!-- Download From -->
<div
*ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0"
class="uk-margin-medium-bottom">
<div class="sideInfoTitle uk-margin-small-bottom uk-flex">
<span class="uk-width-1-2">Download from</span>
<span *ngIf="resultLandingInfo.deletedByInferenceIds"
class="uk-width-1-2 uk-text-right">
<!-- Communities -->
<div *ngIf="resultLandingInfo.contexts && resultLandingInfo.contexts.length >0"
class="uk-margin-medium-bottom">
<relatedTo [contexts]="resultLandingInfo.contexts"></relatedTo>
</div>
</div>
<!-- Download From -->
<div
*ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0"
class="uk-margin-medium-bottom">
<div class="sideInfoTitle uk-margin-small-bottom uk-flex">
<span class="uk-width-1-2">Download from</span>
<span *ngIf="resultLandingInfo.deletedByInferenceIds"
class="uk-width-1-2 uk-text-right">
<a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}}
versions</a>
</span>
</div>
<availableOn [properties]="properties"
[availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
</div>
<availableOn [properties]="properties"
[availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
</div>
</div>
</my-tab>
<my-tab *ngIf="resultLandingInfo.references && resultLandingInfo.references.length > 0"
[tabTitle]="'references'" [tabId]="'references'" [class]="(activeTab === 'references')?'uk-active':''"
[tabNumber]="resultLandingInfo.references.length">
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<div>
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
(pageChange)="updateReferencesPage($event)"
[page]="referencesPage" [pageSize]="1.5*pageSize"
[totalResults]="resultLandingInfo.references.length">
</no-load-paging>
<div
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*1.5*pageSize, referencesPage*1.5*pageSize)">
<p *ngIf="item">
{{item.name}}
<ng-container *ngIf="item.ids && item.ids.length > 0">
</div>
</ng-template>
<ng-template #references_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<div>
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
(pageChange)="updateReferencesPage($event)"
[page]="referencesPage" [pageSize]="1.5*pageSize"
[totalResults]="resultLandingInfo.references.length">
</no-load-paging>
<div
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*1.5*pageSize, referencesPage*1.5*pageSize)">
<p *ngIf="item">
{{item.name}}
<ng-container *ngIf="item.ids && item.ids.length > 0">
<span *ngFor="let id of item.ids">
[<a *ngIf="id.type !== 'openaire'" href="{{getReferenceUrl(id)}}"
target="_blank">{{getReferenceIdName(id)}}</a>
@ -238,229 +234,275 @@
[queryParams]="{id: id.value}"
target="_blank">OpenAIRE</a>]
</span>
</ng-container>
</p>
</div>
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
(pageChange)="updateReferencesPage($event)"
[page]="referencesPage" [pageSize]="1.5*pageSize"
[totalResults]="resultLandingInfo.references.length">
</no-load-paging>
</ng-container>
</p>
</div>
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
(pageChange)="updateReferencesPage($event)"
[page]="referencesPage" [pageSize]="1.5*pageSize"
[totalResults]="resultLandingInfo.references.length">
</no-load-paging>
</div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div>
<!--<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">
<div
*ngIf="resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0"
class="uk-margin-bottom">
<h5>Supplementary Outcomes</h5>
<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">
<h5>Outcomes Supplemented by this {{getTypeName()}}</h5>
<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 *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>
</ng-template>
<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">
<h5>Related Outcomes</h5>
<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">
<h5>Similar Outcomes</h5>
<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 *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>
</ng-template>
<ng-template #bioentities_tab>
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<div>
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
(pageChange)="updateBioentitiesPage($event)"
[page]="bioentitiesPage" [pageSize]="2*pageSize"
[totalResults]="bioentitiesNum">
</no-load-paging>
<div class="uk-child-width-1-4@s uk-child-width-1-2 bioentities-buttons" uk-grid>
<ng-container *ngFor="let key of getKeys(resultLandingInfo.bioentities) let i=index">
<ng-container
*ngFor="let keyIn of keysToArray(resultLandingInfo.bioentities.get(key)).slice((bioentitiesPage-1)*2*pageSize, bioentitiesPage*2*pageSize)">
<div>
<div [title]="key" *ngIf="keyIn && !resultLandingInfo.bioentities.get(key).get(keyIn)">
{{keyIn}}
</div>
<a [href]="resultLandingInfo.bioentities.get(key).get(keyIn)" target="_blank"
[title]="key" *ngIf="keyIn && resultLandingInfo.bioentities.get(key).get(keyIn)">
{{keyIn}}
<span class="custom-external custom-icon space"></span>
</a>
</div>
</ng-container>
</ng-container>
</div>
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
(pageChange)="updateBioentitiesPage($event)"
[page]="bioentitiesPage" [pageSize]="2*pageSize"
[totalResults]="bioentitiesNum">
</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>
<my-tabs [class]="numberOfTabs > 2 ? 'uk-visible@m' : ''">
<my-tab *ngIf="hasPrimaryInfo || hasSecondaryInfo" [tabTitle]="getTypeName() + ' Summary'"
[tabId]="'summary'" [class]="(activeTab === 'summary')?'uk-active':''">
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="resultLandingInfo.references && resultLandingInfo.references.length > 0"
[tabTitle]="'references'" [tabId]="'references'" [class]="(activeTab === 'references')?'uk-active':''"
[tabNumber]="resultLandingInfo.references.length">
<ng-container *ngTemplateOutlet="references_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="(resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0) ||
(resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)"
[tabTitle]="'Supplementary outcomes'" [tabId]="'supplementary'" [class]="(activeTab === 'supplementary')?'uk-active':''"
[tabNumber]="supplementaryResults">
<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">
<h5>Supplementary Outcomes</h5>
<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">
<h5>Outcomes Supplemented by this {{getTypeName()}}</h5>
<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 *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>
<ng-container *ngTemplateOutlet="supplementary_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||
(resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)"
[tabTitle]="'Related outcomes'" [tabId]="'related'" [class]="(activeTab === 'related')?'uk-active':''"
[tabNumber]="relatedResultsNum">
<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">
<h5>Related Outcomes</h5>
<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">
<h5>Similar Outcomes</h5>
<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 *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>
<ng-container *ngTemplateOutlet="related_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0" [class]="(activeTab === 'bioentities')?'uk-active':''"
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
<div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding">
<div>
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
(pageChange)="updateBioentitiesPage($event)"
[page]="bioentitiesPage" [pageSize]="2*pageSize"
[totalResults]="bioentitiesNum">
</no-load-paging>
<div class="uk-child-width-1-4@s uk-child-width-1-2 bioentities-buttons" uk-grid>
<ng-container *ngFor="let key of getKeys(resultLandingInfo.bioentities) let i=index">
<ng-container
*ngFor="let keyIn of keysToArray(resultLandingInfo.bioentities.get(key)).slice((bioentitiesPage-1)*2*pageSize, bioentitiesPage*2*pageSize)">
<div>
<div [title]="key" *ngIf="keyIn && !resultLandingInfo.bioentities.get(key).get(keyIn)">
{{keyIn}}
</div>
<a [href]="resultLandingInfo.bioentities.get(key).get(keyIn)" target="_blank"
[title]="key" *ngIf="keyIn && resultLandingInfo.bioentities.get(key).get(keyIn)">
{{keyIn}}
<span class="custom-external custom-icon space"></span>
</a>
</div>
</ng-container>
</ng-container>
</div>
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
(pageChange)="updateBioentitiesPage($event)"
[page]="bioentitiesPage" [pageSize]="2*pageSize"
[totalResults]="bioentitiesNum">
</no-load-paging>
</div>
</div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div>
<ng-container *ngTemplateOutlet="bioentities_tab;"></ng-container>
</my-tab>
</my-tabs>
<my-small-tabs *ngIf="numberOfTabs > 2" class="uk-hidden@m">
<my-tab *ngIf="hasPrimaryInfo || hasSecondaryInfo" [tabTitle]="getTypeName() + ' Summary'"
[tabId]="'summary'" [class]="(activeTab === 'summary')?'uk-active':''">
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="resultLandingInfo.references && resultLandingInfo.references.length > 0"
[tabTitle]="'references'" [tabId]="'references'" [class]="(activeTab === 'references')?'uk-active':''"
[tabNumber]="resultLandingInfo.references.length">
<ng-container *ngTemplateOutlet="references_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="(resultLandingInfo.supplementaryResearchResults && resultLandingInfo.supplementaryResearchResults.length > 0) ||
(resultLandingInfo.supplementedByResearchResults && resultLandingInfo.supplementedByResearchResults.length > 0)"
[tabTitle]="'Supplementary outcomes'" [tabId]="'supplementary'" [class]="(activeTab === 'supplementary')?'uk-active':''"
[tabNumber]="supplementaryResults">
<ng-container *ngTemplateOutlet="supplementary_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="(resultLandingInfo.relatedResearchResults && resultLandingInfo.relatedResearchResults.length > 0) ||
(resultLandingInfo.similarResearchResults && resultLandingInfo.similarResearchResults.length > 0)"
[tabTitle]="'Related outcomes'" [tabId]="'related'" [class]="(activeTab === 'related')?'uk-active':''"
[tabNumber]="relatedResultsNum">
<ng-container *ngTemplateOutlet="related_tab;"></ng-container>
</my-tab>
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0" [class]="(activeTab === 'bioentities')?'uk-active':''"
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
<ng-container *ngTemplateOutlet="bioentities_tab;"></ng-container>
</my-tab>
</my-small-tabs>
</div>
<div class="uk-margin-small-top uk-flex">
<!-- Last Index Info-->

View File

@ -288,6 +288,28 @@ export class ResultLandingComponent {
}
}
private get numberOfTabs(): number {
let numberOfTabs = 0;
if(this.hasPrimaryInfo || this.hasSecondaryInfo) {
numberOfTabs++;
}
if(this.resultLandingInfo.references && this.resultLandingInfo.references.length > 0) {
numberOfTabs++;
}
if((this.resultLandingInfo.supplementaryResearchResults && this.resultLandingInfo.supplementaryResearchResults.length > 0) ||
(this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0)) {
numberOfTabs++;
}
if((this.resultLandingInfo.relatedResearchResults && this.resultLandingInfo.relatedResearchResults.length > 0) ||
(this.resultLandingInfo.similarResearchResults && this.resultLandingInfo.similarResearchResults.length > 0)) {
numberOfTabs++;
}
if(this.resultLandingInfo.bioentities && this.bioentitiesNum > 0) {
numberOfTabs++;
}
return numberOfTabs;
}
private getResultLandingInfo(provenanceActionVocabulary: any) {
this.infoSub = this._resultLaningService.getResultLandingInfo(this.id, this.type, provenanceActionVocabulary, this.properties).subscribe(
data => {