From 9446cea3df9ee37aaba25ca4a2f5830d95bed6b5 Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Tue, 30 Jun 2020 17:12:50 +0200
Subject: [PATCH] Removed unused code

---
 src/app/app.component.ts          | 18 +-----------------
 src/app/services/error.service.ts | 12 ------------
 2 files changed, 1 insertion(+), 29 deletions(-)
 delete mode 100644 src/app/services/error.service.ts

diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 8ceb96f89..a5f015149 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -8,7 +8,6 @@ import { CdkDragDrop, moveItemInArray } from "@angular/cdk/drag-drop";
 import { Observer, jalhydDateRev, jalhydVersion, CalculatorType, Session } from "jalhyd";
 
 import { I18nService } from "./services/internationalisation.service";
-import { ErrorService } from "./services/error.service";
 import { FormulaireService } from "./services/formulaire.service";
 import { FormulaireDefinition } from "./formulaire/definition/form-definition";
 import { ServiceFactory } from "./services/service-factory";
@@ -43,8 +42,7 @@ declare let device: any;
 @Component({
   selector: "nghyd-app",
   templateUrl: "./app.component.html",
-  styleUrls: ["./app.component.scss"],
-  providers: [ErrorService]
+  styleUrls: ["./app.component.scss"]
 })
 export class AppComponent implements OnInit, OnDestroy, Observer {
 
@@ -81,7 +79,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
   constructor(
     private intlService: I18nService,
     private appSetupService: ApplicationSetupService,
-    private errorService: ErrorService,
     private router: Router,
     private formulaireService: FormulaireService,
     private httpService: HttpService,
@@ -279,12 +276,10 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
    */
   ngOnInit() {
     this.formulaireService.addObserver(this);
-    this.subscribeErrorService();
     this._innerWidth = window.innerWidth;
   }
 
   ngOnDestroy() {
-    this.unsubscribeErrorService();
     this.formulaireService.removeObserver(this);
   }
 
@@ -411,17 +406,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
     return fits;
   }
 
-  /**
-   * abonnement au service d'erreurs
-   */
-  private subscribeErrorService() {
-    this.errorService.addObserver(this);
-  }
-
-  private unsubscribeErrorService() {
-    this.errorService.removeObserver(this);
-  }
-
   public get enableHeaderDoc(): boolean {
     return this.currentRoute === "/list" && this._calculators.length === 0;
   }
diff --git a/src/app/services/error.service.ts b/src/app/services/error.service.ts
deleted file mode 100644
index 77620c3b7..000000000
--- a/src/app/services/error.service.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Injectable } from "@angular/core";
-
-import { Observable } from "jalhyd";
-
-@Injectable()
-export class ErrorService extends Observable {
-  // TODO: add explicit constructor
-
-    doAlert(m: string) {
-        this.notifyObservers(m);
-    }
-}
-- 
GitLab