Project

General

Profile

« Previous | Next » 

Revision 44262

In Projects search component and search PAge: create the proper query using url parameters, mark as checked the proper filters after getting the results from search, apply changes in other components so they can work too.

View differences:

searchDataproviders.component.ts
1 1
import {Component, Input, ViewChild} from '@angular/core';
2 2
import { ActivatedRoute} from '@angular/router';
3
import {Location} from '@angular/common';
3 4

  
4 5
import { Filter, Value} from './searchUtils/searchHelperClasses.class';
5 6

  
......
7 8
import {SearchResult}     from '../utils/entities/searchResult';
8 9
import {OpenaireProperties, ErrorCodes} from '../utils/properties/openaireProperties';
9 10
import {SearchFields} from '../utils/properties/searchFields';
10

  
11
import {SearchPageComponent } from './searchUtils/searchPage.component';
11 12
@Component({
12 13
    selector: 'search-dataproviders',
13 14
    template: `
......
30 31
  private page :number = 1;
31 32
  private size :number = 10;
32 33
  private sub: any;
34
  private _location:Location;
35
  private refineFields = [];
36
  private searchFields:SearchFields = new SearchFields();
37
  @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
33 38

  
34 39
  constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
35 40
    //this.results =[];
......
37 42
    var errorCodes:ErrorCodes = new ErrorCodes();
38 43
    this.status =errorCodes.LOADING;
39 44
    this.baseUrl = OpenaireProperties.getLinkToSearchDataProviders();
45
    if(!this.searchPage){
46
      this.searchPage = new SearchPageComponent(this._location);
47
    }
40 48
  }
41 49

  
42 50
  private ngOnInit() {
51
    this.searchPage.refineFields = this.refineFields;
52

  
43 53
    this.sub =  this.route.queryParams.subscribe(params => {
44 54
    this.keyword = (params['keyword']?params['keyword']:'');
45 55
    this.page = (params['page']=== undefined)?1:+params['page'];

Also available in: Unified diff