Project

General

Profile

« Previous | Next » 

Revision 56496

Registrations Admin Page: on 'items per page' change, page resets to 0 now

View differences:

modules/uoa-repository-dashboard-gui/branches/development/src/app/pages/adminPg/registration.component.ts
77 77
    this.getRegisteredRepositories();
78 78
  }
79 79

  
80
  handleChangeAndResetPage() {
81
    this.dataForm.get('page').setValue(0);
82
    this.getRegisteredRepositories();
83
  }
84

  
80 85
  getCountryName(countryCode): string {
81 86
    for (const country of Object.values(this.countries)) {
82 87
      if (country.code === countryCode) {
......
94 99

  
95 100
  nextPage() {
96 101
    /** remove when page total is fixed!!! **/
97
    this.repoService.searchRegisteredRepositories(this.dataForm.get('country').value, this.dataForm.get('typology').value, this.dataForm.get('englishname').value,
102
      this.repoService.searchRegisteredRepositories(this.dataForm.get('country').value, this.dataForm.get('typology').value, this.dataForm.get('englishname').value,
98 103
      this.dataForm.get('officialname').value, this.dataForm.get('requestSortBy').value, this.dataForm.get('order').value, +this.dataForm.get('page').value + 1,
99 104
      this.dataForm.get('pageSize').value).subscribe(
100 105
      suc => this.thisIsForBadUse = suc,
101 106
      error => console.log(error),
102 107
      () => {
103
        console.log(this.thisIsForBadUse.length );
108
        console.log(this.thisIsForBadUse.length);
104 109
        if (!(this.thisIsForBadUse.length === 0)) {
105 110
          console.log('got here');
106 111
          this.dataForm.get('page').setValue(+this.dataForm.get('page').value + 1);
modules/uoa-repository-dashboard-gui/branches/development/src/app/pages/adminPg/registration.component.html
36 36
                <div class="uk-margin">
37 37
                  <label class="uk-form-label uk-text-right" for="pageSize">Items per page: </label>
38 38
                  <div class="uk-form-controls">
39
                    <select class="uk-select" id="pageSize" (change)="handleChange()" formControlName="pageSize">
39
                    <select class="uk-select" id="pageSize" (change)="handleChangeAndResetPage()" formControlName="pageSize">
40 40
                      <option value="10">10</option>
41 41
                      <option value="25" selected>25</option>
42 42
                      <option value="50">50</option>
......
49 49
                  <label class="uk-form-label uk-text-right" for="sortBy">Sort by: </label>
50 50
                  <div class="uk-form-controls">
51 51
                    <select class="uk-select" id="sortBy" (change)="handleChange()" formControlName="requestSortBy">
52
                      <option value="registrationdate" selected>date</option>
53
                      <option value="officialname">name</option>
52
                      <option value="registrationdate" selected>Date</option>
53
                      <option value="officialname">Name</option>
54 54
                    </select>
55 55
                  </div>
56 56
                </div>

Also available in: Unified diff