Project

General

Profile

« Previous | Next » 

Revision 60664

[Library|Trunk]

Display claims fixes:
initialize and preview keyword
correct communities filter

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/claims/claim-utils/displayClaims/displayClaims.component.html
13 13
    <form class="">
14 14
       <div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
15 15
        <div search-input [control]="filterForm.controls.keyword" [showSearch]="false" placeholder="Search links"
16
             [selected]="inputkeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="resetInput()"
16 17
             [bordered]="true" colorClass="uk-text-secondary"></div>
17 18
      </div>
18 19
      <div  class=" uk-grid uk-flex-middle">
modules/uoa-services-library/trunk/ng-openaire-library/src/app/claims/claim-utils/displayClaims/displayClaims.component.ts
19 19
import {properties} from '../../../../../environments/environment';
20 20
import {FormArray, FormBuilder, FormGroup} from '@angular/forms';
21 21
import {Option} from '../../../sharedComponents/input/input.component';
22
import {SearchInputComponent} from '../../../sharedComponents/search-input/search-input.component';
22 23

  
23 24
declare var UIkit;
24 25
@Component({
......
44 45
  sizes = [10, 20, 30, 50];
45 46
  keyword: string; // the keyword string to give to the request as parameter
46 47
  inputkeyword: string; // the string written in the input field (keyword=inputkeyword when its length is bigger than 3 and the user stops typing)
48
  @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent;
47 49
  types = ["All", "Project", "Context", "Result", "User"];
48 50
  pageLoading:boolean = false;
49 51
  @Input() fetchBy: string;
......
60 62
  public entitiesCtrl: FormArray;
61 63

  
62 64
  allOptions: Option[] = [{label: "Projects", value: {id:"project", label: "Projects"}},{label: "Publications", value:{id:"publication", label: "Publications"}},{label: "Research data", value: {id:"dataset", label: "Research data"}},
63
    {label: "Software", value:  {id:"software", label: "Software"}},{label: "Other reserch products", value: {id:"other", label: "Other reserch products"}},{label: "Communities", value: {id:"community", label: "Communities"}}];
65
    {label: "Software", value:  {id:"software", label: "Software"}},{label: "Other reserch products", value: {id:"other", label: "Other reserch products"}},{label: "Communities", value: {id:"context", label: "Communities"}}];
64 66

  
65 67
  sortOptions: Option[] = [
66 68
    {label:"Date (recent) ", value:{ sort: "date", descending: true }}, {label:"Date (oldest) ", value:{ sort: "date",descending:false }},
......
140 142
      let size = (params['size'] === undefined) ? this.defaultSize : +params['size'];
141 143

  
142 144
      this.keyword = (params['keyword'] ? params['keyword'] : "");
145
      this.filterForm.get('keyword').setValue(this.keyword);
143 146
      this.inputkeyword = this.keyword;
144 147
      this.page = (page <= 0) ? 1 : page;
145 148
      this.size = (size <= 0) ? this.defaultSize : size;
......
513 516
  private updateUrl(url: string) {
514 517
    this._meta.updateTag({content: url}, "property='og:url'");
515 518
  }
519
  public onSearchClose() {
520
    this.inputkeyword = this.filterForm.get('keyword').value;
521
  }
522

  
523
  public resetInput() {
524
    this.inputkeyword = null;
525
    this.searchInputComponent.reset()
526
  }
516 527
}

Also available in: Unified diff