aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-04-12 22:00:17 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-04-12 22:00:17 +0200
commitad42bea3a55ca7937f082cc641764de70ce34bd1 (patch)
tree621302fd9fa39ad5e76c5c0a5e7197464a0ea125 /client
parentd8e689b864749648d03cf4391fd4a475126f01cd (diff)
downloadPeerTube-ad42bea3a55ca7937f082cc641764de70ce34bd1.tar.gz
PeerTube-ad42bea3a55ca7937f082cc641764de70ce34bd1.tar.zst
PeerTube-ad42bea3a55ca7937f082cc641764de70ce34bd1.zip
Client: update to angular 4
Diffstat (limited to 'client')
-rw-r--r--client/config/webpack.common.js22
-rw-r--r--client/package.json30
-rw-r--r--client/src/app/app.module.ts2
-rw-r--r--client/src/app/core/confirm/confirm.component.ts2
-rw-r--r--client/src/app/core/core.module.ts2
-rw-r--r--client/src/app/shared/search/search.component.html2
-rw-r--r--client/src/app/shared/shared.module.ts12
-rw-r--r--client/src/app/videos/video-edit/video-edit.component.scss5
-rw-r--r--client/src/app/videos/video-edit/video-update.component.html2
-rw-r--r--client/src/app/videos/video-watch/video-magnet.component.ts2
-rw-r--r--client/src/app/videos/video-watch/video-report.component.ts2
-rw-r--r--client/src/app/videos/video-watch/video-share.component.ts2
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.html6
-rw-r--r--client/src/app/videos/videos.module.ts4
-rw-r--r--client/src/sass/application.scss24
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) {
288 } 288 }
289 }), 289 }),
290 290
291 // Fix Angular 2
292 new NormalModuleReplacementPlugin(
293 /facade(\\|\/)async/,
294 helpers.root('node_modules/@angular/core/src/facade/async.js')
295 ),
296 new NormalModuleReplacementPlugin(
297 /facade(\\|\/)collection/,
298 helpers.root('node_modules/@angular/core/src/facade/collection.js')
299 ),
300 new NormalModuleReplacementPlugin(
301 /facade(\\|\/)errors/,
302 helpers.root('node_modules/@angular/core/src/facade/errors.js')
303 ),
304 new NormalModuleReplacementPlugin(
305 /facade(\\|\/)lang/,
306 helpers.root('node_modules/@angular/core/src/facade/lang.js')
307 ),
308 new NormalModuleReplacementPlugin(
309 /facade(\\|\/)math/,
310 helpers.root('node_modules/@angular/core/src/facade/math.js')
311 ),
312
313 new ngcWebpack.NgcWebpackPlugin({ 291 new ngcWebpack.NgcWebpackPlugin({
314 disabled: !AOT, 292 disabled: !AOT,
315 tsConfig: helpers.root('tsconfig.webpack.json'), 293 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 @@
18 }, 18 },
19 "license": "GPLv3", 19 "license": "GPLv3",
20 "dependencies": { 20 "dependencies": {
21 "@angular/common": "~2.4.1", 21 "@angular/animations": "^4.0.2",
22 "@angular/compiler": "~2.4.1", 22 "@angular/common": "~4.0.0",
23 "@angular/compiler-cli": "^2.4.3", 23 "@angular/compiler": "~4.0.0",
24 "@angular/core": "~2.4.1", 24 "@angular/compiler-cli": "^4.0.0",
25 "@angular/forms": "~2.4.1", 25 "@angular/core": "~4.0.0",
26 "@angular/http": "~2.4.1", 26 "@angular/forms": "~4.0.0",
27 "@angular/platform-browser": "~2.4.1", 27 "@angular/http": "~4.0.0",
28 "@angular/platform-browser-dynamic": "~2.4.1", 28 "@angular/platform-browser": "~4.0.0",
29 "@angular/router": "~3.4.1", 29 "@angular/platform-browser-dynamic": "~4.0.0",
30 "@angular/router": "~4.0.0",
30 "@angularclass/hmr": "^1.2.0", 31 "@angularclass/hmr": "^1.2.0",
31 "@angularclass/hmr-loader": "^3.0.2", 32 "@angularclass/hmr-loader": "^3.0.2",
32 "@nglibs/meta": "^0.2.0-rc.3", 33 "@nglibs/meta": "^0.4.0-rc.1",
33 "@types/core-js": "^0.9.28", 34 "@types/core-js": "^0.9.28",
34 "@types/node": "^6.0.38", 35 "@types/node": "^6.0.38",
35 "@types/source-map": "^0.1.26", 36 "@types/source-map": "^0.1.26",
@@ -37,7 +38,7 @@
37 "@types/videojs": "0.0.30", 38 "@types/videojs": "0.0.30",
38 "@types/webpack": "^2.0.0", 39 "@types/webpack": "^2.0.0",
39 "angular-pipes": "^5.0.0", 40 "angular-pipes": "^5.0.0",
40 "angular2-notifications": "^0.4.53", 41 "angular2-notifications": "^0.5.4",
41 "angular2-template-loader": "^0.6.0", 42 "angular2-template-loader": "^0.6.0",
42 "assets-webpack-plugin": "^3.4.0", 43 "assets-webpack-plugin": "^3.4.0",
43 "awesome-typescript-loader": "3.0.0-beta.18", 44 "awesome-typescript-loader": "3.0.0-beta.18",
@@ -55,10 +56,11 @@
55 "intl": "^1.2.4", 56 "intl": "^1.2.4",
56 "json-loader": "^0.5.4", 57 "json-loader": "^0.5.4",
57 "ng-router-loader": "^1.0.2", 58 "ng-router-loader": "^1.0.2",
58 "ng2-bootstrap": "1.1.16-10",
59 "ng2-file-upload": "^1.1.4-2", 59 "ng2-file-upload": "^1.1.4-2",
60 "ng2-smart-table": "0.5.2-1", 60 "ng2-smart-table": "1.0.3",
61 "ng2-tag-input": "1.0.1",
61 "ngc-webpack": "1.1.0", 62 "ngc-webpack": "1.1.0",
63 "ngx-bootstrap": "1.6.6",
62 "node-sass": "^4.1.1", 64 "node-sass": "^4.1.1",
63 "normalize.css": "^5.0.0", 65 "normalize.css": "^5.0.0",
64 "optimize-js-plugin": "0.0.4", 66 "optimize-js-plugin": "0.0.4",
@@ -74,7 +76,7 @@
74 "tslib": "^1.5.0", 76 "tslib": "^1.5.0",
75 "tslint": "~4.3.1", 77 "tslint": "~4.3.1",
76 "tslint-loader": "^3.3.0", 78 "tslint-loader": "^3.3.0",
77 "typescript": "~2.1.0", 79 "typescript": "~2.2.0",
78 "url-loader": "^0.5.7", 80 "url-loader": "^0.5.7",
79 "video.js": "^5.11.9", 81 "video.js": "^5.11.9",
80 "videojs-dock": "^2.0.2", 82 "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';
3import { removeNgStyles, createNewHosts } from '@angularclass/hmr'; 3import { removeNgStyles, createNewHosts } from '@angularclass/hmr';
4 4
5import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@nglibs/meta'; 5import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@nglibs/meta';
6// TODO: remove, we need this to avoid error in ng2-smart-table
7import 'rxjs/add/operator/toPromise';
6import 'bootstrap-loader'; 8import 'bootstrap-loader';
7 9
8import { ENV_PROVIDERS } from './environment'; 10import { 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 @@
1import { Component, HostListener, OnInit, ViewChild } from '@angular/core'; 1import { Component, HostListener, OnInit, ViewChild } from '@angular/core';
2 2
3import { ModalDirective } from 'ng2-bootstrap/modal'; 3import { ModalDirective } from 'ngx-bootstrap/modal';
4 4
5import { ConfirmService } from './confirm.service'; 5import { ConfirmService } from './confirm.service';
6 6
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';
4import { RouterModule } from '@angular/router'; 4import { RouterModule } from '@angular/router';
5 5
6import { SimpleNotificationsModule } from 'angular2-notifications'; 6import { SimpleNotificationsModule } from 'angular2-notifications';
7import { ModalModule } from 'ng2-bootstrap/modal'; 7import { ModalModule } from 'ngx-bootstrap/modal';
8 8
9import { AuthService } from './auth'; 9import { AuthService } from './auth';
10import { ConfigService } from './config'; 10import { 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 @@
3 <button id="simple-btn-keyboard-nav" type="button" class="btn btn-default" dropdownToggle> 3 <button id="simple-btn-keyboard-nav" type="button" class="btn btn-default" dropdownToggle>
4 {{ getStringChoice(searchCriterias.field) }} <span class="caret"></span> 4 {{ getStringChoice(searchCriterias.field) }} <span class="caret"></span>
5 </button> 5 </button>
6 <ul class="dropdown-menu" role="menu" aria-labelledby="simple-btn-keyboard-nav" dropdownMenu> 6 <ul class="dropdown-menu" role="menu" aria-labelledby="simple-btn-keyboard-nav" *dropdownMenu>
7 <li *ngFor="let choice of choiceKeys" class="dropdown-item" role="menu-item"> 7 <li *ngFor="let choice of choiceKeys" class="dropdown-item" role="menu-item">
8 <a class="dropdown-item" href="#" (click)="choose($event, choice)">{{ getStringChoice(choice) }}</a> 8 <a class="dropdown-item" href="#" (click)="choose($event, choice)">{{ getStringChoice(choice) }}</a>
9 </li> 9 </li>
diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts
index 84cc86c64..8ffaf964b 100644
--- a/client/src/app/shared/shared.module.ts
+++ b/client/src/app/shared/shared.module.ts
@@ -6,10 +6,10 @@ import { RouterModule } from '@angular/router';
6 6
7import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; 7import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
8import { KeysPipe } from 'angular-pipes/src/object/keys.pipe'; 8import { KeysPipe } from 'angular-pipes/src/object/keys.pipe';
9import { DropdownModule } from 'ng2-bootstrap/dropdown'; 9import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
10import { ProgressbarModule } from 'ng2-bootstrap/progressbar'; 10import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
11import { PaginationModule } from 'ng2-bootstrap/pagination'; 11import { PaginationModule } from 'ngx-bootstrap/pagination';
12import { ModalModule } from 'ng2-bootstrap/modal'; 12import { ModalModule } from 'ngx-bootstrap/modal';
13import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload'; 13import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
14import { Ng2SmartTableModule } from 'ng2-smart-table'; 14import { Ng2SmartTableModule } from 'ng2-smart-table';
15 15
@@ -27,7 +27,7 @@ import { VideoAbuseService } from './video-abuse';
27 HttpModule, 27 HttpModule,
28 RouterModule, 28 RouterModule,
29 29
30 DropdownModule.forRoot(), 30 BsDropdownModule.forRoot(),
31 ModalModule.forRoot(), 31 ModalModule.forRoot(),
32 PaginationModule.forRoot(), 32 PaginationModule.forRoot(),
33 ProgressbarModule.forRoot(), 33 ProgressbarModule.forRoot(),
@@ -49,7 +49,7 @@ import { VideoAbuseService } from './video-abuse';
49 HttpModule, 49 HttpModule,
50 RouterModule, 50 RouterModule,
51 51
52 DropdownModule, 52 BsDropdownModule,
53 FileUploadModule, 53 FileUploadModule,
54 ModalModule, 54 ModalModule,
55 PaginationModule, 55 PaginationModule,
diff --git a/client/src/app/videos/video-edit/video-edit.component.scss b/client/src/app/videos/video-edit/video-edit.component.scss
index 11ee3297e..92b731191 100644
--- a/client/src/app/videos/video-edit/video-edit.component.scss
+++ b/client/src/app/videos/video-edit/video-edit.component.scss
@@ -20,11 +20,6 @@
20 display: block; 20 display: block;
21} 21}
22 22
23.name_file {
24 display: inline-block;
25 margin-left: 10px;
26}
27
28.form-group { 23.form-group {
29 margin-bottom: 10px; 24 margin-bottom: 10px;
30} 25}
diff --git a/client/src/app/videos/video-edit/video-update.component.html b/client/src/app/videos/video-edit/video-update.component.html
index 665a952d0..2e10d5bf7 100644
--- a/client/src/app/videos/video-edit/video-update.component.html
+++ b/client/src/app/videos/video-edit/video-update.component.html
@@ -1,4 +1,4 @@
1<h3>Update {{ video.name }}</h3> 1<h3>Update {{ video?.name }}</h3>
2 2
3<div *ngIf="error" class="alert alert-danger">{{ error }}</div> 3<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
4 4
diff --git a/client/src/app/videos/video-watch/video-magnet.component.ts b/client/src/app/videos/video-watch/video-magnet.component.ts
index 8bee848a4..894fa45fc 100644
--- a/client/src/app/videos/video-watch/video-magnet.component.ts
+++ b/client/src/app/videos/video-watch/video-magnet.component.ts
@@ -1,6 +1,6 @@
1import { Component, Input, ViewChild } from '@angular/core'; 1import { Component, Input, ViewChild } from '@angular/core';
2 2
3import { ModalDirective } from 'ng2-bootstrap/modal'; 3import { ModalDirective } from 'ngx-bootstrap/modal';
4 4
5import { Video } from '../shared'; 5import { Video } from '../shared';
6 6
diff --git a/client/src/app/videos/video-watch/video-report.component.ts b/client/src/app/videos/video-watch/video-report.component.ts
index c4cf936ce..528005b84 100644
--- a/client/src/app/videos/video-watch/video-report.component.ts
+++ b/client/src/app/videos/video-watch/video-report.component.ts
@@ -1,7 +1,7 @@
1import { Component, Input, OnInit, ViewChild } from '@angular/core'; 1import { Component, Input, OnInit, ViewChild } from '@angular/core';
2import { FormBuilder, FormGroup } from '@angular/forms'; 2import { FormBuilder, FormGroup } from '@angular/forms';
3 3
4import { ModalDirective } from 'ng2-bootstrap/modal'; 4import { ModalDirective } from 'ngx-bootstrap/modal';
5import { NotificationsService } from 'angular2-notifications'; 5import { NotificationsService } from 'angular2-notifications';
6 6
7import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared'; 7import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared';
diff --git a/client/src/app/videos/video-watch/video-share.component.ts b/client/src/app/videos/video-watch/video-share.component.ts
index 0b85052cd..aa921afc2 100644
--- a/client/src/app/videos/video-watch/video-share.component.ts
+++ b/client/src/app/videos/video-watch/video-share.component.ts
@@ -1,6 +1,6 @@
1import { Component, Input, ViewChild } from '@angular/core'; 1import { Component, Input, ViewChild } from '@angular/core';
2 2
3import { ModalDirective } from 'ng2-bootstrap/modal'; 3import { ModalDirective } from 'ngx-bootstrap/modal';
4 4
5import { Video } from '../shared'; 5import { Video } from '../shared';
6 6
diff --git a/client/src/app/videos/video-watch/video-watch.component.html b/client/src/app/videos/video-watch/video-watch.component.html
index 2a6b15dc9..19e9bd9ed 100644
--- a/client/src/app/videos/video-watch/video-watch.component.html
+++ b/client/src/app/videos/video-watch/video-watch.component.html
@@ -78,7 +78,7 @@
78 <span class="glyphicon glyphicon-option-horizontal"></span> More 78 <span class="glyphicon glyphicon-option-horizontal"></span> More
79 </button> 79 </button>
80 80
81 <ul dropdownMenu id="more-menu" role="menu" aria-labelledby="single-button"> 81 <ul *dropdownMenu class="dropdown-menu" id="more-menu" role="menu" aria-labelledby="single-button">
82 <li *ngIf="canUserUpdateVideo()" role="menuitem"> 82 <li *ngIf="canUserUpdateVideo()" role="menuitem">
83 <a class="dropdown-item" title="Update this video" href="#" [routerLink]="[ '/videos/edit', video.id ]"> 83 <a class="dropdown-item" title="Update this video" href="#" [routerLink]="[ '/videos/edit', video.id ]">
84 <span class="glyphicon glyphicon-pencil"></span> Update 84 <span class="glyphicon glyphicon-pencil"></span> Update
@@ -142,8 +142,8 @@
142 </div> 142 </div>
143</div> 143</div>
144 144
145<template [ngIf]="video !== null"> 145<ng-template [ngIf]="video !== null">
146 <my-video-share #videoShareModal [video]="video"></my-video-share> 146 <my-video-share #videoShareModal [video]="video"></my-video-share>
147 <my-video-magnet #videoMagnetModal [video]="video"></my-video-magnet> 147 <my-video-magnet #videoMagnetModal [video]="video"></my-video-magnet>
148 <my-video-report #videoReportModal [video]="video"></my-video-report> 148 <my-video-report #videoReportModal [video]="video"></my-video-report>
149</template> 149</ng-template>
diff --git a/client/src/app/videos/videos.module.ts b/client/src/app/videos/videos.module.ts
index fa37ad966..4f2839c85 100644
--- a/client/src/app/videos/videos.module.ts
+++ b/client/src/app/videos/videos.module.ts
@@ -1,5 +1,7 @@
1import { NgModule } from '@angular/core'; 1import { NgModule } from '@angular/core';
2 2
3// import { TagInputModule } from 'ng2-tag-input';
4
3import { VideosRoutingModule } from './videos-routing.module'; 5import { VideosRoutingModule } from './videos-routing.module';
4import { VideosComponent } from './videos.component'; 6import { VideosComponent } from './videos.component';
5import { VideoAddComponent, VideoUpdateComponent } from './video-edit'; 7import { VideoAddComponent, VideoUpdateComponent } from './video-edit';
@@ -16,6 +18,8 @@ import { SharedModule } from '../shared';
16 18
17@NgModule({ 19@NgModule({
18 imports: [ 20 imports: [
21 // TagInputModule,
22
19 VideosRoutingModule, 23 VideosRoutingModule,
20 SharedModule 24 SharedModule
21 ], 25 ],
diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss
index 994b1e2b9..df3ee6c20 100644
--- a/client/src/sass/application.scss
+++ b/client/src/sass/application.scss
@@ -42,23 +42,25 @@ menu {
42 } 42 }
43} 43}
44 44
45.ng2-smart-table-container { 45/* some fixes for ng2-smart-table */
46 .ng2-smart-table { 46ng2-smart-table {
47 47 thead tr {
48 thead tr { 48 border-top: 1px solid rgb(233, 235, 236)
49 border-top: 1px solid rgb(233, 235, 236) 49 }
50 }
51 50
52 td, th { 51 td, th {
53 padding: 8px !important; 52 padding: 8px !important;
54 color: #333333 !important; 53 color: #333333 !important;
55 font-size: 14px !important; 54 font-size: 14px !important;
56 }
57 } 55 }
58 56
59 .ng2-smart-pagination-nav .page-link { 57 .ng2-smart-pagination-nav .page-link {
60 font-size: 11px !important; 58 font-size: 11px !important;
61 } 59 }
60
61 .glyphicon {
62 font-family: 'Glyphicons Halflings' !important;
63 }
62} 64}
63 65
64[hidden] { 66[hidden] {