diff --git a/portal-2/src/app/searchPages/find/search.component.ts b/portal-2/src/app/searchPages/find/search.component.ts index 76053e74..4e86228a 100644 --- a/portal-2/src/app/searchPages/find/search.component.ts +++ b/portal-2/src/app/searchPages/find/search.component.ts @@ -2,7 +2,13 @@ import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import {ActivatedRoute, Router} from '@angular/router'; import { SearchPublicationsComponent } from '../searchPublications.component'; +import { SearchDataprovidersComponent } from '../searchDataproviders.component'; +import { SearchProjectsComponent } from '../searchProjects.component'; + import {SearchPublicationsService} from '../../services/searchPublications.service'; +import {SearchDataprovidersService} from '../../services/searchDataproviders.service'; + +import {SearchProjectsService} from '../../services/searchProjects.service'; import {OpenaireProperties} from '../../utils/properties/openaireProperties'; @Component({ @@ -24,54 +30,59 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
- +
- +
- + +
- + +
- +
- +
@@ -91,12 +102,20 @@ export class SearchComponent { private activeTab = "datasets"; private linkToSearchPublications = ""; + private linkToSearchProjects = ""; + private linkToSearchDataproviders = ""; private searchPublicationsComponent : SearchPublicationsComponent; + private searchDataProvidersComponent : SearchDataprovidersComponent; + private searchProjectsComponent : SearchProjectsComponent; + //TODO add more viewchild for other entities - constructor ( private route: ActivatedRoute,private _searchPublicationsService: SearchPublicationsService) { - this.searchPublicationsComponent = new SearchPublicationsComponent(this.route, this._searchPublicationsService);; + constructor ( private route: ActivatedRoute,private _searchPublicationsService: SearchPublicationsService,private _searchDataprovidersService: SearchDataprovidersService,private _searchProjectsService: SearchProjectsService) { + this.searchPublicationsComponent = new SearchPublicationsComponent(this.route, this._searchPublicationsService); + this.searchDataProvidersComponent = new SearchDataprovidersComponent(this.route,this._searchDataprovidersService); + this.searchProjectsComponent = new SearchProjectsComponent(this.route, this._searchProjectsService);; + } private ngOnInit() { @@ -120,10 +139,14 @@ export class SearchComponent { this.activeTab = "publications"; } private searchProjects() { - this.activeTab = "publications"; + this.activeTab = "projects"; + this.searchProjectsComponent.getResults(this.keyword, 1, 10); + this.linkToSearchProjects = OpenaireProperties.getLinkToSearchProjects() + this.keyword; } private searchDataProviders() { - this.activeTab = "publications"; + this.activeTab = "datproviders"; + this.searchDataProvidersComponent.getResults(this.keyword, 1, 10); + this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders() + this.keyword; } private searchOrganizations() { this.activeTab = "publications"; @@ -133,9 +156,10 @@ export class SearchComponent { } private keywordChanged($event){ - this.keyword = $event.value; - this.activeTab = "datasets"; - this.searchPublications(); + this.keyword = $event.value; + this.searchPublications(); + this.searchProjects(); + this.searchDataProviders(); } diff --git a/portal-2/src/app/searchPages/search.module.ts b/portal-2/src/app/searchPages/search.module.ts index 43753c1e..636c698d 100644 --- a/portal-2/src/app/searchPages/search.module.ts +++ b/portal-2/src/app/searchPages/search.module.ts @@ -14,6 +14,7 @@ import {AdvancedSearchPageComponent} from './searchUtils/advancedSearchPage.comp import {SearchAllComponent} from '../searchAll/searchAll.component';//helpers import {SearchPageComponent} from './searchUtils/searchPage.component'; import {SearchFormComponent} from './searchUtils/searchForm.component'; +import {SearchPagingComponent} from './searchUtils/searchPaging.component'; import {SearchResultComponent} from './searchUtils/searchResult.component'; import {SearchFilterComponent} from './searchUtils/searchFilter.component'; @@ -41,6 +42,7 @@ import {SearchComponent} from './find/search.component'; SearchFormComponent, SearchResultComponent, SearchFilterComponent, + SearchPagingComponent, AdvancedSearchFormComponent, SearchPublicationsComponent, AdvancedSearchPublicationsComponent, diff --git a/portal-2/src/app/searchPages/searchUtils/searchForm.component.ts b/portal-2/src/app/searchPages/searchUtils/searchForm.component.ts index 0d3788aa..e8840dcd 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchForm.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchForm.component.ts @@ -6,7 +6,7 @@ import {Observable} from 'rxjs/Observable'; template: `
- Filter + diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index d1b6312b..26c9b3c3 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -23,29 +23,9 @@ import {SearchResult} from '../../utils/entities/searchResult';
@@ -72,8 +52,6 @@ export class SearchPageComponent { ngOnInit() { console.info(" page - value: "+this.page); - console.log(" search page st: "+this.status); - //this.totalResults = this.totalResults; console.info("searchPage total="+this.totalResults); console.info("searchPage: results.length = "+this.results.length); } diff --git a/portal-2/src/app/searchPages/searchUtils/searchPaging.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPaging.component.ts new file mode 100644 index 00000000..6e936755 --- /dev/null +++ b/portal-2/src/app/searchPages/searchUtils/searchPaging.component.ts @@ -0,0 +1,32 @@ +import {Component, Input, Output, EventEmitter} from '@angular/core'; +import {Observable} from 'rxjs/Observable'; + +@Component({ + selector: 'search-paging', + template: ` +
+
+ +
+
+ {{totalResults}} documents, page {{page}} of {{(totalResults/size)}} +
+
+ ` +}) + +export class SearchPagingComponent { + @Input() page:number = 1; + @Input() size:number = 1; + @Input() results; + @Input() baseUrl:string = ""; + @Input() totalResults:number = 0; + constructor () { + } + + ngOnInit() { + + } + + +}