[Library|Trunk]
Tabs: - use CustomClass directive instead of statistics - update it in landing pages Enermaps Integration: - Result LAnding at a new tab with enermaps tool - Image on the left of the result preview component git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60814 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
589b1d5529
commit
e6d0721fb8
|
@ -4,7 +4,7 @@ import {properties} from "../../../environments/environment";
|
|||
export class ConnectHelper {
|
||||
|
||||
public static getCommunityFromDomain(domain: string): string{
|
||||
domain = "beta.enermaps.openaire.eu"; //for testing
|
||||
domain = "beta.covid-19.openaire.eu"; //for testing
|
||||
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
|
||||
if (domain.indexOf('openaire.eu') === -1) {
|
||||
return null;
|
||||
|
|
|
@ -403,7 +403,7 @@
|
|||
<!-- [class]="(firstTab === 'statistics')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'"
|
||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
|
||||
>
|
||||
<ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
|
||||
</my-tab>
|
||||
|
@ -465,7 +465,7 @@
|
|||
<!-- [class]="(firstTab === 'statistics')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'"
|
||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
|
||||
>
|
||||
<ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
|
||||
</my-tab>
|
||||
|
|
|
@ -615,8 +615,9 @@ export class ParsingFunctions {
|
|||
return contexts;
|
||||
}
|
||||
public static getEnermapsConceptId(contexts: any): string{
|
||||
let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept});
|
||||
return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null;
|
||||
// let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept});
|
||||
// return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null;
|
||||
return "hotmaps_heat_tot_curr_density"
|
||||
}
|
||||
parseTypes(types: string[], uniqueTypes: Set<string>, instance: any) {
|
||||
if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
|
||||
|
|
|
@ -585,7 +585,7 @@
|
|||
<ng-template #statistics_tab>
|
||||
<!-- <my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0-->
|
||||
<!-- || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"-->
|
||||
<!-- [tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'">-->
|
||||
<!-- [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'">-->
|
||||
<div class="">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status,
|
||||
|
@ -668,7 +668,7 @@
|
|||
<!-- [class]="(firstTab === 'statistics')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'"
|
||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
|
||||
>
|
||||
<ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
|
||||
</my-tab>
|
||||
|
@ -719,7 +719,7 @@
|
|||
<!-- [class]="(firstTab === 'statistics')?'uk-active':''"-->
|
||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||
[tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'"
|
||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
|
||||
>
|
||||
<ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
|
||||
</my-tab>
|
||||
|
|
|
@ -210,11 +210,7 @@
|
|||
<a (click)="showAll = !showAll;">View less</a>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="enermapsId && properties.enermapsURL" class="uk-width-expand uk-flex uk-flex-center">
|
||||
<a [href]="properties.enermapsURL" target="_blank" ><img class="uk-width-auto"
|
||||
[src]="properties.enermapsURL +'/images/' + enermapsId + '.png'" alt="Enermaps tool preview">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf="hasSecondaryInfo" class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove">
|
||||
<div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0 ||
|
||||
|
@ -428,6 +424,19 @@
|
|||
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #enermaps_tab>
|
||||
|
||||
<div class="uk-width-expand uk-text-center uk-padding">
|
||||
<img class="uk-width-auto" [src]="properties.enermapsURL +'/images/' + enermapsId + '.png'" alt="Enermaps tool preview">
|
||||
<br>
|
||||
<span class=" uk-text-baseline uk-text-muted"> Visit <a
|
||||
class=" uk-margin-right uk-margin-small-top"
|
||||
[href]="properties.enermapsURL" target="_blank" >
|
||||
Enermaps Tool
|
||||
</a></span>
|
||||
|
||||
</div>
|
||||
</ng-template>
|
||||
<my-tabs>
|
||||
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
|
||||
<!-- [class]="(activeTab === 'summary')?'uk-active':''"-->
|
||||
|
@ -460,6 +469,11 @@
|
|||
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
|
||||
<ng-container *ngTemplateOutlet="bioentities_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<my-tab *ngIf="enermapsId && properties.enermapsURL"
|
||||
[tabTitle]="'Enermaps Tool'" [tabId]="'enermaps'"
|
||||
customClass="portalTab">
|
||||
<ng-container *ngTemplateOutlet="enermaps_tab;"></ng-container>
|
||||
</my-tab>
|
||||
</my-tabs>
|
||||
<my-small-tabs>
|
||||
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
|
||||
|
@ -493,6 +507,11 @@
|
|||
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
|
||||
<ng-container *ngTemplateOutlet="bioentities_tab;"></ng-container>
|
||||
</my-tab>
|
||||
<my-tab *ngIf="enermapsId && properties.enermapsURL"
|
||||
[tabTitle]="'Enermaps Tool'" [tabId]="'enermaps'"
|
||||
customClass="portalTab">
|
||||
<ng-container *ngTemplateOutlet="enermaps_tab;"></ng-container>
|
||||
</my-tab>
|
||||
</my-small-tabs>
|
||||
</div>
|
||||
<div class="uk-margin-small-top uk-flex">
|
||||
|
|
|
@ -423,7 +423,7 @@ export class ResultLandingComponent {
|
|||
}
|
||||
|
||||
public get hasPrimaryInfo(): boolean {
|
||||
return !!this.resultLandingInfo && (!!this.resultLandingInfo.description || !!this.resultLandingInfo.identifiers || !!this.resultLandingInfo.subjects || !!this.enermapsId);
|
||||
return !!this.resultLandingInfo && (!!this.resultLandingInfo.description || !!this.resultLandingInfo.identifiers || !!this.resultLandingInfo.subjects);
|
||||
}
|
||||
|
||||
public get hasSecondaryInfo(): boolean {
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
<div *ngIf="result">
|
||||
<!-- Before title -->
|
||||
<div class="uk-grid uk-flex uk-flex-middle">
|
||||
<div *ngIf="properties.enermapsURL && showEnermaps" class="uk-width-auto">
|
||||
<a [href]="properties.enermapsURL" target="_blank" ><img *ngIf="result.enermapsId"
|
||||
class="uk-width-medium" [src]="properties.enermapsURL + '/images/' + result.enermapsId + '.png'" alt="Enermaps tool preview">
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-width-expand">
|
||||
<div>
|
||||
<!-- deposit searchPage URL -->
|
||||
|
@ -282,11 +287,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="properties.enermapsURL && showEnermaps" class="uk-width-auto">
|
||||
<a [href]="properties.enermapsURL" target="_blank" ><img *ngIf="result.enermapsId"
|
||||
class="uk-width-medium" [src]="properties.enermapsURL + '/images/' + result.enermapsId + '.png'" alt="Enermaps tool preview">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!--&& loggedIn -->
|
||||
<div *ngIf="(result.pop_inf && result.DOI) ||
|
||||
|
|
|
@ -30,6 +30,6 @@ import { Component, Input } from '@angular/core';
|
|||
export class TabComponent {
|
||||
@Input('tabTitle') title: string;
|
||||
@Input('tabNumber') num: number;
|
||||
@Input('statistics') statistics: boolean = false;
|
||||
@Input('customClass') customClass:string = "";
|
||||
@Input('tabId') tabId: string;
|
||||
}
|
||||
|
|
|
@ -18,12 +18,12 @@ import { TabComponent } from './tab.component';
|
|||
<ul [class]="(tabs.toArray().length > 2 ? 'uk-visible@m' : '') + ' uk-tab main-tabs uk-margin-remove uk-child-width-expand'"
|
||||
uk-tab uk-switcher="connect: .tabs-content" uk-height-match="target: .tab-header">
|
||||
<li *ngFor="let tab of tabs.toArray(); let i=index"
|
||||
[class]="'uk-padding-remove'+(tab.statistics ? ' statistics ' : '') + (i == 0?' uk-active':'')"
|
||||
[class]="'uk-padding-remove '+ tab.customClass + (i == 0?' uk-active':'')"
|
||||
(click)="selectTab(tab)">
|
||||
<a class="uk-width-1-1 uk-height-1-1">
|
||||
<div class="tab-header">{{tab.title}}</div>
|
||||
<div *ngIf="tab.num" class="number">{{tab.num | number}}</div>
|
||||
<div *ngIf="tab.statistics" class="number">
|
||||
<div *ngIf="tab.customClass == 'statistics'" class="number">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
|
||||
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||
<path d="M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"></path>
|
||||
|
|
Loading…
Reference in New Issue