1. 'searchPageTableView' component updated: column's 'official name' contents for content providers gotten by community API added.

2. searchPageTableView: if no filters exist, do not contain this section in html template. (datatable expands)


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51013 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2018-03-02 12:57:52 +00:00
parent 9daf669a37
commit 1a3179acf3
2 changed files with 10 additions and 13 deletions

View File

@ -33,7 +33,7 @@
<helper position="top"></helper>
<div class="uk-width-2-3@m uk-width-2-3@l uk-width-1-1@s">
<div class="uk-offcanvas-content uk-hidden@m">
<div *ngIf="filters.length > 0" class="uk-offcanvas-content uk-hidden@m">
<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>
<div id="offcanvas-usage" uk-offcanvas>
@ -48,7 +48,7 @@
</div>
<div class="uk-grid uk-width-1-1">
<div class="helper-left-right search-filters uk-width-1-6@m uk-visible@m">
<div *ngIf="filters.length > 0" class="helper-left-right search-filters uk-width-1-6@m uk-visible@m">
<helper position="left"></helper>
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
</div>
@ -79,7 +79,7 @@
<errorMessages [status]="[searchUtils.status]" [type]="'results'"></errorMessages>
</div>
<div class="uk-overflow-container ">
<div *ngIf="searchUtils.totalResults > 0" class="uk-overflow-container">
<!-- #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
[mfData]="results | contentProvidersDatatable : [searchUtils, filters, triggerPipe, cd]"
@ -127,7 +127,7 @@
<span *ngIf="!result.compatibility">-</span>
</td>
<!--Community Projects-->
<!--Community Projects - name is also used for Community Content Providers-->
<td *ngIf="result.hasOwnProperty('acronym')" [class]="'uk-text-center uk-width-1-'+columnNames.length">
<span *ngIf="result.acronym">{{result.acronym}}</span>
<span *ngIf="!result.acronym">-</span>
@ -144,6 +144,12 @@
<span *ngIf="result.funder">{{result.funder}}</span>
<span *ngIf="!result.funder">-</span>
</td>
<!--Community Content Providers-->
<td *ngIf="result.hasOwnProperty('officialname')" [class]="'uk-text-center uk-width-1-'+columnNames.length">
<span *ngIf="result.officialname">{{result.officialname}}</span>
<span *ngIf="!result.officialname">-</span>
</td>
</tr>
</tbody>
<!-- <thead *ngIf="searchUtils.totalResults > 0">

View File

@ -141,7 +141,6 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit {
}
public getParametersFromUrl(params) {
console.info(this.refineFields);
for(var i=0; i< this.refineFields.length ; i++) {
var filterId = this.refineFields[i];
if(params[filterId] != undefined) {
@ -151,7 +150,6 @@ public getParametersFromUrl(params) {
this.queryParameters[filterId]=decodeURIComponent(params[filterId]);
}
}
console.info(this.queryParameters);
}
/*
* Mark as check the new filters that are selected, when you get them from search
@ -187,7 +185,6 @@ public getParametersFromUrl(params) {
*
*/
private createUrlParameters(filters:Filter[], includePage:boolean){
console.info("====CREATE URL PARAMS====");
var allLimits="";//location.search.slice(1);
this.parameterNames.splice(0,this.parameterNames.length);
this.parameterValues.splice(0,this.parameterValues.length);
@ -214,7 +211,6 @@ public getParametersFromUrl(params) {
this.parameterValues.push(this.searchUtils.keyword);
}
console.info(allLimits);
return allLimits;
}
@ -260,11 +256,8 @@ console.info(allLimits);
this.searchUtils.page=page;
var table = $('#dpTable').DataTable();
console.info(table);
console.info(table.page(page-1));
table.page( page - 1 ).draw( false );
console.info("4");
// Object { page: 0, pages: 3, start: 0, end: 10, length: 10, recordsTotal: 28, recordsDisplay: 21, serverSide: false }
var info = table.page.info();
@ -329,7 +322,6 @@ Transform initial - not filtered results to get the filtered number
var result = results.filter(row=>this.filterAll(row, this.searchUtils.keyword.toLowerCase(),this.filters));
let oldTotal = this.searchUtils.totalResults;
console.log(" Length: "+result.length);
this.searchUtils.totalResults = result.length;
var errorCodes:ErrorCodes = new ErrorCodes();
@ -347,7 +339,6 @@ Transform initial - not filtered results to get the filtered number
}
filterAll(row: any, query: string, filters:Filter[]) {
// console.log(row);
let returnValue: boolean = false;
if(query) {