From 448f43a22e4b2fcd4df0f64e64e4381780faf37e Mon Sep 17 00:00:00 2001 From: "francois.grand" <francois.grand@irstea.fr> Date: Tue, 21 Nov 2017 14:42:15 +0100 Subject: [PATCH] =?UTF-8?q?-=20MAJ=20en=20typescript=202.6.1/Angular=205.0?= =?UTF-8?q?.2=20-=20suppression=20des=20d=C3=A9pendances=20inutilis=C3=A9e?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 54 +++++++---------- src/app/app.component.ts | 21 +++---- src/app/app.module.ts | 12 ++-- .../alert-dialog/alert-dialog.component.ts | 58 +++++++++---------- src/app/services/http/http.service.ts | 2 +- src/systemjs.config.js | 2 +- 6 files changed, 68 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index 8ac553805..90ade9ad8 100644 --- a/package.json +++ b/package.json @@ -24,42 +24,28 @@ "author": "", "license": "MIT", "dependencies": { - "@angular/animations": "4.2.5", - "@angular/common": "4.2.5", - "@angular/compiler": "4.2.5", - "@angular/compiler-cli": "4.2.5", - "@angular/core": "4.2.5", - "@angular/forms": "4.2.5", - "@angular/http": "4.2.5", - "@angular/material": "2.0.0-beta.7", - "@angular/platform-browser": "4.2.5", - "@angular/platform-browser-dynamic": "4.2.5", - "@angular/router": "4.2.5", - "@angular/platform-server": "4.2.5", - "systemjs": "0.19.40", - "core-js": "2.4.1", - "rxjs": "5.0.1", - "zone.js": "0.8.4", - "angular2-chartjs": "0.3.0", - "jalhyd": "1.0.0" + "@angular/animations": "5.0.2", + "@angular/common": "5.0.2", + "@angular/compiler": "5.0.2", + "@angular/core": "5.0.2", + "@angular/forms": "5.0.2", + "@angular/http": "5.0.2", + "@angular/platform-browser": "5.0.2", + "@angular/platform-browser-dynamic": "5.0.2", + "@angular/router": "5.0.2", + "angular2-chartjs": "0.4.1", + "core-js": "2.5.1", + "jalhyd": "file:../jalhyd/jalhyd-1.0.0.tgz", + "rxjs": "5.5.2", + "systemjs": "0.20.19", + "zone.js": "0.8.18" }, "devDependencies": { - "concurrently": "3.2.0", - "lite-server": "2.2.2", - "typescript": "2.2.2", - "canonical-path": "0.0.2", - "tslint": "3.15.1", - "lodash": "4.16.4", - "jasmine-core": "2.4.1", - "karma": "1.3.0", - "karma-chrome-launcher": "2.0.0", - "karma-cli": "1.0.1", - "karma-jasmine": "1.0.2", - "karma-jasmine-html-reporter": "0.2.2", - "protractor": "4.0.14", - "rimraf": "2.5.4", - "@types/node": "6.0.46", - "@types/jasmine": "2.5.36" + "concurrently": "3.5.0", + "lite-server": "2.3.0", + "typescript": "2.6.1", + "tslint": "5.8.0", + "@types/node": "8.0.53" }, "repository": {} } diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0ef2e47b8..b13bc116d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,12 +1,12 @@ import { Component, ChangeDetectorRef, ApplicationRef, AfterViewChecked } from '@angular/core'; -import { MdDialog } from '@angular/material'; +//import { MdDialog } from '@angular/material'; import { ParamService } from './services/param/param.service'; import { HttpService } from './services/http/http.service'; import { InternationalisationService, Language, LanguageCode } from './services/internationalisation/internationalisation.service'; import { Observer } from './services/observer'; import { ErrorService } from './services/error/error.service'; -import { AlertDialog } from './components/alert-dialog/alert-dialog.component'; +// import { AlertDialog } from './components/alert-dialog/alert-dialog.component'; import { FormulaireService } from './services/formulaire/formulaire.service'; @Component({ @@ -38,7 +38,8 @@ export class AppComponent implements Observer { private _displayErrorDialog: boolean = false; - constructor(private intlService: InternationalisationService, private appRef: ApplicationRef, private dialog: MdDialog, private errorService: ErrorService) { } + // constructor(private intlService: InternationalisationService, private appRef: ApplicationRef, private dialog: MdDialog, private errorService: ErrorService) { } + constructor(private intlService: InternationalisationService, private appRef: ApplicationRef, private errorService: ErrorService) { } private initLocale() { let docLocale: string = document['locale'] as string; @@ -78,12 +79,12 @@ export class AppComponent implements Observer { update(data: any): void { // on ouvre un dialogue avec le message d'erreur reçu - if (this._displayErrorDialog) { - let dialogRef = this.dialog.open(AlertDialog); - let ad: AlertDialog = dialogRef.componentInstance; - ad.text = String(data); - } - else - console.log(data); + // if (this._displayErrorDialog) { + // let dialogRef = this.dialog.open(AlertDialog); + // let ad: AlertDialog = dialogRef.componentInstance; + // ad.text = String(data); + // } + // else + console.log(data); } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index b3613a86d..d4f1bee39 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,7 +3,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgModule } from '@angular/core'; import { HttpModule } from '@angular/http'; import { FormsModule } from '@angular/forms'; // <-- NgModel lives here -import { MdInputModule, MdDialogModule } from '@angular/material'; +//import { MdInputModule, MdDialogModule } from '@angular/material'; import { ChartModule } from 'angular2-chartjs'; import { AppComponent } from './app.component'; @@ -17,7 +17,7 @@ import { LechaptCalmonComponent } from './calculators/lechapt-calmon/lechaptcalm import { SectionParametreeComponent } from './calculators/section-param/section-param.component'; import { RegimeUniformeComponent } from './calculators/regime-uniforme/regime-uniforme.component'; import { CourbeRemousComponent } from './calculators/remous/remous.component'; -import { AlertDialog } from './components/alert-dialog/alert-dialog.component'; +// import { AlertDialog } from './components/alert-dialog/alert-dialog.component'; import { AppErrorModule } from './error.module'; import { CalculatorResultsComponent } from './components/calculator-results/calculator-results.component'; import { SectionResultsComponent } from './components/section-results/section-results.component'; @@ -31,9 +31,9 @@ import { RemousResultsComponent } from './components/remous-results/remous-resul BrowserModule, BrowserAnimationsModule, FormsModule, // <-- import the FormsModule before binding with [(ngModel)] - MdInputModule, HttpModule, - MdDialogModule, + // MdInputModule, + // MdDialogModule, ChartModule, AppErrorModule ], @@ -43,11 +43,11 @@ import { RemousResultsComponent } from './components/remous-results/remous-resul FieldSetComponent, ParamFieldLineComponent, SelectFieldLineComponent, CheckFieldLineComponent, CondDistriComponent, LechaptCalmonComponent, SectionParametreeComponent, GenericCalculatorComponent, RegimeUniformeComponent, CourbeRemousComponent, - AlertDialog, + // AlertDialog, CalculatorResultsComponent, SectionResultsComponent, RemousResultsComponent, CalcCanvasComponent, SectionCanvasComponent ], - entryComponents: [AlertDialog], + // entryComponents: [AlertDialog], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/components/alert-dialog/alert-dialog.component.ts b/src/app/components/alert-dialog/alert-dialog.component.ts index e2504802f..82681813a 100644 --- a/src/app/components/alert-dialog/alert-dialog.component.ts +++ b/src/app/components/alert-dialog/alert-dialog.component.ts @@ -1,33 +1,33 @@ -import { Component, Input } from '@angular/core'; -import { MdDialog } from '@angular/material'; +// import { Component, Input } from '@angular/core'; +// import { MdDialog } from '@angular/material'; -@Component({ - selector: 'dialog1', - template: ` - <h2>{{_text}}</h2> - `, - providers: [MdDialog] -}) -export class AlertDialog { - /** - * text input attribute - */ - private _text: string; +// @Component({ +// selector: 'dialog1', +// template: ` +// <h2>{{_text}}</h2> +// `, +// providers: [MdDialog] +// }) +// export class AlertDialog { +// /** +// * text input attribute +// */ +// private _text: string; - // constructor(private _dialog: MdDialog) { } - // public get dialog() { - // return this._dialog; - // } +// // constructor(private _dialog: MdDialog) { } +// // public get dialog() { +// // return this._dialog; +// // } - @Input() - public set text(s: string) { - this._text = s; - } +// @Input() +// public set text(s: string) { +// this._text = s; +// } - // public run(t: string) { - // let dialogRef = this._dialog.open(AlertDialog); - // // let ad: AlertDialog = dialogRef.componentInstance; - // // ad.text = "azeaze"; - // this._text = t; - // } -} +// // public run(t: string) { +// // let dialogRef = this._dialog.open(AlertDialog); +// // // let ad: AlertDialog = dialogRef.componentInstance; +// // // ad.text = "azeaze"; +// // this._text = t; +// // } +// } diff --git a/src/app/services/http/http.service.ts b/src/app/services/http/http.service.ts index 1c1556acd..30433e171 100644 --- a/src/app/services/http/http.service.ts +++ b/src/app/services/http/http.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Http, RequestOptions, RequestOptionsArgs, Headers, Response } from '@angular/http'; import { Observable } from "rxjs/Observable"; - +import 'rxjs/add/operator/map'; @Injectable() export class HttpService { diff --git a/src/systemjs.config.js b/src/systemjs.config.js index be702cf6a..9cb721fa8 100644 --- a/src/systemjs.config.js +++ b/src/systemjs.config.js @@ -27,7 +27,7 @@ '@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js', '@angular/material': 'npm:@angular/material/bundles/material.umd.js', - // charjs + // chartjs pour angular4/angular5 'angular2-chartjs': 'npm:angular2-chartjs', 'chart.js': 'npm:chart.js/dist/Chart.bundle.js', -- GitLab