diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-11 17:36:46 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-12 10:58:16 +0100 |
commit | 63c4db6d71b98523753c51747e308682d9a2e8a0 (patch) | |
tree | d26c0d092ce016f2afe56bf71b08ca4698fe673f /client/src/app | |
parent | 908f6e5e38e85cc0debab0051b7fa34b13025f96 (diff) | |
download | PeerTube-63c4db6d71b98523753c51747e308682d9a2e8a0.tar.gz PeerTube-63c4db6d71b98523753c51747e308682d9a2e8a0.tar.zst PeerTube-63c4db6d71b98523753c51747e308682d9a2e8a0.zip |
Move to angular cli
Diffstat (limited to 'client/src/app')
51 files changed, 132 insertions, 313 deletions
diff --git a/client/src/app/+admin/follows/following-add/following-add.component.scss b/client/src/app/+admin/follows/following-add/following-add.component.scss index 2cb3efe28..7594b502c 100644 --- a/client/src/app/+admin/follows/following-add/following-add.component.scss +++ b/client/src/app/+admin/follows/following-add/following-add.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | textarea { | 4 | textarea { |
2 | height: 250px; | 5 | height: 250px; |
3 | } | 6 | } |
@@ -6,4 +9,3 @@ input[type=submit] { | |||
6 | @include peertube-button; | 9 | @include peertube-button; |
7 | @include orange-button; | 10 | @include orange-button; |
8 | } | 11 | } |
9 | |||
diff --git a/client/src/app/+admin/follows/shared/follow.service.ts b/client/src/app/+admin/follows/shared/follow.service.ts index 0bfbe8eb6..3a430ff64 100644 --- a/client/src/app/+admin/follows/shared/follow.service.ts +++ b/client/src/app/+admin/follows/shared/follow.service.ts | |||
@@ -1,17 +1,16 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 1 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Observable } from 'rxjs/Observable' | 2 | import { Injectable } from '@angular/core' |
3 | import { SortMeta } from 'primeng/primeng' | ||
4 | import 'rxjs/add/operator/catch' | 4 | import 'rxjs/add/operator/catch' |
5 | import 'rxjs/add/operator/map' | 5 | import 'rxjs/add/operator/map' |
6 | 6 | import { Observable } from 'rxjs/Observable' | |
7 | import { SortMeta } from 'primeng/primeng' | ||
8 | |||
9 | import { RestExtractor, RestPagination, RestService } from '../../../shared' | ||
10 | import { AccountFollow, ResultList } from '../../../../../../shared' | 7 | import { AccountFollow, ResultList } from '../../../../../../shared' |
8 | import { environment } from '../../../../environments/environment' | ||
9 | import { RestExtractor, RestPagination, RestService } from '../../../shared' | ||
11 | 10 | ||
12 | @Injectable() | 11 | @Injectable() |
13 | export class FollowService { | 12 | export class FollowService { |
14 | private static BASE_APPLICATION_URL = API_URL + '/api/v1/server' | 13 | private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/server' |
15 | 14 | ||
16 | constructor ( | 15 | constructor ( |
17 | private authHttp: HttpClient, | 16 | private authHttp: HttpClient, |
diff --git a/client/src/app/+admin/index.ts b/client/src/app/+admin/index.ts deleted file mode 100644 index b628a3662..000000000 --- a/client/src/app/+admin/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './admin.module' | ||
diff --git a/client/src/app/+admin/jobs/job.routes.ts b/client/src/app/+admin/jobs/job.routes.ts index a7bf2b221..331dc2af2 100644 --- a/client/src/app/+admin/jobs/job.routes.ts +++ b/client/src/app/+admin/jobs/job.routes.ts | |||
@@ -1,9 +1,6 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | |||
3 | import { UserRightGuard } from '../../core' | ||
4 | import { FollowingAddComponent } from './following-add' | ||
5 | import { UserRight } from '../../../../../shared' | 2 | import { UserRight } from '../../../../../shared' |
6 | import { FollowingListComponent } from './following-list/following-list.component' | 3 | import { UserRightGuard } from '../../core' |
7 | import { JobsComponent } from './job.component' | 4 | import { JobsComponent } from './job.component' |
8 | import { JobsListComponent } from './jobs-list/jobs-list.component' | 5 | import { JobsListComponent } from './jobs-list/jobs-list.component' |
9 | 6 | ||
diff --git a/client/src/app/+admin/jobs/shared/job.service.ts b/client/src/app/+admin/jobs/shared/job.service.ts index 0cfbdbbea..61ee16077 100644 --- a/client/src/app/+admin/jobs/shared/job.service.ts +++ b/client/src/app/+admin/jobs/shared/job.service.ts | |||
@@ -6,12 +6,12 @@ import 'rxjs/add/operator/map' | |||
6 | import { Observable } from 'rxjs/Observable' | 6 | import { Observable } from 'rxjs/Observable' |
7 | import { ResultList } from '../../../../../../shared' | 7 | import { ResultList } from '../../../../../../shared' |
8 | import { Job } from '../../../../../../shared/models/job.model' | 8 | import { Job } from '../../../../../../shared/models/job.model' |
9 | 9 | import { environment } from '../../../../environments/environment' | |
10 | import { RestExtractor, RestPagination, RestService } from '../../../shared' | 10 | import { RestExtractor, RestPagination, RestService } from '../../../shared' |
11 | 11 | ||
12 | @Injectable() | 12 | @Injectable() |
13 | export class JobService { | 13 | export class JobService { |
14 | private static BASE_JOB_URL = API_URL + '/api/v1/jobs' | 14 | private static BASE_JOB_URL = environment.apiUrl + '/api/v1/jobs' |
15 | 15 | ||
16 | constructor ( | 16 | constructor ( |
17 | private authHttp: HttpClient, | 17 | private authHttp: HttpClient, |
diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts index dc77cc1d8..6536546fb 100644 --- a/client/src/app/+admin/users/shared/user.service.ts +++ b/client/src/app/+admin/users/shared/user.service.ts | |||
@@ -6,11 +6,12 @@ import 'rxjs/add/operator/catch' | |||
6 | import 'rxjs/add/operator/map' | 6 | import 'rxjs/add/operator/map' |
7 | import { Observable } from 'rxjs/Observable' | 7 | import { Observable } from 'rxjs/Observable' |
8 | import { ResultList, UserCreate, UserUpdate } from '../../../../../../shared' | 8 | import { ResultList, UserCreate, UserUpdate } from '../../../../../../shared' |
9 | import { environment } from '../../../../environments/environment' | ||
9 | import { RestExtractor, RestPagination, RestService, User } from '../../../shared' | 10 | import { RestExtractor, RestPagination, RestService, User } from '../../../shared' |
10 | 11 | ||
11 | @Injectable() | 12 | @Injectable() |
12 | export class UserService { | 13 | export class UserService { |
13 | private static BASE_USERS_URL = API_URL + '/api/v1/users/' | 14 | private static BASE_USERS_URL = environment.apiUrl + '/api/v1/users/' |
14 | private bytesPipe = new BytesPipe() | 15 | private bytesPipe = new BytesPipe() |
15 | 16 | ||
16 | constructor ( | 17 | constructor ( |
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.scss b/client/src/app/+admin/users/user-edit/user-edit.component.scss index 68d270c19..1bb1c5f0f 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.component.scss +++ b/client/src/app/+admin/users/user-edit/user-edit.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .admin-sub-title { | 4 | .admin-sub-title { |
2 | margin-bottom: 30px; | 5 | margin-bottom: 30px; |
3 | } | 6 | } |
diff --git a/client/src/app/+admin/users/user-list/user-list.component.scss b/client/src/app/+admin/users/user-list/user-list.component.scss index 8b22f67ff..72d31a0cc 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.scss +++ b/client/src/app/+admin/users/user-list/user-list.component.scss | |||
@@ -1,11 +1,14 @@ | |||
1 | .add-button { | 1 | @import '_variables'; |
2 | @include peertube-button-link; | 2 | @import '_mixins'; |
3 | @include orange-button; | ||
4 | 3 | ||
5 | .icon.icon-add { | 4 | .add-button { |
6 | @include icon(22px); | 5 | @include peertube-button-link; |
6 | @include orange-button; | ||
7 | 7 | ||
8 | margin-right: 3px; | 8 | .icon.icon-add { |
9 | background-image: url('../../../../assets/images/admin/add.svg'); | 9 | @include icon(22px); |
10 | } | 10 | |
11 | margin-right: 3px; | ||
12 | background-image: url('../../../../assets/images/admin/add.svg'); | ||
11 | } | 13 | } |
14 | } | ||
diff --git a/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss b/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss index 7a4fdb34d..f8279ffd3 100644 --- a/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss +++ b/client/src/app/account/account-settings/account-change-password/account-change-password.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | input[type=password] { | 4 | input[type=password] { |
2 | @include peertube-input-text(340px); | 5 | @include peertube-input-text(340px); |
3 | display: block; | 6 | display: block; |
diff --git a/client/src/app/account/account-settings/account-details/account-details.component.scss b/client/src/app/account/account-settings/account-details/account-details.component.scss index 5c369f968..1bdb19a38 100644 --- a/client/src/app/account/account-settings/account-details/account-details.component.scss +++ b/client/src/app/account/account-settings/account-details/account-details.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | label { | 4 | label { |
2 | font-size: 15px; | 5 | font-size: 15px; |
3 | font-weight: $font-regular; | 6 | font-weight: $font-regular; |
diff --git a/client/src/app/account/account-settings/account-settings.component.scss b/client/src/app/account/account-settings/account-settings.component.scss index f514809b0..7f1ade377 100644 --- a/client/src/app/account/account-settings/account-settings.component.scss +++ b/client/src/app/account/account-settings/account-settings.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .user { | 4 | .user { |
2 | display: flex; | 5 | display: flex; |
3 | 6 | ||
diff --git a/client/src/app/account/account-videos/account-videos.component.scss b/client/src/app/account/account-videos/account-videos.component.scss index 5459014a6..28b298c3d 100644 --- a/client/src/app/account/account-videos/account-videos.component.scss +++ b/client/src/app/account/account-videos/account-videos.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .action-selection-mode { | 4 | .action-selection-mode { |
2 | width: 174px; | 5 | width: 174px; |
3 | display: flex; | 6 | display: flex; |
diff --git a/client/src/app/account/account.module.ts b/client/src/app/account/account.module.ts index 020199e23..2299c1919 100644 --- a/client/src/app/account/account.module.ts +++ b/client/src/app/account/account.module.ts | |||
@@ -5,7 +5,6 @@ import { AccountChangePasswordComponent } from './account-settings/account-chang | |||
5 | import { AccountDetailsComponent } from './account-settings/account-details/account-details.component' | 5 | import { AccountDetailsComponent } from './account-settings/account-details/account-details.component' |
6 | import { AccountSettingsComponent } from './account-settings/account-settings.component' | 6 | import { AccountSettingsComponent } from './account-settings/account-settings.component' |
7 | import { AccountComponent } from './account.component' | 7 | import { AccountComponent } from './account.component' |
8 | import { AccountService } from './account.service' | ||
9 | import { AccountVideosComponent } from './account-videos/account-videos.component' | 8 | import { AccountVideosComponent } from './account-videos/account-videos.component' |
10 | 9 | ||
11 | @NgModule({ | 10 | @NgModule({ |
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index fe72c9181..f31b51e23 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts | |||
@@ -11,7 +11,7 @@ const routes: Routes = [ | |||
11 | }, | 11 | }, |
12 | { | 12 | { |
13 | path: 'admin', | 13 | path: 'admin', |
14 | loadChildren: './+admin#AdminModule' | 14 | loadChildren: './+admin/admin.module#AdminModule' |
15 | } | 15 | } |
16 | ] | 16 | ] |
17 | 17 | ||
diff --git a/client/src/app/app.component.scss b/client/src/app/app.component.scss index c0ec2025d..2aadb1c97 100644 --- a/client/src/app/app.component.scss +++ b/client/src/app/app.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .main-row { | 4 | .main-row { |
2 | min-height: calc(100vh - #{$header-height} - #{$footer-height} - #{$footer-margin}); | 5 | min-height: calc(100vh - #{$header-height} - #{$footer-height} - #{$footer-margin}); |
3 | } | 6 | } |
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 1326e3411..e69edbc4b 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts | |||
@@ -1,18 +1,10 @@ | |||
1 | import { ApplicationRef, NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { BrowserModule } from '@angular/platform-browser' | 2 | import { BrowserModule } from '@angular/platform-browser' |
3 | import { | ||
4 | removeNgStyles, | ||
5 | createNewHosts, | ||
6 | createInputTransfer | ||
7 | } from '@angularclass/hmr' | ||
8 | 3 | ||
9 | import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' | 4 | import { MetaModule, MetaLoader, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' |
10 | import 'bootstrap-loader' | ||
11 | 5 | ||
12 | import { ENV_PROVIDERS } from './environment' | ||
13 | import { AppRoutingModule } from './app-routing.module' | 6 | import { AppRoutingModule } from './app-routing.module' |
14 | import { AppComponent } from './app.component' | 7 | import { AppComponent } from './app.component' |
15 | import { AppState, InternalStateType } from './app.service' | ||
16 | 8 | ||
17 | import { AccountModule } from './account' | 9 | import { AccountModule } from './account' |
18 | import { CoreModule } from './core' | 10 | import { CoreModule } from './core' |
@@ -35,17 +27,6 @@ export function metaFactory (): MetaLoader { | |||
35 | }) | 27 | }) |
36 | } | 28 | } |
37 | 29 | ||
38 | type StoreType = { | ||
39 | state: InternalStateType, | ||
40 | restoreInputValues: () => void, | ||
41 | disposeOldHosts: () => void | ||
42 | } | ||
43 | |||
44 | // Application wide providers | ||
45 | const APP_PROVIDERS = [ | ||
46 | AppState | ||
47 | ] | ||
48 | |||
49 | @NgModule({ | 30 | @NgModule({ |
50 | bootstrap: [ AppComponent ], | 31 | bootstrap: [ AppComponent ], |
51 | declarations: [ | 32 | declarations: [ |
@@ -74,65 +55,6 @@ const APP_PROVIDERS = [ | |||
74 | useFactory: (metaFactory) | 55 | useFactory: (metaFactory) |
75 | }) | 56 | }) |
76 | ], | 57 | ], |
77 | providers: [ // expose our Services and Providers into Angular's dependency injection | 58 | providers: [ ] |
78 | ENV_PROVIDERS, | ||
79 | APP_PROVIDERS | ||
80 | ] | ||
81 | }) | 59 | }) |
82 | export class AppModule { | 60 | export class AppModule {} |
83 | constructor ( | ||
84 | public appRef: ApplicationRef, | ||
85 | public appState: AppState | ||
86 | ) {} | ||
87 | |||
88 | public hmrOnInit (store: StoreType) { | ||
89 | if (!store || !store.state) { | ||
90 | return | ||
91 | } | ||
92 | console.log('HMR store', JSON.stringify(store, null, 2)) | ||
93 | /** | ||
94 | * Set state | ||
95 | */ | ||
96 | this.appState._state = store.state | ||
97 | /** | ||
98 | * Set input values | ||
99 | */ | ||
100 | if ('restoreInputValues' in store) { | ||
101 | let restoreInputValues = store.restoreInputValues | ||
102 | setTimeout(restoreInputValues) | ||
103 | } | ||
104 | |||
105 | this.appRef.tick() | ||
106 | delete store.state | ||
107 | delete store.restoreInputValues | ||
108 | } | ||
109 | |||
110 | public hmrOnDestroy (store: StoreType) { | ||
111 | const cmpLocation = this.appRef.components.map((cmp) => cmp.location.nativeElement) | ||
112 | /** | ||
113 | * Save state | ||
114 | */ | ||
115 | const state = this.appState._state | ||
116 | store.state = state | ||
117 | /** | ||
118 | * Recreate root elements | ||
119 | */ | ||
120 | store.disposeOldHosts = createNewHosts(cmpLocation) | ||
121 | /** | ||
122 | * Save input values | ||
123 | */ | ||
124 | store.restoreInputValues = createInputTransfer() | ||
125 | /** | ||
126 | * Remove styles | ||
127 | */ | ||
128 | removeNgStyles() | ||
129 | } | ||
130 | |||
131 | public hmrAfterDestroy (store: StoreType) { | ||
132 | /** | ||
133 | * Display new elements | ||
134 | */ | ||
135 | store.disposeOldHosts() | ||
136 | delete store.disposeOldHosts | ||
137 | } | ||
138 | } | ||
diff --git a/client/src/app/app.resolver.ts b/client/src/app/app.resolver.ts deleted file mode 100644 index bc054e90b..000000000 --- a/client/src/app/app.resolver.ts +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* tslint:disable */ | ||
2 | |||
3 | import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router' | ||
4 | import { Injectable } from '@angular/core' | ||
5 | import { Observable } from 'rxjs/Observable' | ||
6 | import 'rxjs/add/observable/of' | ||
7 | |||
8 | @Injectable() | ||
9 | export class DataResolver implements Resolve<any> { | ||
10 | public resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { | ||
11 | return Observable.of({ res: 'I am data'}) | ||
12 | } | ||
13 | } | ||
14 | |||
15 | /** | ||
16 | * An array of services to resolve routes with data. | ||
17 | */ | ||
18 | export const APP_RESOLVER_PROVIDERS = [ | ||
19 | DataResolver | ||
20 | ] | ||
diff --git a/client/src/app/app.service.ts b/client/src/app/app.service.ts deleted file mode 100644 index abffc87f1..000000000 --- a/client/src/app/app.service.ts +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* tslint:disable */ | ||
2 | |||
3 | import { Injectable } from '@angular/core' | ||
4 | |||
5 | export type InternalStateType = { | ||
6 | [key: string]: any | ||
7 | } | ||
8 | |||
9 | @Injectable() | ||
10 | export class AppState { | ||
11 | |||
12 | public _state: InternalStateType = { } | ||
13 | |||
14 | /** | ||
15 | * Already return a clone of the current state. | ||
16 | */ | ||
17 | public get state() { | ||
18 | return this._state = this._clone(this._state) | ||
19 | } | ||
20 | /** | ||
21 | * Never allow mutation | ||
22 | */ | ||
23 | public set state(value) { | ||
24 | throw new Error('do not mutate the `.state` directly') | ||
25 | } | ||
26 | |||
27 | public get(prop?: any) { | ||
28 | /** | ||
29 | * Use our state getter for the clone. | ||
30 | */ | ||
31 | const state = this.state | ||
32 | return state.hasOwnProperty(prop) ? state[prop] : state | ||
33 | } | ||
34 | |||
35 | public set(prop: string, value: any) { | ||
36 | /** | ||
37 | * Internally mutate our state. | ||
38 | */ | ||
39 | return this._state[prop] = value | ||
40 | } | ||
41 | |||
42 | private _clone(object: InternalStateType) { | ||
43 | /** | ||
44 | * Simple object clone. | ||
45 | */ | ||
46 | return JSON.parse(JSON.stringify( object )) | ||
47 | } | ||
48 | } | ||
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index e887dde1f..e2b8b6ba5 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' | 1 | import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' |
2 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
3 | import { Router } from '@angular/router' | 3 | import { Router } from '@angular/router' |
4 | |||
5 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
6 | import 'rxjs/add/observable/throw' | 5 | import 'rxjs/add/observable/throw' |
7 | import 'rxjs/add/operator/do' | 6 | import 'rxjs/add/operator/do' |
@@ -13,10 +12,9 @@ import { Subject } from 'rxjs/Subject' | |||
13 | import { OAuthClientLocal, User as UserServerModel, UserRefreshToken, UserRole, VideoChannel } from '../../../../../shared' | 12 | import { OAuthClientLocal, User as UserServerModel, UserRefreshToken, UserRole, VideoChannel } from '../../../../../shared' |
14 | import { Account } from '../../../../../shared/models/accounts' | 13 | import { Account } from '../../../../../shared/models/accounts' |
15 | import { UserLogin } from '../../../../../shared/models/users/user-login.model' | 14 | import { UserLogin } from '../../../../../shared/models/users/user-login.model' |
16 | // Do not use the barrel (dependency loop) | 15 | import { environment } from '../../../environments/environment' |
17 | import { RestExtractor } from '../../shared/rest' | 16 | import { RestExtractor } from '../../shared/rest' |
18 | import { UserConstructorHash } from '../../shared/users/user.model' | 17 | import { UserConstructorHash } from '../../shared/users/user.model' |
19 | |||
20 | import { AuthStatus } from './auth-status.model' | 18 | import { AuthStatus } from './auth-status.model' |
21 | import { AuthUser } from './auth-user.model' | 19 | import { AuthUser } from './auth-user.model' |
22 | 20 | ||
@@ -43,9 +41,9 @@ interface UserLoginWithUserInformation extends UserLogin { | |||
43 | 41 | ||
44 | @Injectable() | 42 | @Injectable() |
45 | export class AuthService { | 43 | export class AuthService { |
46 | private static BASE_CLIENT_URL = API_URL + '/api/v1/oauth-clients/local' | 44 | private static BASE_CLIENT_URL = environment.apiUrl + '/api/v1/oauth-clients/local' |
47 | private static BASE_TOKEN_URL = API_URL + '/api/v1/users/token' | 45 | private static BASE_TOKEN_URL = environment.apiUrl + '/api/v1/users/token' |
48 | private static BASE_USER_INFORMATION_URL = API_URL + '/api/v1/users/me' | 46 | private static BASE_USER_INFORMATION_URL = environment.apiUrl + '/api/v1/users/me' |
49 | 47 | ||
50 | loginChangedSource: Observable<AuthStatus> | 48 | loginChangedSource: Observable<AuthStatus> |
51 | userInformationLoaded = new ReplaySubject<boolean>(1) | 49 | userInformationLoaded = new ReplaySubject<boolean>(1) |
diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts index 75262e6cf..a58fe6ebe 100644 --- a/client/src/app/core/core.module.ts +++ b/client/src/app/core/core.module.ts | |||
@@ -11,7 +11,6 @@ import { AuthService } from './auth' | |||
11 | import { LoginGuard, UserRightGuard } from './routing' | 11 | import { LoginGuard, UserRightGuard } from './routing' |
12 | import { ServerService } from './server' | 12 | import { ServerService } from './server' |
13 | import { ConfirmComponent, ConfirmService } from './confirm' | 13 | import { ConfirmComponent, ConfirmService } from './confirm' |
14 | import { MenuComponent, MenuAdminComponent } from './menu' | ||
15 | import { throwIfAlreadyLoaded } from './module-import-guard' | 14 | import { throwIfAlreadyLoaded } from './module-import-guard' |
16 | 15 | ||
17 | @NgModule({ | 16 | @NgModule({ |
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index 16e0595b6..a5be9e199 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts | |||
@@ -2,13 +2,13 @@ import { HttpClient } from '@angular/common/http' | |||
2 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
3 | import 'rxjs/add/operator/do' | 3 | import 'rxjs/add/operator/do' |
4 | import { ReplaySubject } from 'rxjs/ReplaySubject' | 4 | import { ReplaySubject } from 'rxjs/ReplaySubject' |
5 | |||
6 | import { ServerConfig } from '../../../../../shared' | 5 | import { ServerConfig } from '../../../../../shared' |
6 | import { environment } from '../../../environments/environment' | ||
7 | 7 | ||
8 | @Injectable() | 8 | @Injectable() |
9 | export class ServerService { | 9 | export class ServerService { |
10 | private static BASE_CONFIG_URL = API_URL + '/api/v1/config/' | 10 | private static BASE_CONFIG_URL = environment.apiUrl + '/api/v1/config/' |
11 | private static BASE_VIDEO_URL = API_URL + '/api/v1/videos/' | 11 | private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' |
12 | 12 | ||
13 | videoPrivaciesLoaded = new ReplaySubject<boolean>(1) | 13 | videoPrivaciesLoaded = new ReplaySubject<boolean>(1) |
14 | videoCategoriesLoaded = new ReplaySubject<boolean>(1) | 14 | videoCategoriesLoaded = new ReplaySubject<boolean>(1) |
diff --git a/client/src/app/environment.ts b/client/src/app/environment.ts deleted file mode 100644 index dd327a62e..000000000 --- a/client/src/app/environment.ts +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | /* tslint:disable */ | ||
2 | |||
3 | /** | ||
4 | * Angular 2 | ||
5 | */ | ||
6 | import { | ||
7 | enableDebugTools, | ||
8 | disableDebugTools | ||
9 | } from '@angular/platform-browser'; | ||
10 | import { | ||
11 | ApplicationRef, | ||
12 | enableProdMode | ||
13 | } from '@angular/core'; | ||
14 | /** | ||
15 | * Environment Providers | ||
16 | */ | ||
17 | let PROVIDERS: any[] = [ | ||
18 | /** | ||
19 | * Common env directives | ||
20 | */ | ||
21 | ]; | ||
22 | |||
23 | /** | ||
24 | * Angular debug tools in the dev console | ||
25 | * https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md | ||
26 | */ | ||
27 | let _decorateModuleRef = <T>(value: T): T => { return value; }; | ||
28 | |||
29 | if ('production' === ENV) { | ||
30 | enableProdMode(); | ||
31 | |||
32 | /** | ||
33 | * Production | ||
34 | */ | ||
35 | _decorateModuleRef = (modRef: any) => { | ||
36 | disableDebugTools(); | ||
37 | |||
38 | return modRef; | ||
39 | }; | ||
40 | |||
41 | PROVIDERS = [ | ||
42 | ...PROVIDERS, | ||
43 | /** | ||
44 | * Custom providers in production. | ||
45 | */ | ||
46 | ]; | ||
47 | |||
48 | } else { | ||
49 | |||
50 | _decorateModuleRef = (modRef: any) => { | ||
51 | const appRef = modRef.injector.get(ApplicationRef); | ||
52 | const cmpRef = appRef.components[0]; | ||
53 | |||
54 | let _ng = (<any> window).ng; | ||
55 | enableDebugTools(cmpRef); | ||
56 | (<any> window).ng.probe = _ng.probe; | ||
57 | (<any> window).ng.coreTokens = _ng.coreTokens; | ||
58 | return modRef; | ||
59 | }; | ||
60 | |||
61 | /** | ||
62 | * Development | ||
63 | */ | ||
64 | PROVIDERS = [ | ||
65 | ...PROVIDERS, | ||
66 | /** | ||
67 | * Custom providers in development. | ||
68 | */ | ||
69 | ]; | ||
70 | |||
71 | } | ||
72 | |||
73 | export const decorateModuleRef = _decorateModuleRef; | ||
74 | |||
75 | export const ENV_PROVIDERS = [ | ||
76 | ...PROVIDERS | ||
77 | ]; | ||
diff --git a/client/src/app/header/header.component.scss b/client/src/app/header/header.component.scss index fba70dd2f..1b67042fc 100644 --- a/client/src/app/header/header.component.scss +++ b/client/src/app/header/header.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | #search-video { | 4 | #search-video { |
2 | @include peertube-input-text($search-input-width); | 5 | @include peertube-input-text($search-input-width); |
3 | margin-right: 15px; | 6 | margin-right: 15px; |
diff --git a/client/src/app/login/login.component.scss b/client/src/app/login/login.component.scss index 3b4326de4..efec6b706 100644 --- a/client/src/app/login/login.component.scss +++ b/client/src/app/login/login.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | input:not([type=submit]) { | 4 | input:not([type=submit]) { |
2 | @include peertube-input-text(340px); | 5 | @include peertube-input-text(340px); |
3 | display: block; | 6 | display: block; |
diff --git a/client/src/app/menu/menu.component.scss b/client/src/app/menu/menu.component.scss index 97ceadde3..8cb94b3dd 100644 --- a/client/src/app/menu/menu.component.scss +++ b/client/src/app/menu/menu.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | menu { | 4 | menu { |
2 | background-color: $black-background; | 5 | background-color: $black-background; |
3 | margin: 0; | 6 | margin: 0; |
diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/account/account.model.ts index 0b008188a..9d1fd3e1d 100644 --- a/client/src/app/shared/account/account.model.ts +++ b/client/src/app/shared/account/account.model.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { Account as ServerAccount } from '../../../../../shared/models/accounts/account.model' | 1 | import { Account as ServerAccount } from '../../../../../shared/models/accounts/account.model' |
2 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | 2 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' |
3 | import { environment } from '../../../environments/environment' | ||
3 | 4 | ||
4 | export class Account implements ServerAccount { | 5 | export class Account implements ServerAccount { |
5 | id: number | 6 | id: number |
@@ -15,6 +16,6 @@ export class Account implements ServerAccount { | |||
15 | static GET_ACCOUNT_AVATAR_PATH (account: Account) { | 16 | static GET_ACCOUNT_AVATAR_PATH (account: Account) { |
16 | if (account && account.avatar) return account.avatar.path | 17 | if (account && account.avatar) return account.avatar.path |
17 | 18 | ||
18 | return API_URL + '/client/assets/images/default-avatar.png' | 19 | return environment.apiUrl + '/client/assets/images/default-avatar.png' |
19 | } | 20 | } |
20 | } | 21 | } |
diff --git a/client/src/app/shared/forms/form-validators/host.validator.ts b/client/src/app/shared/forms/form-validators/host.ts index c18a35f9b..c18a35f9b 100644 --- a/client/src/app/shared/forms/form-validators/host.validator.ts +++ b/client/src/app/shared/forms/form-validators/host.ts | |||
diff --git a/client/src/app/shared/forms/form-validators/index.ts b/client/src/app/shared/forms/form-validators/index.ts index efe77d4ae..09ae86f8a 100644 --- a/client/src/app/shared/forms/form-validators/index.ts +++ b/client/src/app/shared/forms/form-validators/index.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | export * from './host.validator' | 1 | export * from './host' |
2 | export * from './user' | 2 | export * from './user' |
3 | export * from './video-abuse' | 3 | export * from './video-abuse' |
4 | export * from './video' | 4 | export * from './video' |
diff --git a/client/src/app/shared/forms/form-validators/validator-message.ts b/client/src/app/shared/forms/form-validators/validator-message.ts new file mode 100644 index 000000000..5ce45833b --- /dev/null +++ b/client/src/app/shared/forms/form-validators/validator-message.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export type ValidatorMessage = { | ||
2 | [ id: string ]: { | ||
3 | [ error: string ]: string | ||
4 | } | ||
5 | } | ||
diff --git a/client/src/app/shared/forms/form-validators/video.ts b/client/src/app/shared/forms/form-validators/video.ts index 45da7df4a..500b5bc5f 100644 --- a/client/src/app/shared/forms/form-validators/video.ts +++ b/client/src/app/shared/forms/form-validators/video.ts | |||
@@ -1,11 +1,5 @@ | |||
1 | import { Validators } from '@angular/forms' | 1 | import { Validators } from '@angular/forms' |
2 | 2 | ||
3 | export type ValidatorMessage = { | ||
4 | [ id: string ]: { | ||
5 | [ error: string ]: string | ||
6 | } | ||
7 | } | ||
8 | |||
9 | export const VIDEO_NAME = { | 3 | export const VIDEO_NAME = { |
10 | VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ], | 4 | VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ], |
11 | MESSAGES: { | 5 | MESSAGES: { |
diff --git a/client/src/app/shared/misc/button.component.scss b/client/src/app/shared/misc/button.component.scss index 5fcae4f10..c380c7ae1 100644 --- a/client/src/app/shared/misc/button.component.scss +++ b/client/src/app/shared/misc/button.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .action-button { | 4 | .action-button { |
2 | @include peertube-button-link; | 5 | @include peertube-button-link; |
3 | 6 | ||
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index 6d1017fc9..d97edbcbe 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts | |||
@@ -1,14 +1,14 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { HttpClient } from '@angular/common/http' | 1 | import { HttpClient } from '@angular/common/http' |
2 | import { Injectable } from '@angular/core' | ||
3 | import 'rxjs/add/operator/catch' | 3 | import 'rxjs/add/operator/catch' |
4 | import 'rxjs/add/operator/map' | 4 | import 'rxjs/add/operator/map' |
5 | |||
6 | import { RestExtractor } from '../rest' | ||
7 | import { UserCreate, UserUpdateMe } from '../../../../../shared' | 5 | import { UserCreate, UserUpdateMe } from '../../../../../shared' |
6 | import { environment } from '../../../environments/environment' | ||
7 | import { RestExtractor } from '../rest' | ||
8 | 8 | ||
9 | @Injectable() | 9 | @Injectable() |
10 | export class UserService { | 10 | export class UserService { |
11 | static BASE_USERS_URL = API_URL + '/api/v1/users/' | 11 | static BASE_USERS_URL = environment.apiUrl + '/api/v1/users/' |
12 | 12 | ||
13 | constructor ( | 13 | constructor ( |
14 | private authHttp: HttpClient, | 14 | private authHttp: HttpClient, |
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts index 8d979de31..96a1f1fd2 100644 --- a/client/src/app/shared/video-abuse/video-abuse.service.ts +++ b/client/src/app/shared/video-abuse/video-abuse.service.ts | |||
@@ -1,19 +1,17 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 1 | import { HttpClient, HttpParams } from '@angular/common/http' |
2 | import { Injectable } from '@angular/core' | ||
3 | import { SortMeta } from 'primeng/components/common/sortmeta' | ||
3 | import 'rxjs/add/operator/catch' | 4 | import 'rxjs/add/operator/catch' |
4 | import 'rxjs/add/operator/map' | 5 | import 'rxjs/add/operator/map' |
5 | import { Observable } from 'rxjs/Observable' | 6 | import { Observable } from 'rxjs/Observable' |
6 | 7 | import { ResultList, VideoAbuse } from '../../../../../shared' | |
7 | import { SortMeta } from 'primeng/components/common/sortmeta' | ||
8 | |||
9 | import { AuthService } from '../core' | ||
10 | import { RestExtractor, RestPagination, RestService } from '../rest' | 8 | import { RestExtractor, RestPagination, RestService } from '../rest' |
11 | import { Utils } from '../utils' | 9 | import { Utils } from '../utils' |
12 | import { ResultList, VideoAbuse } from '../../../../../shared' | 10 | import { environment } from '../../../environments/environment' |
13 | 11 | ||
14 | @Injectable() | 12 | @Injectable() |
15 | export class VideoAbuseService { | 13 | export class VideoAbuseService { |
16 | private static BASE_VIDEO_ABUSE_URL = API_URL + '/api/v1/videos/' | 14 | private static BASE_VIDEO_ABUSE_URL = environment.apiUrl + '/api/v1/videos/' |
17 | 15 | ||
18 | constructor ( | 16 | constructor ( |
19 | private authHttp: HttpClient, | 17 | private authHttp: HttpClient, |
diff --git a/client/src/app/shared/video-blacklist/video-blacklist.service.ts b/client/src/app/shared/video-blacklist/video-blacklist.service.ts index 17373d52e..1231690aa 100644 --- a/client/src/app/shared/video-blacklist/video-blacklist.service.ts +++ b/client/src/app/shared/video-blacklist/video-blacklist.service.ts | |||
@@ -1,18 +1,17 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 1 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Observable } from 'rxjs/Observable' | 2 | import { Injectable } from '@angular/core' |
3 | import { SortMeta } from 'primeng/components/common/sortmeta' | ||
4 | import 'rxjs/add/operator/catch' | 4 | import 'rxjs/add/operator/catch' |
5 | import 'rxjs/add/operator/map' | 5 | import 'rxjs/add/operator/map' |
6 | 6 | import { Observable } from 'rxjs/Observable' | |
7 | import { SortMeta } from 'primeng/components/common/sortmeta' | 7 | import { BlacklistedVideo, ResultList } from '../../../../../shared' |
8 | 8 | import { environment } from '../../../environments/environment' | |
9 | import { RestExtractor, RestPagination, RestService } from '../rest' | 9 | import { RestExtractor, RestPagination, RestService } from '../rest' |
10 | import { Utils } from '../utils' | 10 | import { Utils } from '../utils' |
11 | import { BlacklistedVideo, ResultList } from '../../../../../shared' | ||
12 | 11 | ||
13 | @Injectable() | 12 | @Injectable() |
14 | export class VideoBlacklistService { | 13 | export class VideoBlacklistService { |
15 | private static BASE_VIDEOS_URL = API_URL + '/api/v1/videos/' | 14 | private static BASE_VIDEOS_URL = environment.apiUrl + '/api/v1/videos/' |
16 | 15 | ||
17 | constructor ( | 16 | constructor ( |
18 | private authHttp: HttpClient, | 17 | private authHttp: HttpClient, |
diff --git a/client/src/app/shared/video/video-miniature.component.scss b/client/src/app/shared/video/video-miniature.component.scss index 37e84897b..49ba1e51c 100644 --- a/client/src/app/shared/video/video-miniature.component.scss +++ b/client/src/app/shared/video/video-miniature.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .video-miniature { | 4 | .video-miniature { |
2 | display: inline-block; | 5 | display: inline-block; |
3 | padding-right: 15px; | 6 | padding-right: 15px; |
diff --git a/client/src/app/shared/video/video-thumbnail.component.scss b/client/src/app/shared/video/video-thumbnail.component.scss index ab4f9bcb1..0fc2df220 100644 --- a/client/src/app/shared/video/video-thumbnail.component.scss +++ b/client/src/app/shared/video/video-thumbnail.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .video-thumbnail { | 4 | .video-thumbnail { |
2 | display: inline-block; | 5 | display: inline-block; |
3 | position: relative; | 6 | position: relative; |
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index d86ef8f92..32c33829d 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Video as VideoServerModel } from '../../../../../shared' | ||
2 | import { User } from '../' | 1 | import { User } from '../' |
2 | import { Video as VideoServerModel } from '../../../../../shared' | ||
3 | import { Account } from '../../../../../shared/models/accounts' | 3 | import { Account } from '../../../../../shared/models/accounts' |
4 | import { environment } from '../../../environments/environment' | ||
4 | 5 | ||
5 | export class Video implements VideoServerModel { | 6 | export class Video implements VideoServerModel { |
6 | accountName: string | 7 | accountName: string |
@@ -48,7 +49,7 @@ export class Video implements VideoServerModel { | |||
48 | } | 49 | } |
49 | 50 | ||
50 | constructor (hash: VideoServerModel) { | 51 | constructor (hash: VideoServerModel) { |
51 | let absoluteAPIUrl = API_URL | 52 | let absoluteAPIUrl = environment.apiUrl |
52 | if (!absoluteAPIUrl) { | 53 | if (!absoluteAPIUrl) { |
53 | // The API is on the same domain | 54 | // The API is on the same domain |
54 | absoluteAPIUrl = window.location.origin | 55 | absoluteAPIUrl = window.location.origin |
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index 1a0644c3d..91dd3977a 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts | |||
@@ -9,9 +9,9 @@ import { UserVideoRateUpdate } from '../../../../../shared/models/videos/user-vi | |||
9 | import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' | 9 | import { UserVideoRate } from '../../../../../shared/models/videos/user-video-rate.model' |
10 | import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' | 10 | import { VideoRateType } from '../../../../../shared/models/videos/video-rate.type' |
11 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' | 11 | import { VideoUpdate } from '../../../../../shared/models/videos/video-update.model' |
12 | import { environment } from '../../../environments/environment' | ||
12 | import { RestExtractor } from '../rest/rest-extractor.service' | 13 | import { RestExtractor } from '../rest/rest-extractor.service' |
13 | import { RestService } from '../rest/rest.service' | 14 | import { RestService } from '../rest/rest.service' |
14 | import { Search } from '../header/search.model' | ||
15 | import { UserService } from '../users/user.service' | 15 | import { UserService } from '../users/user.service' |
16 | import { SortField } from './sort-field.type' | 16 | import { SortField } from './sort-field.type' |
17 | import { VideoDetails } from './video-details.model' | 17 | import { VideoDetails } from './video-details.model' |
@@ -21,7 +21,7 @@ import { Video } from './video.model' | |||
21 | 21 | ||
22 | @Injectable() | 22 | @Injectable() |
23 | export class VideoService { | 23 | export class VideoService { |
24 | private static BASE_VIDEO_URL = API_URL + '/api/v1/videos/' | 24 | private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' |
25 | 25 | ||
26 | constructor ( | 26 | constructor ( |
27 | private authHttp: HttpClient, | 27 | private authHttp: HttpClient, |
@@ -118,7 +118,7 @@ export class VideoService { | |||
118 | 118 | ||
119 | loadCompleteDescription (descriptionPath: string) { | 119 | loadCompleteDescription (descriptionPath: string) { |
120 | return this.authHttp | 120 | return this.authHttp |
121 | .get(API_URL + descriptionPath) | 121 | .get(environment.apiUrl + descriptionPath) |
122 | .map(res => res['description']) | 122 | .map(res => res['description']) |
123 | .catch((res) => this.restExtractor.handleError(res)) | 123 | .catch((res) => this.restExtractor.handleError(res)) |
124 | } | 124 | } |
diff --git a/client/src/app/signup/signup.component.scss b/client/src/app/signup/signup.component.scss index 3b4326de4..efec6b706 100644 --- a/client/src/app/signup/signup.component.scss +++ b/client/src/app/signup/signup.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | input:not([type=submit]) { | 4 | input:not([type=submit]) { |
2 | @include peertube-input-text(340px); | 5 | @include peertube-input-text(340px); |
3 | display: block; | 6 | display: block; |
diff --git a/client/src/app/videos/+video-edit/index.ts b/client/src/app/videos/+video-edit/index.ts deleted file mode 100644 index 63e0414dd..000000000 --- a/client/src/app/videos/+video-edit/index.ts +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | export * from './video-add.module' | ||
2 | export * from './video-update.module' | ||
diff --git a/client/src/app/videos/+video-edit/shared/video-description.component.scss b/client/src/app/videos/+video-edit/shared/video-description.component.scss index 2a4c8d189..d6a5190c5 100644 --- a/client/src/app/videos/+video-edit/shared/video-description.component.scss +++ b/client/src/app/videos/+video-edit/shared/video-description.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | textarea { | 4 | textarea { |
2 | @include peertube-input-text(100%); | 5 | @include peertube-input-text(100%); |
3 | 6 | ||
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.scss b/client/src/app/videos/+video-edit/shared/video-edit.component.scss index d363499ce..f4466bdde 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.scss +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .video-edit { | 4 | .video-edit { |
2 | height: 100%; | 5 | height: 100%; |
3 | 6 | ||
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index 5b1cc3f9c..28c9134a7 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts | |||
@@ -2,12 +2,10 @@ import { Component, Input, OnInit } from '@angular/core' | |||
2 | import { FormBuilder, FormControl, FormGroup } from '@angular/forms' | 2 | import { FormBuilder, FormControl, FormGroup } from '@angular/forms' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
5 | import { ServerService } from 'app/core' | ||
6 | import { VideoEdit } from 'app/shared/video/video-edit.model' | ||
7 | import 'rxjs/add/observable/forkJoin' | 5 | import 'rxjs/add/observable/forkJoin' |
8 | import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' | 6 | import { ServerService } from '../../../core/server' |
7 | import { ValidatorMessage } from '../../../shared/forms/form-validators/validator-message' | ||
9 | import { | 8 | import { |
10 | ValidatorMessage, | ||
11 | VIDEO_CATEGORY, | 9 | VIDEO_CATEGORY, |
12 | VIDEO_DESCRIPTION, | 10 | VIDEO_DESCRIPTION, |
13 | VIDEO_LANGUAGE, | 11 | VIDEO_LANGUAGE, |
@@ -15,7 +13,8 @@ import { | |||
15 | VIDEO_NAME, | 13 | VIDEO_NAME, |
16 | VIDEO_PRIVACY, | 14 | VIDEO_PRIVACY, |
17 | VIDEO_TAGS | 15 | VIDEO_TAGS |
18 | } from '../../../shared/forms/form-validators' | 16 | } from '../../../shared/forms/form-validators/video' |
17 | import { VideoEdit } from '../../../shared/video/video-edit.model' | ||
19 | 18 | ||
20 | @Component({ | 19 | @Component({ |
21 | selector: 'my-video-edit', | 20 | selector: 'my-video-edit', |
diff --git a/client/src/app/videos/+video-edit/video-add.component.scss b/client/src/app/videos/+video-edit/video-add.component.scss index 39673b4b7..78140e0e9 100644 --- a/client/src/app/videos/+video-edit/video-add.component.scss +++ b/client/src/app/videos/+video-edit/video-add.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .upload-video-container { | 4 | .upload-video-container { |
2 | border-radius: 3px; | 5 | border-radius: 3px; |
3 | background-color: #F7F7F7; | 6 | background-color: #F7F7F7; |
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 2bbc3de17..503f705db 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts | |||
@@ -3,13 +3,12 @@ import { Component, OnInit, ViewChild } from '@angular/core' | |||
3 | import { FormBuilder, FormGroup } from '@angular/forms' | 3 | import { FormBuilder, FormGroup } from '@angular/forms' |
4 | import { Router } from '@angular/router' | 4 | import { Router } from '@angular/router' |
5 | import { NotificationsService } from 'angular2-notifications' | 5 | import { NotificationsService } from 'angular2-notifications' |
6 | import { VideoService } from 'app/shared/video/video.service' | ||
7 | import { VideoCreate } from '../../../../../shared' | ||
8 | import { VideoPrivacy } from '../../../../../shared/models/videos' | 6 | import { VideoPrivacy } from '../../../../../shared/models/videos' |
9 | import { AuthService, ServerService } from '../../core' | 7 | import { AuthService, ServerService } from '../../core' |
10 | import { FormReactive } from '../../shared' | 8 | import { FormReactive } from '../../shared' |
11 | import { ValidatorMessage } from '../../shared/forms/form-validators' | 9 | import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message' |
12 | import { VideoEdit } from '../../shared/video/video-edit.model' | 10 | import { VideoEdit } from '../../shared/video/video-edit.model' |
11 | import { VideoService } from '../../shared/video/video.service' | ||
13 | 12 | ||
14 | @Component({ | 13 | @Component({ |
15 | selector: 'my-videos-add', | 14 | selector: 'my-videos-add', |
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index d1da8b6d8..08b74f4c3 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts | |||
@@ -3,10 +3,10 @@ import { FormBuilder, FormGroup } from '@angular/forms' | |||
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
5 | import 'rxjs/add/observable/forkJoin' | 5 | import 'rxjs/add/observable/forkJoin' |
6 | import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' | 6 | import { VideoPrivacy } from '../../../../../shared/models/videos' |
7 | import { ServerService } from '../../core' | 7 | import { ServerService } from '../../core' |
8 | import { FormReactive } from '../../shared' | 8 | import { FormReactive } from '../../shared' |
9 | import { ValidatorMessage } from '../../shared/forms/form-validators' | 9 | import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message' |
10 | import { VideoEdit } from '../../shared/video/video-edit.model' | 10 | import { VideoEdit } from '../../shared/video/video-edit.model' |
11 | import { VideoService } from '../../shared/video/video.service' | 11 | import { VideoService } from '../../shared/video/video.service' |
12 | 12 | ||
@@ -25,8 +25,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
25 | validationMessages: ValidatorMessage = {} | 25 | validationMessages: ValidatorMessage = {} |
26 | videoPrivacies = [] | 26 | videoPrivacies = [] |
27 | 27 | ||
28 | fileError = '' | ||
29 | |||
30 | constructor ( | 28 | constructor ( |
31 | private formBuilder: FormBuilder, | 29 | private formBuilder: FormBuilder, |
32 | private route: ActivatedRoute, | 30 | private route: ActivatedRoute, |
diff --git a/client/src/app/videos/+video-watch/index.ts b/client/src/app/videos/+video-watch/index.ts deleted file mode 100644 index b19bfdb1e..000000000 --- a/client/src/app/videos/+video-watch/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './video-watch.module' | ||
diff --git a/client/src/app/videos/+video-watch/video-download.component.scss b/client/src/app/videos/+video-watch/video-download.component.scss index c9d5af9c1..7eac3d1c9 100644 --- a/client/src/app/videos/+video-watch/video-download.component.scss +++ b/client/src/app/videos/+video-watch/video-download.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | .resolution-block:not(:first-child) { | 4 | .resolution-block:not(:first-child) { |
2 | margin-top: 30px; | 5 | margin-top: 30px; |
3 | } | 6 | } |
diff --git a/client/src/app/videos/+video-watch/video-watch.component.scss b/client/src/app/videos/+video-watch/video-watch.component.scss index 9daa757b4..52082944a 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.scss +++ b/client/src/app/videos/+video-watch/video-watch.component.scss | |||
@@ -1,3 +1,6 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
1 | #video-container { | 4 | #video-container { |
2 | background-color: #000; | 5 | background-color: #000; |
3 | display: flex; | 6 | display: flex; |
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index bec6932ae..3825e8449 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -2,10 +2,9 @@ import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/co | |||
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { MetaService } from '@ngx-meta/core' | 3 | import { MetaService } from '@ngx-meta/core' |
4 | import { NotificationsService } from 'angular2-notifications' | 4 | import { NotificationsService } from 'angular2-notifications' |
5 | import { VideoService } from 'app/shared/video/video.service' | ||
6 | import { Observable } from 'rxjs/Observable' | 5 | import { Observable } from 'rxjs/Observable' |
7 | import { Subscription } from 'rxjs/Subscription' | 6 | import { Subscription } from 'rxjs/Subscription' |
8 | import videojs from 'video.js' | 7 | import * as videojs from 'video.js' |
9 | import { UserVideoRateType, VideoRateType } from '../../../../../shared' | 8 | import { UserVideoRateType, VideoRateType } from '../../../../../shared' |
10 | import '../../../assets/player/peertube-videojs-plugin' | 9 | import '../../../assets/player/peertube-videojs-plugin' |
11 | import { AuthService, ConfirmService } from '../../core' | 10 | import { AuthService, ConfirmService } from '../../core' |
@@ -13,6 +12,7 @@ import { VideoBlacklistService } from '../../shared' | |||
13 | import { Account } from '../../shared/account/account.model' | 12 | import { Account } from '../../shared/account/account.model' |
14 | import { VideoDetails } from '../../shared/video/video-details.model' | 13 | import { VideoDetails } from '../../shared/video/video-details.model' |
15 | import { Video } from '../../shared/video/video.model' | 14 | import { Video } from '../../shared/video/video.model' |
15 | import { VideoService } from '../../shared/video/video.service' | ||
16 | import { MarkdownService } from '../shared' | 16 | import { MarkdownService } from '../shared' |
17 | import { VideoDownloadComponent } from './video-download.component' | 17 | import { VideoDownloadComponent } from './video-download.component' |
18 | import { VideoReportComponent } from './video-report.component' | 18 | import { VideoReportComponent } from './video-report.component' |
diff --git a/client/src/app/videos/videos-routing.module.ts b/client/src/app/videos/videos-routing.module.ts index 6910421b7..29ec5fd4f 100644 --- a/client/src/app/videos/videos-routing.module.ts +++ b/client/src/app/videos/videos-routing.module.ts | |||
@@ -46,7 +46,7 @@ const videosRoutes: Routes = [ | |||
46 | }, | 46 | }, |
47 | { | 47 | { |
48 | path: 'upload', | 48 | path: 'upload', |
49 | loadChildren: 'app/videos/+video-edit#VideoAddModule', | 49 | loadChildren: 'app/videos/+video-edit/video-add.module#VideoAddModule', |
50 | data: { | 50 | data: { |
51 | meta: { | 51 | meta: { |
52 | title: 'Upload a video' | 52 | title: 'Upload a video' |
@@ -55,7 +55,7 @@ const videosRoutes: Routes = [ | |||
55 | }, | 55 | }, |
56 | { | 56 | { |
57 | path: 'edit/:uuid', | 57 | path: 'edit/:uuid', |
58 | loadChildren: 'app/videos/+video-edit#VideoUpdateModule', | 58 | loadChildren: 'app/videos/+video-edit/video-update.module#VideoUpdateModule', |
59 | data: { | 59 | data: { |
60 | meta: { | 60 | meta: { |
61 | title: 'Edit a video' | 61 | title: 'Edit a video' |
@@ -69,7 +69,7 @@ const videosRoutes: Routes = [ | |||
69 | }, | 69 | }, |
70 | { | 70 | { |
71 | path: 'watch/:uuid', | 71 | path: 'watch/:uuid', |
72 | loadChildren: 'app/videos/+video-watch#VideoWatchModule', | 72 | loadChildren: 'app/videos/+video-watch/video-watch.module#VideoWatchModule', |
73 | data: { | 73 | data: { |
74 | preload: 3000 | 74 | preload: 3000 |
75 | } | 75 | } |