[Trunk | Library]:

1. advancedSearchForm.component.html & newSearchPage.component.html & searchDownload.component.ts & 
      searchPaging.component.ts & searchResultsPerPage.component.ts & searchSorting.component.ts & pagingFormatter.component.ts:
  Fix margin, padding and new view according to search redesign.
2. searchDownload.component.ts: Remove 'type' parameter in request (in next commit, type is added from search pages).


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58130 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-02-24 13:33:34 +00:00
parent e11f388087
commit b7d1f6bbb0
7 changed files with 119 additions and 69 deletions

View File

@ -112,7 +112,7 @@
</form>
<div *ngIf="simpleView">
<form class=" uk-margin uk-margin-top ">
<form class=" uk-margin-medium-bottom uk-margin-top ">
<div class="uk-grid">
<div>
<entities-selection [simpleView]="true" [currentEntity]="entityType"

View File

@ -34,16 +34,38 @@
<div id="tm-main" class=" tm-middle">
<div uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container uk-container-large">
<div class="uk-container uk-container-large uk-margin-medium-top">
<div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" [texts]="pageContents['top']"></helper>
<div [class]="(showRefine)? 'uk-width-4-5@m uk-width-4-5@l uk-width-1-1@s' :'uk-width-1-1'">
<div *ngIf="showRefine" class="uk-offcanvas-content uk-hidden@m">
<div *ngIf="showRefine" class="uk-offcanvas-content uk-hidden@m uk-margin-top">
<a href="#offcanvas-usage" uk-toggle><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="6" y="4" width="12" height="1"></rect><rect x="6" y="9" width="12" height="1"></rect><rect x="6" y="14" width="12" height="1"></rect><rect x="2" y="4" width="2" height="1"></rect><rect x="2" y="9" width="2" height="1"></rect><rect x="2" y="14" width="2" height="1"></rect></svg></a>
<a href="#offcanvas-usage" uk-toggle>
<span class="uk-icon uk-margin-small-right uk-margin-small-left">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="settings">
<ellipse fill="none" stroke="#000" cx="6.11" cy="3.55" rx="2.11" ry="2.15"></ellipse>
<ellipse fill="none" stroke="#000" cx="6.11" cy="15.55" rx="2.11" ry="2.15"></ellipse>
<circle fill="none" stroke="#000" cx="13.15" cy="9.55" r="2.15"></circle>
<rect x="1" y="3" width="3" height="1"></rect>
<rect x="10" y="3" width="8" height="1"></rect>
<rect x="1" y="9" width="8" height="1"></rect>
<rect x="15" y="9" width="3" height="1"></rect>
<rect x="1" y="15" width="3" height="1"></rect>
<rect x="10" y="15" width="8" height="1"></rect>
</svg>
</span>
<span>Filters <span *ngIf="(selectedRangeFilters+selectedFilters) > 0">({{(selectedRangeFilters+selectedFilters)}})</span></span>
<!-- <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1">-->
<!-- <rect x="6" y="4" width="12" height="1"></rect><rect x="6" y="9" width="12" height="1"></rect>-->
<!-- <rect x="6" y="14" width="12" height="1"></rect>-->
<!-- <rect x="2" y="4" width="2" height="1"></rect>-->
<!-- <rect x="2" y="9" width="2" height="1"></rect>-->
<!-- <rect x="2" y="14" width="2" height="1"></rect>-->
<!-- </svg>-->
</a>
<div id="offcanvas-usage" uk-offcanvas>
<div id="offcanvas-usage" uk-offcanvas overlay style="z-index:10000;">
<div class="uk-offcanvas-bar">
<button class="uk-offcanvas-close" type="button" uk-close></button>
<div class="uk-width-1-1 uk-margin-small-bottom uk-margin-top">
@ -146,8 +168,8 @@
</div>
</div>
<div class="uk-width-1-1 uk-grid helper-grid uk-padding-small uk-padding-remove-top" >
<div *ngIf="showRefine" class="uk-margin-top uk-width-1-4@m search-filters uk-visible@m">
<div class="uk-grid helper-grid uk-padding-small uk-padding-remove-vertical uk-margin-large-bottom" >
<div *ngIf="showRefine" class="uk-width-1-4@m search-filters uk-visible@m">
<!-- top: #container-1; bottom: #true; -->
<!-- <div id="container-1" style="z-index: -1;" uk-sticky="top: #container-1; offset: 120; "> -->
<span *ngIf="tableViewLink" class="uk-width-expand">
@ -158,12 +180,12 @@
<span uk-tooltip="title: List view" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
</span>
</span>
<search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0 && ( entityType !=
'community' && entityType != 'funder') && usedBy == 'search'"
class="uk-width-1-2" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">
</search-download>
<div class="uk-width-1-1 uk-margin-small-bottom ">
<div *ngIf="selectedRangeFilters > 0 || selectedFilters > 0" class="uk-grid uk-flex uk-flex-bottom uk-margin-top">
<!-- <search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0 && ( entityType !=-->
<!-- 'community' && entityType != 'funder') && usedBy == 'search'"-->
<!-- class="uk-width-1-2" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">-->
<!-- </search-download>-->
<div *ngIf="selectedRangeFilters > 0 || selectedFilters > 0" class="uk-width-1-1 uk-margin-top uk-margin-small-bottom ">
<div class="uk-grid uk-flex uk-flex-bottom uk-margin-small-top">
<h5 class="uk-text-bold">Filters</h5>
<a *ngIf="(selectedRangeFilters+selectedFilters)>1" (click)="clearFilters()" [class]="((disableForms)?'uk-disabled uk-link-muted':'')+' portal-link ' + 'uk-width-1-2'">
Clear All
@ -238,16 +260,25 @@
<div *ngIf="openaireLink"> <a class="uk-margin-top uk-button uk-button-text" [href]=openaireLink target="_blank" >Results in OpenAIRE</a></div>
<div class="uk-align-center uk-margin-remove-bottom">
<div *ngIf="(results && searchUtils.totalResults > 0) || (!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING)"
class="uk-grid uk-margin-top uk-margin-bottom">
<search-results-per-page class="uk-width-1-2@m uk-width-1-1" [(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"></search-results-per-page>
<search-sorting class="uk-width-1-2@m uk-width-1-1" *ngIf="sort" [(sortBy)]="searchUtils.sortBy" (sortByChange)="sortByChanged($event)"></search-sorting>
class="uk-grid uk-margin-small-top uk-margin-bottom">
<div class="uk-width-expand@m uk-grid uk-grid-medium uk-margin-small-bottom">
<search-results-per-page [(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"></search-results-per-page>
<search-sorting *ngIf="sort" [(sortBy)]="searchUtils.sortBy" (sortByChange)="sortByChanged($event)"></search-sorting>
</div>
<div class="uk-flex uk-flex-middle uk-width-auto@m uk-margin-small-bottom">
<search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0
&& ( entityType !='community' && entityType != 'funder') && usedBy == 'search'"
[loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils"
[type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">
</search-download>
</div>
</div>
<search-paging [type]="type" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "searchUtils.baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
</div>
<search-download class="uk-width-1-1@s uk-hidden@m" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" ></search-download>
<div *ngIf="(searchUtils.page <= pagingLimit)" class="">
<div *ngIf="(searchUtils.page <= pagingLimit)" class="uk-margin-large-bottom">
<search-result [results]="results"
[status]=searchUtils.status
[type]="entityType"
@ -260,11 +291,11 @@
</div>
<div class="uk-align-center uk-margin-remove-bottom">
<div *ngIf="(results && searchUtils.totalResults > 0) || (!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING)"
class="uk-grid uk-margin-top uk-margin-bottom">
<search-results-per-page class="uk-width-1-2@m uk-width-1-1" [(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"></search-results-per-page>
<search-sorting class="uk-width-1-2@m uk-width-1-1" *ngIf="sort" [(sortBy)]="searchUtils.sortBy" (sortByChange)="sortByChanged($event)"></search-sorting>
</div>
<!-- <div *ngIf="(results && searchUtils.totalResults > 0) || (!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING)"-->
<!-- class="uk-grid uk-margin-top uk-margin-bottom">-->
<!-- <search-results-per-page class="uk-width-1-2@m uk-width-1-1" [(size)]="searchUtils.size" (sizeChange)="sizeChanged($event)"></search-results-per-page>-->
<!-- <search-sorting class="uk-width-1-2@m uk-width-1-1" *ngIf="sort" [(sortBy)]="searchUtils.sortBy" (sortByChange)="sortByChanged($event)"></search-sorting>-->
<!-- </div>-->
<search-paging [type]="type" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "searchUtils.baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
</div>

View File

@ -14,10 +14,18 @@ import 'rxjs';
template: `
<a [attr.uk-tooltip]="'title: Download'
+ ((totalResults > csvLimit)?' the first 2000 ':' ')
+ 'results'" class="" *ngIf="totalResults > 0">
<span class="clickable" (click)="downloadfile(downloadURLAPI+'?type='+type+'&format=csv'+csvParams,type+'-report-'+((totalResults > csvLimit)?'2000 ':totalResults))">
+ 'results'" class="uk-link-text" *ngIf="totalResults > 0">
<!-- type: {{type}}-->
<span class="clickable" (click)="downloadfile(downloadURLAPI+'?format=csv'+csvParams,type+'-report-'+((totalResults > csvLimit)?'2000 ':totalResults))">
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> (CSV)
<span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1">
<polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline>
<rect x="3" y="17" width="13" height="1"></rect>
<line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line>
</svg>
</span>
Download Results
</span>
</a>
<modal-loading></modal-loading>

View File

@ -5,24 +5,34 @@ import {ErrorCodes} from '../../utils/properties/errorCodes';
@Component({
selector: 'search-paging',
template: `
<div class= "searchPaging uk-panel uk-margin-small-top uk-grid">
<div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > 0">
<span class="portal-color">{{searchUtils.totalResults|number}}</span> {{type}}, page <span class="portal-color">{{searchUtils.page | number}}</span> of <span class="portal-color">{{(totalPages(searchUtils.totalResults)|number)}}</span>
</div>
<div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
<span class="portal-color">{{oldTotalResults|number}}</span> {{type}}, page <span class="portal-color">{{searchUtils.page | number}}</span> of <span class="portal-color">{{(totalPages(oldTotalResults)|number)}}</span>
</div>
<!--div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > 0">
{{searchUtils.totalResults|number}} {{type}}, page {{searchUtils.page | number}} of {{(totalPages(searchUtils.totalResults)|number)}}
</div>
<div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
{{oldTotalResults|number}} {{type}}, page {{searchUtils.page | number}} of {{(totalPages(oldTotalResults)|number)}}
</div-->
<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">
<paging [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [baseUrl]="baseUrl" [size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
</div>
<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">
<paging [currentPage]="searchUtils.page" [totalResults]="oldTotalResults" [baseUrl]="baseUrl" [size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
<div class= "paging-hr searchPaging uk-margin-small-bottom">
<div class="uk-panel uk-margin-small-top uk-grid uk-flex uk-flex-middle">
<div class="uk-width-1-1@s uk-width-1-2@m uk-text-uppercase" *ngIf="results && searchUtils.totalResults > 0">
{{searchUtils.totalResults|number}}
<span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
{{searchUtils.page | number}}
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(totalPages(searchUtils.totalResults)|number)}}
</div>
<div class="uk-width-1-1@s uk-width-1-2@m uk-flex uk-flex-middle" *ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
{{oldTotalResults|number}}
<span class="uk-text-muted uk-text-uppercase"> {{type}}, page </span>
{{searchUtils.page | number}}
<span class="uk-text-muted uk-text-uppercase"> of </span>
{{(totalPages(oldTotalResults)|number)}}
</div>
<!--div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > 0">
{{searchUtils.totalResults|number}} {{type}}, page {{searchUtils.page | number}} of {{(totalPages(searchUtils.totalResults)|number)}}
</div>
<div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
{{oldTotalResults|number}} {{type}}, page {{searchUtils.page | number}} of {{(totalPages(oldTotalResults)|number)}}
</div-->
<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">
<paging [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [baseUrl]="baseUrl" [size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
</div>
<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">
<paging [currentPage]="searchUtils.page" [totalResults]="oldTotalResults" [baseUrl]="baseUrl" [size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
</div>
</div>
</div>
`

View File

@ -3,16 +3,14 @@ import {Component, Input, Output, EventEmitter} from '@angular/core';
@Component({
selector: 'search-results-per-page',
template: `
<span class="uk-width-2-3@m uk-width-1-1@s">
<span class="uk-width-5-6@m"> Results per page:</span>
<select class="uk-select uk-width-1-6@m uk-width-auto" id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="size" (ngModelChange)="sizeChanged()">
<option [ngValue]="5" > 5</option>
<option [ngValue]="10">10</option>
<option [ngValue]="20">20</option>
<option [ngValue]="50">50</option>
</select>
</span>
<span> Results per page:</span>
<select class="uk-select uk-width-auto uk-text-bold" id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="size" (ngModelChange)="sizeChanged()">
<option [ngValue]="5" > 5</option>
<option [ngValue]="10">10</option>
<option [ngValue]="20">20</option>
<option [ngValue]="50">50</option>
</select>
`
})

View File

@ -3,21 +3,23 @@ import {Component, Input, Output, EventEmitter} from '@angular/core';
@Component({
selector: 'search-sorting',
template: `
<span class="uk-width-2-3@m uk-width-1-1@s uk-float-right">
<span class="uk-width-1-4"> Sort by:</span>
<select *ngIf="(entityType != 'community' && entityType != 'funder' )" class="uk-select uk-width-3-4@m uk-width-auto" id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="sortBy" (ngModelChange)="sortByChanged()">
<option value="">Relevance</option>
<option value="resultdateofacceptance,descending">Date (most recent)</option>
<option value="resultdateofacceptance,ascending">Date (least recent)</option>
</select>
<select *ngIf="(entityType == 'community' || entityType == 'funder')" class="uk-select uk-width-3-4@m uk-width-auto" id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="sortBy" (ngModelChange)="sortByChanged()">
<option value="">Title</option>
<option value="creationdate,descending">Creation Date (most recent)</option>
<option value="creationdate,ascending">Creation Date (least recent)</option>
</select>
</span>
<span class="uk-width-1-4"> Sort by:</span>
<select *ngIf="(entityType != 'community' && entityType != 'funder' )"
class="uk-select uk-width-auto uk-text-bold"
id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="sortBy" (ngModelChange)="sortByChanged()">
<option value="">Relevance</option>
<option value="resultdateofacceptance,descending">Date (most recent)</option>
<option value="resultdateofacceptance,ascending">Date (least recent)</option>
</select>
<select *ngIf="(entityType == 'community' || entityType == 'funder')"
class="uk-select uk-width-auto uk-text-bold"
id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="sortBy" (ngModelChange)="sortByChanged()">
<option value="">Title</option>
<option value="creationdate,descending">Creation Date (most recent)</option>
<option value="creationdate,ascending">Creation Date (least recent)</option>
</select>
`
})

View File

@ -9,7 +9,8 @@ import {EnvProperties} from './properties/env-properties';
template: `
<ul *ngIf=" ( getTotalPages() > 0 ) && (getTotalPages() > 1) && ( 0 < currentPage && currentPage <= getTotalPages() ) " class="uk-pagination uk-margin-bottom-remove">
<ul *ngIf=" ( getTotalPages() > 0 ) && (getTotalPages() > 1) && ( 0 < currentPage && currentPage <= getTotalPages() ) "
class="uk-pagination uk-margin-remove-bottom uk-flex uk-flex-middle">
<!--li *ngIf=" currentPage > 1" ><a [queryParams]="routerHelper.createQueryParamsPaging(parameterNames,parameterValues,'page',1)" routerLinkActive="router-link-active" [routerLink]=baseUrl aria-label="Previous">
<span><span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-left" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span></span></a></li-->