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/core | |
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/core')
-rw-r--r-- | client/src/app/core/auth/auth.service.ts | 10 | ||||
-rw-r--r-- | client/src/app/core/core.module.ts | 1 | ||||
-rw-r--r-- | client/src/app/core/server/server.service.ts | 6 |
3 files changed, 7 insertions, 10 deletions
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) |