Project

General

Profile

« Previous | Next » 

Revision 58136

[Library | Landing-redesign]: Create no load paging component. Add identifiers and download from on result preview. Change view all versions base on mocks.

View differences:

modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/searchPages/searchUtils/no-load-paging.module.ts
1
import {NgModule} from '@angular/core';
2
import {CommonModule} from '@angular/common';
3
import {FormsModule} from '@angular/forms';
4
import {PagingModule} from '../../utils/paging.module';
5
import {NoLoadPagingComponent} from "./no-load-paging.component";
6

  
7
@NgModule({
8
  imports: [
9
    CommonModule, FormsModule, PagingModule
10
  ],
11
  declarations: [
12
    NoLoadPagingComponent
13
  ],
14
  exports: [
15
    NoLoadPagingComponent
16
  ]
17
})
18
export class NoLoadPaging {
19
}
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/searchPages/searchUtils/searchFilter.component.html
7 7
  </div>
8 8
    <div  aria-expanded="false">
9 9
      <div>
10
        <ng-container  *ngIf="!isOpen">
11
          <div *ngFor = "let value of getSelectedValues(filter,'num')"  class="uk-animation-fade filterItem searchFilterItem uk-text-small">
12
                <div title = "{{value.name}}">
13
                  <ng-container *ngIf="filter.filterType == 'checkbox' || filter.filterType == 'radio'">
14
                    <input *ngIf="filter.filterType == 'checkbox'" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
15
                    <input *ngIf="filter.filterType == 'radio'" type="radio" (click)="uniqueFilterChange(value)"
16
                           [name]=filter.filterId checked/>
17
                    {{' '+_formatName(value)}}
18
                    <span *ngIf = "showResultCount === true" >
10
        <ng-container>
11
<!--          <div *ngFor = "let value of getSelectedValues(filter,'num')"  class="uk-animation-fade filterItem searchFilterItem uk-text-small">-->
12
<!--                <div title = "{{value.name}}">-->
13
<!--                  <ng-container *ngIf="filter.filterType == 'checkbox' || filter.filterType == 'radio'">-->
14
<!--                    <input *ngIf="filter.filterType == 'checkbox'" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />-->
15
<!--                    <input *ngIf="filter.filterType == 'radio'" type="radio" (click)="uniqueFilterChange(value)"-->
16
<!--                           [name]=filter.filterId checked/>-->
17
<!--                    {{' '+_formatName(value)}}-->
18
<!--                    <span *ngIf = "showResultCount === true" >-->
19
<!--                      {{' ('+(value.number|number)+')'}}</span>-->
20
<!--                  </ng-container>-->
21
<!--                </div>-->
22
<!--          </div>-->
23

  
24
<!--          <div *ngFor = "let value of getNotSelectedValues(filter,'num').slice(0,(!addShowMore?getNotSelectedValues(filter,'num').length:filterValuesNum-getSelectedValues(filter,'num').length))" class = "uk-animation-fade filterItem searchFilterItem uk-text-small">-->
25
<!--                <div title = "{{value.name}}" [class]="(isDisabled || (showResultCount && value.number === 0))?'uk-text-muted':''" >-->
26
<!--                  <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled || (showResultCount && value.number === 0)" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />-->
27
<!--                  <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled || (showResultCount && value.number === 0)" type="radio" (click)="uniqueFilterChange(value)"-->
28
<!--                         [name]=filter.filterId value=false  />-->
29
<!--                  {{' '+ _formatName(value) }}-->
30
<!--                  <span *ngIf = "showResultCount === true" [class]="(isDisabled || value.number === 0)?'uk-text-muted':''" >-->
31
<!--                   {{' ('+(value.number|number)+')'}}-->
32
<!--                  </span>-->
33
<!--                </div>-->
34
<!--          </div>-->
35

  
36
          <div *ngFor="let value of getSelectedAndTopValues(filter, 6)"
37
               class="uk-animation-fade filterItem searchFilterItem uk-text-small">
38
            <div title = "{{value.name}}">
39
              <ng-container *ngIf="filter.filterType == 'checkbox' || filter.filterType == 'radio'">
40
                <input *ngIf="filter.filterType == 'checkbox'" type="checkbox"
41
                       [disabled]="isDisabled || (showResultCount && value.number === 0)"
42
                       [(ngModel)]="value.selected" (ngModelChange)="filterChange(value.selected)" />
43
                <input *ngIf="filter.filterType == 'radio'" type="radio"
44
                       [disabled]="isDisabled || (showResultCount && value.number === 0)"
45
                       [name]=filter.filterId [checked]="value.selected" (click)="uniqueFilterChange(value)"/>
46
                {{' '+_formatName(value)}}
47
                <span *ngIf = "showResultCount === true" >
19 48
                      {{' ('+(value.number|number)+')'}}</span>
20
                  </ng-container>
21
                </div>
49
              </ng-container>
50
            </div>
22 51
          </div>
23

  
24
          <div *ngFor = "let value of getNotSelectedValues(filter,'num').slice(0,(!addShowMore?getNotSelectedValues(filter,'num').length:filterValuesNum-getSelectedValues(filter,'num').length))" class = "uk-animation-fade filterItem searchFilterItem uk-text-small">
25
                <div title = "{{value.name}}" [class]="(isDisabled || (showResultCount && value.number === 0))?'uk-text-muted':''" >
26
                  <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled || (showResultCount && value.number === 0)" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
27
                  <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled || (showResultCount && value.number === 0)" type="radio" (click)="uniqueFilterChange(value)"
28
                         [name]=filter.filterId value=false  />
29
                  {{' '+ _formatName(value) }}
30
                  <span *ngIf = "showResultCount === true" [class]="(isDisabled || value.number === 0)?'uk-text-muted':''" >
31
                   {{' ('+(value.number|number)+')'}}
32
                  </span>
33
                </div>
34
          </div>
35 52
        </ng-container>
36 53

  
37 54
        <div *ngIf=" addShowMore && (filter.values.length) > filterValuesNum">
38
          <a *ngIf="!isOpen"
55
          <a
39 56
             [class]="((isDisabled)?'uk-disabled uk-link-muted ':' portal-link ') + ' uk-margin-small-top'"
40 57
             [attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">
41
            + View more
58
            <span *ngIf="!isOpen">+ View more</span>
59
            <span *ngIf="isOpen">- View less</span>
42 60
          </a>
43 61

  
44 62
          <div hidden [id]="'toggle-'+filter.filterId" class="uk-text-small uk-margin-small-bottom">
......
47 65
              <input   class="uk-input uk-margin-small-bottom uk-width-1-1  " name="filter-keyword"  placeholder="Search for {{filter.title}}" type="text" [(ngModel)]="keyword">
48 66

  
49 67
              <span *ngIf = "showResultCount === true" class="uk-width-5-6@m uk-width-1-1@s uk-align-right uk-margin-small-bottom">
50
                <span class="uk-width-1-4"> Sort by:</span>
68
                <span class="uk-width-1-4 uk-text-muted"> Sort by:</span>
51 69
                <select [(ngModel)]="sortBy"
52 70
                        class="uk-select uk-width-3-4@m uk-width-auto"
53 71
                        id="form-horizontal-select" name="select_order">
......
58 76
            </div>
59 77

  
60 78
            <div   class="uk-modal-body uk-overflow-auto uk-height-max-small uk-padding-remove
61
                      uk-margin-small-left uk-margin-small-right uk-margin-small-top">
62
              <ng-container *ngFor = "let value of getSelectedValues(filter, sortBy)">
63
                <div *ngIf="filterKeywords(value.name)"  class = "uk-animation-fade filterItem searchFilterItem">
79
                      uk-margin-small-left uk-margin-small-right uk-margin-small-top uk-width-1-1">
80
<!--              <ng-container *ngFor = "let value of getSelectedValues(filter, sortBy)">-->
81
<!--                <div *ngIf="filterKeywords(value.name)"  class = "uk-animation-fade filterItem searchFilterItem">-->
64 82

  
65
                      <div title = "{{value.name}}">
66
                        <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
67
                        <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled" type="radio" (click)="uniqueFilterChange(value)"
68
                               [name]=filter.filterId checked/>
69
                        {{' ' + _formatName(value) + ' '}}
70
                        <span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number|number}})</span>
71
                      </div>
83
<!--                      <div title = "{{value.name}}">-->
84
<!--                        <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />-->
85
<!--                        <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled" type="radio" (click)="uniqueFilterChange(value)"-->
86
<!--                               [name]=filter.filterId checked/>-->
87
<!--                        {{' ' + _formatName(value) + ' '}}-->
88
<!--                        <span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number|number}})</span>-->
89
<!--                      </div>-->
72 90

  
73
                </div>
74
              </ng-container>
91
<!--                </div>-->
92
<!--              </ng-container>-->
75 93

  
76
              <ng-container *ngFor = "let value of getNotSelectedValues(filter, sortBy)">
77
                <div *ngIf="filterKeywords(value.name)"  class = "uk-animation-fade filterItem searchFilterItem">
94
<!--              <ng-container *ngFor = "let value of getNotSelectedValues(filter, sortBy)">-->
95
<!--                <div *ngIf="filterKeywords(value.name)"  class = "uk-animation-fade filterItem searchFilterItem">-->
78 96

  
79
                      <div title = "{{value.name}}">
80
                        <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
81
                        <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled" type="radio" (click)="uniqueFilterChange(value)"
82
                               [name]=filter.filterId value=false  />
83
                        {{' ' + _formatName(value) + ' '}}
84
                        <span   *ngIf = "showResultCount === true" > ({{value.number|number}})</span>
85
                      </div>
97
<!--                      <div title = "{{value.name}}">-->
98
<!--                        <input *ngIf="filter.filterType == 'checkbox'" [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />-->
99
<!--                        <input *ngIf="filter.filterType == 'radio'" [disabled]="isDisabled" type="radio" (click)="uniqueFilterChange(value)"-->
100
<!--                               [name]=filter.filterId value=false  />-->
101
<!--                        {{' ' + _formatName(value) + ' '}}-->
102
<!--                        <span   *ngIf = "showResultCount === true" > ({{value.number|number}})</span>-->
103
<!--                      </div>-->
104
<!--                </div>-->
105
<!--              </ng-container>-->
106
              <ng-container *ngFor="let value of sort(filter.values)"
107
                   class="uk-animation-fade filterItem searchFilterItem uk-text-small">
108
                <div title = "{{value.name}}">
109
                  <ng-container *ngIf="filter.filterType == 'checkbox' || filter.filterType == 'radio'">
110
                    <input *ngIf="filter.filterType == 'checkbox'" type="checkbox"
111
                           [disabled]="isDisabled || (showResultCount && value.number === 0)"
112
                           [(ngModel)]="value.selected" (ngModelChange)="filterChange(value.selected)" />
113
                    <input *ngIf="filter.filterType == 'radio'" type="radio"
114
                           [disabled]="isDisabled || (showResultCount && value.number === 0)"
115
                           [name]=filter.filterId [checked]="value.selected" (click)="uniqueFilterChange(value)"/>
116
                    {{' '+_formatName(value)}}
117
                    <span *ngIf = "showResultCount === true" >
118
                      {{' ('+(value.number|number)+')'}}</span>
119
                  </ng-container>
86 120
                </div>
87 121
              </ng-container>
88 122
            </div>
89 123
          </div>
90
          <a [class]="(isDisabled)?'uk-disabled uk-link-muted ':' portal-link '"
91
             [attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">
92
            <span *ngIf="isOpen">- View less</span>
93
          </a>
124
<!--          <a [class]="(isDisabled)?'uk-disabled uk-link-muted ':' portal-link '"-->
125
<!--             [attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">-->
126
<!--            <span *ngIf="isOpen">- View less</span>-->
127
<!--          </a>-->
94 128
        </div>
95 129
   </div>
96 130
  </div>
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/searchPages/searchUtils/searchPaging.component.ts
27 27
        <div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
28 28
          {{oldTotalResults|number}} {{type}}, page {{searchUtils.page | number}} of {{(totalPages(oldTotalResults)|number)}}
29 29
        </div-->
30
        <div class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > searchUtils.size">
30
        <div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand" *ngIf="results && searchUtils.totalResults > searchUtils.size">
31 31
          <paging [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults"  [baseUrl]="baseUrl" [size]="searchUtils.size"  [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
32 32
        </div>
33
        <div class="float-children-right-at-medium margin-small-top-at-small uk-width-1-1@s uk-width-1-2@m" *ngIf="!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING">
33
        <div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand" *ngIf="!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING">
34 34
          <paging [currentPage]="searchUtils.page" [totalResults]="oldTotalResults"  [baseUrl]="baseUrl" [size]="searchUtils.size"  [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
35 35
        </div>
36 36
      </div>
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/searchPages/searchUtils/no-load-paging.component.ts
1
import {Component, Input, Output, EventEmitter} from '@angular/core';
2
import {Observable}       from 'rxjs';
3
import {ErrorCodes} from '../../utils/properties/errorCodes';
4

  
5
@Component({
6
    selector: 'no-load-paging',
7
    template: `
8
        <div class="paging-hr searchPaging uk-margin-small-bottom">
9
            <div class="uk-panel uk-margin-small-top uk-grid  uk-flex uk-flex-middle">
10
                <div class="uk-width-1-1@s uk-width-1-2@m  uk-text-uppercase" *ngIf="type && totalResults">
11
                    {{totalResults}}
12
                    <span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
13
                    {{page}}
14
                    <span class="uk-text-muted uk-text-uppercase"> of </span>
15
                    {{paging.getTotalPages()}}
16
                </div>
17
                <div class="float-children-right-at-medium margin-small-top-at-small uk-width-expand">
18
                    <paging-no-load  #paging [currentPage]="page"
19
                                    customClasses="uk-margin-remove-bottom"
20
                                    [totalResults]="totalResults" [size]="pageSize"
21
                                    (pageChange)="updatePage($event)">
22
                    </paging-no-load>
23
                </div>
24
            </div>
25
        </div>
26
    `
27
})
28
export class NoLoadPagingComponent {
29
    @Input() type: string;
30
    @Input() page: number = 1;
31
    @Input() pageSize: number = 10;
32
    @Input() totalResults: number;
33
    @Output() pageChange: EventEmitter<any> = new EventEmitter<any>();
34
    
35
    public updatePage(event) {
36
        this.pageChange.emit({
37
            value: event.value
38
        });
39
    }
40
}
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/searchPages/searchUtils/searchFilter.component.ts
22 22
  @Output() modalChange = new EventEmitter();
23 23
  @Output() onFilterChange = new EventEmitter();
24 24
  keyword = "";
25
  sortBy = "num";
25
  sortBy = "name";
26 26

  
27 27
  public isOpen:boolean=false;
28 28

  
......
32 32
    ngOnInit() {}
33 33

  
34 34
    public _formatTitle(title,length){
35
      return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title+" ("+((length >= 99)?length+"+":length)+")")
35
      return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title+" ("+length+")")
36 36
    }
37 37
    public _formatName(value){
38 38
      //let maxLineLength = 24;
......
59 59
      return true;
60 60
    }
61 61
    filterChange(selected:boolean){
62
        if(selected){
63
            this.filter.countSelectedValues++;
64
        }else{
65
            this.filter.countSelectedValues--;
66
        }
67
        this.onFilterChange.emit({
68
            value: this.filter
69
          });
62
      if(selected){
63
          this.filter.countSelectedValues++;
64
      }else{
65
          this.filter.countSelectedValues--;
66
      }
67
      // this.onFilterChange.emit({
68
      //     value: this.filter
69
      // });
70 70
    }
71 71
    uniqueFilterChange(value: Value) {
72 72
      let tmp = value.selected;
......
78 78
        this.filter.countSelectedValues--;
79 79
      }
80 80

  
81
      this.onFilterChange.emit({
82
        value: this.filter
83
      });
81
      // this.onFilterChange.emit({
82
      //   value: this.filter
83
      // });
84 84
    }
85 85
    clearFilter() {
86 86
      for (var i=0; i < this.filter.values.length; i++){
......
91 91
        value: this.filter
92 92
      });
93 93
    }
94

  
95
  getSelectedAndTopValues(filter, topNum: number = 6):any{
96
    var values = [];
97

  
98
    for (let i=0; i < topNum; i++){
99
      if(filter.values.length <= i) {
100
        break;
101
      }
102
      values.push(filter.values[i]);
103
    }
104

  
105
    if(filter.countSelectedValues >0){
106
      for (let i=topNum; i < filter.values.length; i++){
107
        if(filter.values[i].selected){
108
          values.push(filter.values[i]);
109
        }
110
      }
111
    }
112

  
113
    return values;
114
  }
115

  
94 116
    getSelectedValues(filter, sortBy:string = "num"):any{
95 117
      var selected = [];
96 118
      if(filter.countSelectedValues >0){
......
141 163
      return notSselected;
142 164
    }
143 165

  
166
    sort(values: Value[]) {
167
      let sorted: Value[] = values.slice();
168
      if(this.sortBy == "name"){
169

  
170
        sorted.sort((n1,n2)=> {
171
          if (n1.name > n2.name) {
172
            return 1;
173
          }
174

  
175
          if (n1.name < n2.name) {
176
            return -1;
177
          }
178

  
179
          return 0;
180
        });
181
      }
182
      return sorted;
183
    }
184

  
144 185
  toggle() {
145 186
    this.isOpen = !this.isOpen;
146 187
  }
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/searchPages/searchUtils/newSearchPage.component.ts
360 360
              //console.log("checkSelectedRangeFilters: yearFrom: " + yearFrom + " - yearTo: "+yearTo);
361 361
              if(yearFrom) {
362 362
                filter.selectedFromValue = yearFrom;
363
                filter.selectedFromAndToValues = yearFrom;
364 363
              }
365
              if(yearFrom && yearTo) {
366
                filter.selectedFromAndToValues += "-";
367
              }
368 364
              if(yearTo) {
369 365
                filter.selectedToValue = yearTo;
370
                filter.selectedFromAndToValues += yearTo;
371 366
              }
367
              if(yearFrom && yearTo) {
368
                filter.selectedFromAndToValues = yearFrom + "-" + yearTo;
369
              } else if(yearFrom) {
370
                filter.selectedFromAndToValues = "from " + yearFrom;
371
              } else if(yearTo) {
372
                filter.selectedFromAndToValues = "until " + yearTo;
373
              }
374

  
372 375
              if(!yearFrom && !yearTo) {
373 376
                validDates = false;
374 377
              }
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/searchPages/searchUtils/searchPaging.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
1
import {NgModule} from '@angular/core';
2
import {CommonModule} from '@angular/common';
3
import {FormsModule} from '@angular/forms';
4 4

  
5
import{SearchPagingComponent} from './searchPaging.component';
6
import{PagingModule} from '../../utils/paging.module';
5
import {SearchPagingComponent} from './searchPaging.component';
6
import {PagingModule} from '../../utils/paging.module';
7 7

  
8 8
@NgModule({
9 9
  imports: [
......
11 11
  ],
12 12
  declarations: [
13 13
    SearchPagingComponent
14
],
15

  
16
  providers:[
17 14
  ],
18 15
  exports: [
19 16
    SearchPagingComponent
20

  
21
    ]
17
  ]
22 18
})
23
export class SearchPagingModule { }
19
export class SearchPagingModule {
20
}
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/landingPages/landing-utils/landing-header/landing-header.component.ts
28 28
        <span [innerHTML]="subTitle"></span>
29 29
      </div>
30 30
      <div *ngIf="authors" class="uk-margin-small-bottom uk-margin-small-top">
31
        <showAuthors [authors]="authors" [small]="false"></showAuthors>
31
        <showAuthors [authorsLimit]="authorLimit" [showAll]="showAllAuthors" [authors]="authors" [small]="false"></showAuthors>
32 32
      </div>
33 33
    </div>`
34 34
})
......
41 41
  @Input() title: string;
42 42
  @Input() subTitle: string;
43 43
  @Input() authors: Author[];
44
  @Input() authorLimit: number = 30;
45
  @Input() showAllAuthors: boolean = true;
44 46
  
45 47
  public removeUnknown(array: string[], type: boolean = false): string[] {
46 48
    if (type) {
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/landingPages/landing-utils/availableOn.component.ts
32 32
          </div>
33 33
          <div *ngIf="available.collectedName" class="uk-text-small provider">
34 34
            <span>Provider: </span>
35
            <a routerLink="/search/dataprovider" [queryParams]="{datasourceId: available.collectedId}">
35
            <a *ngIf="available.collectedId" routerLink="/search/dataprovider" [queryParams]="{datasourceId: available.collectedId}">
36 36
              {{available.collectedName}}
37 37
            </a>
38
            <span *ngIf="!available.collectedId">
39
              {{available.collectedName}}
40
            </span>
38 41
          </div>
39 42
        </div>
40 43
      </div>
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/landingPages/result/resultLanding.component.html
16 16
            <!-- schema.org-->
17 17
            <schema2jsonld *ngIf="resultLandingInfo.record" [data]=resultLandingInfo.record
18 18
                           [URL]="properties.baseLink+linkToLandingPage+id"></schema2jsonld>
19
            <landing-header [properties]="properties" [title]="resultLandingInfo.title" [subTitle]="resultLandingInfo.subtitle"
19
            <landing-header [properties]="properties" [title]="resultLandingInfo.title"
20
                            [subTitle]="resultLandingInfo.subtitle"
20 21
                            [entityType]="getTypeName()" [types]="resultLandingInfo.types"
21 22
                            [year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
22 23
            </landing-header>
23 24
            <div *ngIf="properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds"
24 25
                 class="uk-text-muted uk-text-small uk-text-right">
25
              <a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}} versions</a>
26
              <a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}}
27
                versions</a>
26 28
            </div>
27 29
            <div class="uk-margin-small-bottom uk-margin-small-top">
28 30
              <showAuthors [authors]="resultLandingInfo.authors" [small]="false"></showAuthors>
......
133 135
                   uk-height-match="target: .target; row: false"
134 136
                   uk-grid>
135 137
                <div *ngIf="resultLandingInfo.relatedResearchResults">
136
                  <div  class="clickable">
138
                  <div class="clickable">
137 139
                    <div class="header target uk-text-bold">Related Research Results</div>
138 140
                    <div class="footer target uk-position-relative">
139 141
                      <span class="uk-text-bold uk-position-center">{{relatedResearchResultsNum | number}}</span>
......
141 143
                  </div>
142 144
                </div>
143 145
                <div *ngIf="resultLandingInfo.supplementaryResearchResults">
144
                  <div  class="clickable">
146
                  <div class="clickable">
145 147
                    <div class="header target uk-text-bold">Supplementary Research Results</div>
146 148
                    <div class="footer target uk-position-relative">
147
                      <span class="uk-text-bold uk-position-center">{{resultLandingInfo.supplementaryResearchResults.length | number}}</span>
149
                      <span
150
                          class="uk-text-bold uk-position-center">{{resultLandingInfo.supplementaryResearchResults.length | number}}</span>
148 151
                    </div>
149 152
                  </div>
150 153
                </div>
151 154
                <div *ngIf="resultLandingInfo.supplementedByResearchResults">
152
                  <div  class="clickable">
153
                    <div class="header target uk-text-bold">Research Results supplemented by this {{getTypeName()}}</div>
155
                  <div class="clickable">
156
                    <div class="header target uk-text-bold">Research Results supplemented by
157
                      this {{getTypeName()}}</div>
154 158
                    <div class="footer target uk-position-relative">
155
                      <span class="uk-text-bold uk-position-center">{{resultLandingInfo.supplementedByResearchResults.length | number}}</span>
159
                      <span
160
                          class="uk-text-bold uk-position-center">{{resultLandingInfo.supplementedByResearchResults.length | number}}</span>
156 161
                    </div>
157 162
                  </div>
158 163
                </div>
159 164
                <div *ngIf="resultLandingInfo.similarResearchResults">
160
                  <div  class="clickable">
165
                  <div class="clickable">
161 166
                    <div class="header target uk-text-bold">Similar Research Results</div>
162 167
                    <div class="footer target uk-position-relative">
163
                      <span class="uk-text-bold uk-position-center">{{resultLandingInfo.similarResearchResults.length | number}}</span>
168
                      <span
169
                          class="uk-text-bold uk-position-center">{{resultLandingInfo.similarResearchResults.length | number}}</span>
164 170
                    </div>
165 171
                  </div>
166 172
                </div>
167 173
                <div *ngIf="resultLandingInfo.organizations">
168
                  <div  class="clickable">
174
                  <div class="clickable">
169 175
                    <div class="header target uk-text-bold">Related Organizations</div>
170 176
                    <div class="footer target uk-position-relative">
171
                      <span class="uk-text-bold uk-position-center">{{resultLandingInfo.organizations.length | number}}</span>
177
                      <span
178
                          class="uk-text-bold uk-position-center">{{resultLandingInfo.organizations.length | number}}</span>
172 179
                    </div>
173 180
                  </div>
174 181
                </div>
......
191 198
                                      (pageChange)="updateReferencesPage($event)"></paging-no-load>
192 199
                    </div>
193 200

  
194
                    <div *ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
201
                    <div
202
                        *ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
195 203
                      <p *ngIf=" item && item['url']"
196 204
                         class="custom-external custom-icon">
197 205
                        <a href="{{item['url']}}" target="_blank">
......
500 508
                <addThis></addThis>
501 509
              </div>
502 510
              <!-- Download From -->
503
              <div *ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0"
511
              <div
512
                  *ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0"
504 513
                  class="uk-margin-top">
505
                <availableOn [properties]="properties" [availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
514
                <availableOn [properties]="properties"
515
                             [availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
506 516
              </div>
507 517
              <!-- Metrics -->
508 518
              <div *ngIf="hasAltMetrics" class="uk-margin-top">
......
532 542
    </div>
533 543
  </div>
534 544
  <modal-alert *ngIf="resultLandingInfo && resultLandingInfo.deletedByInferenceIds"
535
               #AlertModalDeletedByInference classBody="uk-width-xxlarge">
536
    <deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened"
537
                        [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
538
                        [ids]="resultLandingInfo.deletedByInferenceIds"
539
                        [type]="'publications'"></deletedByInference>
540
    <deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
541
                        [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
542
                        [ids]="resultLandingInfo.deletedByInferenceIds"
543
                        [type]="'research data'"></deletedByInference>
544
    <deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
545
                        [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
546
                        [ids]="resultLandingInfo.deletedByInferenceIds"
547
                        [type]="'software'"></deletedByInference>
548
    <deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
549
                        [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
550
                        [ids]="resultLandingInfo.deletedByInferenceIds"
551
                        [type]="'other research products'"></deletedByInference>
545
               #AlertModalDeletedByInference classBody="uk-width-xxlarge uk-padding-remove-right">
546
    <landing-header [properties]="properties" [title]="resultLandingInfo.title"
547
                    [subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
548
                    [entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
549
                    [year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
550
    </landing-header>
551
    <div class="uk-margin-medium-top uk-margin-medium-right">
552
      <deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened"
553
                          [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
554
                          [ids]="resultLandingInfo.deletedByInferenceIds"
555
                          [resultType]="type" [type]="'publications'"></deletedByInference>
556
      <deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
557
                          [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
558
                          [ids]="resultLandingInfo.deletedByInferenceIds"
559
                          [resultType]="'research data'" [type]="'research data'"></deletedByInference>
560
      <deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
561
                          [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
562
                          [ids]="resultLandingInfo.deletedByInferenceIds"
563
                          [resultType]="type" [type]="'software'"></deletedByInference>
564
      <deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
565
                          [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
566
                          [ids]="resultLandingInfo.deletedByInferenceIds"
567
                          [resultType]="'other research outcome'" [type]="'other research outcomes'"></deletedByInference>
568
    </div>
552 569
  </modal-alert>
553
  <modal-alert *ngIf="resultLandingInfo && resultLandingInfo.references" classBody="uk-width-xxlarge uk-padding-remove-right"
570
  <modal-alert *ngIf="resultLandingInfo && resultLandingInfo.references"
571
               classBody="uk-width-xxlarge uk-padding-remove-right"
554 572
               #referencesModal>
555
    <landing-header class="uk-margin-bottom" [properties]="properties" [title]="resultLandingInfo.title" [subTitle]="resultLandingInfo.subtitle"
573
    <landing-header [properties]="properties" [title]="resultLandingInfo.title"
574
                    [subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
556 575
                    [entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
557 576
                    [year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
558 577
    </landing-header>
559 578
    <div class="uk-margin-medium-top uk-margin-medium-right">
560
      <div class="search-hr uk-flex uk-flex-middle uk-margin-small-bottom">
561
        <div class="uk-width-1-2 uk-text-uppercase">
562
          {{resultLandingInfo.references.length}}
563
          <span class="uk-text-muted">references, page</span>
564
          {{referencesPage}}
565
          <span class="uk-text-muted">of</span>
566
          {{paging.getTotalPages()}}
567
        </div>
568
        <div class="uk-width-expand">
569
          <paging-no-load class="uk-float-right" #paging [currentPage]="referencesPage" customClasses="uk-margin-remove-bottom"
570
                          [totalResults]="resultLandingInfo.references.length" [size]="pageSize"
571
                          (pageChange)="updateReferencesPage($event)"></paging-no-load>
572
        </div>
573
      </div>
574
      <div *ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
579
      <no-load-paging *ngIf="resultLandingInfo.references.length > pageSize" [type]="'references'"
580
                      (pageChange)="updateReferencesPage($event)"
581
                      [page]="referencesPage" [pageSize]="pageSize"
582
                      [totalResults]="resultLandingInfo.references.length">
583
      </no-load-paging>
584
      <div
585
          *ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
575 586
        <p *ngIf="item">
576 587
          {{item['name']}}
577 588
          <span *ngIf="item.url">
......
579 590
          </span>
580 591
        </p>
581 592
      </div>
582
      <div class="search-hr uk-flex uk-flex-middle uk-margin-small-bottom">
583
        <div class="uk-width-1-2 uk-text-uppercase">
584
          <span class="uk-text-muted">page</span> {{referencesPage}}
585
          <span class="uk-text-muted">of</span> {{paging.getTotalPages()}}
586
        </div>
587
        <div class="uk-width-expand">
588
          <paging-no-load class="uk-float-right" #paging [currentPage]="referencesPage" customClasses="uk-margin-remove-bottom"
589
                          [totalResults]="resultLandingInfo.references.length" [size]="pageSize"
590
                          (pageChange)="updateReferencesPage($event)"></paging-no-load>
591
        </div>
592
      </div>
593
      <no-load-paging *ngIf="resultLandingInfo.references.length > pageSize" [type]="'references'"
594
                      (pageChange)="updateReferencesPage($event)"
595
                      [page]="referencesPage" [pageSize]="pageSize"
596
                      [totalResults]="resultLandingInfo.references.length">
597
      </no-load-paging>
593 598
    </div>
594 599
  </modal-alert>
595 600
</div>
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/landingPages/result/deletedByInference/deletedByInference.component.ts
1
import {Component, ViewChild}         from '@angular/core';
2
import {ElementRef, Input}            from '@angular/core';
3
import {ActivatedRoute, Router}       from '@angular/router';
1
import {Component, ViewChild} from '@angular/core';
2
import {ElementRef, Input} from '@angular/core';
3
import {ActivatedRoute, Router} from '@angular/router';
4 4

  
5
import {EnvProperties}                from '../../../utils/properties/env-properties';
6
import {ResultLandingInfo}     from '../../../utils/entities/resultLandingInfo';
7
import {RouterHelper}                 from '../../../utils/routerHelper.class';
8
import {ErrorCodes}                   from '../../../utils/properties/errorCodes';
5
import {EnvProperties} from '../../../utils/properties/env-properties';
6
import {ResultLandingInfo} from '../../../utils/entities/resultLandingInfo';
7
import {RouterHelper} from '../../../utils/routerHelper.class';
8
import {ErrorCodes} from '../../../utils/properties/errorCodes';
9 9

  
10
import {DeletedByInferenceService}    from './deletedByInference.service';
10
import {DeletedByInferenceService} from './deletedByInference.service';
11
import {SearchResult} from "../../../utils/entities/searchResult";
12
import {ResultPreview} from "../../../utils/result-preview/result-preview";
11 13

  
12 14
@Component({
13
    selector: 'deletedByInference',
14
    template: `
15
  selector: 'deletedByInference',
16
  template: `
15 17
    <errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
16

  
17
    <div>
18
      <div *ngIf="results.length > pageSize" class="uk-margin-bottom">
19
        <span class="uk-h6">{{results.length | number}} {{type}}, page {{page | number}} of {{totalPages(results.length) | number}}</span>
20
        <paging-no-load class="uk-float-right" [currentPage]="page" [totalResults]="results.length" [size]="pageSize" (pageChange)="updatePage($event)"></paging-no-load>
21
      </div>
22
      <search-result [properties]="properties" [results]="results"></search-result>
23
      <ul class="uk-list uk-list-divider  uk-margin">
24
        <li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
25
          <h5 *ngIf="result.title" class="uk-margin-remove-bottom">
26
            <span [innerHTML]="result.title"></span>
27
          </h5>
28
          <h5 *ngIf="!result.title">
29
            <span>[no title available]</span>
30
          </h5>
31

  
32
          <span *ngIf="result.types && result.types.length > 0" class="uk-label custom-label label-blue label-publication" title="Type">{{result.types.join(", ")}}</span>{{" "}}
33
          <span *ngIf="result.languages && result.languages.length > 0" class="uk-label custom-label  label-language " title="Language">{{result.languages.join(", ")}}</span>{{" "}}
34
          <span *ngIf="result.countries && result.countries.length > 0" class="uk-label custom-label  label-country " title="Country">{{result.countries.join(", ")}}</span>{{" "}}
35
          <span *ngIf="result.accessMode" [class]="'uk-label custom-label  label-'+ result.accessMode " title="Access Mode">{{result.accessMode}}</span>{{" "}}
36

  
37
          <div>
38
              <showAuthors [authors]="result.authors"></showAuthors>
39
              <span *ngIf="result.date != ''">({{result.date}})</span>
40
          </div>
41

  
42
          <div *ngIf="result.identifiers && result.identifiers.size > 0">
43
            <showIdentifiers [identifiers]="result.identifiers"></showIdentifiers>
44
          </div>
45

  
46
          <div *ngIf="result.hostedBy_collectedFrom != undefined && result.hostedBy_collectedFrom.length > 0">
47
            <span class="uk-text-bold"> Download From: </span>
48
            <span *ngFor="let available of result.hostedBy_collectedFrom let i=index">
49
              <span *ngIf="available.downloadUrl.length > 1"
50
                    class="custom-external custom-icon">
51
                    {{available.downloadName}}
52
                <span *ngFor="let url of available.downloadUrl; let i=index;">
53
                    <a  href="{{url}}" target="_blank"
54
                        attr.uk-tooltip="pos:right; delay:10">
55
                        [{{(i+1) | number}}]
56
                    </a>
57
                </span>
58
              </span><a
59
              class="custom-external custom-icon"
60
                  *ngIf="available['downloadUrl'].length == 1"
61
                  href="{{available['downloadUrl']}}"
62
                  target="_blank"
63
                  attr.uk-tooltip="pos:right; delay:10">
64
                  {{available.downloadName}}</a><span
65
              *ngIf="i < result['hostedBy_collectedFrom'].length-1">,</span>
66
            </span>
67
            <span *ngIf="result['hostedBy_collectedFrom'].length > 15">...</span>
68
          </div>
69

  
70
          <div *ngIf="result.description" class="uk-margin-bottom uk-text-justify descriptionText">
71
            {{result.description}}
72
          </div>
73

  
74

  
75

  
76
        </li>
77
      </ul>
78
    </div>
79
    `
18
    <no-load-paging *ngIf="results.length > pageSize" [type]="type"
19
                    (pageChange)="updatePage($event)"
20
                    [page]="page" [pageSize]="pageSize"
21
                    [totalResults]="results.length">
22
    </no-load-paging>
23
    <ul class="uk-list uk-list-divider  uk-margin">
24
      <li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
25
        <result-preview [properties]="properties" [result]="getResultPreview(result)"></result-preview>
26
      </li>
27
    </ul>
28
    <no-load-paging *ngIf="results.length > pageSize" [type]="type"
29
                    (pageChange)="updatePage($event)"
30
                    [page]="page" [pageSize]="pageSize"
31
                    [totalResults]="results.length">
32
    </no-load-paging>
33
  `
80 34
})
81 35

  
82 36
export class DeletedByInferenceComponent {
......
84 38
  @Input() id: string;
85 39
  @Input() ids: string[] = [];
86 40
  @Input() type: string;
87

  
41
  @Input() resultType: string;
42
  
88 43
  // Custom tab paging variables
89 44
  public page: number = 1;
90 45
  public pageSize: number = 5;
91

  
46
  
92 47
  public status: number;
93
  public routerHelper:RouterHelper = new RouterHelper();
94
  public errorCodes:ErrorCodes = new ErrorCodes();
95

  
48
  public routerHelper: RouterHelper = new RouterHelper();
49
  public errorCodes: ErrorCodes = new ErrorCodes();
50
  
96 51
  sub: any;
97
  properties:EnvProperties;
98

  
99
  constructor ( private element: ElementRef,
100
                private _deletedByInferenceService: DeletedByInferenceService,
101
                private route: ActivatedRoute,
102
                private _router: Router) {
52
  properties: EnvProperties;
53
  
54
  constructor(private element: ElementRef,
55
              private _deletedByInferenceService: DeletedByInferenceService,
56
              private route: ActivatedRoute,
57
              private _router: Router) {
103 58
  }
104

  
59
  
105 60
  ngOnInit() {
106 61
    this.route.data
107 62
      .subscribe((data: { envSpecific: EnvProperties }) => {
108
         this.properties = data.envSpecific;
109

  
63
        this.properties = data.envSpecific;
64
        
110 65
      });
111
       this.sub =  this.route.queryParams.subscribe(data => {
112
         this.errorCodes = new ErrorCodes();
113
         this.status = this.errorCodes.LOADING;
114

  
115
         this.getDeletedByInference();
66
    this.sub = this.route.queryParams.subscribe(data => {
67
      this.errorCodes = new ErrorCodes();
68
      this.status = this.errorCodes.LOADING;
69
      
70
      this.getDeletedByInference();
116 71
    });
117 72
  }
118

  
119
  ngOnDestroy() {}
120

  
73
  
74
  ngOnDestroy() {
75
  }
76
  
121 77
  getDeletedByInference() {
122 78
    this.results = [];
123 79
    this.status = this.errorCodes.LOADING;
124
/*
125
    if(this.ids) {
126
      var allRequests = [];
127
      for(let id of this.ids) {
128
        allRequests.push(this._deletedByInferenceService.getDeletedByInferencePublications(id, this.properties));
129
      }
130

  
131
      zip.apply(null, allRequests).subscribe(
132
     //   this._deletedByInferenceService.getDeletedByInferencePublications(id, this.properties).subscribe(
133
         data => {
134
           this.results = data;
135
           this.status = this.errorCodes.DONE;
136
         },
137
         error => {
138
           if(error.status == '404') {
139
             this.status = this.errorCodes.NOT_FOUND;
140
           } else if(error.status == '500') {
141
             this.status = this.errorCodes.ERROR;
142
           } else {
143
             this.status = this.errorCodes.NOT_AVAILABLE;
144
           }
80
    /*
81
        if(this.ids) {
82
          var allRequests = [];
83
          for(let id of this.ids) {
84
            allRequests.push(this._deletedByInferenceService.getDeletedByInferencePublications(id, this.properties));
85
          }
86
    
87
          zip.apply(null, allRequests).subscribe(
88
         //   this._deletedByInferenceService.getDeletedByInferencePublications(id, this.properties).subscribe(
89
             data => {
90
               this.results = data;
91
               this.status = this.errorCodes.DONE;
92
             },
93
             error => {
94
               if(error.status == '404') {
95
                 this.status = this.errorCodes.NOT_FOUND;
96
               } else if(error.status == '500') {
97
                 this.status = this.errorCodes.ERROR;
98
               } else {
99
                 this.status = this.errorCodes.NOT_AVAILABLE;
100
               }
101
             }
102
           );
145 103
         }
146
       );
147
     }
148
 */
104
     */
149 105
    this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe(
150 106
      data => {
151 107
        this.results = data;
152 108
        this.status = this.errorCodes.DONE;
153 109
      },
154 110
      error => {
155
        if(error.status == '404') {
111
        if (error.status == '404') {
156 112
          this.status = this.errorCodes.NOT_FOUND;
157
        } else if(error.status == '500') {
113
        } else if (error.status == '500') {
158 114
          this.status = this.errorCodes.ERROR;
159 115
        } else {
160 116
          this.status = this.errorCodes.NOT_AVAILABLE;
......
162 118
      }
163 119
    );
164 120
  }
165

  
121
  
122
  public getResultPreview(result: ResultLandingInfo): ResultPreview {
123
    return ResultPreview.resultLandingInfoConvert(result, this.resultType);
124
  }
125
  
166 126
  public totalPages(totalResults: number): number {
167
    let totalPages:any = totalResults/this.pageSize;
168
    if(!(Number.isInteger(totalPages))) {
169
        totalPages = (parseInt(totalPages, this.pageSize) + 1);
127
    let totalPages: any = totalResults / this.pageSize;
128
    if (!(Number.isInteger(totalPages))) {
129
      totalPages = (parseInt(totalPages, this.pageSize) + 1);
170 130
    }
171 131
    return totalPages;
172 132
  }
173

  
133
  
174 134
  public updatePage($event) {
175 135
    this.page = $event.value;
176 136
  }
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/landingPages/result/deletedByInference/deletedByInference.module.ts
12 12
 import {ErrorMessagesModule} from '../../../utils/errorMessages.module';
13 13
import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module";
14 14
import {SearchResultsModule} from "../../../searchPages/searchUtils/searchResults.module";
15
import {NoLoadPaging} from "../../../searchPages/searchUtils/no-load-paging.module";
16
import {ResultPreviewModule} from "../../../utils/result-preview/result-preview.module";
15 17

  
16 18
@NgModule({
17 19
  imports: [
18 20
    CommonModule, FormsModule, ResultLandingUtilsModule,
19
    PagingModule, ErrorMessagesModule, ShowAuthorsModule, SearchResultsModule
21
    PagingModule, ErrorMessagesModule, ShowAuthorsModule, SearchResultsModule, NoLoadPaging, ResultPreviewModule
20 22
  ],
21 23
  declarations: [
22 24
    DeletedByInferenceComponent
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/landingPages/result/resultLanding.component.ts
448 448
    this.deleteByInferenceOpened = true;
449 449
    this.alertModalDeletedByInference.cancelButton = false;
450 450
    this.alertModalDeletedByInference.okButton = false;
451
    this.alertModalDeletedByInference.alertTitle = "Other versions";
451
    this.alertModalDeletedByInference.alertTitle = "Other versions of";
452 452
    this.alertModalDeletedByInference.open();
453 453
  }
454 454
  
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/landingPages/result/resultLanding.module.ts
26 26
import {AlertModalModule}             from "../../utils/modal/alertModal.module";
27 27
import {AnnotationModule} from "../annotation/annotation.module";
28 28
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
29
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
29 30

  
30 31
@NgModule({
31 32
  imports: [
32 33
    CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
33 34
    CiteThisModule, PagingModule, IFrameModule,
34 35
    MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
35
    DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, AnnotationModule, LandingHeaderModule
36
    DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, AnnotationModule, LandingHeaderModule, NoLoadPaging
36 37
  ],
37 38
  declarations: [
38 39
    ResultLandingComponent
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/utils/result-preview/result-preview.component.html
18 18
</div>
19 19
<!-- Title -->
20 20
<div class="uk-h5 uk-margin-remove">
21
  <a [queryParams]="routerHelper.createQueryParam(urlParam, result.id)"
21
  <a *ngIf="result.id" [queryParams]="routerHelper.createQueryParam(urlParam, result.id)"
22 22
     routerLink="/search/{{result.resultType}}" class="portal-link">
23 23
    <div *ngIf="(result.title) || result.acronym">
24 24
      <span *ngIf="result.acronym">
......
32 32
      [no title available]
33 33
    </div>
34 34
  </a>
35
  <div *ngIf="!result.id">
36
    <div *ngIf="(result.title) || result.acronym">
37
      <span *ngIf="result.acronym">
38
        {{result.acronym}}
39
      </span>
40
      <span *ngIf="result.acronym && (result.title)"> (</span>
41
      <span *ngIf="result.title" [innerHTML]="result.title"></span>
42
      <span *ngIf="result.acronym && result.title">)</span>
43
    </div>
44
    <div *ngIf="!result.title && !result.acronym">
45
      [no title available]
46
    </div>
47
  </div>
35 48
</div>
49
<!-- Download from-->
50
<div *ngIf="result.hostedBy_collectedFrom && result.hostedBy_collectedFrom.length > 0" class="uk-margin-small-bottom download-from">
51
  <div *ngFor="let from of result.hostedBy_collectedFrom">
52
    <span class="uk-margin-right uk-display-inline-block">
53
      <span class="uk-text-muted">Download from: </span>
54
      <a *ngIf="from.downloadUrl && from.downloadUrl.length === 1"
55
         [href]="from.downloadUrl[0]" target="_blank" class="title">
56
        {{from.downloadName}}
57
        <span class="custom-external"></span>
58
      </a>
59
      <span *ngIf="!from.downloadUrl || from.downloadUrl.length === 0" class="title">
60
        {{from.downloadName}}
61
      </span>
62
    </span>
63
    <span class="provider uk-display-inline-block">
64
      <span class="uk-text-muted">Provider: </span>
65
      <a *ngIf="from.collectedId" routerLink="/search/dataprovider" [queryParams]="{datasourceId: from.collectedId}"
66
         [href]="from.downloadUrl[0]" target="_blank">
67
        {{from.collectedName}}
68
      </a>
69
      <span *ngIf="!from.collectedId">
70
        {{from.collectedName}}
71
      </span>
72
    </span>
73
  </div>
74
</div>
36 75
<!-- Authors -->
37 76
<div *ngIf="result.authors" class="uk-margin-small-bottom">
38 77
  <showAuthors [authors]="result.authors" [authorsLimit]=10 [showAll]=false></showAuthors>
......
102 141
    {{result.compatibility}}
103 142
  </span>{{' '}}
104 143
</div>
144
<!-- Identifiers -->
145
<div *ngIf="result.identifiers && result.identifiers.size > 0">
146
  <showIdentifiers [identifiers]="result.identifiers"></showIdentifiers>
147
</div>
105 148
<!-- Publisher -->
106 149
<div *ngIf="result.publisher && result.publisher != ''" class="uk-text-small uk-margin-small-bottom">
107 150
  <span class="uk-text-muted">Publisher: </span>
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/utils/result-preview/result-preview.ts
52 52
  resultType: string;
53 53
  types: string[];
54 54
  
55
  public static searchResultConvert(result: SearchResult, type: string) {
55
  public static searchResultConvert(result: SearchResult, type: string): ResultPreview {
56 56
    let resultPreview: ResultPreview = new ResultPreview();
57 57
    resultPreview.id = result.id;
58 58
    resultPreview.title = result.title.name;
......
96 96
    return resultPreview;
97 97
  }
98 98
  
99
  public static resultLandingInfoConvert(result: ResultLandingInfo, type: string) {
99
  public static resultLandingInfoConvert(result: ResultLandingInfo, type: string): ResultPreview  {
100 100
    let resultPreview: ResultPreview = new ResultPreview();
101 101
    resultPreview.title = result.title;
102 102
    resultPreview.accessMode = result.accessMode;
103 103
    resultPreview.countries = result.countries;
104 104
    resultPreview.projects = result.fundedByProjects;
105 105
    resultPreview.description = result.description;
106
    resultPreview.year = result.dateofacceptance.getFullYear().toString();
106
    if(result.dateofacceptance) {
107
      resultPreview.year = new Date(result.dateofacceptance).getFullYear().toString();
108
    }
107 109
    resultPreview.embargoEndDate = result.embargoEndDate;
108 110
    resultPreview.authors = result.authors;
109 111
    resultPreview.languages = result.languages;
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/utils/result-preview/result-preview.module.ts
3 3
import {ResultPreviewComponent} from "./result-preview.component";
4 4
import {RouterModule} from "@angular/router";
5 5
import {ShowAuthorsModule} from "../authors/showAuthors.module";
6
import {ResultLandingUtilsModule} from "../../landingPages/landing-utils/resultLandingUtils.module";
6 7

  
7 8
@NgModule({
8
  imports: [CommonModule, RouterModule, ShowAuthorsModule],
9
  imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule],
9 10
  declarations: [ResultPreviewComponent],
10 11
  exports: [ResultPreviewComponent]
11 12
})
modules/uoa-services-library/branches/landing-redesign/ng-openaire-library/src/app/utils/paging.module.ts
1
import { NgModule }            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
4
import { RouterModule } from '@angular/router';
1
import {NgModule} from '@angular/core';
2
import {CommonModule} from '@angular/common';
3
import {FormsModule} from '@angular/forms';
4
import {RouterModule} from '@angular/router';
5 5

  
6 6
import {pagingFormatterNoLoad} from './pagingFormatterNoLoad.component';
7 7

  
......
15 15
  declarations: [
16 16
    pagingFormatterNoLoad,
17 17
    PagingFormatter,
18

  
19

  
20 18
  ],
21 19
  exports: [
22
      pagingFormatterNoLoad,
23
      PagingFormatter,
24

  
25

  
26
    ]
20
    pagingFormatterNoLoad,
21
    PagingFormatter,
22
  ]
27 23
})
28
export class PagingModule { }
24
export class PagingModule {}

Also available in: Unified diff