layout changes in filters/ search form

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44648 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2016-11-24 09:21:10 +00:00
parent d3e70bbec1
commit 1fb51c87d1
8 changed files with 10 additions and 14 deletions

View File

@ -84,14 +84,13 @@ export class OrganizationComponent {
} }
private getOrganizationInfo () { private getOrganizationInfo () {
console.info("inside getOrganizationInfo of component");
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage=""
console.info("do request");
this._organizationService.getOrganizationInfo(this.organizationId).subscribe( this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
data => { data => {
this.organizationInfo = data; this.organizationInfo = data;
let projectsNum = 0; let projectsNum = 0;
@ -102,12 +101,10 @@ export class OrganizationComponent {
this.fundersSet.add(key); this.fundersSet.add(key);
}.bind(this)); }.bind(this));
} }
this.projectsNum = projectsNum; this.projectsNum = projectsNum;
}, },
err => { err => {
console.error(err) console.error(err)
console.info("error");
this.errorMessage = 'No organization found'; this.errorMessage = 'No organization found';
} }

View File

@ -74,7 +74,7 @@ export class SearchFilterComponent {
} }
private _formatTitle(title,length){ private _formatTitle(title,length){
return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title) return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title+" ("+length+")")
} }
private _formatName(value){ private _formatName(value){
return (((value.name+" ("+value.number+")").length >this._maxCharacters)?(value.name.substring(0,(this._maxCharacters - (" ("+value.number+")").length - ('...').length))+"..."):value.name) return (((value.name+" ("+value.number+")").length >this._maxCharacters)?(value.name.substring(0,(this._maxCharacters - (" ("+value.number+")").length - ('...').length))+"..."):value.name)

View File

@ -4,7 +4,7 @@ import {Observable} from 'rxjs/Observable';
@Component({ @Component({
selector: 'search-form', selector: 'search-form',
template: ` template: `
<form> <form class = "search-form">
<div class="input-group"> <div class="input-group">
<!--span class="input-group-addon" id="sizing-addon2">Filter</span--> <!--span class="input-group-addon" id="sizing-addon2">Filter</span-->
<input type="text" class="form-control" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="keyword" name="keyword" > <input type="text" class="form-control" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="keyword" name="keyword" >

View File

@ -20,7 +20,7 @@ import {SearchUtilsClass} from './searchUtils.class';
<div class="col-xs-12 col-sm-10 text-center col-md-offset-1 "> <div class="col-xs-12 col-sm-10 text-center col-md-offset-1 ">
<search-form [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form> <search-form [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form>
<div> <div *ngIf="isFiltered()" class = "selected-filters-box">
<span *ngIf = "searchUtils.keyword.length > 0">Keywords: <span *ngIf = "searchUtils.keyword.length > 0">Keywords:
<span>{{searchUtils.keyword}}<a (click) = "clearKeywords() "> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></span> <span>{{searchUtils.keyword}}<a (click) = "clearKeywords() "> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></span>
</span> </span>
@ -31,7 +31,7 @@ import {SearchUtilsClass} from './searchUtils.class';
<span *ngIf="!end">,</span> <span *ngIf="!end">,</span>
</span> </span>
</span> </span>
<a *ngIf="isFiltered()" (click)="clearFilters()" class = "btn text-right"> Clear Filters</a> <a (click)="clearFilters()" class = "btn text-right"> Clear Filters</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -31,8 +31,6 @@ export class PersonService {
getPersonInfo (id: string):any { getPersonInfo (id: string):any {
console.info("Cache: NOT in cache ");
console.info("getPersonInfo in service"); console.info("getPersonInfo in service");
let url = OpenaireProperties.getSearchAPIURL()+'people/'+id; let url = OpenaireProperties.getSearchAPIURL()+'people/'+id;

View File

@ -88,7 +88,6 @@ export class SearchOrganizationsService {
url += "&page="+page+"&size="+size; url += "&page="+page+"&size="+size;
let key = url; let key = url;
console.log("Org: "+key);
if (this._cache.has(key)) { if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)); return Observable.of(this._cache.get(key));
} }
@ -107,7 +106,6 @@ export class SearchOrganizationsService {
let length = Array.isArray(data) ? data.length : 1; let length = Array.isArray(data) ? data.length : 1;
for(let i=0; i<length; i++) { for(let i=0; i<length; i++) {
console.log("Organizations size::: "+length+ " is array::"+Array.isArray(data) );
let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:organization'] : data['result']['metadata']['oaf:entity']['oaf:organization']; let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:organization'] : data['result']['metadata']['oaf:entity']['oaf:organization'];
var result: SearchResult = new SearchResult(); var result: SearchResult = new SearchResult();

View File

@ -28,7 +28,7 @@ export class CacheService {
* get our cached value * get our cached value
*/ */
get(key: string | number): any { get(key: string | number): any {
console.debug("Cache get :"+key); console.log("Cache get :"+key);
let _key = this.normalizeKey(key); let _key = this.normalizeKey(key);
return this._cache.get(_key); return this._cache.get(_key);
} }

View File

@ -19,6 +19,9 @@
<style> <style>
.custom-hidden-dropdown-menu {position:static !important;} .custom-hidden-dropdown-menu {position:static !important;}
.searchFilterBox .values {overflow:auto; max-height:200px; } .searchFilterBox .values {overflow:auto; max-height:200px; }
.selected-filters-box {margin:5px; background-color:#F8F8F8; }
.search-form {margin:5px; }
</style> </style>
<base href="/"> <base href="/">