From ad42bea3a55ca7937f082cc641764de70ce34bd1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Apr 2017 22:00:17 +0200 Subject: [PATCH] Client: update to angular 4 --- client/config/webpack.common.js | 22 -------------- client/package.json | 30 ++++++++++--------- client/src/app/app.module.ts | 2 ++ .../src/app/core/confirm/confirm.component.ts | 2 +- client/src/app/core/core.module.ts | 2 +- .../app/shared/search/search.component.html | 2 +- client/src/app/shared/shared.module.ts | 12 ++++---- .../video-edit/video-edit.component.scss | 5 ---- .../video-edit/video-update.component.html | 2 +- .../video-watch/video-magnet.component.ts | 2 +- .../video-watch/video-report.component.ts | 2 +- .../video-watch/video-share.component.ts | 2 +- .../video-watch/video-watch.component.html | 6 ++-- client/src/app/videos/videos.module.ts | 4 +++ client/src/sass/application.scss | 24 ++++++++------- 15 files changed, 51 insertions(+), 68 deletions(-) diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js index 08b8a4b09..86cbf84d7 100644 --- a/client/config/webpack.common.js +++ b/client/config/webpack.common.js @@ -288,28 +288,6 @@ module.exports = function (options) { } }), - // Fix Angular 2 - new NormalModuleReplacementPlugin( - /facade(\\|\/)async/, - helpers.root('node_modules/@angular/core/src/facade/async.js') - ), - new NormalModuleReplacementPlugin( - /facade(\\|\/)collection/, - helpers.root('node_modules/@angular/core/src/facade/collection.js') - ), - new NormalModuleReplacementPlugin( - /facade(\\|\/)errors/, - helpers.root('node_modules/@angular/core/src/facade/errors.js') - ), - new NormalModuleReplacementPlugin( - /facade(\\|\/)lang/, - helpers.root('node_modules/@angular/core/src/facade/lang.js') - ), - new NormalModuleReplacementPlugin( - /facade(\\|\/)math/, - helpers.root('node_modules/@angular/core/src/facade/math.js') - ), - new ngcWebpack.NgcWebpackPlugin({ disabled: !AOT, tsConfig: helpers.root('tsconfig.webpack.json'), diff --git a/client/package.json b/client/package.json index f882e157f..e8b2a1c35 100644 --- a/client/package.json +++ b/client/package.json @@ -18,18 +18,19 @@ }, "license": "GPLv3", "dependencies": { - "@angular/common": "~2.4.1", - "@angular/compiler": "~2.4.1", - "@angular/compiler-cli": "^2.4.3", - "@angular/core": "~2.4.1", - "@angular/forms": "~2.4.1", - "@angular/http": "~2.4.1", - "@angular/platform-browser": "~2.4.1", - "@angular/platform-browser-dynamic": "~2.4.1", - "@angular/router": "~3.4.1", + "@angular/animations": "^4.0.2", + "@angular/common": "~4.0.0", + "@angular/compiler": "~4.0.0", + "@angular/compiler-cli": "^4.0.0", + "@angular/core": "~4.0.0", + "@angular/forms": "~4.0.0", + "@angular/http": "~4.0.0", + "@angular/platform-browser": "~4.0.0", + "@angular/platform-browser-dynamic": "~4.0.0", + "@angular/router": "~4.0.0", "@angularclass/hmr": "^1.2.0", "@angularclass/hmr-loader": "^3.0.2", - "@nglibs/meta": "^0.2.0-rc.3", + "@nglibs/meta": "^0.4.0-rc.1", "@types/core-js": "^0.9.28", "@types/node": "^6.0.38", "@types/source-map": "^0.1.26", @@ -37,7 +38,7 @@ "@types/videojs": "0.0.30", "@types/webpack": "^2.0.0", "angular-pipes": "^5.0.0", - "angular2-notifications": "^0.4.53", + "angular2-notifications": "^0.5.4", "angular2-template-loader": "^0.6.0", "assets-webpack-plugin": "^3.4.0", "awesome-typescript-loader": "3.0.0-beta.18", @@ -55,10 +56,11 @@ "intl": "^1.2.4", "json-loader": "^0.5.4", "ng-router-loader": "^1.0.2", - "ng2-bootstrap": "1.1.16-10", "ng2-file-upload": "^1.1.4-2", - "ng2-smart-table": "0.5.2-1", + "ng2-smart-table": "1.0.3", + "ng2-tag-input": "1.0.1", "ngc-webpack": "1.1.0", + "ngx-bootstrap": "1.6.6", "node-sass": "^4.1.1", "normalize.css": "^5.0.0", "optimize-js-plugin": "0.0.4", @@ -74,7 +76,7 @@ "tslib": "^1.5.0", "tslint": "~4.3.1", "tslint-loader": "^3.3.0", - "typescript": "~2.1.0", + "typescript": "~2.2.0", "url-loader": "^0.5.7", "video.js": "^5.11.9", "videojs-dock": "^2.0.2", diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 534651cea..7d1760fcd 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -3,6 +3,8 @@ import { BrowserModule } from '@angular/platform-browser'; import { removeNgStyles, createNewHosts } from '@angularclass/hmr'; import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@nglibs/meta'; +// TODO: remove, we need this to avoid error in ng2-smart-table +import 'rxjs/add/operator/toPromise'; import 'bootstrap-loader'; import { ENV_PROVIDERS } from './environment'; diff --git a/client/src/app/core/confirm/confirm.component.ts b/client/src/app/core/confirm/confirm.component.ts index 14b4ef324..ae42ff68a 100644 --- a/client/src/app/core/confirm/confirm.component.ts +++ b/client/src/app/core/confirm/confirm.component.ts @@ -1,6 +1,6 @@ import { Component, HostListener, OnInit, ViewChild } from '@angular/core'; -import { ModalDirective } from 'ng2-bootstrap/modal'; +import { ModalDirective } from 'ngx-bootstrap/modal'; import { ConfirmService } from './confirm.service'; diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts index 9a5ee5221..81c8f2da6 100644 --- a/client/src/app/core/core.module.ts +++ b/client/src/app/core/core.module.ts @@ -4,7 +4,7 @@ import { HttpModule } from '@angular/http'; import { RouterModule } from '@angular/router'; import { SimpleNotificationsModule } from 'angular2-notifications'; -import { ModalModule } from 'ng2-bootstrap/modal'; +import { ModalModule } from 'ngx-bootstrap/modal'; import { AuthService } from './auth'; import { ConfigService } from './config'; diff --git a/client/src/app/shared/search/search.component.html b/client/src/app/shared/search/search.component.html index b3afc9598..0c7b5038a 100644 --- a/client/src/app/shared/search/search.component.html +++ b/client/src/app/shared/search/search.component.html @@ -3,7 +3,7 @@ -