commit b887ecc363f19f1820f2db973ebcb2681ff779c4
Author: hlavja <hlavjah@gmail.com>
Date:   Mon May 3 22:12:00 2021 +0200

    Re #8792 - Sensor page - tweak
    
    + adding error catchup on requests
    + toast message upon request

diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index da19b19..98757d1 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -3,7 +3,7 @@ import {faCoffee} from '@fortawesome/free-solid-svg-icons';
 
 @Component({
   selector: 'app-root',
-  template: '<router-outlet></router-outlet>'
+  template: `<router-outlet></router-outlet><p-toast position="bottom-center" key="mainToast"></p-toast>`
 })
 export class AppComponent {
   title = 'SensLog';
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 4de5967..a90f2a8 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -14,6 +14,7 @@ import {SensorModule} from './sensor/sensor.module';
 import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
 import {UnitModule} from './unit/unit.module';
 import {ConfirmationService, MessageService} from 'primeng/api';
+import {ToastModule} from 'primeng/toast';
 
 @NgModule({
   declarations: [
@@ -32,6 +33,7 @@ import {ConfirmationService, MessageService} from 'primeng/api';
     SensorModule,
     FontAwesomeModule,
     UnitModule,
+    ToastModule
   ],
   providers: [
     ConfirmationService,
diff --git a/src/app/auth/interceptors/auth.interceptor.ts b/src/app/auth/interceptors/auth.interceptor.ts
index b310680..e45ed2e 100644
--- a/src/app/auth/interceptors/auth.interceptor.ts
+++ b/src/app/auth/interceptors/auth.interceptor.ts
@@ -11,13 +11,15 @@ import {catchError} from 'rxjs/operators';
 import {AuthService} from '../services/auth.service';
 import {CookieService} from 'ngx-cookie-service';
 import {GlobalVariable} from '../../globals';
+import {ToastService} from '../../shared/services/toast.service';
 
 @Injectable()
 export class AuthInterceptor implements HttpInterceptor {
 
   constructor(
     private authService: AuthService,
-    private cookieService: CookieService
+    private cookieService: CookieService,
+    private toastService: ToastService
   ) {
   }
 
@@ -36,12 +38,14 @@ export class AuthInterceptor implements HttpInterceptor {
       });
     }
 
-    console.log('Sending request!');
+    console.log('Sending request!', request);
     return next.handle(request)
       .pipe(
         catchError(err => {
           if ((err instanceof HttpErrorResponse && err.status === 504 || err.status === 502 || err.status === 401 ||
             err.status === 0 || err.status === 500)) {
+            console.log(err);
+            this.toastService.showError(err.error);
             return this.handleError(request, next);
           } else {
             return throwError(err);
diff --git a/src/app/auth/services/auth.service.ts b/src/app/auth/services/auth.service.ts
index 349d13e..6fcf5be 100644
--- a/src/app/auth/services/auth.service.ts
+++ b/src/app/auth/services/auth.service.ts
@@ -76,6 +76,7 @@ export class AuthService {
     this.cookieService.deleteAll();
     localStorage.clear();
     this.router.navigate(['/login']);
+    this.cookieService.deleteAll();
   }
 
   setSessionStorage(userCookie: UserCookie, username) {
diff --git a/src/app/sensor/components/sensor.component.ts b/src/app/sensor/components/sensor.component.ts
index d87e77a..331a2d1 100644
--- a/src/app/sensor/components/sensor.component.ts
+++ b/src/app/sensor/components/sensor.component.ts
@@ -1,13 +1,13 @@
 import {Component, OnInit} from '@angular/core';
 import {ActivatedRoute} from '@angular/router';
-import {Observation} from '../../shared/api/endpoints/models/observation';
 import * as moment from 'moment-timezone';
 import {AnalyticsService} from '../../shared/api/endpoints/services/analytics.service';
 import {AggreationModel} from '../../shared/models/aggreation.model';
 import {GraphLoader} from '../../shared/graph-loading/graphloader';
 import {ObservationService} from '../../shared/api/endpoints/services/observation.service';
-
-declare var require: any;
+import {HttpResponse} from '@angular/common/http';
+import {map} from 'rxjs/operators';
+import {ToastService} from '../../shared/services/toast.service';
 
 @Component({
   selector: 'app-sensor',
@@ -18,7 +18,6 @@ export class SensorComponent implements OnInit {
 
   sensorId: number;
   unitId: number;
-  observations: Observation[];
   data = [];
   time = [];
   from: Date;
@@ -31,7 +30,8 @@ export class SensorComponent implements OnInit {
   constructor(
     private activatedRoute: ActivatedRoute,
     private analyticsService: AnalyticsService,
-    private observationService: ObservationService
+    private observationService: ObservationService,
+    private toastService: ToastService
   ) {
     this.sensorId = parseInt(this.activatedRoute.snapshot.paramMap.get('sensorId'), 10);
     this.unitId = parseInt(this.activatedRoute.snapshot.paramMap.get('unitId'), 10);
@@ -52,46 +52,80 @@ export class SensorComponent implements OnInit {
     let agg = 'HOUR';
     const range: Date[] = [moment().subtract(7, 'days').toDate(), moment().toDate()];
 
+    if (this.from && !this.to || !this.from && this.to) {
+      return;
+    }
+
     if (this.from && this.to) {
       range[0] = this.from;
       range[1] = this.to;
-
-      if (moment(this.to).diff(moment(this.from), 'days') > 7) {
-        this.showAggregation = true;
-      }
     }
 
-  /* this.observationService.getObservation({
-      unit_id: this.unitId,
-      sensor_id: this.sensorId,
-      from: moment(range[0]).format('yyyy-MM-DD HH:mm:ssZ').slice(0, -3),
-      to: moment(range[1]).format('yyyy-MM-DD HH:mm:ssZ').slice(0, -3)
-    }).subscribe(
-      observations => {
-        if (observations) {
-          GraphLoader.getObservationGraph(this.sensorId, observations, "#view");
-        }
-      });*/
-
-
+    if (moment(range[1]).diff(moment(range[0]), 'days') > 7) {
+      this.showAggregation = true;
+    }
 
     if (this.selectedAggregationFunction) {
       agg = this.selectedAggregationFunction;
     }
 
-    this.analyticsService.getAnalytics({
+    if (moment(this.to).diff(moment(this.from), 'days') > 7) {
+      this.getAnalytics(range, agg);
+    } else {
+      this.getObservations(range, agg);
+    }
+  }
+
+  getAnalytics(range: Date[], agg: string) {
+    this.analyticsService.getAnalytics$Response({
       unit_id: this.unitId, sensor_id: this.sensorId,
       from: moment(range[0]).format('yyyy-MM-DD HH:mm:ssZ').slice(0, -3),
       to: moment(range[1]).format('yyyy-MM-DD HH:mm:ssZ').slice(0, -3), interval: agg
-    }).subscribe(
+    }).pipe(
+      map((response: HttpResponse<any>) => {
+        if (response.status === 200) {
+          return response.body;
+        } else if (response.status === 204) {
+          this.toastService.showWarningNoData();
+          return response.body;
+        } else {
+          return false;
+        }
+      })
+    ).subscribe(
       observations => {
         if (observations) {
           GraphLoader.getGraph(this.sensorId, observations[this.sensorId].data, observations[this.sensorId].interval, '#view');
         } else {
           GraphLoader.getGraph(null, null, null, null);
         }
-      }
-    );
+      }, err => this.toastService.showError(err.error.message));
+  }
 
+  getObservations(range: Date[], agg: string) {
+    this.observationService.getObservation$Response({
+      unit_id: this.unitId,
+      sensor_id: this.sensorId,
+      from: moment(range[0]).format('yyyy-MM-DD HH:mm:ssZ').slice(0, -3),
+      to: moment(range[1]).format('yyyy-MM-DD HH:mm:ssZ').slice(0, -3)
+    }).pipe(
+      map((response: HttpResponse<any>) => {
+        if (response.status === 200) {
+          return response.body;
+        } else if (response.status === 204) {
+          this.toastService.showWarningNoData();
+          return response.body;
+        } else {
+          return false;
+        }
+      })
+    ).subscribe(
+      observations => {
+        if (observations) {
+          GraphLoader.getObservationGraph(this.sensorId, observations, '#view');
+        } else {
+          GraphLoader.getObservationGraph(null, null, null);
+        }
+      }, err => this.toastService.showError(err.error.message));
   }
 }
diff --git a/src/app/shared/api/endpoints/services/management.service.ts b/src/app/shared/api/endpoints/services/management.service.ts
index 3ba8abd..afbcf1e 100644
--- a/src/app/shared/api/endpoints/services/management.service.ts
+++ b/src/app/shared/api/endpoints/services/management.service.ts
@@ -44,7 +44,7 @@ export class ManagementService extends BaseService {
    */
   insertUnit$Response(params: {
     body: { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }
-  }): Observable<StrictHttpResponse<void>> {
+  }): Observable<StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>> {
 
     const rb = new RequestBuilder(this.rootUrl, ManagementService.InsertUnitPath, 'post');
     if (params) {
@@ -52,12 +52,12 @@ export class ManagementService extends BaseService {
     }
 
     return this.http.request(rb.build({
-      responseType: 'text',
-      accept: '*/*'
+      responseType: 'json',
+      accept: 'application/json'
     })).pipe(
       filter((r: any) => r instanceof HttpResponse),
       map((r: HttpResponse<any>) => {
-        return (r as HttpResponse<any>).clone({ body: undefined }) as StrictHttpResponse<void>;
+        return r as StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>;
       })
     );
   }
@@ -74,10 +74,64 @@ export class ManagementService extends BaseService {
    */
   insertUnit(params: {
     body: { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }
-  }): Observable<void> {
+  }): Observable<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }> {
 
     return this.insertUnit$Response(params).pipe(
-      map((r: StrictHttpResponse<void>) => r.body as void)
+      map((r: StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>) => r.body as { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> })
+    );
+  }
+
+  /**
+   * Path part for operation insertSensor
+   */
+  static readonly InsertSensorPath = '/senslog15/ManagementService?Operation=InsertSensor';
+
+  /**
+   * Insert Sensor.
+   *
+   *
+   *
+   * This method provides access to the full `HttpResponse`, allowing access to response headers.
+   * To access only the response body, use `insertSensor()` instead.
+   *
+   * This method sends `application/json` and handles request body of type `application/json`.
+   */
+  insertSensor$Response(params: {
+    body: { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }
+  }): Observable<StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>> {
+
+    const rb = new RequestBuilder(this.rootUrl, ManagementService.InsertSensorPath, 'post');
+    if (params) {
+      rb.body(params.body, 'application/json');
+    }
+
+    return this.http.request(rb.build({
+      responseType: 'json',
+      accept: 'application/json'
+    })).pipe(
+      filter((r: any) => r instanceof HttpResponse),
+      map((r: HttpResponse<any>) => {
+        return r as StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>;
+      })
+    );
+  }
+
+  /**
+   * Insert Sensor.
+   *
+   *
+   *
+   * This method provides access to only to the response body.
+   * To access the full response (for headers, for example), `insertSensor$Response()` instead.
+   *
+   * This method sends `application/json` and handles request body of type `application/json`.
+   */
+  insertSensor(params: {
+    body: { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }
+  }): Observable<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }> {
+
+    return this.insertSensor$Response(params).pipe(
+      map((r: StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>) => r.body as { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> })
     );
   }
 
@@ -206,7 +260,7 @@ export class ManagementService extends BaseService {
    */
   deleteSensor$Response(params: {
     body: { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }
-  }): Observable<StrictHttpResponse<{ 'message'?: string }>> {
+  }): Observable<StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>> {
 
     const rb = new RequestBuilder(this.rootUrl, ManagementService.DeleteSensorPath, 'delete');
     if (params) {
@@ -219,7 +273,7 @@ export class ManagementService extends BaseService {
     })).pipe(
       filter((r: any) => r instanceof HttpResponse),
       map((r: HttpResponse<any>) => {
-        return r as StrictHttpResponse<{ 'message'?: string }>;
+        return r as StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>;
       })
     );
   }
@@ -236,10 +290,10 @@ export class ManagementService extends BaseService {
    */
   deleteSensor(params: {
     body: { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }
-  }): Observable<{ 'message'?: string }> {
+  }): Observable<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }> {
 
     return this.deleteSensor$Response(params).pipe(
-      map((r: StrictHttpResponse<{ 'message'?: string }>) => r.body as { 'message'?: string })
+      map((r: StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>) => r.body as { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> })
     );
   }
 
@@ -260,7 +314,7 @@ export class ManagementService extends BaseService {
    */
   updateSensor$Response(params: {
     body: { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }
-  }): Observable<StrictHttpResponse<void>> {
+  }): Observable<StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>> {
 
     const rb = new RequestBuilder(this.rootUrl, ManagementService.UpdateSensorPath, 'put');
     if (params) {
@@ -268,12 +322,12 @@ export class ManagementService extends BaseService {
     }
 
     return this.http.request(rb.build({
-      responseType: 'text',
-      accept: '*/*'
+      responseType: 'json',
+      accept: 'application/json'
     })).pipe(
       filter((r: any) => r instanceof HttpResponse),
       map((r: HttpResponse<any>) => {
-        return (r as HttpResponse<any>).clone({ body: undefined }) as StrictHttpResponse<void>;
+        return r as StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>;
       })
     );
   }
@@ -290,10 +344,10 @@ export class ManagementService extends BaseService {
    */
   updateSensor(params: {
     body: { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }
-  }): Observable<void> {
+  }): Observable<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }> {
 
     return this.updateSensor$Response(params).pipe(
-      map((r: StrictHttpResponse<void>) => r.body as void)
+      map((r: StrictHttpResponse<{ 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> }>) => r.body as { 'unit'?: InsertUnit, 'sensors'?: Array<InsertSensor> })
     );
   }
 
diff --git a/src/app/shared/api/endpoints/services/sensors.service.ts b/src/app/shared/api/endpoints/services/sensors.service.ts
index 5a1f9cb..7c216c7 100644
--- a/src/app/shared/api/endpoints/services/sensors.service.ts
+++ b/src/app/shared/api/endpoints/services/sensors.service.ts
@@ -9,6 +9,7 @@ import { RequestBuilder } from '../request-builder';
 import { Observable } from 'rxjs';
 import { map, filter } from 'rxjs/operators';
 
+import { Phenomenon } from '../models/phenomenon';
 
 
 /**
@@ -41,7 +42,7 @@ export class SensorsService extends BaseService {
    * This method doesn't expect any request body.
    */
   getPhenomenons$Response(params?: {
-  }): Observable<StrictHttpResponse<Array<any>>> {
+  }): Observable<StrictHttpResponse<Array<Phenomenon>>> {
 
     const rb = new RequestBuilder(this.rootUrl, SensorsService.GetPhenomenonsPath, 'get');
     if (params) {
@@ -53,7 +54,7 @@ export class SensorsService extends BaseService {
     })).pipe(
       filter((r: any) => r instanceof HttpResponse),
       map((r: HttpResponse<any>) => {
-        return r as StrictHttpResponse<Array<any>>;
+        return r as StrictHttpResponse<Array<Phenomenon>>;
       })
     );
   }
@@ -69,10 +70,10 @@ export class SensorsService extends BaseService {
    * This method doesn't expect any request body.
    */
   getPhenomenons(params?: {
-  }): Observable<Array<any>> {
+  }): Observable<Array<Phenomenon>> {
 
     return this.getPhenomenons$Response(params).pipe(
-      map((r: StrictHttpResponse<Array<any>>) => r.body as Array<any>)
+      map((r: StrictHttpResponse<Array<Phenomenon>>) => r.body as Array<Phenomenon>)
     );
   }
 
diff --git a/src/app/shared/api/openapi.yaml b/src/app/shared/api/openapi.yaml
index dd685f3..e447ee5 100644
--- a/src/app/shared/api/openapi.yaml
+++ b/src/app/shared/api/openapi.yaml
@@ -53,6 +53,12 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/UserCookie'
+        401:
+          description: Wrong username or password
+          content:
+            text/plain:
+              schema:
+                type: string
 
   /senslog15/rest/user:
     get:
@@ -116,6 +122,8 @@ paths:
                 type: array
                 items:
                   $ref: '#/components/schemas/OldObservation'
+        500:
+          description: Internal server error
 
   /senslog1/GroupService:
     get:
@@ -220,6 +228,19 @@ paths:
                 properties:
                   sensor:
                     $ref: '#/components/schemas/Sensors'
+        400:
+          description: wrong request
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  message:
+                    type: string
+                  path:
+                    type: string
+                  timestamp:
+                    type: number
 
   /senslog15/ManagementService?Operation=InsertUnit:
     post:
@@ -230,6 +251,69 @@ paths:
       responses:
         200:
           description: inserted
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  unit:
+                    $ref: '#/components/schemas/InsertUnit'
+                  sensors:
+                    type: array
+                    items:
+                      $ref: '#/components/schemas/InsertSensor'
+        400:
+          description: wrong request
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  message:
+                    type: string
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              type: object
+              properties:
+                unit:
+                  $ref: '#/components/schemas/InsertUnit'
+                sensors:
+                  type: array
+                  items:
+                    $ref: '#/components/schemas/InsertSensor'
+
+  /senslog15/ManagementService?Operation=InsertSensor:
+    post:
+      tags:
+        - management
+      summary: Insert Sensor
+      operationId: insertSensor
+      responses:
+        200:
+          description: inserted
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  unit:
+                    $ref: '#/components/schemas/InsertUnit'
+                  sensors:
+                    type: array
+                    items:
+                      $ref: '#/components/schemas/InsertSensor'
+        400:
+          description: wrong request
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  message:
+                    type: string
       requestBody:
         required: true
         content:
@@ -258,7 +342,7 @@ paths:
               schema:
                 type: array
                 items:
-                  $ref: ''#/components/schemas/Phenomenon''
+                  $ref: '#/components/schemas/Phenomenon'
 
   /senslog15/ManagementService?Operation=UpdateUnit:
     put:
@@ -295,6 +379,15 @@ paths:
                 properties:
                   message:
                     type: string
+        400:
+          description: wrong request
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  message:
+                    type: string
       requestBody:
         required: true
         content:
@@ -314,6 +407,19 @@ paths:
       responses:
         200:
           description: deleted
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  unit:
+                    $ref: '#/components/schemas/InsertUnit'
+                  sensors:
+                    type: array
+                    items:
+                      $ref: '#/components/schemas/InsertSensor'
+        400:
+          description: wrong request
           content:
             application/json:
               schema:
@@ -344,6 +450,26 @@ paths:
       responses:
         200:
           description: updated
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  unit:
+                    $ref: '#/components/schemas/InsertUnit'
+                  sensors:
+                    type: array
+                    items:
+                      $ref: '#/components/schemas/InsertSensor'
+        400:
+          description: wrong request
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  message:
+                    type: string
       requestBody:
         required: true
         content:
diff --git a/src/app/shared/nav-bar/components/user-insert-popup/user-insert-popup.component.ts b/src/app/shared/nav-bar/components/user-insert-popup/user-insert-popup.component.ts
index 1b3f91b..463a3fd 100644
--- a/src/app/shared/nav-bar/components/user-insert-popup/user-insert-popup.component.ts
+++ b/src/app/shared/nav-bar/components/user-insert-popup/user-insert-popup.component.ts
@@ -6,6 +6,7 @@ import {AdministrationService} from '../../../api/endpoints/services/administrat
 import {Right} from '../../../api/endpoints/models/right';
 import {FormBuilder, FormGroup, Validators} from '@angular/forms';
 import {HttpResponse} from '@angular/common/http';
+import {ToastService} from '../../../services/toast.service';
 
 @Component({
   selector: 'app-user-insert-popup',
@@ -23,7 +24,8 @@ export class UserInsertPopupComponent implements OnInit {
   constructor(
     private formBuilder: FormBuilder,
     private groupService: GroupService,
-    private administrationService: AdministrationService
+    private administrationService: AdministrationService,
+    private toastService: ToastService
   ) {
     this.initForm();
     // TODO this.getGroups();
@@ -56,18 +58,17 @@ export class UserInsertPopupComponent implements OnInit {
         userName: this.insertForm.controls.userName.value,
         rightsId: this.insertForm.controls.rights.value,
         userRealName: this.insertForm.controls.userRealName.value,
-          // TODO
-        groupId: 2
+        groupId: 2 // TODO
         }
       }).pipe(
         map((response: HttpResponse<any>) => {
-          if (response.status === 200) { // Accepts only 200 status response, due to API Definition
+          if (response.status === 200) {
             this.close();
           } else {
-            console.log('ERROR');
+            this.toastService.showError(null);
           }
         })
-      ).toPromise();
+      ).toPromise().then().catch(err => this.toastService.showError(err.error));
     }
   }
 
diff --git a/src/app/shared/services/toast.service.ts b/src/app/shared/services/toast.service.ts
new file mode 100644
index 0000000..63c64db
--- /dev/null
+++ b/src/app/shared/services/toast.service.ts
@@ -0,0 +1,25 @@
+import {Injectable} from '@angular/core';
+import {MessageService} from 'primeng/api';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class ToastService {
+
+  constructor(
+    private messageService: MessageService
+  ) {
+  }
+
+  showError(err: any) {
+    this.messageService.add({key: 'mainToast', severity:'error', summary: 'Unsuccessful!', detail: err});
+  }
+
+  showWarningNoData() {
+    this.messageService.add({key: 'mainToast', severity:'warn', summary: 'No data!', detail: 'Can not display any data for given interval and aggregation!'});
+  }
+
+  showSuccess() {
+    this.messageService.add({key: 'mainToast', severity:'success', summary: 'No data!', detail: 'Successful request!'});
+  }
+}
