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,30 +84,27 @@ export class OrganizationComponent {
}
private getOrganizationInfo () {
console.info("inside getOrganizationInfo of component");
this.warningMessage = '';
this.errorMessage=""
console.info("do request");
this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
data => {
this.organizationInfo = data;
let projectsNum = 0;
if(this.organizationInfo.projects != undefined) {
this.fundersSet = new Set<string>();
this.fundersSet = new Set<string>();
this.organizationInfo.projects.forEach(function (value, key, map) {
projectsNum += value.length;
this.fundersSet.add(key);
}.bind(this));
}
this.projectsNum = projectsNum;
},
err => {
console.error(err)
console.info("error");
this.errorMessage = 'No organization found';
}

View File

@ -74,7 +74,7 @@ export class SearchFilterComponent {
}
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){
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({
selector: 'search-form',
template: `
<form>
<form class = "search-form">
<div class="input-group">
<!--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" >

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 ">
<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>{{searchUtils.keyword}}<a (click) = "clearKeywords() "> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></span>
</span>
@ -31,7 +31,7 @@ import {SearchUtilsClass} from './searchUtils.class';
<span *ngIf="!end">,</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>

View File

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

View File

@ -88,7 +88,6 @@ export class SearchOrganizationsService {
url += "&page="+page+"&size="+size;
let key = url;
console.log("Org: "+key);
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key));
}
@ -107,7 +106,6 @@ export class SearchOrganizationsService {
let length = Array.isArray(data) ? data.length : 1;
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'];
var result: SearchResult = new SearchResult();

View File

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

View File

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