diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-09-06 22:40:57 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-09-06 22:40:57 +0200 |
commit | ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca (patch) | |
tree | 1749a7390cf0a726a179c5fa554053f5c0f0e51c /client/src/app/admin | |
parent | 088a967fe0bc285aa7811515f6a9655e1144b9f9 (diff) | |
download | PeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.tar.gz PeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.tar.zst PeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.zip |
Dirty update to Angular RC6
Diffstat (limited to 'client/src/app/admin')
-rw-r--r-- | client/src/app/admin/admin.component.ts | 4 | ||||
-rw-r--r-- | client/src/app/admin/admin.routes.ts | 4 | ||||
-rw-r--r-- | client/src/app/admin/friends/friend-add/friend-add.component.ts | 14 | ||||
-rw-r--r-- | client/src/app/admin/friends/friend-list/friend-list.component.ts | 4 | ||||
-rw-r--r-- | client/src/app/admin/friends/friends.component.ts | 7 | ||||
-rw-r--r-- | client/src/app/admin/friends/friends.routes.ts | 4 | ||||
-rw-r--r-- | client/src/app/admin/friends/index.ts | 1 | ||||
-rw-r--r-- | client/src/app/admin/index.ts | 1 | ||||
-rw-r--r-- | client/src/app/admin/menu-admin.component.ts | 4 | ||||
-rw-r--r-- | client/src/app/admin/users/user-add/user-add.component.ts | 6 | ||||
-rw-r--r-- | client/src/app/admin/users/user-list/user-list.component.ts | 4 | ||||
-rw-r--r-- | client/src/app/admin/users/users.component.ts | 7 | ||||
-rw-r--r-- | client/src/app/admin/users/users.routes.ts | 4 |
13 files changed, 23 insertions, 41 deletions
diff --git a/client/src/app/admin/admin.component.ts b/client/src/app/admin/admin.component.ts index 82f2529ec..64a7400e7 100644 --- a/client/src/app/admin/admin.component.ts +++ b/client/src/app/admin/admin.component.ts | |||
@@ -1,9 +1,7 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | ||
3 | 2 | ||
4 | @Component({ | 3 | @Component({ |
5 | template: '<router-outlet></router-outlet>', | 4 | template: '<router-outlet></router-outlet>' |
6 | directives: [ ROUTER_DIRECTIVES ] | ||
7 | }) | 5 | }) |
8 | 6 | ||
9 | export class AdminComponent { | 7 | export class AdminComponent { |
diff --git a/client/src/app/admin/admin.routes.ts b/client/src/app/admin/admin.routes.ts index 80b3ecbc1..1fcace994 100644 --- a/client/src/app/admin/admin.routes.ts +++ b/client/src/app/admin/admin.routes.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { RouterConfig } from '@angular/router'; | 1 | import { Routes } from '@angular/router'; |
2 | 2 | ||
3 | import { AdminComponent } from './admin.component'; | 3 | import { AdminComponent } from './admin.component'; |
4 | import { FriendsRoutes } from './friends'; | 4 | import { FriendsRoutes } from './friends'; |
5 | import { UsersRoutes } from './users'; | 5 | import { UsersRoutes } from './users'; |
6 | 6 | ||
7 | export const AdminRoutes: RouterConfig = [ | 7 | export const AdminRoutes: Routes = [ |
8 | { | 8 | { |
9 | path: 'admin', | 9 | path: 'admin', |
10 | component: AdminComponent, | 10 | component: AdminComponent, |
diff --git a/client/src/app/admin/friends/friend-add/friend-add.component.ts b/client/src/app/admin/friends/friend-add/friend-add.component.ts index 2b2aceb8a..55aed9156 100644 --- a/client/src/app/admin/friends/friend-add/friend-add.component.ts +++ b/client/src/app/admin/friends/friend-add/friend-add.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | import { FormControl, FormGroup, REACTIVE_FORM_DIRECTIVES } from '@angular/forms'; | 2 | import { FormControl, FormGroup } from '@angular/forms'; |
3 | import { Router } from '@angular/router'; | 3 | import { Router } from '@angular/router'; |
4 | 4 | ||
5 | import { validateUrl } from '../../../shared'; | 5 | import { validateUrl } from '../../../shared'; |
@@ -8,8 +8,7 @@ import { FriendService } from '../shared'; | |||
8 | @Component({ | 8 | @Component({ |
9 | selector: 'my-friend-add', | 9 | selector: 'my-friend-add', |
10 | template: require('./friend-add.component.html'), | 10 | template: require('./friend-add.component.html'), |
11 | styles: [ require('./friend-add.component.scss') ], | 11 | styles: [ require('./friend-add.component.scss') ] |
12 | directives: [ REACTIVE_FORM_DIRECTIVES ] | ||
13 | }) | 12 | }) |
14 | export class FriendAddComponent implements OnInit { | 13 | export class FriendAddComponent implements OnInit { |
15 | friendAddForm: FormGroup; | 14 | friendAddForm: FormGroup; |
@@ -80,12 +79,13 @@ export class FriendAddComponent implements OnInit { | |||
80 | 79 | ||
81 | this.friendService.makeFriends(notEmptyUrls).subscribe( | 80 | this.friendService.makeFriends(notEmptyUrls).subscribe( |
82 | status => { | 81 | status => { |
83 | if (status === 409) { | 82 | // TODO: extractdatastatus |
84 | alert('Already made friends!'); | 83 | // if (status === 409) { |
85 | } else { | 84 | // alert('Already made friends!'); |
85 | // } else { | ||
86 | alert('Make friends request sent!'); | 86 | alert('Make friends request sent!'); |
87 | this.router.navigate([ '/admin/friends/list' ]); | 87 | this.router.navigate([ '/admin/friends/list' ]); |
88 | } | 88 | // } |
89 | }, | 89 | }, |
90 | error => alert(error) | 90 | error => alert(error) |
91 | ); | 91 | ); |
diff --git a/client/src/app/admin/friends/friend-list/friend-list.component.ts b/client/src/app/admin/friends/friend-list/friend-list.component.ts index 38d4799a6..c76fc4df2 100644 --- a/client/src/app/admin/friends/friend-list/friend-list.component.ts +++ b/client/src/app/admin/friends/friend-list/friend-list.component.ts | |||
@@ -1,13 +1,11 @@ | |||
1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | ||
3 | 2 | ||
4 | import { Friend, FriendService } from '../shared'; | 3 | import { Friend, FriendService } from '../shared'; |
5 | 4 | ||
6 | @Component({ | 5 | @Component({ |
7 | selector: 'my-friend-list', | 6 | selector: 'my-friend-list', |
8 | template: require('./friend-list.component.html'), | 7 | template: require('./friend-list.component.html'), |
9 | styles: [ require('./friend-list.component.scss') ], | 8 | styles: [ require('./friend-list.component.scss') ] |
10 | directives: [ ROUTER_DIRECTIVES ] | ||
11 | }) | 9 | }) |
12 | export class FriendListComponent implements OnInit { | 10 | export class FriendListComponent implements OnInit { |
13 | friends: Friend[]; | 11 | friends: Friend[]; |
diff --git a/client/src/app/admin/friends/friends.component.ts b/client/src/app/admin/friends/friends.component.ts index e66280f01..bc3f54158 100644 --- a/client/src/app/admin/friends/friends.component.ts +++ b/client/src/app/admin/friends/friends.component.ts | |||
@@ -1,12 +1,7 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | ||
3 | |||
4 | import { FriendService } from './shared'; | ||
5 | 2 | ||
6 | @Component({ | 3 | @Component({ |
7 | template: '<router-outlet></router-outlet>', | 4 | template: '<router-outlet></router-outlet>' |
8 | directives: [ ROUTER_DIRECTIVES ], | ||
9 | providers: [ FriendService ] | ||
10 | }) | 5 | }) |
11 | 6 | ||
12 | export class FriendsComponent { | 7 | export class FriendsComponent { |
diff --git a/client/src/app/admin/friends/friends.routes.ts b/client/src/app/admin/friends/friends.routes.ts index 42b4a6c14..7fdef68f9 100644 --- a/client/src/app/admin/friends/friends.routes.ts +++ b/client/src/app/admin/friends/friends.routes.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { RouterConfig } from '@angular/router'; | 1 | import { Routes } from '@angular/router'; |
2 | 2 | ||
3 | import { FriendsComponent } from './friends.component'; | 3 | import { FriendsComponent } from './friends.component'; |
4 | import { FriendAddComponent } from './friend-add'; | 4 | import { FriendAddComponent } from './friend-add'; |
5 | import { FriendListComponent } from './friend-list'; | 5 | import { FriendListComponent } from './friend-list'; |
6 | 6 | ||
7 | export const FriendsRoutes: RouterConfig = [ | 7 | export const FriendsRoutes: Routes = [ |
8 | { | 8 | { |
9 | path: 'friends', | 9 | path: 'friends', |
10 | component: FriendsComponent, | 10 | component: FriendsComponent, |
diff --git a/client/src/app/admin/friends/index.ts b/client/src/app/admin/friends/index.ts index f3110e31d..dd4df2538 100644 --- a/client/src/app/admin/friends/index.ts +++ b/client/src/app/admin/friends/index.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | export * from './friend-add'; | 1 | export * from './friend-add'; |
2 | export * from './friend-list'; | 2 | export * from './friend-list'; |
3 | export * from './shared'; | 3 | export * from './shared'; |
4 | export * from './friends.component'; | ||
4 | export * from './friends.routes'; | 5 | export * from './friends.routes'; |
diff --git a/client/src/app/admin/index.ts b/client/src/app/admin/index.ts index 292973681..3d0e67b15 100644 --- a/client/src/app/admin/index.ts +++ b/client/src/app/admin/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './friends'; | ||
1 | export * from './users'; | 2 | export * from './users'; |
2 | export * from './admin.component'; | 3 | export * from './admin.component'; |
3 | export * from './admin.routes'; | 4 | export * from './admin.routes'; |
diff --git a/client/src/app/admin/menu-admin.component.ts b/client/src/app/admin/menu-admin.component.ts index 788592872..a9115d49f 100644 --- a/client/src/app/admin/menu-admin.component.ts +++ b/client/src/app/admin/menu-admin.component.ts | |||
@@ -1,9 +1,7 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | ||
3 | 2 | ||
4 | @Component({ | 3 | @Component({ |
5 | selector: 'my-menu-admin', | 4 | selector: 'my-menu-admin', |
6 | template: require('./menu-admin.component.html'), | 5 | template: require('./menu-admin.component.html') |
7 | directives: [ ROUTER_DIRECTIVES ] | ||
8 | }) | 6 | }) |
9 | export class MenuAdminComponent { } | 7 | export class MenuAdminComponent { } |
diff --git a/client/src/app/admin/users/user-add/user-add.component.ts b/client/src/app/admin/users/user-add/user-add.component.ts index 8dd98cc5c..e3f4b2e1a 100644 --- a/client/src/app/admin/users/user-add/user-add.component.ts +++ b/client/src/app/admin/users/user-add/user-add.component.ts | |||
@@ -1,14 +1,12 @@ | |||
1 | import { Validators } from '@angular/common'; | ||
2 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
3 | import { FormGroup, FormControl, REACTIVE_FORM_DIRECTIVES } from '@angular/forms'; | 2 | import { FormGroup, FormControl, Validators } from '@angular/forms'; |
4 | import { Router } from '@angular/router'; | 3 | import { Router } from '@angular/router'; |
5 | 4 | ||
6 | import { UserService } from '../shared'; | 5 | import { UserService } from '../shared'; |
7 | 6 | ||
8 | @Component({ | 7 | @Component({ |
9 | selector: 'my-user-add', | 8 | selector: 'my-user-add', |
10 | template: require('./user-add.component.html'), | 9 | template: require('./user-add.component.html') |
11 | directives: [ REACTIVE_FORM_DIRECTIVES ] | ||
12 | }) | 10 | }) |
13 | export class UserAddComponent implements OnInit { | 11 | export class UserAddComponent implements OnInit { |
14 | userAddForm: FormGroup; | 12 | userAddForm: FormGroup; |
diff --git a/client/src/app/admin/users/user-list/user-list.component.ts b/client/src/app/admin/users/user-list/user-list.component.ts index c89a61bca..d3827eb28 100644 --- a/client/src/app/admin/users/user-list/user-list.component.ts +++ b/client/src/app/admin/users/user-list/user-list.component.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | ||
3 | 2 | ||
4 | import { User } from '../../../shared'; | 3 | import { User } from '../../../shared'; |
5 | import { UserService } from '../shared'; | 4 | import { UserService } from '../shared'; |
@@ -7,8 +6,7 @@ import { UserService } from '../shared'; | |||
7 | @Component({ | 6 | @Component({ |
8 | selector: 'my-user-list', | 7 | selector: 'my-user-list', |
9 | template: require('./user-list.component.html'), | 8 | template: require('./user-list.component.html'), |
10 | styles: [ require('./user-list.component.scss') ], | 9 | styles: [ require('./user-list.component.scss') ] |
11 | directives: [ ROUTER_DIRECTIVES ] | ||
12 | }) | 10 | }) |
13 | export class UserListComponent implements OnInit { | 11 | export class UserListComponent implements OnInit { |
14 | totalUsers: number; | 12 | totalUsers: number; |
diff --git a/client/src/app/admin/users/users.component.ts b/client/src/app/admin/users/users.component.ts index 46aa0862f..37e3b158d 100644 --- a/client/src/app/admin/users/users.component.ts +++ b/client/src/app/admin/users/users.component.ts | |||
@@ -1,12 +1,7 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | ||
3 | |||
4 | import { UserService } from './shared'; | ||
5 | 2 | ||
6 | @Component({ | 3 | @Component({ |
7 | template: '<router-outlet></router-outlet>', | 4 | template: '<router-outlet></router-outlet>' |
8 | directives: [ ROUTER_DIRECTIVES ], | ||
9 | providers: [ UserService ] | ||
10 | }) | 5 | }) |
11 | 6 | ||
12 | export class UsersComponent { | 7 | export class UsersComponent { |
diff --git a/client/src/app/admin/users/users.routes.ts b/client/src/app/admin/users/users.routes.ts index 0457c3843..eb71bd0ae 100644 --- a/client/src/app/admin/users/users.routes.ts +++ b/client/src/app/admin/users/users.routes.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { RouterConfig } from '@angular/router'; | 1 | import { Routes } from '@angular/router'; |
2 | 2 | ||
3 | import { UsersComponent } from './users.component'; | 3 | import { UsersComponent } from './users.component'; |
4 | import { UserAddComponent } from './user-add'; | 4 | import { UserAddComponent } from './user-add'; |
5 | import { UserListComponent } from './user-list'; | 5 | import { UserListComponent } from './user-list'; |
6 | 6 | ||
7 | export const UsersRoutes: RouterConfig = [ | 7 | export const UsersRoutes: Routes = [ |
8 | { | 8 | { |
9 | path: 'users', | 9 | path: 'users', |
10 | component: UsersComponent, | 10 | component: UsersComponent, |