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/shared | |
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/shared')
-rw-r--r-- | client/src/app/shared/account/account.model.ts | 3 | ||||
-rw-r--r-- | client/src/app/shared/forms/form-validators/host.ts (renamed from client/src/app/shared/forms/form-validators/host.validator.ts) | 0 | ||||
-rw-r--r-- | client/src/app/shared/forms/form-validators/index.ts | 2 | ||||
-rw-r--r-- | client/src/app/shared/forms/form-validators/validator-message.ts | 5 | ||||
-rw-r--r-- | client/src/app/shared/forms/form-validators/video.ts | 6 | ||||
-rw-r--r-- | client/src/app/shared/misc/button.component.scss | 3 | ||||
-rw-r--r-- | client/src/app/shared/users/user.service.ts | 8 | ||||
-rw-r--r-- | client/src/app/shared/video-abuse/video-abuse.service.ts | 12 | ||||
-rw-r--r-- | client/src/app/shared/video-blacklist/video-blacklist.service.ts | 13 | ||||
-rw-r--r-- | client/src/app/shared/video/video-miniature.component.scss | 3 | ||||
-rw-r--r-- | client/src/app/shared/video/video-thumbnail.component.scss | 3 | ||||
-rw-r--r-- | client/src/app/shared/video/video.model.ts | 5 | ||||
-rw-r--r-- | client/src/app/shared/video/video.service.ts | 6 |
13 files changed, 38 insertions, 31 deletions
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 | } |