Project

General

Profile

« Previous | Next » 

Revision 51359

fixed some bugs and checked update/add repository methods

View differences:

modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.html
60 60

  
61 61
                    <datasource-update-form *ngIf="showForm && repo"
62 62
                                            #updateDatasource
63
                                            [selectedRepo]="repo"></datasource-update-form>
63
                                            [selectedRepo]="repo"
64
                                            (emittedInfo)="getUpdatedRepo($event)"></datasource-update-form>
64 65

  
65 66
                    <div *ngIf="loadingMessage" class="loading-big">
66 67
                      <div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.ts
72 72
        console.log(`got datasource with id ${this.datasourceId}`);
73 73
      }
74 74
    } else if(this.showForm) {
75
      if (this.updateDatasource.updateRepo()){
76
        this.group = this.fb.group({});
77
        this.getRepoInterfaces();
78
      }
75
        this.updateDatasource.updateRepo();
79 76
    } else if(this.showInterfaces) {
80 77
        this.setQueryParam('finish');
81 78
        this.showInterfaces = false;
......
133 130
    }
134 131
  }
135 132

  
133
  getUpdatedRepo(repo: Repository){
134
    this.repo = repo;
135
    console.log(`repo was updated!`);
136
    this.group = this.fb.group({});
137
    this.getRepoInterfaces();
138
  }
139

  
136 140
  getRepoInterfaces() {
137 141
    this.repoService.getRepositoryInterface(this.datasourceId).subscribe(
138 142
      interfaces => {
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-journal.component.ts
45 45

  
46 46
  moveAStep(){
47 47
    if (this.showForm) {
48
      setTimeout( () => {
49
        if(this.registerJournal.registerDatasource()){
50
          this.setQueryParam('interfaces');
51
          this.showForm = false;
52
          this.showInterfaces = true;
53
          this.step2 = 'active';
54
          this.group = this.fb.group({});
55
        }
56
      }, 500);
48
      this.registerJournal.registerDatasource();
57 49
    } else if (this.showInterfaces) {
58 50
      this.setQueryParam('finish');
59 51
      this.showInterfaces = false;
......
78 70

  
79 71
  getCurrentRepo(repo: Repository) {
80 72
    this.repo = repo;
73
    this.setQueryParam('interfaces');
74
    this.showForm = false;
75
    this.showInterfaces = true;
76
    this.step2 = 'active';
77
    this.group = this.fb.group({});
81 78
  }
82 79

  
83 80
  downloadLogo() {
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.html
60 60

  
61 61
                    <datasource-update-form *ngIf="showForm && repo"
62 62
                                            #updateDatasource
63
                                            [selectedRepo]="repo"></datasource-update-form>
63
                                            [selectedRepo]="repo"
64
                                            (emittedInfo)="getUpdatedRepo($event)"></datasource-update-form>
64 65

  
65 66
                    <div *ngIf="loadingMessage" class="loading-big">
66 67
                      <div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.ts
71 71
        console.log(`got datasource with id ${this.datasourceId}`);
72 72
      }
73 73
    } else if(this.showForm) {
74
      setTimeout( () => {
75
        if (this.updateDatasource.updateRepo()){
76
          this.group = this.fb.group({});
77
          this.getRepoInterfaces();
78
        }
79
      }, 1000);
74
        this.updateDatasource.updateRepo();
80 75
    } else if(this.showInterfaces) {
81 76
        this.setQueryParam('finish');
82 77
        this.showInterfaces = false;
......
134 129
    }
135 130
  }
136 131

  
132
  getUpdatedRepo(repo: Repository){
133
    this.repo = repo;
134
    console.log(`repo was updated!`);
135
    this.group = this.fb.group({});
136
    this.getRepoInterfaces();
137
  }
138

  
137 139
  getRepoInterfaces() {
138 140
    this.repoService.getRepositoryInterface(this.datasourceId).subscribe(
139 141
      interfaces => {
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-aggregator.component.ts
45 45

  
46 46
  moveAStep(){
47 47
    if (this.showForm) {
48
      if (this.registerAggregator.registerDatasource()){
49
        this.setQueryParam('interfaces');
50
        this.showForm = false;
51
        this.showInterfaces = true;
52
        this.step2 = 'active';
53
        this.group = this.fb.group({});
54
      }
48
      this.registerAggregator.registerDatasource();
55 49
    } else if (this.showInterfaces) {
56 50
      this.setQueryParam('finish');
57 51
      this.showInterfaces = false;
......
76 70

  
77 71
  getCurrentRepo(repo: Repository) {
78 72
    this.repo = repo;
73
    this.setQueryParam('interfaces');
74
    this.showForm = false;
75
    this.showInterfaces = true;
76
    this.step2 = 'active';
77
    this.group = this.fb.group({});
79 78
  }
80 79

  
81 80
  downloadLogo() {
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-interface-form.component.ts
100 100
  getInterfaceInfo(baseUrl: string) {
101 101
    this.successMessage = '';
102 102
    this.errorMessage = '';
103
    this.loadingMessage = formInfoLoading;
104 103
    if (baseUrl) {
104
      this.loadingMessage = formInfoLoading;
105 105
      this.valService.getInterfaceInformation(baseUrl).subscribe(
106 106
        info => {
107 107
          this.interfaceInfo = info;
......
180 180
    this.repoService.updateInterface(this.currentInterface).subscribe(
181 181
      response => {
182 182
        console.log(`updateRepository responded ${response}`);
183
        if (response == '200') {
183
        if (response) {
184 184
          this.successMessage = formSuccessUpdatedInterface;
185 185
        } else {
186 186
          this.errorMessage = formErrorWasntSaved;
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-update-form.component.ts
3 3
  formErrorRequiredFields,
4 4
  formErrorWasntSaved,
5 5
  formSubmitting,
6
  formSuccessUpdatedRepo,
6
  formSuccessUpdatedRepo, loadingRepoError, loadingRepoMessage,
7 7
  noServiceMessage
8 8
} from '../../../domain/shared-messages';
9 9
import { RepositoryService } from "../../../services/repository.service";
......
29 29
  adminEmailDesc, lissnDesc, eissnDesc, issnDesc
30 30
} from '../../../domain/oa-description';
31 31
import { ConfirmationDialogComponent } from '../../../shared/reusablecomponents/confirmation-dialog.component';
32
import {AuthenticationService} from "../../../services/authentication.service";
32 33

  
33 34
@Component ({
34 35
  selector: 'datasource-update-form',
......
72 73
    country : ['', Validators.required],
73 74
    longtitude : ['', [Validators.required, Validators.min(-180), Validators.max(180)] ],
74 75
    latitude : ['', [Validators.required, Validators.min(-90), Validators.max(90)] ],
75
    websiteUrl : ['', Validators.required],
76
    websiteUrl : ['', [Validators.required] ],
76 77
    institutionName : ['', Validators.required],
77 78
    englishName: ['', Validators.required],
78
    logoUrl: '',
79
    logoUrl: [''],
79 80
    timezone: ['', Validators.required],
80 81
    datasourceType: ['', Validators.required],
81 82
    adminEmail: ['', [Validators.required, Validators.email]]
......
101 102

  
102 103
  constructor(
103 104
    private fb: FormBuilder,
104
    private repoService: RepositoryService
105
    private repoService: RepositoryService,
106
    private authService: AuthenticationService
105 107
  ) {}
106 108

  
107 109
  ngOnInit(){
......
109 111
  }
110 112

  
111 113
  loadForm() {
112
    this.updateGroup = this.fb.group(this.updateGroupDefinition, {validator: checkPlatform});
113
    this.setupUpdateForm();
114
    this.getDatasourceClasses();
115
    this.getCountries();
116
    this.getTypologies();
117
    this.getTimezones();
114
    if (this.selectedRepo) {
115
      this.loadingMessage = loadingRepoMessage;
116
      this.updateGroup = this.fb.group(this.updateGroupDefinition, {validator: checkPlatform});
117
      this.setupUpdateForm();
118
      //this.getDatasourceClasses();
119
      //this.getCountries();
120
      this.getTypologies();
121
      this.getTimezones();
122
    } else {
123
      this.errorMessage = loadingRepoError;
124
    }
118 125
  }
119 126

  
120 127
  setupUpdateForm(){
......
163 170
        this.updateGroup.get('lissn').setValue(this.selectedRepo.lissn);
164 171
        this.updateGroup.get('lissn').disable();
165 172
      }
173
      this.getDatasourceClasses();
166 174
    }
167 175
  }
168 176

  
177
  getDatasourceClasses() {
178
    this.repoService.getDatasourceClasses(this.selectedRepo.datasourceType).subscribe(
179
      classes => this.datasourceClasses = classes,
180
      error => {
181
        this.loadingMessage = '';
182
        this.errorMessage = noServiceMessage;
183
        console.log(error);
184
      },
185
      () => {
186
        for (let key in this.datasourceClasses){
187
          this.classCodes.push(key);
188
        }
189
        this.getCountries();
190
      }
191
    );
192
  }
193

  
169 194
  getCountries(){
170 195
    this.repoService.getCountries()
171 196
      .subscribe(
......
179 204
          }
180 205
        } ),
181 206
        error => {
207
          this.loadingMessage = '';
182 208
          this.errorMessage = noServiceMessage;
183 209
          console.log(error);
210
        }, () => {
211
          this.getTypologies();
184 212
        });
185 213
  }
186 214

  
187
  getDatasourceClasses() {
188
    this.repoService.getDatasourceClasses(this.selectedRepo.datasourceType).subscribe(
189
      classes => this.datasourceClasses = classes,
215
  getTypologies() {
216
    this.repoService.getTypologies().subscribe(
217
      types => this.typologies = types,
190 218
      error => {
191
        this.errorMessage = noServiceMessage;
219
        this.loadingMessage = '';
192 220
        console.log(error);
193 221
      },
194
      () => {
195
        for (let key in this.datasourceClasses){
196
          this.classCodes.push(key);
197
        }
198
      }
222
      () => this.getTimezones()
199 223
    );
200 224
  }
201 225

  
202
  getTypologies() {
203
    this.repoService.getTypologies().subscribe(
204
      types => this.typologies = types,
205
      error => console.log(error)
206
    );
207
  }
208

  
209 226
  getTimezones() {
210 227
    this.repoService.getTimezones().subscribe(
211 228
      zones => this.timezones = zones,
212
      error => console.log(error)
229
      error => {
230
        this.loadingMessage = '';
231
        console.log(error);
232
      },
233
      () => {
234
        this.loadingMessage = '';
235
      }
213 236
    );
214 237
  }
215 238

  
216
  updateRepo(): boolean {
217
    let result: boolean;
218

  
239
  updateRepo() {
219 240
    this.errorMessage = '';
220 241
    this.successMessage = '';
221 242

  
......
226 247
        this.errorMessage = '';
227 248
        this.repoService.updateRepository(this.selectedRepo).subscribe(
228 249
          response => {
229
            console.log(`updateRepository responded: ${response}`);
230
            result = (response == '200');
250
            if(response) {
251
              this.selectedRepo = response;
252
              console.log(`updateRepository responded: ${JSON.stringify(response)}`);
253
              this.emittedInfo.emit(response);
254
            }
231 255
          },
232 256
          error => {
233 257
            console.log(error);
234 258
            this.loadingMessage = '';
235 259
            this.errorMessage = formErrorWasntSaved;
236
            result = false;
237 260
          },
238 261
          () => {
239 262
            this.loadingMessage = '';
240
            if (result) {
241
              this.emittedInfo.emit(this.selectedRepo);
263
            if (!this.selectedRepo) {
264
              this.errorMessage = formErrorWasntSaved;
265
            } else {
242 266
              this.successMessage = formSuccessUpdatedRepo;
243
            } else {
244
              this.errorMessage = formErrorWasntSaved;
245 267
            }
246 268
          }
247 269
        );
248 270
      } else {
249 271
        this.errorMessage = formErrorRequiredFields;
250
        result = false;
251 272
      }
252 273
    } else {
253 274
      this.errorMessage = formErrorRequiredFields;
254
      result = false;
255 275
    }
256
    return result;
257 276
  }
258 277

  
259 278
  refreshSelectedRepo() {
......
280 299
        this.selectedRepo.eissn = this.updateGroup.get('eissn').value;
281 300
        this.selectedRepo.lissn = this.updateGroup.get('lissn').value;
282 301
    }
302
    if (!this.showButton) {
303
      this.selectedRepo.registeredBy = this.authService.getUserEmail();
304
      this.selectedRepo.registered = true;
305
      /*this.selectedRepo.registrationDate = new Date(Date.now());*/ //NOT NEEDED
306
    }
283 307
  }
284 308

  
285 309
  changeLogoUrl(logoUrl: string) {
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-create-form.component.ts
67 67
    country : ['', Validators.required],
68 68
    longtitude : ['', [Validators.required, Validators.min(-180), Validators.max(180)] ],
69 69
    latitude : ['', [Validators.required, Validators.min(-90), Validators.max(90)] ],
70
    websiteUrl : ['', Validators.required],
70
    websiteUrl : ['', [Validators.required] ],
71 71
    institutionName : ['', Validators.required],
72 72
    englishName: ['', Validators.required],
73
    logoUrl: '',
73
    logoUrl: [''],
74 74
    timezone: ['', Validators.required],
75 75
    datasourceType: ['', Validators.required],
76 76
    adminEmail: ['', [Validators.required, Validators.email] ]
......
166 166
    );
167 167
  }
168 168

  
169
  registerDatasource(): boolean {
170
    let result: boolean;
171

  
169
  registerDatasource() {
172 170
    this.errorMessage = '';
173 171
    this.successMessage = '';
174 172

  
......
180 178
        this.repoService.addRepository(newRepo.datasourceType, newRepo).subscribe(
181 179
          response => {
182 180
            console.log(`addRepository responded:\n${JSON.stringify(response)}`);
183
            if (response) {
184
              result = true;
185
              this.emittedInfo.emit(response);
186
            }
181
            newRepo = response;
187 182
          },
188 183
          error => {
189 184
            console.log(error);
190 185
            this.loadingMessage = '';
191 186
            this.errorMessage = formErrorWasntSaved;
192
            result = false;
193 187
          },
194 188
          () => {
195 189
            this.loadingMessage = '';
196
            if (result) {
190
            if (newRepo) {
191
              this.emittedInfo.emit(newRepo);
197 192
              this.successMessage = formSuccessRegisteredDatasource;
198 193
            } else {
199 194
              this.errorMessage = formErrorWasntSaved;
......
201 196
          }
202 197
        );
203 198
      } else {
204
        result = false;
199
        this.errorMessage = formErrorRequiredFields;
205 200
      }
206 201
    } else {
207 202
      this.errorMessage = formErrorRequiredFields;
208
      result = false;
209 203
    }
210
    return result;
211 204
  }
212 205

  
213 206
  createNewRepository(): Repository {
......
230 223
    newRepo.eissn = this.group.get('eissn').value;
231 224
    newRepo.lissn = this.group.get('lissn').value;
232 225
    newRepo.registeredBy = this.authService.getUserEmail();
226

  
227
    /* THE BELOW FIELDS ARE NOT SET IN GWT CODE*/
233 228
    newRepo.datasourceType = this.mode;
234

  
235
    newRepo.dateOfCreation = new Date(Date.now()); //is this correct ?????
229
    /*newRepo.dateOfCreation = new Date(Date.now());*/ // NOT NEEDED
236 230
    newRepo.registered = true;
231
    /*newRepo.registrationDate = new Date(Date.now());*/ // NOT NEEDED
237 232

  
238 233
    return newRepo;
239 234
  }
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.html
33 33
                  {{ repo.officialName }}
34 34
                </h1>
35 35
              </div>
36
              <div *ngIf="repo">
36
              <div *ngIf="repo && repoInterfaces">
37 37
                <div>
38 38
                  <ul class="uk-margin el-nav uk-tab" uk-switcher="connect: .uk-switcher">
39 39
                    <li routerLinkActive="uk-active">
modules/uoa-repository-dashboard-gui/trunk/app/pages/metrics/metrics-enable.component.ts
33 33
  public confirmEnablingModal: ConfirmationDialogComponent;
34 34

  
35 35

  
36
  constructor(
36
  constructor (
37 37
    private route: ActivatedRoute,
38 38
    private authService: AuthenticationService,
39 39
    private piwikService: PiwikService,
modules/uoa-repository-dashboard-gui/trunk/app/pages/metrics/metrics-enable.component.html
83 83
  </div>
84 84
</div>
85 85

  
86
<confirmation-dialog #confirmEnablingModal [title]="modalTitle" [isModalShown]="isModalShown"
87
                     [confirmActionButton]="modalButton" (emitObject)="confirmedEnabling($event)">
88
  Are you sure you want to enable metrics for this repository?
89
</confirmation-dialog>
90

  
86 91
<!--   *** OLD HTML ***
87 92

  
88 93
<div id="contentWrapper"
......
169 174
  </div>
170 175
</div>
171 176
-->
172

  
173
<confirmation-dialog #confirmEnablingModal [title]="modalTitle" [isModalShown]="isModalShown"
174
                     [confirmActionButton]="modalButton" (emitObject)="confirmedEnabling($event)">
175
  Are you sure you want to enable metrics for this repository?
176
</confirmation-dialog>
modules/uoa-repository-dashboard-gui/trunk/app/pages/compatibility/compatibility-validation-history.component.ts
131 131
      error => {
132 132
        console.log(`The API returned ${error.status}`);
133 133
        this.loadingMessage = '';
134
        this.jobsOfUser = null;
134 135
        this.errorMessage = loadingUserJobsError;
135 136
      },
136 137
      () => {
modules/uoa-repository-dashboard-gui/trunk/app/pages/compatibility/compatibility-validation-history.component.html
97 97
              </div>
98 98
              <div>
99 99
                <div>
100
                  <div
101
                    class="uk-overflow-auto uk-scrollspy-inview uk-animation-slide-top-medium uk-margin-top uk-margin-bottom">
100
                  <div class="uk-overflow-auto uk-scrollspy-inview uk-animation-slide-top-medium uk-margin-top uk-margin-bottom">
102 101
                    <table class="uk-table uk-table-middle uk-table-striped" style="vertical-align: top !important;">
103 102
                      <thead>
104 103
                      <tr>
modules/uoa-repository-dashboard-gui/trunk/app/pages/compatibility/compatibility-validate-type.component.ts
7 7
import {
8 8
  identifyingUrl, invalidCustomBaseUrl,
9 9
  loadingReposMessage, loadingRuleSets, loadingRuleSetsError,
10
  loadingUserRepoInfoError, loadingValSets, loadingValSetsError, noRuleSets, submittingJobError
10
  loadingUserRepoInfoError, loadingValSets, loadingValSetsError, noRuleSets, noServiceMessage, submittingJobError
11 11
} from '../../domain/shared-messages';
12 12
import { ValidatorService } from '../../services/validator.service';
13 13
import { CompatibilityValidateStep2Component } from './compatibility-validate-forms/compatibility-validate-step2.component';
......
108 108
  moveAStep() {
109 109
    this.errorMessage = '';
110 110
    if (this.showDatasource) {
111
      if ( this.step1ChooseBaseUrl.submitForm() ) {
112
        this.identifyUrl();
113
      }
111
      this.step1ChooseBaseUrl.submitForm();
114 112
    } else if (this.showGuidelines) {
115 113
      this.step2ChooseGuidelines.saveChanges();
116 114
      if (this.type == 'cris'){
......
175 173
        console.log(error);
176 174
        this.loadingMessage = '';
177 175
        this.identifiedUrl = false;
178
        this.errorMessage = invalidCustomBaseUrl;
176
        this.errorMessage = noServiceMessage;
179 177
      }, () => {
180 178
        this.loadingMessage = '';
181 179
        if (this.identifiedUrl) {
182 180
          this.getRuleSetsForType();
181
        } else {
182
          this.errorMessage = invalidCustomBaseUrl;
183 183
        }
184 184
      }
185 185
    );
......
226 226

  
227 227
  getChosenUrl(url: string) {
228 228
    this.chosenUrl = url;
229
    this.identifyUrl();
229 230
  }
230 231

  
231 232
  getChosenRules(rules: any[]) {
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-events-of-repo-eventslist.component.html
28 28
              <div class="whiteFilm"></div>
29 29
            </div>
30 30
            <div *ngIf="noEvents" class="uk-alert">{{ noEvents }}</div>
31
            <div *ngIf="eventsPage && eventsPage.totalPages" class="events-results">
31
            <div *ngIf="!noEvents && !loadingMessage && !errorMessage && eventsPage && eventsPage.totalPages" class="events-results">
32 32
              <div class="numberOfEventsLabel">
33
                <span>Showing {{(eventsPage.currPage*10)+1 }}-{{ ( (eventsPage.total < 10) || (eventsPage.total < (eventsPage.currPage+1)*10) ) ? (eventsPage.total) : (eventsPage.currPage+1)*10 }} of {{ eventsPage.total }} results</span>
33

  
34
                <!-- RESTORE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
35
                <!--<span>Showing {{(eventsPage.currPage*10)+1 }}-{{ ( (eventsPage.total < 10) || (eventsPage.total < (eventsPage.currPage+1)*10) ) ? (eventsPage.total) : (eventsPage.currPage+1)*10 }} of {{ eventsPage.total }} results</span>-->
36

  
37
                <!-- DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
38
                <span>Showing {{(currentPage*10)+1 }}-{{ ( (eventsPage.total < 10) || (eventsPage.total < (currentPage+1)*10) ) ? (eventsPage.total) : (currentPage+1)*10 }} of {{ eventsPage.total }} results</span>
39

  
34 40
                <span class="uk-float-right">
35 41
                  <button id="subscribe" type="button" class="uk-button uk-button-primary uk-button-small" (click)="showSubscriptionModal()">Subscribe to these events</button>
36 42
                </span>
......
54 60
                    </a>
55 61
                  </li>
56 62
                </ul>
57
                <div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>
63

  
64
                <!-- RESTORE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
65
                <!--<div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>-->
66

  
67
                <!-- DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
68
                <div class="resultsPageLabel">page {{ currentPage+1 }} of {{ eventsPage.totalPages }}</div>
69

  
58 70
              </div>
59 71
              <div *ngFor="let event of eventsPage.values" class="events-list">
60 72
                <div class="uk-card uk-card-default well uk-scrollspy-inview uk-animation-slide-top-medium">
......
146 158
                    </a>
147 159
                  </li>
148 160
                </ul>
149
                <div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>
161

  
162
                <!-- RESTORE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
163
                <!--<div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>-->
164

  
165
                <!-- DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
166
                <div class="resultsPageLabel">page {{ currentPage+1 }} of {{ eventsPage.totalPages }}</div>
167

  
150 168
              </div>
151 169
            </div>
152 170
          </div>
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-events-of-repo-eventslist.component.ts
29 29

  
30 30
  advanceSearch: AdvQueryObject;
31 31
  eventsPage: EventsPage;
32
  currentPage: number;/* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
32 33

  
33 34
  group: FormGroup;
34 35
  readonly titleDefinition = { eventTitle: [''] };
......
61 62
    this.getParams();
62 63
    this.initQuery();
63 64
    this.initForm();
65
    this.currentPage = 0; /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
64 66
    this.getEventsPage(0);
65 67
  }
66 68

  
......
165 167
        }
166 168
      }
167 169
      console.log(this.advanceSearch);
170
      this.currentPage = 0; /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
168 171
      this.getEventsPage(0);
169 172
    }
170 173
  }
......
207 210
  }
208 211

  
209 212
  goToNextPage(){
210
    if(this.eventsPage.currPage < this.eventsPage.totalPages) {
213
    /* RESTORE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
214
    /*if(this.eventsPage.currPage < this.eventsPage.totalPages) {
211 215
      console.log(`Get me page ${this.eventsPage.currPage+1}!`);
212 216
      this.getEventsPage(this.eventsPage.currPage+1);
217
    }*/
218

  
219
    /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
220
    if(this.currentPage < this.eventsPage.totalPages) {
221
      this.currentPage = this.currentPage+1;
222
      console.log(`Get me page ${this.currentPage}!`);
223
      this.getEventsPage(this.currentPage);
213 224
    }
225

  
214 226
  }
215 227

  
216 228
  goToPreviousPage(){
217
    if(this.eventsPage.currPage > 0) {
229
    /* RESTORE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
230
    /*if(this.eventsPage.currPage > 0) {
218 231
      console.log(`Get me page ${this.eventsPage.currPage-1}!`);
219 232
      this.getEventsPage(this.eventsPage.currPage-1);
233
    }*/
234

  
235
    /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
236
    if(this.currentPage > 0) {
237
      this.currentPage = this.currentPage-1;
238
      console.log(`Get me page ${this.currentPage}!`);
239
      this.getEventsPage(this.currentPage);
220 240
    }
221 241
  }
222 242

  
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-notifications-of-subscription.component.html
26 26
            <div class="whiteFilm"></div>
27 27
          </div>
28 28
          <div *ngIf="noEvents" class="uk-alert">{{ noEvents }}</div>
29
          <div *ngIf="!noEvents && eventsPage && eventsPage.totalPages" class="events-results">
29
          <div *ngIf="!noEvents && !loadingMessage && !errorMessage && eventsPage && eventsPage.totalPages" class="events-results">
30 30
            <div class="numberOfEventsLabel">
31
              <span>Showing {{(eventsPage.currPage*10)+1 }}-{{ ( (eventsPage.total < 10) || (eventsPage.total < (eventsPage.currPage+1)*10) ) ? (eventsPage.total) : (eventsPage.currPage+1)*10 }} of {{ eventsPage.total }} results</span>
31

  
32
              <!-- RESTORE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
33
              <!--<span>Showing {{(eventsPage.currPage*10)+1 }}-{{ ( (eventsPage.total < 10) || (eventsPage.total < (eventsPage.currPage+1)*10) ) ? (eventsPage.total) : (eventsPage.currPage+1)*10 }} of {{ eventsPage.total }} results</span>-->
34

  
35
              <!-- DELETE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
36
              <span>Showing {{(currentPage*10)+1 }}-{{ ( (eventsPage.total < 10) || (eventsPage.total < (currentPage+1)*10) ) ? (eventsPage.total) : (currentPage+1)*10 }} of {{ eventsPage.total }} results</span>
37

  
32 38
            </div>
33 39
            <div>
34 40
              <ul class="uk-pagination">
......
49 55
                  </a>
50 56
                </li>
51 57
              </ul>
52
              <div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>
58

  
59
              <!-- RESTORE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
60
              <!--<div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>-->
61

  
62
              <!-- DELETE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
63
              <div class="resultsPageLabel">page {{ currentPage+1 }} of {{ eventsPage.totalPages }}</div>
64

  
53 65
            </div>
54 66
            <div *ngFor="let event of eventsPage.values" class="events-list">
55 67
              <div class="uk-card uk-card-default well uk-scrollspy-inview uk-animation-slide-top-medium">
......
142 154
                  </a>
143 155
                </li>
144 156
              </ul>
145
              <div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>
157

  
158
              <!-- RESTORE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
159
              <!--<div class="resultsPageLabel">page {{ eventsPage.currPage+1 }} of {{ eventsPage.totalPages }}</div>-->
160

  
161
              <!-- DELETE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE -->
162
              <div class="resultsPageLabel">page {{ currentPage+1 }} of {{ eventsPage.totalPages }}</div>
163

  
146 164
            </div>
147 165
          </div>
148 166

  
modules/uoa-repository-dashboard-gui/trunk/app/pages/content/content-notifications-of-subscription.component.ts
17 17
  subId: string;
18 18
  topic: string;
19 19
  eventsPage: EventsPage;
20
  currentPage: number;  /* DELETE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
20 21

  
21 22
  constructor(private route: ActivatedRoute,
22 23
              private brokerService: BrokerService) {}
23 24

  
24 25
  ngOnInit () {
25 26
    this.subId = this.route.snapshot.paramMap.get('id');
27
    this.currentPage = 0; /* DELETE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
26 28
    this.getEventsPage(0);
27 29
  }
28 30

  
......
49 51

  
50 52

  
51 53
  goToNextPage(){
52
    if(this.eventsPage.currPage < this.eventsPage.totalPages) {
54
    /* RESTORE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
55
    /*if(this.eventsPage.currPage < this.eventsPage.totalPages) {
53 56
      console.log(`Get me page ${this.eventsPage.currPage+1}!`);
54 57
      this.getEventsPage(this.eventsPage.currPage+1);
58
    }*/
59

  
60
    /* DELETE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
61
    if(this.currentPage < this.eventsPage.totalPages) {
62
      this.currentPage = this.currentPage+1;
63
      console.log(`Get me page ${this.currentPage}!`);
64
      this.getEventsPage(this.currentPage);
55 65
    }
56 66
  }
57 67

  
58 68
  goToPreviousPage(){
59
    if(this.eventsPage.currPage > 0) {
69
    /* RESTORE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
70
    /*if(this.eventsPage.currPage > 0) {
60 71
      console.log(`Get me page ${this.eventsPage.currPage-1}!`);
61 72
      this.getEventsPage(this.eventsPage.currPage-1);
73
    }*/
74

  
75
    /* DELETE WHEN getNotificationsBySubscriptionId IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
76
    if(this.currentPage > 0) {
77
      this.currentPage = this.currentPage-1;
78
      console.log(`Get me page ${this.currentPage}!`);
79
      this.getEventsPage(this.currentPage);
62 80
    }
63 81
  }
64 82

  
modules/uoa-repository-dashboard-gui/trunk/app/services/repository.service.ts
38 38
      .catch(this.handleError);
39 39
  }
40 40

  
41
  updateInterface(interfaceInfo: RepositoryInterface): Observable<string> {
41
  updateInterface(interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> {
42 42
    let url = `${this.apiUrl}updateInterface`;
43 43
    console.log(`knocking on: ${url}`);
44 44
    console.log(`sending ${JSON.stringify(interfaceInfo)}`);
45 45
    httpOptions.withCredentials = true;
46 46
    return this.http.post(url,interfaceInfo,httpOptions)
47
      .map( res => res.status.toString())
47
      .map( res => <RepositoryInterface>res.json())
48 48
      .catch(this.handleError);
49 49
  }
50 50

  
......
67 67
      .catch(this.handleError);
68 68
  }
69 69

  
70
  updateRepository(repoInfo: Repository): Observable<string> {
70
  updateRepository(repoInfo: Repository): Observable<Repository> {
71 71
    let url = `${this.apiUrl}updateRepository`;
72 72
    console.log(`knocking on: ${url}`);
73 73
    console.log(`sending ${JSON.stringify(repoInfo)}`);
74 74
    httpOptions.withCredentials = true;
75 75
    return this.http.post(url,repoInfo,httpOptions)
76
      .map( res => res.status.toString())
76
      .map( res => <Repository>res.json())
77 77
      .catch(this.handleError);
78 78
  }
79 79

  
modules/uoa-repository-dashboard-gui/trunk/app/services/auth-guard.service.ts
12 12
  private loginUrl : string = `${apiUrl}/openid_connect_login`;
13 13

  
14 14

  
15
  constructor(private authenticationService: AuthenticationService, private router: Router) {}
15
  constructor (private authenticationService: AuthenticationService, private router: Router) {}
16 16

  
17
  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
17
  canActivate (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
18 18

  
19
    if (this.authenticationService.getIsUserLoggedIn()) { return true; }
19
    if ( this.authenticationService.getIsUserLoggedIn() ) { return true; }
20 20

  
21
    if (getCookie('currentUser') != null) {return true;}
21
    if ( getCookie('currentUser') != null ) { return true; }
22 22

  
23 23
    // Store the attempted URL for redirecting
24 24
    sessionStorage.setItem("state.location",state.url);
modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-array.interface.ts
8 8
import { MyWrapper } from "./my-wrapper.interface";
9 9
import { Description } from '../../../domain/oa-description';
10 10
import { Subject } from "rxjs/Subject";
11
import {ConfirmationDialogComponent} from "../confirmation-dialog.component";
11 12

  
12 13

  
13 14
@Component({
......
159 160
  template : `
160 161
    <div class="el-item uk-card uk-card-default uk-card-body uk-scrollspy-inview uk-animation-fade">
161 162
      <div class="interfaceActionsPanel" style="margin-left: 5px;">
162
        <a (click)="remove()"><i class="fa fa-remove fa-lg"></i></a>
163
        <a (click)="confirmRemoveInterface()"><i class="fa fa-remove fa-lg"></i></a>
163 164
      </div>
164 165
      <ng-template my-form></ng-template>
165 166
    </div>
167

  
168

  
169
    <confirmation-dialog #confirmDelete [title]="'Delete Interface'" [isModalShown]="isModalShown"
170
                         [confirmActionButton]="'Yes, delete it'" (emitObject)="confirmedRemove($event)">
171
      Are you sure you want to delete this interface?
172
    </confirmation-dialog>
166 173
  `
167 174

  
168 175
})
169 176
export class MyArrayWrapper extends MyWrapper{
177

  
178
  isModalShown: boolean = false;
179

  
180
  @ViewChild('confirmDelete')
181
  public confirmDelete: ConfirmationDialogComponent;
182

  
183
  confirmRemoveInterface(){
184
    this.confirmDelete.showModal();
185
  }
186

  
187
  confirmedRemove(){
188
    this.remove();
189
  }
170 190
}
171 191

  
172 192
@Component({

Also available in: Unified diff