Project

General

Profile

« Previous | Next » 

Revision 60814

[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

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/connect/connectHelper.ts
4 4
export class ConnectHelper {
5 5

  
6 6
  public static  getCommunityFromDomain(domain: string): string{
7
    domain = "beta.enermaps.openaire.eu"; //for testing
7
    domain = "beta.covid-19.openaire.eu"; //for testing
8 8
    domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
9 9
    if (domain.indexOf('openaire.eu') === -1) {
10 10
      return null;
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/dataProvider/dataProvider.component.html
403 403
<!--              [class]="(firstTab === 'statistics')?'uk-active':''"-->
404 404
              <my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
405 405
                       || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
406
                      [tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'"
406
                      [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
407 407
                      >
408 408
                <ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
409 409
              </my-tab>
......
465 465
              <!--              [class]="(firstTab === 'statistics')?'uk-active':''"-->
466 466
              <my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
467 467
                       || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
468
                      [tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'"
468
                      [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
469 469
              >
470 470
                <ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
471 471
              </my-tab>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/project/project.component.html
585 585
            <ng-template #statistics_tab>
586 586
              <!--              <my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0-->
587 587
              <!--                       || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"-->
588
              <!--                      [tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'">-->
588
              <!--                      [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'">-->
589 589
              <div class="">
590 590
                <div class="uk-width-expand uk-padding">
591 591
                  <errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status,
......
668 668
              <!--              [class]="(firstTab === 'statistics')?'uk-active':''"-->
669 669
              <my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
670 670
                       || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
671
                      [tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'"
671
                      [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
672 672
              >
673 673
                <ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
674 674
              </my-tab>
......
719 719
              <!--              [class]="(firstTab === 'statistics')?'uk-active':''"-->
720 720
              <my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
721 721
                       || fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
722
                      [tabTitle]="'Statistics'" [statistics]="true" [tabId]="'statistics'"
722
                      [tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
723 723
              >
724 724
                <ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
725 725
              </my-tab>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/parsingFunctions.class.ts
615 615
    return contexts;
616 616
  }
617 617
  public static getEnermapsConceptId(contexts: any): string{
618
    let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept});
619
    return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null;
618
    // let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept});
619
    // return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null;
620
    return "hotmaps_heat_tot_curr_density"
620 621
  }
621 622
  parseTypes(types: string[], uniqueTypes: Set<string>, instance: any) {
622 623
    if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/result/resultLanding.component.html
210 210
                        <a (click)="showAll = !showAll;">View less</a>
211 211
                      </div>
212 212
                    </div>
213
                    <div  *ngIf="enermapsId && properties.enermapsURL" class="uk-width-expand uk-flex uk-flex-center">
214
                      <a [href]="properties.enermapsURL" target="_blank" ><img  class="uk-width-auto"
215
                      [src]="properties.enermapsURL +'/images/' + enermapsId + '.png'" alt="Enermaps tool preview">
216
                      </a>
217
                    </div>
213

  
218 214
                  </div>
219 215
                  <div *ngIf="hasSecondaryInfo" class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove">
220 216
                    <div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0 ||
......
428 424
                  <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
429 425
                </div>
430 426
              </ng-template>
427
              <ng-template #enermaps_tab>
428

  
429
                  <div   class="uk-width-expand  uk-text-center uk-padding">
430
                    <img  class="uk-width-auto" [src]="properties.enermapsURL +'/images/' + enermapsId + '.png'" alt="Enermaps tool preview">
431
                    <br>
432
                    <span class=" uk-text-baseline uk-text-muted"> Visit <a
433
                      class=" uk-margin-right uk-margin-small-top"
434
                      [href]="properties.enermapsURL" target="_blank" >
435
                      Enermaps Tool
436
                    </a></span>
437

  
438
                </div>
439
              </ng-template>
431 440
              <my-tabs>
432 441
<!--                *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
433 442
<!--                [class]="(activeTab === 'summary')?'uk-active':''"-->
......
460 469
                        [tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
461 470
                  <ng-container *ngTemplateOutlet="bioentities_tab;"></ng-container>
462 471
                </my-tab>
472
                <my-tab *ngIf="enermapsId && properties.enermapsURL"
473
                        [tabTitle]="'Enermaps Tool'" [tabId]="'enermaps'"
474
                        customClass="portalTab">
475
                  <ng-container *ngTemplateOutlet="enermaps_tab;"></ng-container>
476
                </my-tab>
463 477
              </my-tabs>
464 478
              <my-small-tabs>
465 479
                <!--                *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
......
493 507
                        [tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
494 508
                  <ng-container *ngTemplateOutlet="bioentities_tab;"></ng-container>
495 509
                </my-tab>
510
                <my-tab *ngIf="enermapsId && properties.enermapsURL"
511
                        [tabTitle]="'Enermaps Tool'" [tabId]="'enermaps'"
512
                        customClass="portalTab">
513
                  <ng-container *ngTemplateOutlet="enermaps_tab;"></ng-container>
514
                </my-tab>
496 515
              </my-small-tabs>
497 516
            </div>
498 517
            <div class="uk-margin-small-top uk-flex">
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/result/resultLanding.component.ts
423 423
  }
424 424
  
425 425
  public get hasPrimaryInfo(): boolean {
426
    return !!this.resultLandingInfo && (!!this.resultLandingInfo.description || !!this.resultLandingInfo.identifiers || !!this.resultLandingInfo.subjects || !!this.enermapsId);
426
    return !!this.resultLandingInfo && (!!this.resultLandingInfo.description || !!this.resultLandingInfo.identifiers || !!this.resultLandingInfo.subjects);
427 427
  }
428 428
  
429 429
  public get hasSecondaryInfo(): boolean {
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/tabs/tabs.component.ts
18 18
    <ul [class]="(tabs.toArray().length > 2 ? 'uk-visible@m' : '') + ' uk-tab main-tabs uk-margin-remove uk-child-width-expand'"
19 19
        uk-tab uk-switcher="connect: .tabs-content" uk-height-match="target: .tab-header">
20 20
      <li *ngFor="let tab of tabs.toArray(); let i=index" 
21
          [class]="'uk-padding-remove'+(tab.statistics ? ' statistics ' : '') + (i == 0?' uk-active':'')"
21
          [class]="'uk-padding-remove '+ tab.customClass + (i == 0?' uk-active':'')"
22 22
          (click)="selectTab(tab)">
23 23
        <a class="uk-width-1-1 uk-height-1-1">
24 24
          <div class="tab-header">{{tab.title}}</div>
25 25
          <div *ngIf="tab.num" class="number">{{tab.num | number}}</div>
26
          <div *ngIf="tab.statistics" class="number">
26
          <div *ngIf="tab.customClass == 'statistics'" class="number">
27 27
            <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
28 28
              <path d="M0 0h24v24H0z" fill="none"></path>
29 29
              <path d="M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"></path>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/tabs/tab.component.ts
30 30
export class TabComponent {
31 31
  @Input('tabTitle') title: string;
32 32
  @Input('tabNumber') num: number;
33
  @Input('statistics') statistics: boolean = false;
33
  @Input('customClass') customClass:string = "";
34 34
  @Input('tabId') tabId: string;
35 35
}
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/result-preview/result-preview.component.html
1 1
<div *ngIf="result">
2 2
  <!-- Before title -->
3 3
  <div class="uk-grid uk-flex uk-flex-middle">
4
    <div *ngIf="properties.enermapsURL && showEnermaps" class="uk-width-auto">
5
      <a [href]="properties.enermapsURL" target="_blank" ><img *ngIf="result.enermapsId"
6
                                                               class="uk-width-medium" [src]="properties.enermapsURL + '/images/' + result.enermapsId + '.png'" alt="Enermaps tool preview">
7
      </a>
8
    </div>
4 9
    <div class="uk-width-expand">
5 10
  <div>
6 11
    <!-- deposit searchPage URL -->
......
282 287
    </div>
283 288
  </div>
284 289
    </div>
285
    <div *ngIf="properties.enermapsURL && showEnermaps" class="uk-width-auto">
286
      <a [href]="properties.enermapsURL" target="_blank" ><img *ngIf="result.enermapsId"
287
       class="uk-width-medium" [src]="properties.enermapsURL + '/images/' + result.enermapsId + '.png'" alt="Enermaps tool preview">
288
      </a>
289
    </div>
290 290
  </div>
291 291
  <!--&& loggedIn -->
292 292
  <div *ngIf="(result.pop_inf && result.DOI) ||

Also available in: Unified diff