Fix client admin
authorChocobozzz <florian.bigard@gmail.com>
Sun, 25 Jun 2017 09:35:09 +0000 (11:35 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Sun, 25 Jun 2017 09:35:09 +0000 (11:35 +0200)
client/src/app/+admin/requests/request-stats/request-stats.component.html
client/src/app/+admin/users/user-list/user-list.component.ts
client/src/app/shared/rest/rest-data-source.ts

index 29e7f70520f7442b681fbde4853082cc383d5a2e..4508ab4c26c828360aa0816d1188c5c77ac11983 100644 (file)
@@ -3,41 +3,44 @@
 
     <h3>Requests stats</h3>
 
-    <div *ngFor="let requestSchedulerName of statsTitles | keys" class="col-lg-4 col-md-12">
-      <div class="panel panel-default" *ngIf="stats[requestSchedulerName] !== null">
-        <div class="panel-heading">{{ statsTitles[requestSchedulerName] }}</div>
-
-        <div class="panel-body">
-          <div class="requests-general">
-            <div>
-              <span class="label-description">Remaining requests:</span>
-              {{ stats[requestSchedulerName].totalRequests }}
-            </div>
+    <ng-template [ngIf]="stats">
+      <div *ngFor="let requestSchedulerName of statsTitles | keys" class="col-lg-4 col-md-12">
+        <div class="panel panel-default" *ngIf="stats[requestSchedulerName] !== null">
+          <div class="panel-heading">{{ statsTitles[requestSchedulerName] }}</div>
 
-            <div>
-              <span class="label-description">Interval seconds between requests:</span>
-              {{ stats[requestSchedulerName].secondsInterval }}
-            </div>
+          <div class="panel-body">
+            <div class="requests-general">
+              <div>
+                <span class="label-description">Remaining requests:</span>
+                {{ stats[requestSchedulerName].totalRequests }}
+              </div>
 
-            <div>
-              <span class="label-description">Remaining time before the scheduled request:</span>
-              {{ stats[requestSchedulerName].remainingSeconds }}
-            </div>
-          </div>
+              <div>
+                <span class="label-description">Interval seconds between requests:</span>
+                {{ stats[requestSchedulerName].secondsInterval }}
+              </div>
 
-          <div class="requests-limit">
-            <div>
-              <span class="label-description">Maximum number of different pods for a scheduled request:</span>
-              {{ stats[requestSchedulerName].requestsLimitPods }}
+              <div>
+                <span class="label-description">Remaining time before the scheduled request:</span>
+                {{ stats[requestSchedulerName].remainingSeconds }}
+              </div>
             </div>
 
-            <div>
-              <span class="label-description">Maximum number of requests per pod for a scheduled request:</span>
-              {{ stats[requestSchedulerName].requestsLimitPerPod }}
+            <div class="requests-limit">
+              <div>
+                <span class="label-description">Maximum number of different pods for a scheduled request:</span>
+                {{ stats[requestSchedulerName].requestsLimitPods }}
+              </div>
+
+              <div>
+                <span class="label-description">Maximum number of requests per pod for a scheduled request:</span>
+                {{ stats[requestSchedulerName].requestsLimitPerPod }}
+              </div>
             </div>
           </div>
         </div>
       </div>
-    </div>
+    </ng-template>
+
   </div>
 </div>
index b6fb0ed99f4d8e387aa7fe12039dd84886e292c1..12826741c027969077442c7d5e0def949f45cf60 100644 (file)
@@ -3,7 +3,7 @@ import { Component } from '@angular/core'
 import { NotificationsService } from 'angular2-notifications'
 
 import { ConfirmService } from '../../../core'
-import { User, Utils } from '../../../shared'
+import { RestDataSource, User, Utils } from '../../../shared'
 import { UserService } from '../shared'
 
 @Component({
@@ -12,7 +12,7 @@ import { UserService } from '../shared'
   styleUrls: [ './user-list.component.scss' ]
 })
 export class UserListComponent {
-  usersSource = null
+  usersSource: RestDataSource = null
   tableSettings = {
     mode: 'external',
     attr: {
index 2ef5d38da8883bdbec4cbf0ff54a89929f43fd85..7956637e0c36d4686b6e202c95f45c64ed40795d 100644 (file)
@@ -19,7 +19,7 @@ export class RestDataSource extends ServerDataSource {
   }
 
   protected addSortRequestOptions (requestOptions: RequestOptionsArgs) {
-    const searchParams = requestOptions.search as URLSearchParams
+    const searchParams = requestOptions.params as URLSearchParams
 
     if (this.sortConf) {
       this.sortConf.forEach((fieldConf) => {
@@ -33,7 +33,7 @@ export class RestDataSource extends ServerDataSource {
   }
 
   protected addPagerRequestOptions (requestOptions: RequestOptionsArgs) {
-    const searchParams = requestOptions.search as URLSearchParams
+    const searchParams = requestOptions.params as URLSearchParams
 
     if (this.pagingConf && this.pagingConf['page'] && this.pagingConf['perPage']) {
       const perPage = this.pagingConf['perPage']