diff options
510 files changed, 2282 insertions, 2212 deletions
diff --git a/client/src/app/+about/about-follows/about-follows.component.ts b/client/src/app/+about/about-follows/about-follows.component.ts index fc265fecb..17c6903b8 100644 --- a/client/src/app/+about/about-follows/about-follows.component.ts +++ b/client/src/app/+about/about-follows/about-follows.component.ts | |||
@@ -1,10 +1,8 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | ||
2 | import { FollowService } from '@app/shared/instance/follow.service' | ||
3 | import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' | ||
4 | import { Notifier } from '@app/core' | ||
5 | import { RestService } from '@app/shared' | ||
6 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
7 | import { Subject } from 'rxjs' | 2 | import { Subject } from 'rxjs' |
3 | import { Component, OnInit } from '@angular/core' | ||
4 | import { ComponentPagination, hasMoreItems, Notifier, RestService } from '@app/core' | ||
5 | import { InstanceFollowService } from '@app/shared/shared-instance' | ||
8 | 6 | ||
9 | @Component({ | 7 | @Component({ |
10 | selector: 'my-about-follows', | 8 | selector: 'my-about-follows', |
@@ -38,7 +36,7 @@ export class AboutFollowsComponent implements OnInit { | |||
38 | constructor ( | 36 | constructor ( |
39 | private restService: RestService, | 37 | private restService: RestService, |
40 | private notifier: Notifier, | 38 | private notifier: Notifier, |
41 | private followService: FollowService | 39 | private followService: InstanceFollowService |
42 | ) { } | 40 | ) { } |
43 | 41 | ||
44 | ngOnInit () { | 42 | ngOnInit () { |
diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts index 15841be74..c57ac69ab 100644 --- a/client/src/app/+about/about-instance/about-instance.component.ts +++ b/client/src/app/+about/about-instance/about-instance.component.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { Component, OnInit, ViewChild, AfterViewChecked } from '@angular/core' | 1 | import { ViewportScroller } from '@angular/common' |
2 | import { Notifier, ServerService } from '@app/core' | 2 | import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' |
3 | import { ActivatedRoute } from '@angular/router' | ||
3 | import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' | 4 | import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' |
4 | import { InstanceService } from '@app/shared/instance/instance.service' | 5 | import { ServerService } from '@app/core' |
6 | import { InstanceService } from '@app/shared/shared-instance' | ||
5 | import { ServerConfig } from '@shared/models' | 7 | import { ServerConfig } from '@shared/models' |
6 | import { ActivatedRoute } from '@angular/router' | ||
7 | import { ResolverData } from './about-instance.resolver' | 8 | import { ResolverData } from './about-instance.resolver' |
8 | import { ViewportScroller } from '@angular/common' | ||
9 | 9 | ||
10 | @Component({ | 10 | @Component({ |
11 | selector: 'my-about-instance', | 11 | selector: 'my-about-instance', |
diff --git a/client/src/app/+about/about-instance/about-instance.resolver.ts b/client/src/app/+about/about-instance/about-instance.resolver.ts index 94c6abe5a..b2349ba12 100644 --- a/client/src/app/+about/about-instance/about-instance.resolver.ts +++ b/client/src/app/+about/about-instance/about-instance.resolver.ts | |||
@@ -1,17 +1,16 @@ | |||
1 | import { forkJoin } from 'rxjs' | ||
2 | import { map, switchMap } from 'rxjs/operators' | ||
1 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' | 4 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' |
3 | import { map, switchMap } from 'rxjs/operators' | 5 | import { InstanceService } from '@app/shared/shared-instance' |
4 | import { forkJoin } from 'rxjs' | ||
5 | import { InstanceService } from '@app/shared/instance/instance.service' | ||
6 | import { About } from '@shared/models/server' | 6 | import { About } from '@shared/models/server' |
7 | 7 | ||
8 | export type ResolverData = { about: About, languages: string[], categories: string[] } | 8 | export type ResolverData = { about: About, languages: string[], categories: string[] } |
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class AboutInstanceResolver implements Resolve<any> { | 11 | export class AboutInstanceResolver implements Resolve<any> { |
12 | constructor ( | 12 | |
13 | private instanceService: InstanceService | 13 | constructor (private instanceService: InstanceService) {} |
14 | ) {} | ||
15 | 14 | ||
16 | resolve (route: ActivatedRouteSnapshot) { | 15 | resolve (route: ActivatedRouteSnapshot) { |
17 | return this.instanceService.getAbout() | 16 | return this.instanceService.getAbout() |
diff --git a/client/src/app/+about/about-instance/contact-admin-modal.component.ts b/client/src/app/+about/about-instance/contact-admin-modal.component.ts index d5e146b82..5199402e6 100644 --- a/client/src/app/+about/about-instance/contact-admin-modal.component.ts +++ b/client/src/app/+about/about-instance/contact-admin-modal.component.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { Notifier, ServerService } from '@app/core' | 2 | import { Notifier, ServerService } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { FormReactive, FormValidatorService, InstanceValidatorsService } from '@app/shared/shared-forms' |
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 4 | import { InstanceService } from '@app/shared/shared-instance' |
5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
6 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 6 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
7 | import { FormReactive, InstanceValidatorsService } from '@app/shared' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { InstanceService } from '@app/shared/instance/instance.service' | ||
9 | import { ServerConfig } from '@shared/models' | 8 | import { ServerConfig } from '@shared/models' |
10 | 9 | ||
11 | @Component({ | 10 | @Component({ |
diff --git a/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts b/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts index fa2c0daa0..da1fcdc92 100644 --- a/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts +++ b/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { MarkdownService } from '@app/shared/renderer' | 2 | import { MarkdownService } from '@app/core' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-about-peertube-contributors', | 5 | selector: 'my-about-peertube-contributors', |
diff --git a/client/src/app/+about/about.module.ts b/client/src/app/+about/about.module.ts index 84d697540..1aca14033 100644 --- a/client/src/app/+about/about.module.ts +++ b/client/src/app/+about/about.module.ts | |||
@@ -1,18 +1,25 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { AboutRoutingModule } from './about-routing.module' | 2 | import { AboutFollowsComponent } from '@app/+about/about-follows/about-follows.component' |
3 | import { AboutComponent } from './about.component' | ||
4 | import { SharedModule } from '../shared' | ||
5 | import { AboutInstanceComponent } from '@app/+about/about-instance/about-instance.component' | 3 | import { AboutInstanceComponent } from '@app/+about/about-instance/about-instance.component' |
6 | import { AboutPeertubeComponent } from '@app/+about/about-peertube/about-peertube.component' | 4 | import { AboutInstanceResolver } from '@app/+about/about-instance/about-instance.resolver' |
7 | import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' | 5 | import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' |
8 | import { AboutFollowsComponent } from '@app/+about/about-follows/about-follows.component' | ||
9 | import { AboutPeertubeContributorsComponent } from '@app/+about/about-peertube/about-peertube-contributors.component' | 6 | import { AboutPeertubeContributorsComponent } from '@app/+about/about-peertube/about-peertube-contributors.component' |
10 | import { AboutInstanceResolver } from '@app/+about/about-instance/about-instance.resolver' | 7 | import { AboutPeertubeComponent } from '@app/+about/about-peertube/about-peertube.component' |
8 | import { SharedFormModule } from '@app/shared/shared-forms' | ||
9 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | ||
10 | import { SharedInstanceModule } from '@app/shared/shared-instance' | ||
11 | import { SharedMainModule } from '@app/shared/shared-main' | ||
12 | import { AboutRoutingModule } from './about-routing.module' | ||
13 | import { AboutComponent } from './about.component' | ||
11 | 14 | ||
12 | @NgModule({ | 15 | @NgModule({ |
13 | imports: [ | 16 | imports: [ |
14 | AboutRoutingModule, | 17 | AboutRoutingModule, |
15 | SharedModule | 18 | |
19 | SharedMainModule, | ||
20 | SharedFormModule, | ||
21 | SharedInstanceModule, | ||
22 | SharedGlobalIconModule | ||
16 | ], | 23 | ], |
17 | 24 | ||
18 | declarations: [ | 25 | declarations: [ |
diff --git a/client/src/app/+accounts/account-about/account-about.component.ts b/client/src/app/+accounts/account-about/account-about.component.ts index d1616490f..8c01e4007 100644 --- a/client/src/app/+accounts/account-about/account-about.component.ts +++ b/client/src/app/+accounts/account-about/account-about.component.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { Subscription } from 'rxjs' | ||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 2 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { Account } from '@app/shared/account/account.model' | 3 | import { MarkdownService } from '@app/core' |
3 | import { AccountService } from '@app/shared/account/account.service' | 4 | import { Account, AccountService } from '@app/shared/shared-main' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { Subscription } from 'rxjs' | ||
6 | import { MarkdownService } from '@app/shared/renderer' | ||
7 | 6 | ||
8 | @Component({ | 7 | @Component({ |
9 | selector: 'my-account-about', | 8 | selector: 'my-account-about', |
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts index eba1acfa1..205245675 100644 --- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts +++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts | |||
@@ -1,16 +1,9 @@ | |||
1 | import { from, Subject, Subscription } from 'rxjs' | 1 | import { from, Subject, Subscription } from 'rxjs' |
2 | import { concatMap, map, switchMap, tap } from 'rxjs/operators' | 2 | import { concatMap, map, switchMap, tap } from 'rxjs/operators' |
3 | import { Component, OnDestroy, OnInit } from '@angular/core' | 3 | import { Component, OnDestroy, OnInit } from '@angular/core' |
4 | import { User, UserService } from '@app/shared' | 4 | import { ComponentPagination, hasMoreItems, ScreenService, User, UserService } from '@app/core' |
5 | import { Account } from '@app/shared/account/account.model' | 5 | import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' |
6 | import { AccountService } from '@app/shared/account/account.service' | 6 | import { VideoSortField } from '@shared/models' |
7 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
8 | import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' | ||
9 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
10 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
11 | import { VideoSortField } from '@app/shared/video/sort-field.type' | ||
12 | import { Video } from '@app/shared/video/video.model' | ||
13 | import { VideoService } from '@app/shared/video/video.service' | ||
14 | 7 | ||
15 | @Component({ | 8 | @Component({ |
16 | selector: 'my-account-video-channels', | 9 | selector: 'my-account-video-channels', |
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts index 41b27b541..dd47589c1 100644 --- a/client/src/app/+accounts/account-videos/account-videos.component.ts +++ b/client/src/app/+accounts/account-videos/account-videos.component.ts | |||
@@ -1,25 +1,18 @@ | |||
1 | import { Subscription } from 'rxjs' | ||
2 | import { first, tap } from 'rxjs/operators' | ||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 3 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 5 | import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
4 | import { AuthService } from '../../core/auth' | 6 | import { immutableAssign } from '@app/helpers' |
5 | import { ConfirmService } from '../../core/confirm' | 7 | import { Account, AccountService, VideoService } from '@app/shared/shared-main' |
6 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 8 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' |
7 | import { VideoService } from '../../shared/video/video.service' | ||
8 | import { Account } from '@app/shared/account/account.model' | ||
9 | import { AccountService } from '@app/shared/account/account.service' | ||
10 | import { first, tap } from 'rxjs/operators' | ||
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
12 | import { Subscription } from 'rxjs' | ||
13 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
14 | import { Notifier, ServerService } from '@app/core' | ||
15 | import { UserService } from '@app/shared' | ||
16 | import { LocalStorageService } from '@app/shared/misc/storage.service' | ||
17 | 10 | ||
18 | @Component({ | 11 | @Component({ |
19 | selector: 'my-account-videos', | 12 | selector: 'my-account-videos', |
20 | templateUrl: '../../shared/video/abstract-video-list.html', | 13 | templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html', |
21 | styleUrls: [ | 14 | styleUrls: [ |
22 | '../../shared/video/abstract-video-list.scss', | 15 | '../../shared/shared-video-miniature/abstract-video-list.scss', |
23 | './account-videos.component.scss' | 16 | './account-videos.component.scss' |
24 | ] | 17 | ] |
25 | }) | 18 | }) |
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index bf71179f3..01911cac2 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts | |||
@@ -1,17 +1,11 @@ | |||
1 | import { Subscription } from 'rxjs' | ||
2 | import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators' | ||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 3 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute } from '@angular/router' | 4 | import { ActivatedRoute } from '@angular/router' |
3 | import { AccountService } from '@app/shared/account/account.service' | 5 | import { AuthService, Notifier, RedirectService, RestExtractor, ScreenService, UserService } from '@app/core' |
4 | import { Account } from '@app/shared/account/account.model' | 6 | import { Account, AccountService, ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main' |
5 | import { RestExtractor, UserService } from '@app/shared' | ||
6 | import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators' | ||
7 | import { Subscription } from 'rxjs' | ||
8 | import { AuthService, Notifier, RedirectService } from '@app/core' | ||
9 | import { User, UserRight } from '../../../../shared' | ||
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 8 | import { User, UserRight } from '@shared/models' |
12 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
13 | import { ListOverflowItem } from '@app/shared/misc/list-overflow.component' | ||
14 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
15 | 9 | ||
16 | @Component({ | 10 | @Component({ |
17 | templateUrl: './accounts.component.html', | 11 | templateUrl: './accounts.component.html', |
diff --git a/client/src/app/+accounts/accounts.module.ts b/client/src/app/+accounts/accounts.module.ts index 8e679822a..815360341 100644 --- a/client/src/app/+accounts/accounts.module.ts +++ b/client/src/app/+accounts/accounts.module.ts | |||
@@ -1,15 +1,26 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { SharedModule } from '../shared' | 2 | import { SharedFormModule } from '@app/shared/shared-forms' |
3 | import { AccountsRoutingModule } from './accounts-routing.module' | 3 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' |
4 | import { AccountsComponent } from './accounts.component' | 4 | import { SharedMainModule } from '@app/shared/shared-main' |
5 | import { AccountVideosComponent } from './account-videos/account-videos.component' | 5 | import { SharedModerationModule } from '@app/shared/shared-moderation' |
6 | import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' | ||
7 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' | ||
6 | import { AccountAboutComponent } from './account-about/account-about.component' | 8 | import { AccountAboutComponent } from './account-about/account-about.component' |
7 | import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' | 9 | import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' |
10 | import { AccountVideosComponent } from './account-videos/account-videos.component' | ||
11 | import { AccountsRoutingModule } from './accounts-routing.module' | ||
12 | import { AccountsComponent } from './accounts.component' | ||
8 | 13 | ||
9 | @NgModule({ | 14 | @NgModule({ |
10 | imports: [ | 15 | imports: [ |
11 | AccountsRoutingModule, | 16 | AccountsRoutingModule, |
12 | SharedModule | 17 | |
18 | SharedMainModule, | ||
19 | SharedFormModule, | ||
20 | SharedUserSubscriptionModule, | ||
21 | SharedModerationModule, | ||
22 | SharedVideoMiniatureModule, | ||
23 | SharedGlobalIconModule | ||
13 | ], | 24 | ], |
14 | 25 | ||
15 | declarations: [ | 26 | declarations: [ |
diff --git a/client/src/app/+admin/admin-routing.module.ts b/client/src/app/+admin/admin-routing.module.ts index 79c57221b..986dae8eb 100644 --- a/client/src/app/+admin/admin-routing.module.ts +++ b/client/src/app/+admin/admin-routing.module.ts | |||
@@ -1,15 +1,13 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | import { ConfigRoutes } from '@app/+admin/config' | 3 | import { ConfigRoutes } from '@app/+admin/config' |
4 | 4 | import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes' | |
5 | import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes' | ||
6 | import { SystemRoutes } from '@app/+admin/system' | ||
5 | import { MetaGuard } from '@ngx-meta/core' | 7 | import { MetaGuard } from '@ngx-meta/core' |
6 | |||
7 | import { AdminComponent } from './admin.component' | 8 | import { AdminComponent } from './admin.component' |
8 | import { FollowsRoutes } from './follows' | 9 | import { FollowsRoutes } from './follows' |
9 | import { UsersRoutes } from './users' | 10 | import { UsersRoutes } from './users' |
10 | import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes' | ||
11 | import { SystemRoutes } from '@app/+admin/system' | ||
12 | import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes' | ||
13 | 11 | ||
14 | const adminRoutes: Routes = [ | 12 | const adminRoutes: Routes = [ |
15 | { | 13 | { |
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index a97a33cf5..e47c7a8f4 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { UserRight } from '../../../../shared' | 2 | import { AuthService } from '@app/core' |
3 | import { AuthService } from '../core/auth/auth.service' | 3 | import { ListOverflowItem } from '@app/shared/shared-main' |
4 | import { ListOverflowItem } from '@app/shared/misc/list-overflow.component' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { UserRight } from '@shared/models' | ||
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | templateUrl: './admin.component.html' | 8 | templateUrl: './admin.component.html' |
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts index eccec8a49..728227a84 100644 --- a/client/src/app/+admin/admin.module.ts +++ b/client/src/app/+admin/admin.module.ts | |||
@@ -1,39 +1,41 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { ChartModule } from 'primeng/chart' |
2 | import { ConfigComponent, EditCustomConfigComponent } from '@app/+admin/config' | 2 | import { SelectButtonModule } from 'primeng/selectbutton' |
3 | import { ConfigService } from '@app/+admin/config/shared/config.service' | ||
4 | import { TableModule } from 'primeng/table' | 3 | import { TableModule } from 'primeng/table' |
5 | import { SharedModule } from '../shared' | 4 | import { NgModule } from '@angular/core' |
5 | import { SharedFormModule } from '@app/shared/shared-forms' | ||
6 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | ||
7 | import { SharedMainModule } from '@app/shared/shared-main' | ||
8 | import { SharedModerationModule } from '@app/shared/shared-moderation' | ||
6 | import { AdminRoutingModule } from './admin-routing.module' | 9 | import { AdminRoutingModule } from './admin-routing.module' |
7 | import { AdminComponent } from './admin.component' | 10 | import { AdminComponent } from './admin.component' |
11 | import { ConfigComponent, EditCustomConfigComponent } from './config' | ||
12 | import { ConfigService } from './config/shared/config.service' | ||
8 | import { FollowersListComponent, FollowsComponent, VideoRedundanciesListComponent } from './follows' | 13 | import { FollowersListComponent, FollowsComponent, VideoRedundanciesListComponent } from './follows' |
9 | import { FollowingListComponent } from './follows/following-list/following-list.component' | 14 | import { FollowingListComponent } from './follows/following-list/following-list.component' |
10 | import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users' | 15 | import { RedundancyCheckboxComponent } from './follows/shared/redundancy-checkbox.component' |
11 | import { | 16 | import { VideoRedundancyInformationComponent } from './follows/video-redundancies-list/video-redundancy-information.component' |
12 | ModerationCommentModalComponent, | 17 | import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoBlockListComponent } from './moderation' |
13 | VideoAbuseListComponent, | 18 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist' |
14 | VideoBlockListComponent | 19 | import { ModerationComponent } from './moderation/moderation.component' |
15 | } from './moderation' | ||
16 | import { ModerationComponent } from '@app/+admin/moderation/moderation.component' | ||
17 | import { RedundancyCheckboxComponent } from '@app/+admin/follows/shared/redundancy-checkbox.component' | ||
18 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' | ||
19 | import { JobsComponent } from '@app/+admin/system/jobs/jobs.component' | ||
20 | import { JobService, LogsComponent, LogsService, SystemComponent } from '@app/+admin/system' | ||
21 | import { DebugComponent, DebugService } from '@app/+admin/system/debug' | ||
22 | import { PluginsComponent } from '@app/+admin/plugins/plugins.component' | ||
23 | import { PluginListInstalledComponent } from '@app/+admin/plugins/plugin-list-installed/plugin-list-installed.component' | ||
24 | import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component' | ||
25 | import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component' | ||
26 | import { SelectButtonModule } from 'primeng/selectbutton' | ||
27 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | ||
28 | import { VideoRedundancyInformationComponent } from '@app/+admin/follows/video-redundancies-list/video-redundancy-information.component' | ||
29 | import { ChartModule } from 'primeng/chart' | ||
30 | import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component' | 20 | import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component' |
21 | import { PluginListInstalledComponent } from './plugins/plugin-list-installed/plugin-list-installed.component' | ||
22 | import { PluginSearchComponent } from './plugins/plugin-search/plugin-search.component' | ||
23 | import { PluginShowInstalledComponent } from './plugins/plugin-show-installed/plugin-show-installed.component' | ||
24 | import { PluginsComponent } from './plugins/plugins.component' | ||
25 | import { PluginApiService } from './plugins/shared/plugin-api.service' | ||
26 | import { JobService, LogsComponent, LogsService, SystemComponent } from './system' | ||
27 | import { DebugComponent, DebugService } from './system/debug' | ||
28 | import { JobsComponent } from './system/jobs/jobs.component' | ||
29 | import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users' | ||
31 | 30 | ||
32 | @NgModule({ | 31 | @NgModule({ |
33 | imports: [ | 32 | imports: [ |
34 | AdminRoutingModule, | 33 | AdminRoutingModule, |
35 | 34 | ||
36 | SharedModule, | 35 | SharedMainModule, |
36 | SharedFormModule, | ||
37 | SharedModerationModule, | ||
38 | SharedGlobalIconModule, | ||
37 | 39 | ||
38 | TableModule, | 40 | TableModule, |
39 | SelectButtonModule, | 41 | SelectButtonModule, |
diff --git a/client/src/app/+admin/config/config.routes.ts b/client/src/app/+admin/config/config.routes.ts index 2ca2f8fde..7c1a1a166 100644 --- a/client/src/app/+admin/config/config.routes.ts +++ b/client/src/app/+admin/config/config.routes.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config' | 2 | import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config' |
3 | import { UserRightGuard } from '@app/core' | 3 | import { UserRightGuard } from '@app/core' |
4 | import { UserRight } from '../../../../../shared/models/users' | 4 | import { UserRight } from '@shared/models' |
5 | import { ConfigComponent } from './config.component' | 5 | import { ConfigComponent } from './config.component' |
6 | 6 | ||
7 | export const ConfigRoutes: Routes = [ | 7 | export const ConfigRoutes: Routes = [ |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 3a47ba25e..69629770f 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -1,16 +1,14 @@ | |||
1 | import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' | ||
2 | import { ConfigService } from '@app/+admin/config/shared/config.service' | ||
3 | import { ServerService } from '@app/core/server/server.service' | ||
4 | import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared' | ||
5 | import { Notifier } from '@app/core' | ||
6 | import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
9 | import { SelectItem } from 'primeng/api' | 1 | import { SelectItem } from 'primeng/api' |
10 | import { forkJoin } from 'rxjs' | 2 | import { forkJoin } from 'rxjs' |
11 | import { ServerConfig } from '@shared/models' | ||
12 | import { ViewportScroller } from '@angular/common' | 3 | import { ViewportScroller } from '@angular/common' |
4 | import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' | ||
5 | import { ConfigService } from '@app/+admin/config/shared/config.service' | ||
6 | import { Notifier } from '@app/core' | ||
7 | import { ServerService } from '@app/core/server/server.service' | ||
8 | import { CustomConfigValidatorsService, FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' | ||
13 | import { NgbNav } from '@ng-bootstrap/ng-bootstrap' | 9 | import { NgbNav } from '@ng-bootstrap/ng-bootstrap' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
11 | import { CustomConfig, ServerConfig } from '@shared/models' | ||
14 | 12 | ||
15 | @Component({ | 13 | @Component({ |
16 | selector: 'my-edit-custom-config', | 14 | selector: 'my-edit-custom-config', |
diff --git a/client/src/app/+admin/config/shared/config.service.ts b/client/src/app/+admin/config/shared/config.service.ts index 874b8094d..f182946b8 100644 --- a/client/src/app/+admin/config/shared/config.service.ts +++ b/client/src/app/+admin/config/shared/config.service.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { catchError } from 'rxjs/operators' | 1 | import { catchError } from 'rxjs/operators' |
2 | import { HttpClient } from '@angular/common/http' | 2 | import { HttpClient } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model' | 4 | import { RestExtractor } from '@app/core' |
5 | import { environment } from '../../../../environments/environment' | ||
6 | import { RestExtractor } from '../../../shared' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { CustomConfig } from '@shared/models' | ||
7 | import { environment } from '../../../../environments/environment' | ||
8 | 8 | ||
9 | @Injectable() | 9 | @Injectable() |
10 | export class ConfigService { | 10 | export class ConfigService { |
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts index 17352a601..63135f898 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | ||
2 | import { ConfirmService, Notifier } from '@app/core' | ||
3 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
4 | import { ActorFollow } from '../../../../../../shared/models/actors/follow.model' | 2 | import { Component, OnInit } from '@angular/core' |
5 | import { RestPagination, RestTable } from '../../../shared' | 3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' |
6 | import { FollowService } from '@app/shared/instance/follow.service' | 4 | import { InstanceFollowService } from '@app/shared/shared-instance' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { ActorFollow } from '@shared/models' | ||
8 | 7 | ||
9 | @Component({ | 8 | @Component({ |
10 | selector: 'my-followers-list', | 9 | selector: 'my-followers-list', |
@@ -21,7 +20,7 @@ export class FollowersListComponent extends RestTable implements OnInit { | |||
21 | private confirmService: ConfirmService, | 20 | private confirmService: ConfirmService, |
22 | private notifier: Notifier, | 21 | private notifier: Notifier, |
23 | private i18n: I18n, | 22 | private i18n: I18n, |
24 | private followService: FollowService | 23 | private followService: InstanceFollowService |
25 | ) { | 24 | ) { |
26 | super() | 25 | super() |
27 | } | 26 | } |
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index 6ddbf02d6..dae8923b5 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | ||
2 | import { Notifier } from '@app/core' | ||
3 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
4 | import { ActorFollow } from '../../../../../../shared/models/actors/follow.model' | 2 | import { Component, OnInit, ViewChild } from '@angular/core' |
5 | import { ConfirmService } from '../../../core/confirm/confirm.service' | 3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' |
6 | import { RestPagination, RestTable } from '../../../shared' | 4 | import { InstanceFollowService } from '@app/shared/shared-instance' |
7 | import { FollowService } from '@app/shared/instance/follow.service' | 5 | import { BatchDomainsModalComponent } from '@app/shared/shared-moderation' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
9 | import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-domains-modal.component' | 7 | import { ActorFollow } from '@shared/models' |
10 | 8 | ||
11 | @Component({ | 9 | @Component({ |
12 | selector: 'my-followers-list', | 10 | selector: 'my-followers-list', |
@@ -24,7 +22,7 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
24 | constructor ( | 22 | constructor ( |
25 | private notifier: Notifier, | 23 | private notifier: Notifier, |
26 | private confirmService: ConfirmService, | 24 | private confirmService: ConfirmService, |
27 | private followService: FollowService, | 25 | private followService: InstanceFollowService, |
28 | private i18n: I18n | 26 | private i18n: I18n |
29 | ) { | 27 | ) { |
30 | super() | 28 | super() |
diff --git a/client/src/app/+admin/follows/follows.routes.ts b/client/src/app/+admin/follows/follows.routes.ts index 8270ae444..817074536 100644 --- a/client/src/app/+admin/follows/follows.routes.ts +++ b/client/src/app/+admin/follows/follows.routes.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | 2 | import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' | |
3 | import { UserRightGuard } from '../../core' | 3 | import { UserRightGuard } from '@app/core' |
4 | import { FollowsComponent } from './follows.component' | 4 | import { UserRight } from '@shared/models' |
5 | import { FollowersListComponent } from './followers-list' | 5 | import { FollowersListComponent } from './followers-list' |
6 | import { UserRight } from '../../../../../shared' | ||
7 | import { FollowingListComponent } from './following-list/following-list.component' | 6 | import { FollowingListComponent } from './following-list/following-list.component' |
8 | import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' | 7 | import { FollowsComponent } from './follows.component' |
9 | 8 | ||
10 | export const FollowsRoutes: Routes = [ | 9 | export const FollowsRoutes: Routes = [ |
11 | { | 10 | { |
diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts index 9d7883d97..662143abc 100644 --- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts +++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier } from '@app/core' |
3 | import { RedundancyService } from '@app/shared/shared-main' | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { RedundancyService } from '@app/shared/video/redundancy.service' | ||
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'my-redundancy-checkbox', | 7 | selector: 'my-redundancy-checkbox', |
diff --git a/client/src/app/+admin/follows/video-redundancies-list/index.ts b/client/src/app/+admin/follows/video-redundancies-list/index.ts index 6a7c7f483..07e734b1a 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/index.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/index.ts | |||
@@ -1 +1,2 @@ | |||
1 | export * from './video-redundancies-list.component' | 1 | export * from './video-redundancies-list.component' |
2 | export * from './video-redundancy-information.component' | ||
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts index 267a1f58e..0048882bc 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts | |||
@@ -1,14 +1,12 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { BytesPipe } from 'ngx-pipes' |
2 | import { Notifier, ServerService } from '@app/core' | ||
3 | import { SortMeta } from 'primeng/api' | 2 | import { SortMeta } from 'primeng/api' |
4 | import { ConfirmService } from '../../../core/confirm/confirm.service' | 3 | import { Component, OnInit } from '@angular/core' |
5 | import { RestPagination, RestTable } from '../../../shared' | 4 | import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' |
5 | import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' | ||
6 | import { RedundancyService } from '@app/shared/shared-main' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' | 8 | import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' |
8 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | ||
9 | import { VideosRedundancyStats } from '@shared/models/server' | 9 | import { VideosRedundancyStats } from '@shared/models/server' |
10 | import { BytesPipe } from 'ngx-pipes' | ||
11 | import { RedundancyService } from '@app/shared/video/redundancy.service' | ||
12 | 10 | ||
13 | @Component({ | 11 | @Component({ |
14 | selector: 'my-video-redundancies-list', | 12 | selector: 'my-video-redundancies-list', |
diff --git a/client/src/app/+admin/moderation/index.ts b/client/src/app/+admin/moderation/index.ts index e99244b74..16249236c 100644 --- a/client/src/app/+admin/moderation/index.ts +++ b/client/src/app/+admin/moderation/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './instance-blocklist' | ||
1 | export * from './video-abuse-list' | 2 | export * from './video-abuse-list' |
2 | export * from './video-block-list' | 3 | export * from './video-block-list' |
3 | export * from './moderation.component' | 4 | export * from './moderation.component' |
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts index 90a176194..d9fec29ce 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component } from '@angular/core' |
2 | import { GenericAccountBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' | 2 | import { BlocklistComponentType, GenericAccountBlocklistComponent } from '@app/shared/shared-moderation' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-instance-account-blocklist', | 5 | selector: 'my-instance-account-blocklist', |
6 | styleUrls: [ '../moderation.component.scss', '../../../shared/blocklist/account-blocklist.component.scss' ], | 6 | styleUrls: [ '../moderation.component.scss', '../../../shared/shared-moderation/account-blocklist.component.scss' ], |
7 | templateUrl: '../../../shared/blocklist/account-blocklist.component.html' | 7 | templateUrl: '../../../shared/shared-moderation/account-blocklist.component.html' |
8 | }) | 8 | }) |
9 | export class InstanceAccountBlocklistComponent extends GenericAccountBlocklistComponent { | 9 | export class InstanceAccountBlocklistComponent extends GenericAccountBlocklistComponent { |
10 | mode = BlocklistComponentType.Instance | 10 | mode = BlocklistComponentType.Instance |
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts index 9d4ec174a..3afae529f 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component } from '@angular/core' |
2 | import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' | 2 | import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/shared-moderation' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-instance-server-blocklist', | 5 | selector: 'my-instance-server-blocklist', |
6 | styleUrls: [ '../../../shared/blocklist/server-blocklist.component.scss' ], | 6 | styleUrls: [ '../../../shared/shared-moderation/server-blocklist.component.scss' ], |
7 | templateUrl: '../../../shared/blocklist/server-blocklist.component.html' | 7 | templateUrl: '../../../shared/shared-moderation/server-blocklist.component.html' |
8 | }) | 8 | }) |
9 | export class InstanceServerBlocklistComponent extends GenericServerBlocklistComponent { | 9 | export class InstanceServerBlocklistComponent extends GenericServerBlocklistComponent { |
10 | mode = BlocklistComponentType.Instance | 10 | mode = BlocklistComponentType.Instance |
diff --git a/client/src/app/+admin/moderation/moderation.component.ts b/client/src/app/+admin/moderation/moderation.component.ts index 1b1df6f09..806f9d100 100644 --- a/client/src/app/+admin/moderation/moderation.component.ts +++ b/client/src/app/+admin/moderation/moderation.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { UserRight } from '../../../../../shared' | ||
3 | import { AuthService, ServerService } from '@app/core' | 2 | import { AuthService, ServerService } from '@app/core' |
3 | import { UserRight } from '@shared/models' | ||
4 | 4 | ||
5 | @Component({ | 5 | @Component({ |
6 | templateUrl: './moderation.component.html', | 6 | templateUrl: './moderation.component.html', |
diff --git a/client/src/app/+admin/moderation/moderation.routes.ts b/client/src/app/+admin/moderation/moderation.routes.ts index c08333f17..cd837bcb9 100644 --- a/client/src/app/+admin/moderation/moderation.routes.ts +++ b/client/src/app/+admin/moderation/moderation.routes.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { UserRight } from '../../../../../shared' | 2 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' |
3 | import { UserRightGuard } from '@app/core' | 3 | import { ModerationComponent } from '@app/+admin/moderation/moderation.component' |
4 | import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list' | 4 | import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list' |
5 | import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' | 5 | import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' |
6 | import { ModerationComponent } from '@app/+admin/moderation/moderation.component' | 6 | import { UserRightGuard } from '@app/core' |
7 | import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' | 7 | import { UserRight } from '@shared/models' |
8 | 8 | ||
9 | export const ModerationRoutes: Routes = [ | 9 | export const ModerationRoutes: Routes = [ |
10 | { | 10 | { |
diff --git a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts index a0471f2b0..3cd763ca4 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier } from '@app/core' |
3 | import { FormReactive, VideoAbuseService, VideoAbuseValidatorsService } from '../../../shared' | 3 | import { FormReactive, FormValidatorService, VideoAbuseValidatorsService } from '@app/shared/shared-forms' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { VideoAbuseService } from '@app/shared/shared-moderation' |
5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
6 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 6 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
7 | import { FormValidatorService } from '../../../shared/forms/form-validators/form-validator.service' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { VideoAbuse } from '../../../../../../shared/models/videos' | 8 | import { VideoAbuse } from '@shared/models' |
9 | 9 | ||
10 | @Component({ | 10 | @Component({ |
11 | selector: 'my-moderation-comment-modal', | 11 | selector: 'my-moderation-comment-modal', |
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts index 13485124f..9aa70288d 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { Actor } from '@app/shared/actor/actor.model' | 2 | import { Actor } from '@app/shared/shared-main' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
3 | import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model' | 4 | import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model' |
4 | import { ProcessedVideoAbuse } from './video-abuse-list.component' | 5 | import { ProcessedVideoAbuse } from './video-abuse-list.component' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
6 | import { durationToString } from '@app/shared/misc/utils' | ||
7 | 6 | ||
8 | @Component({ | 7 | @Component({ |
9 | selector: 'my-video-abuse-details', | 8 | selector: 'my-video-abuse-details', |
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts index d7f5beef3..b0a655e71 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts | |||
@@ -1,23 +1,16 @@ | |||
1 | import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core' | ||
2 | import { Account } from '@app/shared/account/account.model' | ||
3 | import { Notifier } from '@app/core' | ||
4 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
5 | import { VideoAbuse, VideoAbuseState } from '../../../../../../shared' | 2 | import { filter } from 'rxjs/operators' |
6 | import { RestPagination, RestTable, VideoAbuseService, VideoBlockService } from '../../../shared' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { DropdownAction } from '../../../shared/buttons/action-dropdown.component' | ||
9 | import { ConfirmService } from '../../../core/index' | ||
10 | import { ModerationCommentModalComponent } from './moderation-comment-modal.component' | ||
11 | import { Video } from '../../../shared/video/video.model' | ||
12 | import { MarkdownService } from '@app/shared/renderer' | ||
13 | import { Actor } from '@app/shared/actor/actor.model' | ||
14 | import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' | 3 | import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' |
4 | import { environment } from 'src/environments/environment' | ||
5 | import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core' | ||
15 | import { DomSanitizer } from '@angular/platform-browser' | 6 | import { DomSanitizer } from '@angular/platform-browser' |
16 | import { BlocklistService } from '@app/shared/blocklist' | ||
17 | import { VideoService } from '@app/shared/video/video.service' | ||
18 | import { ActivatedRoute, Params, Router } from '@angular/router' | 7 | import { ActivatedRoute, Params, Router } from '@angular/router' |
19 | import { filter } from 'rxjs/operators' | 8 | import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core' |
20 | import { environment } from 'src/environments/environment' | 9 | import { Account, Actor, DropdownAction, Video, VideoService } from '@app/shared/shared-main' |
10 | import { BlocklistService, VideoAbuseService, VideoBlockService } from '@app/shared/shared-moderation' | ||
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
12 | import { VideoAbuse, VideoAbuseState } from '@shared/models' | ||
13 | import { ModerationCommentModalComponent } from './moderation-comment-modal.component' | ||
21 | 14 | ||
22 | export type ProcessedVideoAbuse = VideoAbuse & { | 15 | export type ProcessedVideoAbuse = VideoAbuse & { |
23 | moderationCommentHtml?: string, | 16 | moderationCommentHtml?: string, |
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts index c0ac32242..c03f9248e 100644 --- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts +++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts | |||
@@ -1,16 +1,12 @@ | |||
1 | import { Component, OnInit, AfterViewInit } from '@angular/core' | ||
2 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
3 | import { Notifier, ServerService } from '@app/core' | ||
4 | import { ConfirmService } from '../../../core' | ||
5 | import { RestPagination, RestTable, VideoBlockService } from '../../../shared' | ||
6 | import { VideoBlacklist, VideoBlacklistType } from '../../../../../../shared' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { DropdownAction } from '../../../shared/buttons/action-dropdown.component' | ||
9 | import { Video } from '../../../shared/video/video.model' | ||
10 | import { MarkdownService } from '@app/shared/renderer' | ||
11 | import { Params, ActivatedRoute, Router } from '@angular/router' | ||
12 | import { filter, switchMap } from 'rxjs/operators' | 2 | import { filter, switchMap } from 'rxjs/operators' |
13 | import { VideoService } from '@app/shared/video/video.service' | 3 | import { AfterViewInit, Component, OnInit } from '@angular/core' |
4 | import { ActivatedRoute, Params, Router } from '@angular/router' | ||
5 | import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' | ||
6 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' | ||
7 | import { VideoBlockService } from '@app/shared/shared-moderation' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { VideoBlacklist, VideoBlacklistType } from '@shared/models' | ||
14 | 10 | ||
15 | @Component({ | 11 | @Component({ |
16 | selector: 'my-video-block-list', | 12 | selector: 'my-video-block-list', |
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts index a8973f2b2..af31f1144 100644 --- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts | |||
@@ -1,14 +1,13 @@ | |||
1 | import { Subject } from 'rxjs' | ||
1 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
2 | import { PluginType } from '@shared/models/plugins/plugin.type' | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
4 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | ||
5 | import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' | ||
6 | import { ConfirmService, Notifier } from '@app/core' | ||
7 | import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' | ||
8 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
9 | import { compareSemVer } from '@shared/core-utils/miscs/miscs' | 4 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' |
5 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' | ||
10 | import { PluginService } from '@app/core/plugins/plugin.service' | 6 | import { PluginService } from '@app/core/plugins/plugin.service' |
11 | import { Subject } from 'rxjs' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { compareSemVer } from '@shared/core-utils/miscs/miscs' | ||
9 | import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' | ||
10 | import { PluginType } from '@shared/models/plugins/plugin.type' | ||
12 | 11 | ||
13 | @Component({ | 12 | @Component({ |
14 | selector: 'my-plugin-list-installed', | 13 | selector: 'my-plugin-list-installed', |
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts index dc59e759b..ccf9f1ed5 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts | |||
@@ -1,14 +1,12 @@ | |||
1 | import { Subject } from 'rxjs' | ||
2 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' | ||
1 | import { Component, OnInit } from '@angular/core' | 3 | import { Component, OnInit } from '@angular/core' |
2 | import { Notifier, ServerService } from '@app/core' | ||
3 | import { ConfirmService } from '../../../core' | ||
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | import { PluginType } from '@shared/models/plugins/plugin.type' | ||
6 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | ||
7 | import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' | ||
8 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
5 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | ||
6 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, ServerService } from '@app/core' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' | 8 | import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' |
10 | import { Subject } from 'rxjs' | 9 | import { PluginType } from '@shared/models/plugins/plugin.type' |
11 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' | ||
12 | 10 | ||
13 | @Component({ | 11 | @Component({ |
14 | selector: 'my-plugin-search', | 12 | selector: 'my-plugin-search', |
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts index 13d12b145..dde03f1da 100644 --- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts | |||
@@ -1,13 +1,12 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | ||
2 | import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
4 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | ||
5 | import { Notifier } from '@app/core' | ||
6 | import { ActivatedRoute } from '@angular/router' | ||
7 | import { Subscription } from 'rxjs' | 1 | import { Subscription } from 'rxjs' |
8 | import { map, switchMap } from 'rxjs/operators' | 2 | import { map, switchMap } from 'rxjs/operators' |
9 | import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared' | 3 | import { Component, OnDestroy, OnInit } from '@angular/core' |
10 | import { RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model' | 4 | import { ActivatedRoute } from '@angular/router' |
5 | import { Notifier } from '@app/core' | ||
6 | import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared/shared-forms' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { PeerTubePlugin, RegisterServerSettingOptions } from '@shared/models' | ||
9 | import { PluginApiService } from '../shared/plugin-api.service' | ||
11 | 10 | ||
12 | @Component({ | 11 | @Component({ |
13 | selector: 'my-plugin-show-installed', | 12 | selector: 'my-plugin-show-installed', |
diff --git a/client/src/app/+admin/plugins/shared/plugin-api.service.ts b/client/src/app/+admin/plugins/shared/plugin-api.service.ts index f6ef68e9c..bf9129e01 100644 --- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts +++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts | |||
@@ -1,19 +1,21 @@ | |||
1 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map, switchMap } from 'rxjs/operators' | 2 | import { catchError, map, switchMap } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
4 | import { environment } from '../../../../environments/environment' | 5 | import { ComponentPagination, RestExtractor, RestService } from '@app/core' |
5 | import { RestExtractor, RestService } from '../../../shared' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { PluginType } from '@shared/models/plugins/plugin.type' | ||
8 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | ||
9 | import { peertubeTranslate, ResultList } from '@shared/models' | ||
10 | import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' | ||
11 | import { ManagePlugin } from '@shared/models/plugins/manage-plugin.model' | ||
12 | import { InstallOrUpdatePlugin } from '@shared/models/plugins/install-plugin.model' | ||
13 | import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' | ||
14 | import { RegisteredServerSettings, RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model' | ||
15 | import { PluginService } from '@app/core/plugins/plugin.service' | 6 | import { PluginService } from '@app/core/plugins/plugin.service' |
16 | import { Observable } from 'rxjs' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { | ||
9 | InstallOrUpdatePlugin, | ||
10 | ManagePlugin, | ||
11 | PeerTubePlugin, | ||
12 | PeerTubePluginIndex, | ||
13 | peertubeTranslate, | ||
14 | PluginType, | ||
15 | RegisteredServerSettings, | ||
16 | ResultList | ||
17 | } from '@shared/models' | ||
18 | import { environment } from '../../../../environments/environment' | ||
17 | 19 | ||
18 | @Injectable() | 20 | @Injectable() |
19 | export class PluginApiService { | 21 | export class PluginApiService { |
diff --git a/client/src/app/+admin/system/debug/debug.component.ts b/client/src/app/+admin/system/debug/debug.component.ts index 8a77f79f7..a88d837f3 100644 --- a/client/src/app/+admin/system/debug/debug.component.ts +++ b/client/src/app/+admin/system/debug/debug.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier } from '@app/core' |
3 | import { Debug } from '@shared/models/server' | 3 | import { Debug } from '@shared/models' |
4 | import { DebugService } from '@app/+admin/system/debug/debug.service' | 4 | import { DebugService } from './debug.service' |
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | templateUrl: './debug.component.html', | 7 | templateUrl: './debug.component.html', |
diff --git a/client/src/app/+admin/system/debug/debug.service.ts b/client/src/app/+admin/system/debug/debug.service.ts index 6c722d177..ab1d0a7fa 100644 --- a/client/src/app/+admin/system/debug/debug.service.ts +++ b/client/src/app/+admin/system/debug/debug.service.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Observable } from 'rxjs' | ||
1 | import { catchError } from 'rxjs/operators' | 2 | import { catchError } from 'rxjs/operators' |
2 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
4 | import { Observable } from 'rxjs' | 5 | import { RestExtractor } from '@app/core' |
6 | import { Debug } from '@shared/models' | ||
5 | import { environment } from '../../../../environments/environment' | 7 | import { environment } from '../../../../environments/environment' |
6 | import { RestExtractor, RestService } from '../../../shared' | ||
7 | import { Debug } from '@shared/models/server' | ||
8 | 8 | ||
9 | @Injectable() | 9 | @Injectable() |
10 | export class DebugService { | 10 | export class DebugService { |
@@ -12,7 +12,6 @@ export class DebugService { | |||
12 | 12 | ||
13 | constructor ( | 13 | constructor ( |
14 | private authHttp: HttpClient, | 14 | private authHttp: HttpClient, |
15 | private restService: RestService, | ||
16 | private restExtractor: RestExtractor | 15 | private restExtractor: RestExtractor |
17 | ) {} | 16 | ) {} |
18 | 17 | ||
diff --git a/client/src/app/+admin/system/index.ts b/client/src/app/+admin/system/index.ts index 226d999d2..8cced0cdb 100644 --- a/client/src/app/+admin/system/index.ts +++ b/client/src/app/+admin/system/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './debug' | ||
1 | export * from './jobs' | 2 | export * from './jobs' |
2 | export * from './logs' | 3 | export * from './logs' |
3 | export * from './system.component' | 4 | export * from './system.component' |
diff --git a/client/src/app/+admin/system/jobs/job.service.ts b/client/src/app/+admin/system/jobs/job.service.ts index 1e2291ad1..1ac50f050 100644 --- a/client/src/app/+admin/system/jobs/job.service.ts +++ b/client/src/app/+admin/system/jobs/job.service.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import { SortMeta } from 'primeng/api' | ||
2 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map } from 'rxjs/operators' | 3 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
4 | import { SortMeta } from 'primeng/api' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
5 | import { Observable } from 'rxjs' | 7 | import { Job, ResultList } from '@shared/models' |
6 | import { ResultList } from '../../../../../../shared' | ||
7 | import { Job } from '../../../../../../shared/models/server/job.model' | ||
8 | import { environment } from '../../../../environments/environment' | 8 | import { environment } from '../../../../environments/environment' |
9 | import { RestExtractor, RestPagination, RestService } from '../../../shared' | ||
10 | import { JobStateClient } from '../../../../types/job-state-client.type' | 9 | import { JobStateClient } from '../../../../types/job-state-client.type' |
11 | import { JobTypeClient } from '../../../../types/job-type-client.type' | 10 | import { JobTypeClient } from '../../../../types/job-type-client.type' |
12 | 11 | ||
diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts index 4f7f7c368..38a78de33 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.ts +++ b/client/src/app/+admin/system/jobs/jobs.component.ts | |||
@@ -1,14 +1,12 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | ||
2 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | ||
3 | import { Notifier } from '@app/core' | ||
4 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
5 | import { Job, JobType } from '../../../../../../shared/index' | 2 | import { Component, OnInit } from '@angular/core' |
6 | import { JobState } from '../../../../../../shared/models' | 3 | import { Notifier, RestPagination, RestTable } from '@app/core' |
7 | import { RestPagination, RestTable } from '../../../shared' | 4 | import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' |
8 | import { JobService } from './job.service' | ||
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { Job, JobState, JobType } from '@shared/models' | ||
10 | import { JobStateClient } from '../../../../types/job-state-client.type' | 7 | import { JobStateClient } from '../../../../types/job-state-client.type' |
11 | import { JobTypeClient } from '../../../../types/job-type-client.type' | 8 | import { JobTypeClient } from '../../../../types/job-type-client.type' |
9 | import { JobService } from './job.service' | ||
12 | 10 | ||
13 | @Component({ | 11 | @Component({ |
14 | selector: 'my-jobs', | 12 | selector: 'my-jobs', |
diff --git a/client/src/app/+admin/system/logs/log-row.model.ts b/client/src/app/+admin/system/logs/log-row.model.ts index b22581b5a..615778210 100644 --- a/client/src/app/+admin/system/logs/log-row.model.ts +++ b/client/src/app/+admin/system/logs/log-row.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { LogLevel } from '@shared/models/server/log-level.type' | 1 | import { LogLevel } from '@shared/models' |
2 | import omit from 'lodash-es/omit' | 2 | import omit from 'lodash-es/omit' |
3 | 3 | ||
4 | export class LogRow { | 4 | export class LogRow { |
diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts index b63f11953..51f047188 100644 --- a/client/src/app/+admin/system/logs/logs.component.ts +++ b/client/src/app/+admin/system/logs/logs.component.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' |
2 | import { LogsService } from '@app/+admin/system/logs/logs.service' | ||
3 | import { Notifier } from '@app/core' | 2 | import { Notifier } from '@app/core' |
4 | import { LogRow } from '@app/+admin/system/logs/log-row.model' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { LogLevel } from '@shared/models/server/log-level.type' | 4 | import { LogLevel } from '@shared/models' |
5 | import { LogRow } from './log-row.model' | ||
6 | import { LogsService } from './logs.service' | ||
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
9 | templateUrl: './logs.component.html', | 9 | templateUrl: './logs.component.html', |
diff --git a/client/src/app/+admin/system/logs/logs.service.ts b/client/src/app/+admin/system/logs/logs.service.ts index 41b38c7ba..69439a179 100644 --- a/client/src/app/+admin/system/logs/logs.service.ts +++ b/client/src/app/+admin/system/logs/logs.service.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map } from 'rxjs/operators' | 2 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
4 | import { Observable } from 'rxjs' | 5 | import { RestExtractor } from '@app/core' |
6 | import { LogLevel } from '@shared/models' | ||
5 | import { environment } from '../../../../environments/environment' | 7 | import { environment } from '../../../../environments/environment' |
6 | import { RestExtractor, RestService } from '../../../shared' | 8 | import { LogRow } from './log-row.model' |
7 | import { LogRow } from '@app/+admin/system/logs/log-row.model' | ||
8 | import { LogLevel } from '@shared/models/server/log-level.type' | ||
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class LogsService { | 11 | export class LogsService { |
@@ -14,7 +14,6 @@ export class LogsService { | |||
14 | 14 | ||
15 | constructor ( | 15 | constructor ( |
16 | private authHttp: HttpClient, | 16 | private authHttp: HttpClient, |
17 | private restService: RestService, | ||
18 | private restExtractor: RestExtractor | 17 | private restExtractor: RestExtractor |
19 | ) {} | 18 | ) {} |
20 | 19 | ||
diff --git a/client/src/app/+admin/system/system.routes.ts b/client/src/app/+admin/system/system.routes.ts index 2d851794d..0e8d98519 100644 --- a/client/src/app/+admin/system/system.routes.ts +++ b/client/src/app/+admin/system/system.routes.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | import { UserRightGuard } from '../../core' | 2 | import { UserRightGuard } from '@app/core' |
3 | import { UserRight } from '../../../../../shared' | 3 | import { UserRight } from '@shared/models' |
4 | import { JobsComponent } from '@app/+admin/system/jobs/jobs.component' | 4 | import { DebugComponent } from './debug' |
5 | import { LogsComponent } from '@app/+admin/system/logs' | 5 | import { JobsComponent } from './jobs/jobs.component' |
6 | import { SystemComponent } from '@app/+admin/system/system.component' | 6 | import { LogsComponent } from './logs' |
7 | import { DebugComponent } from '@app/+admin/system/debug' | 7 | import { SystemComponent } from './system.component' |
8 | 8 | ||
9 | export const SystemRoutes: Routes = [ | 9 | export const SystemRoutes: Routes = [ |
10 | { | 10 | { |
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts index b459eb8fa..f9f5b90bd 100644 --- a/client/src/app/+admin/users/user-edit/user-create.component.ts +++ b/client/src/app/+admin/users/user-edit/user-create.component.ts | |||
@@ -1,14 +1,11 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { Router, ActivatedRoute } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { AuthService, Notifier, ServerService } from '@app/core' | ||
4 | import { UserCreate, UserRole } from '../../../../../../shared' | ||
5 | import { UserEdit } from './user-edit' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
8 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
9 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 3 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
10 | import { UserService } from '@app/shared' | 4 | import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
11 | import { ScreenService } from '@app/shared/misc/screen.service' | 5 | import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { UserCreate, UserRole } from '@shared/models' | ||
8 | import { UserEdit } from './user-edit' | ||
12 | 9 | ||
13 | @Component({ | 10 | @Component({ |
14 | selector: 'my-user-create', | 11 | selector: 'my-user-create', |
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts index 5f5cc590c..8fa4b0635 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/users/user-edit/user-edit.ts | |||
@@ -1,11 +1,8 @@ | |||
1 | import { AuthService, ServerService } from '../../../core' | ||
2 | import { FormReactive } from '../../../shared' | ||
3 | import { ServerConfig, USER_ROLE_LABELS, UserRole, VideoResolution } from '../../../../../../shared' | ||
4 | import { ConfigService } from '@app/+admin/config/shared/config.service' | ||
5 | import { UserAdminFlag } from '@shared/models/users/user-flag.model' | ||
6 | import { OnInit } from '@angular/core' | 1 | import { OnInit } from '@angular/core' |
7 | import { User } from '@app/shared/users/user.model' | 2 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
8 | import { ScreenService } from '@app/shared/misc/screen.service' | 3 | import { AuthService, ScreenService, ServerService, User } from '@app/core' |
4 | import { FormReactive } from '@app/shared/shared-forms' | ||
5 | import { ServerConfig, USER_ROLE_LABELS, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' | ||
9 | 6 | ||
10 | export abstract class UserEdit extends FormReactive implements OnInit { | 7 | export abstract class UserEdit extends FormReactive implements OnInit { |
11 | videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = [] | 8 | videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = [] |
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts index ecad000f7..33c7de31f 100644 --- a/client/src/app/+admin/users/user-edit/user-password.component.ts +++ b/client/src/app/+admin/users/user-edit/user-password.component.ts | |||
@@ -1,12 +1,8 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { Notifier, UserService } from '@app/core' |
3 | import { UserService } from '@app/shared/users/user.service' | 3 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
4 | import { Notifier } from '../../../core' | ||
5 | import { User, UserUpdate } from '../../../../../../shared' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 5 | import { UserUpdate } from '@shared/models' |
8 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
9 | import { FormReactive } from '../../../shared' | ||
10 | 6 | ||
11 | @Component({ | 7 | @Component({ |
12 | selector: 'my-user-password', | 8 | selector: 'my-user-password', |
diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/users/user-edit/user-update.component.ts index 035c0d4bb..870880fee 100644 --- a/client/src/app/+admin/users/user-edit/user-update.component.ts +++ b/client/src/app/+admin/users/user-edit/user-update.component.ts | |||
@@ -1,18 +1,12 @@ | |||
1 | import { Subscription } from 'rxjs' | ||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 2 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { Subscription } from 'rxjs' | ||
4 | import { AuthService, Notifier } from '@app/core' | ||
5 | import { ServerService } from '../../../core' | ||
6 | import { UserEdit } from './user-edit' | ||
7 | import { User as UserType, UserUpdate, UserRole } from '../../../../../../shared' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
10 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
11 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 4 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
12 | import { UserService } from '@app/shared' | 5 | import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core' |
13 | import { UserAdminFlag } from '@shared/models/users/user-flag.model' | 6 | import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
14 | import { User } from '@app/shared/users/user.model' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
15 | import { ScreenService } from '@app/shared/misc/screen.service' | 8 | import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models' |
9 | import { UserEdit } from './user-edit' | ||
16 | 10 | ||
17 | @Component({ | 11 | @Component({ |
18 | selector: 'my-user-update', | 12 | selector: 'my-user-update', |
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 da50b7ed0..8f01c7d51 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,13 +1,10 @@ | |||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | ||
2 | import { AuthService, Notifier } from '@app/core' | ||
3 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
4 | import { ConfirmService, ServerService } from '../../../core' | 2 | import { Component, OnInit, ViewChild } from '@angular/core' |
5 | import { RestPagination, RestTable, UserService } from '../../../shared' | 3 | import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService, UserService } from '@app/core' |
4 | import { Actor, DropdownAction } from '@app/shared/shared-main' | ||
5 | import { UserBanModalComponent } from '@app/shared/shared-moderation' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { ServerConfig, User } from '../../../../../../shared' | 7 | import { ServerConfig, User } from '@shared/models' |
8 | import { UserBanModalComponent } from '@app/shared/moderation' | ||
9 | import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' | ||
10 | import { Actor } from '@app/shared/actor/actor.model' | ||
11 | 8 | ||
12 | @Component({ | 9 | @Component({ |
13 | selector: 'my-user-list', | 10 | selector: 'my-user-list', |
diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/users/users.routes.ts index 2d4f9305e..6560f0260 100644 --- a/client/src/app/+admin/users/users.routes.ts +++ b/client/src/app/+admin/users/users.routes.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | 2 | import { ServerConfigResolver, UserRightGuard } from '@app/core' | |
3 | import { UserRightGuard } from '../../core' | 3 | import { UserRight } from '@shared/models' |
4 | import { UserRight } from '../../../../../shared' | ||
5 | import { UsersComponent } from './users.component' | ||
6 | import { UserCreateComponent, UserUpdateComponent } from './user-edit' | 4 | import { UserCreateComponent, UserUpdateComponent } from './user-edit' |
7 | import { UserListComponent } from './user-list' | 5 | import { UserListComponent } from './user-list' |
8 | import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' | 6 | import { UsersComponent } from './users.component' |
9 | 7 | ||
10 | export const UsersRoutes: Routes = [ | 8 | export const UsersRoutes: Routes = [ |
11 | { | 9 | { |
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts index a68f79b47..039c389e4 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { Router } from '@angular/router' | 2 | import { Router } from '@angular/router' |
3 | import { AuthService, Notifier } from '@app/core' | 3 | import { AuthService, Notifier } from '@app/core' |
4 | import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' | 4 | import { FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms' |
5 | import { VideoChannelCreate } from '../../../../../shared/models/videos' | 5 | import { VideoChannelService } from '@app/shared/shared-main' |
6 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 7 | import { VideoChannelCreate } from '@shared/models' |
9 | import { VideoChannelValidatorsService } from '@app/shared/forms/form-validators/video-channel-validators.service' | 8 | import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' |
10 | 9 | ||
11 | @Component({ | 10 | @Component({ |
12 | selector: 'my-account-video-channel-create', | 11 | selector: 'my-account-video-channel-create', |
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.html index 048d143cd..048d143cd 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.html | |||
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.scss b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.scss index 8f8af655c..8f8af655c 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.scss +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.scss | |||
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.ts index 355cb4f55..710c51d8e 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { FormReactive } from '@app/shared' | 1 | import { FormReactive } from '@app/shared/shared-forms' |
2 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 2 | import { VideoChannel } from '@app/shared/shared-main' |
3 | 3 | ||
4 | export abstract class MyAccountVideoChannelEdit extends FormReactive { | 4 | export abstract class MyAccountVideoChannelEdit extends FormReactive { |
5 | // We need it even in the create component because it's used in the edit template | 5 | // We need it even in the create component because it's used in the edit template |
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts index 9c948b367..489c437ea 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts | |||
@@ -1,15 +1,12 @@ | |||
1 | import { Subscription } from 'rxjs' | ||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 2 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { AuthService, Notifier, ServerService } from '@app/core' | 4 | import { AuthService, Notifier, ServerService } from '@app/core' |
4 | import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' | 5 | import { FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms' |
5 | import { VideoChannelUpdate } from '../../../../../shared/models/videos' | 6 | import { VideoChannel, VideoChannelService } from '@app/shared/shared-main' |
6 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
7 | import { Subscription } from 'rxjs' | ||
8 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
10 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 8 | import { ServerConfig, VideoChannelUpdate } from '@shared/models' |
11 | import { VideoChannelValidatorsService } from '@app/shared/forms/form-validators/video-channel-validators.service' | 9 | import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' |
12 | import { ServerConfig } from '@shared/models' | ||
13 | 10 | ||
14 | @Component({ | 11 | @Component({ |
15 | selector: 'my-account-video-channel-update', | 12 | selector: 'my-account-video-channel-update', |
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels-routing.module.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels-routing.module.ts index 94037e18f..94037e18f 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels-routing.module.ts +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels-routing.module.ts | |||
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.html index b2e8210d3..b2e8210d3 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.html | |||
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.scss b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.scss index 76fb2cde0..76fb2cde0 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.scss +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.scss | |||
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.ts index 9caefe5b1..70510d7c9 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.ts | |||
@@ -1,15 +1,10 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { ChartData } from 'chart.js' |
2 | import { Notifier } from '@app/core' | 2 | import { max, maxBy, min, minBy } from 'lodash-es' |
3 | import { AuthService } from '../../core/auth' | ||
4 | import { ConfirmService } from '../../core/confirm' | ||
5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
6 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
7 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
8 | import { User } from '@app/shared' | ||
9 | import { flatMap } from 'rxjs/operators' | 3 | import { flatMap } from 'rxjs/operators' |
4 | import { Component, OnInit } from '@angular/core' | ||
5 | import { AuthService, ConfirmService, Notifier, ScreenService, User } from '@app/core' | ||
6 | import { VideoChannel, VideoChannelService } from '@app/shared/shared-main' | ||
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { min, minBy, max, maxBy } from 'lodash-es' | ||
12 | import { ChartData } from 'chart.js' | ||
13 | 8 | ||
14 | @Component({ | 9 | @Component({ |
15 | selector: 'my-account-video-channels', | 10 | selector: 'my-account-video-channels', |
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.module.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.module.ts index 87d6b762f..f8c6ad56b 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.module.ts +++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.module.ts | |||
@@ -1,16 +1,22 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | import { ChartModule } from 'primeng/chart' | 1 | import { ChartModule } from 'primeng/chart' |
3 | import { MyAccountVideoChannelsRoutingModule } from './my-account-video-channels-routing.module' | 2 | import { NgModule } from '@angular/core' |
4 | import { MyAccountVideoChannelsComponent } from './my-account-video-channels.component' | 3 | import { SharedFormModule } from '@app/shared/shared-forms' |
4 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | ||
5 | import { SharedMainModule } from '@app/shared/shared-main' | ||
5 | import { MyAccountVideoChannelCreateComponent } from './my-account-video-channel-create.component' | 6 | import { MyAccountVideoChannelCreateComponent } from './my-account-video-channel-create.component' |
6 | import { MyAccountVideoChannelUpdateComponent } from './my-account-video-channel-update.component' | 7 | import { MyAccountVideoChannelUpdateComponent } from './my-account-video-channel-update.component' |
7 | import { SharedModule } from '@app/shared' | 8 | import { MyAccountVideoChannelsRoutingModule } from './my-account-video-channels-routing.module' |
9 | import { MyAccountVideoChannelsComponent } from './my-account-video-channels.component' | ||
8 | 10 | ||
9 | @NgModule({ | 11 | @NgModule({ |
10 | imports: [ | 12 | imports: [ |
11 | MyAccountVideoChannelsRoutingModule, | 13 | MyAccountVideoChannelsRoutingModule, |
12 | SharedModule, | 14 | |
13 | ChartModule | 15 | ChartModule, |
16 | |||
17 | SharedMainModule, | ||
18 | SharedFormModule, | ||
19 | SharedGlobalIconModule | ||
14 | ], | 20 | ], |
15 | 21 | ||
16 | declarations: [ | 22 | declarations: [ |
diff --git a/client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts b/client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts index e48c39cdf..03ec75e25 100644 --- a/client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts +++ b/client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component } from '@angular/core' |
2 | import { GenericAccountBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' | 2 | import { BlocklistComponentType, GenericAccountBlocklistComponent } from '@app/shared/shared-moderation' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-account-blocklist', | 5 | selector: 'my-account-blocklist', |
6 | styleUrls: [ '../../shared/blocklist/account-blocklist.component.scss' ], | 6 | styleUrls: [ '../../shared/shared-moderation/account-blocklist.component.scss' ], |
7 | templateUrl: '../../shared/blocklist/account-blocklist.component.html' | 7 | templateUrl: '../../shared/shared-moderation/account-blocklist.component.html' |
8 | }) | 8 | }) |
9 | export class MyAccountBlocklistComponent extends GenericAccountBlocklistComponent { | 9 | export class MyAccountBlocklistComponent extends GenericAccountBlocklistComponent { |
10 | mode = BlocklistComponentType.Account | 10 | mode = BlocklistComponentType.Account |
diff --git a/client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts b/client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts index cfaba1c7b..9b983a197 100644 --- a/client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts +++ b/client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component } from '@angular/core' |
2 | import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' | 2 | import { BlocklistComponentType, GenericServerBlocklistComponent } from '@app/shared/shared-moderation' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-account-server-blocklist', | 5 | selector: 'my-account-server-blocklist', |
6 | styleUrls: [ '../../+admin/moderation/moderation.component.scss', '../../shared/blocklist/server-blocklist.component.scss' ], | 6 | styleUrls: [ '../../+admin/moderation/moderation.component.scss', '../../shared/shared-moderation/server-blocklist.component.scss' ], |
7 | templateUrl: '../../shared/blocklist/server-blocklist.component.html' | 7 | templateUrl: '../../shared/shared-moderation/server-blocklist.component.html' |
8 | }) | 8 | }) |
9 | export class MyAccountServerBlocklistComponent extends GenericServerBlocklistComponent { | 9 | export class MyAccountServerBlocklistComponent extends GenericServerBlocklistComponent { |
10 | mode = BlocklistComponentType.Account | 10 | mode = BlocklistComponentType.Account |
diff --git a/client/src/app/+my-account/my-account-history/my-account-history.component.ts b/client/src/app/+my-account/my-account-history/my-account-history.component.ts index 5f0ccee50..dc78b3d6e 100644 --- a/client/src/app/+my-account/my-account-history/my-account-history.component.ts +++ b/client/src/app/+my-account/my-account-history/my-account-history.component.ts | |||
@@ -1,17 +1,19 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 3 | import { |
4 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | 4 | AuthService, |
5 | import { AuthService } from '../../core/auth' | 5 | ComponentPagination, |
6 | import { ConfirmService } from '../../core/confirm' | 6 | ConfirmService, |
7 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 7 | LocalStorageService, |
8 | import { VideoService } from '../../shared/video/video.service' | 8 | Notifier, |
9 | ScreenService, | ||
10 | ServerService, | ||
11 | UserService | ||
12 | } from '@app/core' | ||
13 | import { immutableAssign } from '@app/helpers' | ||
14 | import { UserHistoryService } from '@app/shared/shared-main' | ||
15 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' | ||
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | 16 | import { I18n } from '@ngx-translate/i18n-polyfill' |
10 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
11 | import { UserHistoryService } from '@app/shared/users/user-history.service' | ||
12 | import { UserService } from '@app/shared' | ||
13 | import { Notifier, ServerService } from '@app/core' | ||
14 | import { LocalStorageService } from '@app/shared/misc/storage.service' | ||
15 | 17 | ||
16 | @Component({ | 18 | @Component({ |
17 | selector: 'my-account-history', | 19 | selector: 'my-account-history', |
@@ -38,7 +40,6 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn | |||
38 | protected screenService: ScreenService, | 40 | protected screenService: ScreenService, |
39 | protected storageService: LocalStorageService, | 41 | protected storageService: LocalStorageService, |
40 | private confirmService: ConfirmService, | 42 | private confirmService: ConfirmService, |
41 | private videoService: VideoService, | ||
42 | private userHistoryService: UserHistoryService | 43 | private userHistoryService: UserHistoryService |
43 | ) { | 44 | ) { |
44 | super() | 45 | super() |
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts index a50cb0fb9..0c1427d96 100644 --- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts +++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, ViewChild } from '@angular/core' | 1 | import { Component, ViewChild } from '@angular/core' |
2 | import { UserNotificationsComponent } from '@app/shared' | 2 | import { UserNotificationsComponent } from '@app/shared/shared-main' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | templateUrl: './my-account-notifications.component.html', | 5 | templateUrl: './my-account-notifications.component.html', |
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts index d5682914e..0e62b5ca5 100644 --- a/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts +++ b/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts | |||
@@ -1,14 +1,10 @@ | |||
1 | import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { AuthService, Notifier } from '@app/core' | 2 | import { AuthService, Notifier } from '@app/core' |
3 | import { FormReactive } from '@app/shared' | 3 | import { FormReactive, FormValidatorService, VideoAcceptOwnershipValidatorsService } from '@app/shared/shared-forms' |
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 4 | import { VideoChannelService, VideoOwnershipService } from '@app/shared/shared-main' |
5 | import { VideoOwnershipService } from '@app/shared/video-ownership' | ||
6 | import { VideoChangeOwnership } from '../../../../../../shared/models/videos' | ||
7 | import { VideoAcceptOwnershipValidatorsService } from '@app/shared/forms/form-validators' | ||
8 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
9 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
11 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { VideoChangeOwnership, VideoChannel } from '@shared/models' | ||
12 | 8 | ||
13 | @Component({ | 9 | @Component({ |
14 | selector: 'my-account-accept-ownership', | 10 | selector: 'my-account-accept-ownership', |
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts index f0a6303d1..5167732c2 100644 --- a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts +++ b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts | |||
@@ -1,10 +1,8 @@ | |||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | ||
2 | import { Notifier } from '@app/core' | ||
3 | import { RestPagination, RestTable } from '@app/shared' | ||
4 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
5 | import { VideoChangeOwnership } from '../../../../../shared' | 2 | import { Component, OnInit, ViewChild } from '@angular/core' |
6 | import { VideoOwnershipService } from '@app/shared/video-ownership' | 3 | import { Notifier, RestPagination, RestTable } from '@app/core' |
7 | import { Account } from '@app/shared/account/account.model' | 4 | import { Account, VideoOwnershipService } from '@app/shared/shared-main' |
5 | import { VideoChangeOwnership } from '@shared/models' | ||
8 | import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component' | 6 | import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component' |
9 | 7 | ||
10 | @Component({ | 8 | @Component({ |
diff --git a/client/src/app/+my-account/my-account-routing.module.ts b/client/src/app/+my-account/my-account-routing.module.ts index f6b711e09..ac9cf4cfd 100644 --- a/client/src/app/+my-account/my-account-routing.module.ts +++ b/client/src/app/+my-account/my-account-routing.module.ts | |||
@@ -2,26 +2,20 @@ import { NgModule } from '@angular/core' | |||
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | import { MetaGuard } from '@ngx-meta/core' | 3 | import { MetaGuard } from '@ngx-meta/core' |
4 | import { LoginGuard } from '../core' | 4 | import { LoginGuard } from '../core' |
5 | import { MyAccountComponent } from './my-account.component' | 5 | import { MyAccountBlocklistComponent } from './my-account-blocklist/my-account-blocklist.component' |
6 | import { MyAccountServerBlocklistComponent } from './my-account-blocklist/my-account-server-blocklist.component' | ||
7 | import { MyAccountHistoryComponent } from './my-account-history/my-account-history.component' | ||
8 | import { MyAccountNotificationsComponent } from './my-account-notifications/my-account-notifications.component' | ||
9 | import { MyAccountOwnershipComponent } from './my-account-ownership/my-account-ownership.component' | ||
6 | import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' | 10 | import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' |
11 | import { MyAccountSubscriptionsComponent } from './my-account-subscriptions/my-account-subscriptions.component' | ||
12 | import { MyAccountVideoImportsComponent } from './my-account-video-imports/my-account-video-imports.component' | ||
13 | import { MyAccountVideoPlaylistCreateComponent } from './my-account-video-playlists/my-account-video-playlist-create.component' | ||
14 | import { MyAccountVideoPlaylistElementsComponent } from './my-account-video-playlists/my-account-video-playlist-elements.component' | ||
15 | import { MyAccountVideoPlaylistUpdateComponent } from './my-account-video-playlists/my-account-video-playlist-update.component' | ||
16 | import { MyAccountVideoPlaylistsComponent } from './my-account-video-playlists/my-account-video-playlists.component' | ||
7 | import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' | 17 | import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' |
8 | import { MyAccountVideoImportsComponent } from '@app/+my-account/my-account-video-imports/my-account-video-imports.component' | 18 | import { MyAccountComponent } from './my-account.component' |
9 | import { MyAccountSubscriptionsComponent } from '@app/+my-account/my-account-subscriptions/my-account-subscriptions.component' | ||
10 | import { MyAccountOwnershipComponent } from '@app/+my-account/my-account-ownership/my-account-ownership.component' | ||
11 | import { MyAccountBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-blocklist.component' | ||
12 | import { MyAccountServerBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-server-blocklist.component' | ||
13 | import { MyAccountHistoryComponent } from '@app/+my-account/my-account-history/my-account-history.component' | ||
14 | import { MyAccountNotificationsComponent } from '@app/+my-account/my-account-notifications/my-account-notifications.component' | ||
15 | import { MyAccountVideoPlaylistsComponent } from '@app/+my-account/my-account-video-playlists/my-account-video-playlists.component' | ||
16 | import { | ||
17 | MyAccountVideoPlaylistCreateComponent | ||
18 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component' | ||
19 | import { | ||
20 | MyAccountVideoPlaylistUpdateComponent | ||
21 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component' | ||
22 | import { | ||
23 | MyAccountVideoPlaylistElementsComponent | ||
24 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component' | ||
25 | 19 | ||
26 | const myAccountRoutes: Routes = [ | 20 | const myAccountRoutes: Routes = [ |
27 | { | 21 | { |
@@ -46,7 +40,10 @@ const myAccountRoutes: Routes = [ | |||
46 | 40 | ||
47 | { | 41 | { |
48 | path: 'video-channels', | 42 | path: 'video-channels', |
49 | loadChildren: () => import('./my-account-video-channels/my-account-video-channels.module').then(m => m.MyAccountVideoChannelsModule) | 43 | loadChildren: () => { |
44 | return import('./+my-account-video-channels/my-account-video-channels.module') | ||
45 | .then(m => m.MyAccountVideoChannelsModule) | ||
46 | } | ||
50 | }, | 47 | }, |
51 | 48 | ||
52 | { | 49 | { |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts index 9d406805f..5444b97ae 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | import { forkJoin } from 'rxjs' | ||
2 | import { tap } from 'rxjs/operators' | ||
1 | import { Component, OnInit } from '@angular/core' | 3 | import { Component, OnInit } from '@angular/core' |
2 | import { AuthService, Notifier, ServerService } from '@app/core' | 4 | import { AuthService, ServerService, UserService } from '@app/core' |
3 | import { FormReactive, UserService } from '../../../shared' | 5 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 7 | import { User } from '@shared/models' |
6 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
7 | import { User } from '../../../../../../shared' | ||
8 | import { tap } from 'rxjs/operators' | ||
9 | import { forkJoin } from 'rxjs' | ||
10 | 8 | ||
11 | @Component({ | 9 | @Component({ |
12 | selector: 'my-account-change-email', | 10 | selector: 'my-account-change-email', |
@@ -21,7 +19,6 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni | |||
21 | constructor ( | 19 | constructor ( |
22 | protected formValidatorService: FormValidatorService, | 20 | protected formValidatorService: FormValidatorService, |
23 | private userValidatorsService: UserValidatorsService, | 21 | private userValidatorsService: UserValidatorsService, |
24 | private notifier: Notifier, | ||
25 | private authService: AuthService, | 22 | private authService: AuthService, |
26 | private userService: UserService, | 23 | private userService: UserService, |
27 | private serverService: ServerService, | 24 | private serverService: ServerService, |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts index cbb068c7c..6a16f8a2c 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | import { filter } from 'rxjs/operators' | ||
1 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
2 | import { AuthService, Notifier } from '@app/core' | 3 | import { AuthService, Notifier, UserService } from '@app/core' |
3 | import { FormReactive, UserService } from '../../../shared' | 4 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 6 | import { User } from '@shared/models' |
6 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
7 | import { filter } from 'rxjs/operators' | ||
8 | import { User } from '../../../../../../shared' | ||
9 | 7 | ||
10 | @Component({ | 8 | @Component({ |
11 | selector: 'my-account-change-password', | 9 | selector: 'my-account-change-password', |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts index 25d862867..ae6ac5387 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts | |||
@@ -1,9 +1,6 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { AuthService, ConfirmService, Notifier, RedirectService, User, UserService } from '@app/core' |
3 | import { AuthService, ConfirmService, RedirectService } from '../../../core' | ||
4 | import { UserService } from '../../../shared' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { User } from '@app/shared' | ||
7 | 4 | ||
8 | @Component({ | 5 | @Component({ |
9 | selector: 'my-account-danger-zone', | 6 | selector: 'my-account-danger-zone', |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/index.ts b/client/src/app/+my-account/my-account-settings/my-account-interface/index.ts deleted file mode 100644 index 62fce79a8..000000000 --- a/client/src/app/+my-account/my-account-settings/my-account-interface/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './my-account-interface-settings.component' | ||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts index af17a0352..cfa514b26 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import { debounce } from 'lodash-es' | ||
2 | import { Subject } from 'rxjs' | ||
1 | import { Component, Input, OnInit } from '@angular/core' | 3 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { User } from '@app/shared' | 4 | import { Notifier, ServerService, User } from '@app/core' |
5 | import { UserNotificationService } from '@app/shared/shared-main' | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { Subject } from 'rxjs' | 7 | import { UserNotificationSetting, UserNotificationSettingValue, UserRight } from '@shared/models' |
5 | import { UserNotificationSetting, UserNotificationSettingValue, UserRight } from '../../../../../../shared' | ||
6 | import { Notifier, ServerService } from '@app/core' | ||
7 | import { debounce } from 'lodash-es' | ||
8 | import { UserNotificationService } from '@app/shared/users/user-notification.service' | ||
9 | 8 | ||
10 | @Component({ | 9 | @Component({ |
11 | selector: 'my-account-notification-preferences', | 10 | selector: 'my-account-notification-preferences', |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts index fcad5a6c2..b0d8494e7 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts | |||
@@ -1,11 +1,8 @@ | |||
1 | import { Subject } from 'rxjs' | ||
1 | import { Component, Input, OnInit } from '@angular/core' | 2 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 3 | import { Notifier, User, UserService } from '@app/core' |
3 | import { FormReactive, UserService } from '../../../shared' | 4 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
4 | import { User } from '@app/shared' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
7 | import { Subject } from 'rxjs' | ||
8 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
9 | 6 | ||
10 | @Component({ | 7 | @Component({ |
11 | selector: 'my-account-profile', | 8 | selector: 'my-account-profile', |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html index 040b2130f..2826d8d83 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html | |||
@@ -34,7 +34,7 @@ | |||
34 | </div> | 34 | </div> |
35 | 35 | ||
36 | <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> | 36 | <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> |
37 | <my-account-video-settings [user]="user" [userInformationLoaded]="userInformationLoaded"></my-account-video-settings> | 37 | <my-user-video-settings [user]="user" [userInformationLoaded]="userInformationLoaded"></my-user-video-settings> |
38 | </div> | 38 | </div> |
39 | </div> | 39 | </div> |
40 | 40 | ||
@@ -55,7 +55,7 @@ | |||
55 | </div> | 55 | </div> |
56 | 56 | ||
57 | <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> | 57 | <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> |
58 | <my-account-interface-settings [user]="user" [userInformationLoaded]="userInformationLoaded"></my-account-interface-settings> | 58 | <my-user-interface-settings [user]="user" [userInformationLoaded]="userInformationLoaded"></my-user-interface-settings> |
59 | </div> | 59 | </div> |
60 | </div> | 60 | </div> |
61 | 61 | ||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts index f73f3aa1e..4800be24b 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts | |||
@@ -1,11 +1,8 @@ | |||
1 | import { Component, OnInit, AfterViewChecked } from '@angular/core' | ||
2 | import { Notifier } from '@app/core' | ||
3 | import { BytesPipe } from 'ngx-pipes' | 1 | import { BytesPipe } from 'ngx-pipes' |
4 | import { AuthService } from '../../core' | ||
5 | import { User } from '../../shared' | ||
6 | import { UserService } from '../../shared/users' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { ViewportScroller } from '@angular/common' | 2 | import { ViewportScroller } from '@angular/common' |
3 | import { AfterViewChecked, Component, OnInit } from '@angular/core' | ||
4 | import { AuthService, Notifier, User, UserService } from '@app/core' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | 6 | ||
10 | @Component({ | 7 | @Component({ |
11 | selector: 'my-account-settings', | 8 | selector: 'my-account-settings', |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/index.ts b/client/src/app/+my-account/my-account-settings/my-account-video-settings/index.ts deleted file mode 100644 index 1253bd369..000000000 --- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './my-account-video-settings.component' | ||
diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts index b347fc3fe..390293a28 100644 --- a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts +++ b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | ||
2 | import { Notifier } from '@app/core' | ||
3 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
4 | import { UserSubscriptionService } from '@app/shared/user-subscription' | ||
5 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | ||
6 | import { Subject } from 'rxjs' | 1 | import { Subject } from 'rxjs' |
2 | import { Component, OnInit } from '@angular/core' | ||
3 | import { ComponentPagination, Notifier } from '@app/core' | ||
4 | import { VideoChannel } from '@app/shared/shared-main' | ||
5 | import { UserSubscriptionService } from '@app/shared/shared-user-subscription' | ||
7 | 6 | ||
8 | @Component({ | 7 | @Component({ |
9 | selector: 'my-account-subscriptions', | 8 | selector: 'my-account-subscriptions', |
diff --git a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts index 4452154eb..42ddb0ee2 100644 --- a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts +++ b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | ||
2 | import { RestPagination, RestTable } from '@app/shared' | ||
3 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
4 | import { Notifier } from '@app/core' | 2 | import { Component, OnInit } from '@angular/core' |
5 | import { VideoImport, VideoImportState } from '../../../../../shared/models/videos' | 3 | import { Notifier, RestPagination, RestTable } from '@app/core' |
6 | import { VideoImportService } from '@app/shared/video-import' | 4 | import { VideoImportService } from '@app/shared/shared-main' |
5 | import { VideoImport, VideoImportState } from '@shared/models' | ||
7 | 6 | ||
8 | @Component({ | 7 | @Component({ |
9 | selector: 'my-account-video-imports', | 8 | selector: 'my-account-video-imports', |
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts index e47e5f980..e72ae2366 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts | |||
@@ -1,14 +1,13 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { Router } from '@angular/router' | 2 | import { Router } from '@angular/router' |
3 | import { AuthService, Notifier, ServerService } from '@app/core' | 3 | import { AuthService, Notifier, ServerService } from '@app/core' |
4 | import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' | 4 | import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' |
5 | import { VideoPlaylistService } from '@app/shared/shared-video-playlist' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
7 | import { VideoPlaylistValidatorsService } from '@app/shared' | ||
8 | import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' | 7 | import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' |
9 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
10 | import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' | 8 | import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' |
11 | import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils' | 9 | import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' |
10 | import { populateAsyncUserVideoChannels } from '@app/helpers' | ||
12 | 11 | ||
13 | @Component({ | 12 | @Component({ |
14 | selector: 'my-account-video-playlist-create', | 13 | selector: 'my-account-video-playlist-create', |
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts index e94188786..7ae8de75e 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { FormReactive } from '@app/shared' | 1 | import { FormReactive } from '@app/shared/shared-forms' |
2 | import { VideoPlaylist } from '@shared/models/videos/playlist/video-playlist.model' | ||
3 | import { VideoConstant, VideoPlaylistPrivacy } from '@shared/models' | 2 | import { VideoConstant, VideoPlaylistPrivacy } from '@shared/models' |
3 | import { VideoPlaylist } from '@shared/models/videos/playlist/video-playlist.model' | ||
4 | 4 | ||
5 | export abstract class MyAccountVideoPlaylistEdit extends FormReactive { | 5 | export abstract class MyAccountVideoPlaylistEdit extends FormReactive { |
6 | // Declare it here to avoid errors in create template | 6 | // Declare it here to avoid errors in create template |
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts index 366640618..0add81c38 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts | |||
@@ -1,16 +1,9 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | ||
2 | import { Notifier, ServerService } from '@app/core' | ||
3 | import { AuthService } from '../../core/auth' | ||
4 | import { ConfirmService } from '../../core/confirm' | ||
5 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | ||
6 | import { Subject, Subscription } from 'rxjs' | 1 | import { Subject, Subscription } from 'rxjs' |
7 | import { ActivatedRoute } from '@angular/router' | ||
8 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
9 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | ||
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
11 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
12 | import { CdkDragDrop } from '@angular/cdk/drag-drop' | 2 | import { CdkDragDrop } from '@angular/cdk/drag-drop' |
13 | import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model' | 3 | import { Component, OnDestroy, OnInit } from '@angular/core' |
4 | import { ActivatedRoute } from '@angular/router' | ||
5 | import { ComponentPagination, Notifier, ScreenService } from '@app/core' | ||
6 | import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist' | ||
14 | 7 | ||
15 | @Component({ | 8 | @Component({ |
16 | selector: 'my-account-video-playlist-elements', | 9 | selector: 'my-account-video-playlist-elements', |
@@ -33,12 +26,8 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro | |||
33 | private paramsSub: Subscription | 26 | private paramsSub: Subscription |
34 | 27 | ||
35 | constructor ( | 28 | constructor ( |
36 | private authService: AuthService, | ||
37 | private serverService: ServerService, | ||
38 | private notifier: Notifier, | 29 | private notifier: Notifier, |
39 | private confirmService: ConfirmService, | ||
40 | private route: ActivatedRoute, | 30 | private route: ActivatedRoute, |
41 | private i18n: I18n, | ||
42 | private screenService: ScreenService, | 31 | private screenService: ScreenService, |
43 | private videoPlaylistService: VideoPlaylistService | 32 | private videoPlaylistService: VideoPlaylistService |
44 | ) {} | 33 | ) {} |
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts index 2f85cdd96..6787fb757 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts | |||
@@ -1,16 +1,14 @@ | |||
1 | import { forkJoin, Subscription } from 'rxjs' | ||
2 | import { map, switchMap } from 'rxjs/operators' | ||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 3 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { AuthService, Notifier, ServerService } from '@app/core' | 5 | import { AuthService, Notifier, ServerService } from '@app/core' |
4 | import { forkJoin, Subscription } from 'rxjs' | 6 | import { populateAsyncUserVideoChannels } from '@app/helpers' |
7 | import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' | ||
8 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 10 | import { VideoPlaylistUpdate } from '@shared/models' |
7 | import { MyAccountVideoPlaylistEdit } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-edit' | 11 | import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' |
8 | import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils' | ||
9 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
10 | import { VideoPlaylistValidatorsService } from '@app/shared' | ||
11 | import { VideoPlaylistUpdate } from '@shared/models/videos/playlist/video-playlist-update.model' | ||
12 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | ||
13 | import { delayWhen, map, switchMap } from 'rxjs/operators' | ||
14 | 12 | ||
15 | @Component({ | 13 | @Component({ |
16 | selector: 'my-account-video-playlist-update', | 14 | selector: 'my-account-video-playlist-update', |
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts index c6728cc30..ea3bcde4f 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts | |||
@@ -1,15 +1,10 @@ | |||
1 | import { Subject } from 'rxjs' | ||
2 | import { debounceTime, flatMap } from 'rxjs/operators' | ||
1 | import { Component, OnInit } from '@angular/core' | 3 | import { Component, OnInit } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 4 | import { AuthService, ComponentPagination, ConfirmService, Notifier, User } from '@app/core' |
3 | import { AuthService } from '../../core/auth' | 5 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
4 | import { ConfirmService } from '../../core/confirm' | ||
5 | import { User } from '@app/shared' | ||
6 | import { flatMap, debounceTime } from 'rxjs/operators' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | ||
9 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | ||
10 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
11 | import { VideoPlaylistType } from '@shared/models' | 7 | import { VideoPlaylistType } from '@shared/models' |
12 | import { Subject } from 'rxjs' | ||
13 | 8 | ||
14 | @Component({ | 9 | @Component({ |
15 | selector: 'my-account-video-playlists', | 10 | selector: 'my-account-video-playlists', |
diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts index 0ec033eaf..3cfe8fb38 100644 --- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts +++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts | |||
@@ -1,21 +1,15 @@ | |||
1 | import { concat, Observable, Subject } from 'rxjs' | 1 | import { concat, Observable, Subject } from 'rxjs' |
2 | import { tap, toArray, debounceTime } from 'rxjs/operators' | 2 | import { debounceTime, tap, toArray } from 'rxjs/operators' |
3 | import { Component, ViewChild, OnInit } from '@angular/core' | 3 | import { Component, OnInit, ViewChild } from '@angular/core' |
4 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
5 | import { immutableAssign } from '@app/shared/misc/utils' | 5 | import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenService, ServerService } from '@app/core' |
6 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | 6 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' |
7 | import { Notifier, ServerService } from '@app/core' | 7 | import { immutableAssign } from '@app/helpers' |
8 | import { AuthService } from '../../core/auth' | 8 | import { Video, VideoService } from '@app/shared/shared-main' |
9 | import { ConfirmService } from '../../core/confirm' | 9 | import { MiniatureDisplayOptions, OwnerDisplayType, SelectionType, VideosSelectionComponent } from '@app/shared/shared-video-miniature' |
10 | import { Video } from '../../shared/video/video.model' | ||
11 | import { VideoService } from '../../shared/video/video.service' | ||
12 | import { I18n } from '@ngx-translate/i18n-polyfill' | 10 | import { I18n } from '@ngx-translate/i18n-polyfill' |
13 | import { ScreenService } from '@app/shared/misc/screen.service' | 11 | import { VideoSortField } from '@shared/models' |
14 | import { VideoChangeOwnershipComponent } from './video-change-ownership/video-change-ownership.component' | 12 | import { VideoChangeOwnershipComponent } from './video-change-ownership/video-change-ownership.component' |
15 | import { MiniatureDisplayOptions, OwnerDisplayType } from '@app/shared/video/video-miniature.component' | ||
16 | import { SelectionType, VideosSelectionComponent } from '@app/shared/video/videos-selection.component' | ||
17 | import { VideoSortField } from '@app/shared/video/sort-field.type' | ||
18 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' | ||
19 | 13 | ||
20 | @Component({ | 14 | @Component({ |
21 | selector: 'my-account-videos', | 15 | selector: 'my-account-videos', |
diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts index f4e2b5955..18e716a09 100644 --- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts +++ b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier, UserService } from '@app/core' |
3 | import { FormReactive, FormValidatorService, VideoChangeOwnershipValidatorsService } from '@app/shared/shared-forms' | ||
4 | import { Video, VideoOwnershipService } from '@app/shared/shared-main' | ||
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { FormReactive, UserService } from '../../../shared/index' | ||
5 | import { Video } from '@app/shared/video/video.model' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { FormValidatorService, VideoChangeOwnershipValidatorsService } from '@app/shared' | ||
8 | import { VideoOwnershipService } from '@app/shared/video-ownership' | ||
9 | 7 | ||
10 | @Component({ | 8 | @Component({ |
11 | selector: 'my-video-change-ownership', | 9 | selector: 'my-video-change-ownership', |
diff --git a/client/src/app/+my-account/my-account.component.ts b/client/src/app/+my-account/my-account.component.ts index ca447c054..ea4da676a 100644 --- a/client/src/app/+my-account/my-account.component.ts +++ b/client/src/app/+my-account/my-account.component.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { ServerService } from '@app/core' | 2 | import { ServerService } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { TopMenuDropdownParam } from '@app/shared/menu/top-menu-dropdown.component' | ||
5 | import { ServerConfig } from '@shared/models' | 4 | import { ServerConfig } from '@shared/models' |
5 | import { TopMenuDropdownParam } from './top-menu-dropdown.component' | ||
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-my-account', | 8 | selector: 'my-my-account', |
diff --git a/client/src/app/+my-account/my-account.module.ts b/client/src/app/+my-account/my-account.module.ts index 72b9fd9f2..9a11a89ea 100644 --- a/client/src/app/+my-account/my-account.module.ts +++ b/client/src/app/+my-account/my-account.module.ts | |||
@@ -1,47 +1,55 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | import { TableModule } from 'primeng/table' | ||
3 | import { AutoCompleteModule } from 'primeng/autocomplete' | 1 | import { AutoCompleteModule } from 'primeng/autocomplete' |
4 | import { InputSwitchModule } from 'primeng/inputswitch' | 2 | import { InputSwitchModule } from 'primeng/inputswitch' |
5 | import { SharedModule } from '../shared' | 3 | import { TableModule } from 'primeng/table' |
4 | import { DragDropModule } from '@angular/cdk/drag-drop' | ||
5 | import { NgModule } from '@angular/core' | ||
6 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | ||
7 | import { SharedMainModule } from '@app/shared/shared-main' | ||
8 | import { SharedModerationModule } from '@app/shared/shared-moderation' | ||
9 | import { SharedUserInterfaceSettingsModule } from '@app/shared/shared-user-settings' | ||
10 | import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription/shared-user-subscription.module' | ||
11 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' | ||
12 | import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist/shared-video-playlist.module' | ||
13 | import { MyAccountBlocklistComponent } from './my-account-blocklist/my-account-blocklist.component' | ||
14 | import { MyAccountServerBlocklistComponent } from './my-account-blocklist/my-account-server-blocklist.component' | ||
15 | import { MyAccountHistoryComponent } from './my-account-history/my-account-history.component' | ||
16 | import { MyAccountNotificationsComponent } from './my-account-notifications/my-account-notifications.component' | ||
17 | import { MyAccountAcceptOwnershipComponent } from './my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component' | ||
18 | import { MyAccountOwnershipComponent } from './my-account-ownership/my-account-ownership.component' | ||
6 | import { MyAccountRoutingModule } from './my-account-routing.module' | 19 | import { MyAccountRoutingModule } from './my-account-routing.module' |
20 | import { MyAccountChangeEmailComponent } from './my-account-settings/my-account-change-email' | ||
7 | import { MyAccountChangePasswordComponent } from './my-account-settings/my-account-change-password/my-account-change-password.component' | 21 | import { MyAccountChangePasswordComponent } from './my-account-settings/my-account-change-password/my-account-change-password.component' |
22 | import { MyAccountDangerZoneComponent } from './my-account-settings/my-account-danger-zone' | ||
23 | import { MyAccountNotificationPreferencesComponent } from './my-account-settings/my-account-notification-preferences' | ||
24 | import { MyAccountProfileComponent } from './my-account-settings/my-account-profile/my-account-profile.component' | ||
8 | import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' | 25 | import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' |
9 | import { MyAccountComponent } from './my-account.component' | 26 | import { MyAccountSubscriptionsComponent } from './my-account-subscriptions/my-account-subscriptions.component' |
27 | import { MyAccountVideoImportsComponent } from './my-account-video-imports/my-account-video-imports.component' | ||
28 | import { MyAccountVideoPlaylistCreateComponent } from './my-account-video-playlists/my-account-video-playlist-create.component' | ||
29 | import { MyAccountVideoPlaylistElementsComponent } from './my-account-video-playlists/my-account-video-playlist-elements.component' | ||
30 | import { MyAccountVideoPlaylistUpdateComponent } from './my-account-video-playlists/my-account-video-playlist-update.component' | ||
31 | import { MyAccountVideoPlaylistsComponent } from './my-account-video-playlists/my-account-video-playlists.component' | ||
10 | import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' | 32 | import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' |
11 | import { VideoChangeOwnershipComponent } from './my-account-videos/video-change-ownership/video-change-ownership.component' | 33 | import { VideoChangeOwnershipComponent } from './my-account-videos/video-change-ownership/video-change-ownership.component' |
12 | import { MyAccountOwnershipComponent } from './my-account-ownership/my-account-ownership.component' | 34 | import { MyAccountComponent } from './my-account.component' |
13 | import { MyAccountAcceptOwnershipComponent } from './my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component' | 35 | import { TopMenuDropdownComponent } from './top-menu-dropdown.component' |
14 | import { MyAccountProfileComponent } from '@app/+my-account/my-account-settings/my-account-profile/my-account-profile.component' | ||
15 | import { MyAccountVideoImportsComponent } from '@app/+my-account/my-account-video-imports/my-account-video-imports.component' | ||
16 | import { MyAccountDangerZoneComponent } from '@app/+my-account/my-account-settings/my-account-danger-zone' | ||
17 | import { MyAccountSubscriptionsComponent } from '@app/+my-account/my-account-subscriptions/my-account-subscriptions.component' | ||
18 | import { MyAccountBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-blocklist.component' | ||
19 | import { MyAccountServerBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-server-blocklist.component' | ||
20 | import { MyAccountHistoryComponent } from '@app/+my-account/my-account-history/my-account-history.component' | ||
21 | import { MyAccountNotificationsComponent } from '@app/+my-account/my-account-notifications/my-account-notifications.component' | ||
22 | import { MyAccountNotificationPreferencesComponent } from '@app/+my-account/my-account-settings/my-account-notification-preferences' | ||
23 | import { | ||
24 | MyAccountVideoPlaylistCreateComponent | ||
25 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component' | ||
26 | import { | ||
27 | MyAccountVideoPlaylistUpdateComponent | ||
28 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component' | ||
29 | import { MyAccountVideoPlaylistsComponent } from '@app/+my-account/my-account-video-playlists/my-account-video-playlists.component' | ||
30 | import { | ||
31 | MyAccountVideoPlaylistElementsComponent | ||
32 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component' | ||
33 | import { DragDropModule } from '@angular/cdk/drag-drop' | ||
34 | import { MyAccountChangeEmailComponent } from '@app/+my-account/my-account-settings/my-account-change-email' | ||
35 | 36 | ||
36 | @NgModule({ | 37 | @NgModule({ |
37 | imports: [ | 38 | imports: [ |
38 | TableModule, | ||
39 | MyAccountRoutingModule, | 39 | MyAccountRoutingModule, |
40 | |||
40 | AutoCompleteModule, | 41 | AutoCompleteModule, |
41 | SharedModule, | ||
42 | TableModule, | 42 | TableModule, |
43 | InputSwitchModule, | 43 | InputSwitchModule, |
44 | DragDropModule | 44 | DragDropModule, |
45 | |||
46 | SharedMainModule, | ||
47 | SharedModerationModule, | ||
48 | SharedVideoMiniatureModule, | ||
49 | SharedUserSubscriptionModule, | ||
50 | SharedVideoPlaylistModule, | ||
51 | SharedUserInterfaceSettingsModule, | ||
52 | SharedGlobalIconModule | ||
45 | ], | 53 | ], |
46 | 54 | ||
47 | declarations: [ | 55 | declarations: [ |
@@ -68,7 +76,9 @@ import { MyAccountChangeEmailComponent } from '@app/+my-account/my-account-setti | |||
68 | MyAccountVideoPlaylistCreateComponent, | 76 | MyAccountVideoPlaylistCreateComponent, |
69 | MyAccountVideoPlaylistUpdateComponent, | 77 | MyAccountVideoPlaylistUpdateComponent, |
70 | MyAccountVideoPlaylistsComponent, | 78 | MyAccountVideoPlaylistsComponent, |
71 | MyAccountVideoPlaylistElementsComponent | 79 | MyAccountVideoPlaylistElementsComponent, |
80 | |||
81 | TopMenuDropdownComponent | ||
72 | ], | 82 | ], |
73 | 83 | ||
74 | exports: [ | 84 | exports: [ |
diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.html b/client/src/app/+my-account/top-menu-dropdown.component.html index aeaceb662..aeaceb662 100644 --- a/client/src/app/shared/menu/top-menu-dropdown.component.html +++ b/client/src/app/+my-account/top-menu-dropdown.component.html | |||
diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.scss b/client/src/app/+my-account/top-menu-dropdown.component.scss index 84dd7dce3..84dd7dce3 100644 --- a/client/src/app/shared/menu/top-menu-dropdown.component.scss +++ b/client/src/app/+my-account/top-menu-dropdown.component.scss | |||
diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.ts b/client/src/app/+my-account/top-menu-dropdown.component.ts index 3f121e785..5909db0b5 100644 --- a/client/src/app/shared/menu/top-menu-dropdown.component.ts +++ b/client/src/app/+my-account/top-menu-dropdown.component.ts | |||
@@ -1,17 +1,10 @@ | |||
1 | import { | 1 | import { Subscription } from 'rxjs' |
2 | Component, | ||
3 | Input, | ||
4 | OnDestroy, | ||
5 | OnInit, | ||
6 | ViewChild | ||
7 | } from '@angular/core' | ||
8 | import { filter, take } from 'rxjs/operators' | 2 | import { filter, take } from 'rxjs/operators' |
3 | import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core' | ||
9 | import { NavigationEnd, Router } from '@angular/router' | 4 | import { NavigationEnd, Router } from '@angular/router' |
10 | import { Subscription } from 'rxjs' | 5 | import { MenuService, ScreenService } from '@app/core' |
6 | import { GlobalIconName } from '@app/shared/shared-icons' | ||
11 | import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' | 7 | import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' |
12 | import { GlobalIconName } from '@app/shared/images/global-icon.component' | ||
13 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
14 | import { MenuService } from '@app/core/menu' | ||
15 | 8 | ||
16 | export type TopMenuDropdownParam = { | 9 | export type TopMenuDropdownParam = { |
17 | label: string | 10 | label: string |
diff --git a/client/src/app/+page-not-found/page-not-found.module.ts b/client/src/app/+page-not-found/page-not-found.module.ts index ffc1f777d..2e09ab299 100644 --- a/client/src/app/+page-not-found/page-not-found.module.ts +++ b/client/src/app/+page-not-found/page-not-found.module.ts | |||
@@ -1,12 +1,13 @@ | |||
1 | import { CommonModule } from '@angular/common' | ||
1 | import { NgModule } from '@angular/core' | 2 | import { NgModule } from '@angular/core' |
2 | import { SharedModule } from '../shared' | 3 | import { PageNotFoundRoutingModule } from './page-not-found-routing.module' |
3 | import { PageNotFoundComponent } from '@app/+page-not-found/page-not-found.component' | 4 | import { PageNotFoundComponent } from './page-not-found.component' |
4 | import { PageNotFoundRoutingModule } from '@app/+page-not-found/page-not-found-routing.module' | ||
5 | 5 | ||
6 | @NgModule({ | 6 | @NgModule({ |
7 | imports: [ | 7 | imports: [ |
8 | PageNotFoundRoutingModule, | 8 | CommonModule, |
9 | SharedModule | 9 | |
10 | PageNotFoundRoutingModule | ||
10 | ], | 11 | ], |
11 | 12 | ||
12 | declarations: [ | 13 | declarations: [ |
diff --git a/client/src/app/+signup/+register/register-routing.module.ts b/client/src/app/+signup/+register/register-routing.module.ts index f47e80755..0deed8a9b 100644 --- a/client/src/app/+signup/+register/register-routing.module.ts +++ b/client/src/app/+signup/+register/register-routing.module.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | import { ServerConfigResolver, UnloggedGuard } from '@app/core' | ||
3 | import { MetaGuard } from '@ngx-meta/core' | 4 | import { MetaGuard } from '@ngx-meta/core' |
4 | import { RegisterComponent } from './register.component' | 5 | import { RegisterComponent } from './register.component' |
5 | import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' | ||
6 | import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service' | ||
7 | 6 | ||
8 | const registerRoutes: Routes = [ | 7 | const registerRoutes: Routes = [ |
9 | { | 8 | { |
diff --git a/client/src/app/+signup/+register/register-step-channel.component.ts b/client/src/app/+signup/+register/register-step-channel.component.ts index e434b91a7..8a0120840 100644 --- a/client/src/app/+signup/+register/register-step-channel.component.ts +++ b/client/src/app/+signup/+register/register-step-channel.component.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import { concat, of } from 'rxjs' | ||
2 | import { pairwise } from 'rxjs/operators' | ||
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { AuthService } from '@app/core' | ||
3 | import { FormReactive, UserService, VideoChannelValidatorsService } from '@app/shared' | ||
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
5 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
6 | import { pairwise } from 'rxjs/operators' | 5 | import { UserService } from '@app/core' |
7 | import { concat, of } from 'rxjs' | 6 | import { FormReactive, FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms' |
8 | 7 | ||
9 | @Component({ | 8 | @Component({ |
10 | selector: 'my-register-step-channel', | 9 | selector: 'my-register-step-channel', |
@@ -17,7 +16,6 @@ export class RegisterStepChannelComponent extends FormReactive implements OnInit | |||
17 | 16 | ||
18 | constructor ( | 17 | constructor ( |
19 | protected formValidatorService: FormValidatorService, | 18 | protected formValidatorService: FormValidatorService, |
20 | private authService: AuthService, | ||
21 | private userService: UserService, | 19 | private userService: UserService, |
22 | private videoChannelValidatorsService: VideoChannelValidatorsService | 20 | private videoChannelValidatorsService: VideoChannelValidatorsService |
23 | ) { | 21 | ) { |
diff --git a/client/src/app/+signup/+register/register-step-user.component.ts b/client/src/app/+signup/+register/register-step-user.component.ts index 6c96f20b4..3d9ab8b6b 100644 --- a/client/src/app/+signup/+register/register-step-user.component.ts +++ b/client/src/app/+signup/+register/register-step-user.component.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import { concat, of } from 'rxjs' | ||
2 | import { pairwise } from 'rxjs/operators' | ||
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { AuthService } from '@app/core' | ||
3 | import { FormReactive, UserService, UserValidatorsService } from '@app/shared' | ||
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
5 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
6 | import { pairwise } from 'rxjs/operators' | 5 | import { UserService } from '@app/core' |
7 | import { concat, of } from 'rxjs' | 6 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
8 | 7 | ||
9 | @Component({ | 8 | @Component({ |
10 | selector: 'my-register-step-user', | 9 | selector: 'my-register-step-user', |
@@ -20,7 +19,6 @@ export class RegisterStepUserComponent extends FormReactive implements OnInit { | |||
20 | 19 | ||
21 | constructor ( | 20 | constructor ( |
22 | protected formValidatorService: FormValidatorService, | 21 | protected formValidatorService: FormValidatorService, |
23 | private authService: AuthService, | ||
24 | private userService: UserService, | 22 | private userService: UserService, |
25 | private userValidatorsService: UserValidatorsService | 23 | private userValidatorsService: UserValidatorsService |
26 | ) { | 24 | ) { |
diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts index ae944ec15..3e8171b27 100644 --- a/client/src/app/+signup/+register/register.component.ts +++ b/client/src/app/+signup/+register/register.component.ts | |||
@@ -1,14 +1,13 @@ | |||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { AuthService, Notifier, RedirectService, ServerService } from '@app/core' | ||
3 | import { UserService, UserValidatorsService } from '@app/shared' | ||
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | import { UserRegister } from '@shared/models/users/user-register.model' | ||
6 | import { FormGroup } from '@angular/forms' | 2 | import { FormGroup } from '@angular/forms' |
7 | import { About, ServerConfig } from '@shared/models/server' | 3 | import { ActivatedRoute } from '@angular/router' |
8 | import { InstanceService } from '@app/shared/instance/instance.service' | 4 | import { AuthService, Notifier, UserService } from '@app/core' |
9 | import { HooksService } from '@app/core/plugins/hooks.service' | 5 | import { HooksService } from '@app/core/plugins/hooks.service' |
6 | import { InstanceService } from '@app/shared/shared-instance' | ||
10 | import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap' | 7 | import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap' |
11 | import { ActivatedRoute } from '@angular/router' | 8 | import { I18n } from '@ngx-translate/i18n-polyfill' |
9 | import { UserRegister } from '@shared/models' | ||
10 | import { About, ServerConfig } from '@shared/models/server' | ||
12 | 11 | ||
13 | @Component({ | 12 | @Component({ |
14 | selector: 'my-register', | 13 | selector: 'my-register', |
@@ -40,11 +39,8 @@ export class RegisterComponent implements OnInit { | |||
40 | constructor ( | 39 | constructor ( |
41 | private route: ActivatedRoute, | 40 | private route: ActivatedRoute, |
42 | private authService: AuthService, | 41 | private authService: AuthService, |
43 | private userValidatorsService: UserValidatorsService, | ||
44 | private notifier: Notifier, | 42 | private notifier: Notifier, |
45 | private userService: UserService, | 43 | private userService: UserService, |
46 | private serverService: ServerService, | ||
47 | private redirectService: RedirectService, | ||
48 | private instanceService: InstanceService, | 44 | private instanceService: InstanceService, |
49 | private hooks: HooksService, | 45 | private hooks: HooksService, |
50 | private i18n: I18n | 46 | private i18n: I18n |
diff --git a/client/src/app/+signup/+register/register.module.ts b/client/src/app/+signup/+register/register.module.ts index e55f83990..608045f58 100644 --- a/client/src/app/+signup/+register/register.module.ts +++ b/client/src/app/+signup/+register/register.module.ts | |||
@@ -1,21 +1,24 @@ | |||
1 | import { CdkStepperModule } from '@angular/cdk/stepper' | ||
1 | import { NgModule } from '@angular/core' | 2 | import { NgModule } from '@angular/core' |
3 | import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module' | ||
4 | import { SharedInstanceModule } from '@app/shared/shared-instance' | ||
5 | import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap' | ||
6 | import { CustomStepperComponent } from './custom-stepper.component' | ||
2 | import { RegisterRoutingModule } from './register-routing.module' | 7 | import { RegisterRoutingModule } from './register-routing.module' |
3 | import { RegisterComponent } from './register.component' | ||
4 | import { SharedModule } from '@app/shared' | ||
5 | import { CdkStepperModule } from '@angular/cdk/stepper' | ||
6 | import { RegisterStepChannelComponent } from './register-step-channel.component' | 8 | import { RegisterStepChannelComponent } from './register-step-channel.component' |
7 | import { RegisterStepUserComponent } from './register-step-user.component' | 9 | import { RegisterStepUserComponent } from './register-step-user.component' |
8 | import { CustomStepperComponent } from './custom-stepper.component' | 10 | import { RegisterComponent } from './register.component' |
9 | import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module' | ||
10 | import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap' | ||
11 | 11 | ||
12 | @NgModule({ | 12 | @NgModule({ |
13 | imports: [ | 13 | imports: [ |
14 | RegisterRoutingModule, | 14 | RegisterRoutingModule, |
15 | SharedModule, | 15 | |
16 | CdkStepperModule, | 16 | CdkStepperModule, |
17 | NgbAccordionModule, | ||
18 | |||
17 | SignupSharedModule, | 19 | SignupSharedModule, |
18 | NgbAccordionModule | 20 | |
21 | SharedInstanceModule | ||
19 | ], | 22 | ], |
20 | 23 | ||
21 | declarations: [ | 24 | declarations: [ |
diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts index 3bd604b66..51910471b 100644 --- a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts +++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { Notifier, RedirectService, ServerService, UserService } from '@app/core' | ||
3 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' | ||
2 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
3 | import { Notifier, RedirectService } from '@app/core' | ||
4 | import { ServerService } from '@app/core/server' | ||
5 | import { FormReactive, UserService } from '@app/shared' | ||
6 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
7 | import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' | ||
8 | import { ServerConfig } from '@shared/models' | 5 | import { ServerConfig } from '@shared/models' |
9 | 6 | ||
10 | @Component({ | 7 | @Component({ |
diff --git a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts index 48ddd7130..586f4e231 100644 --- a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts +++ b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute } from '@angular/router' |
3 | import { AuthService, Notifier, UserService } from '@app/core' | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { AuthService, Notifier } from '@app/core' | ||
5 | import { UserService } from '@app/shared' | ||
6 | 5 | ||
7 | @Component({ | 6 | @Component({ |
8 | selector: 'my-verify-account-email', | 7 | selector: 'my-verify-account-email', |
@@ -21,7 +20,6 @@ export class VerifyAccountEmailComponent implements OnInit { | |||
21 | private userService: UserService, | 20 | private userService: UserService, |
22 | private authService: AuthService, | 21 | private authService: AuthService, |
23 | private notifier: Notifier, | 22 | private notifier: Notifier, |
24 | private router: Router, | ||
25 | private route: ActivatedRoute, | 23 | private route: ActivatedRoute, |
26 | private i18n: I18n | 24 | private i18n: I18n |
27 | ) { | 25 | ) { |
diff --git a/client/src/app/+signup/+verify-account/verify-account.module.ts b/client/src/app/+signup/+verify-account/verify-account.module.ts index 9fe14e81e..7255605d4 100644 --- a/client/src/app/+signup/+verify-account/verify-account.module.ts +++ b/client/src/app/+signup/+verify-account/verify-account.module.ts | |||
@@ -1,14 +1,13 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { VerifyAccountRoutingModule } from './verify-account-routing.module' | 2 | import { SignupSharedModule } from '../shared/signup-shared.module' |
3 | import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component' | ||
4 | import { VerifyAccountAskSendEmailComponent } from './verify-account-ask-send-email/verify-account-ask-send-email.component' | 3 | import { VerifyAccountAskSendEmailComponent } from './verify-account-ask-send-email/verify-account-ask-send-email.component' |
5 | import { SharedModule } from '@app/shared' | 4 | import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component' |
6 | import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module' | 5 | import { VerifyAccountRoutingModule } from './verify-account-routing.module' |
7 | 6 | ||
8 | @NgModule({ | 7 | @NgModule({ |
9 | imports: [ | 8 | imports: [ |
10 | VerifyAccountRoutingModule, | 9 | VerifyAccountRoutingModule, |
11 | SharedModule, | 10 | |
12 | SignupSharedModule | 11 | SignupSharedModule |
13 | ], | 12 | ], |
14 | 13 | ||
diff --git a/client/src/app/+signup/shared/signup-shared.module.ts b/client/src/app/+signup/shared/signup-shared.module.ts index cd21fdef3..56b0b3bae 100644 --- a/client/src/app/+signup/shared/signup-shared.module.ts +++ b/client/src/app/+signup/shared/signup-shared.module.ts | |||
@@ -1,10 +1,14 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { SignupSuccessComponent } from '../shared/signup-success.component' | 2 | import { SharedMainModule } from '@app/shared/shared-main' |
3 | import { SharedModule } from '@app/shared' | 3 | import { SignupSuccessComponent } from './signup-success.component' |
4 | import { SharedFormModule } from '@app/shared/shared-forms' | ||
5 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | ||
4 | 6 | ||
5 | @NgModule({ | 7 | @NgModule({ |
6 | imports: [ | 8 | imports: [ |
7 | SharedModule | 9 | SharedMainModule, |
10 | SharedFormModule, | ||
11 | SharedGlobalIconModule | ||
8 | ], | 12 | ], |
9 | 13 | ||
10 | declarations: [ | 14 | declarations: [ |
@@ -12,6 +16,10 @@ import { SharedModule } from '@app/shared' | |||
12 | ], | 16 | ], |
13 | 17 | ||
14 | exports: [ | 18 | exports: [ |
19 | SharedMainModule, | ||
20 | SharedFormModule, | ||
21 | SharedGlobalIconModule, | ||
22 | |||
15 | SignupSuccessComponent | 23 | SignupSuccessComponent |
16 | ], | 24 | ], |
17 | 25 | ||
diff --git a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts index 11f9391e1..19e4bc1f4 100644 --- a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts +++ b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { Subscription } from 'rxjs' | ||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 2 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 3 | import { MarkdownService } from '@app/core' |
3 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 4 | import { VideoChannel, VideoChannelService } from '@app/shared/shared-main' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { Subscription } from 'rxjs' | ||
6 | import { MarkdownService } from '@app/shared/renderer' | ||
7 | 6 | ||
8 | @Component({ | 7 | @Component({ |
9 | selector: 'my-video-channel-about', | 8 | selector: 'my-video-channel-about', |
diff --git a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts index 0b0033082..8b507c626 100644 --- a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts +++ b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts | |||
@@ -1,12 +1,8 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | ||
2 | import { ConfirmService } from '../../core/confirm' | ||
3 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
4 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
5 | import { Subject, Subscription } from 'rxjs' | 1 | import { Subject, Subscription } from 'rxjs' |
6 | import { Notifier } from '@app/core' | 2 | import { Component, OnDestroy, OnInit } from '@angular/core' |
7 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | 3 | import { ComponentPagination, hasMoreItems } from '@app/core' |
8 | import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' | 4 | import { VideoChannel, VideoChannelService } from '@app/shared/shared-main' |
9 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | 5 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
10 | 6 | ||
11 | @Component({ | 7 | @Component({ |
12 | selector: 'my-video-channel-playlists', | 8 | selector: 'my-video-channel-playlists', |
@@ -28,8 +24,6 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy { | |||
28 | private videoChannel: VideoChannel | 24 | private videoChannel: VideoChannel |
29 | 25 | ||
30 | constructor ( | 26 | constructor ( |
31 | private notifier: Notifier, | ||
32 | private confirmService: ConfirmService, | ||
33 | private videoPlaylistService: VideoPlaylistService, | 27 | private videoPlaylistService: VideoPlaylistService, |
34 | private videoChannelService: VideoChannelService | 28 | private videoChannelService: VideoChannelService |
35 | ) {} | 29 | ) {} |
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts index 5749701e8..267c328f2 100644 --- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts +++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts | |||
@@ -1,25 +1,18 @@ | |||
1 | import { Subscription } from 'rxjs' | ||
2 | import { first, tap } from 'rxjs/operators' | ||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 3 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 5 | import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
4 | import { AuthService } from '../../core/auth' | 6 | import { immutableAssign } from '@app/helpers' |
5 | import { ConfirmService } from '../../core/confirm' | 7 | import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' |
6 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 8 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' |
7 | import { VideoService } from '../../shared/video/video.service' | ||
8 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
9 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
10 | import { first, tap } from 'rxjs/operators' | ||
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
12 | import { Subscription } from 'rxjs' | ||
13 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
14 | import { Notifier, ServerService } from '@app/core' | ||
15 | import { UserService } from '@app/shared' | ||
16 | import { LocalStorageService } from '@app/shared/misc/storage.service' | ||
17 | 10 | ||
18 | @Component({ | 11 | @Component({ |
19 | selector: 'my-video-channel-videos', | 12 | selector: 'my-video-channel-videos', |
20 | templateUrl: '../../shared/video/abstract-video-list.html', | 13 | templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html', |
21 | styleUrls: [ | 14 | styleUrls: [ |
22 | '../../shared/video/abstract-video-list.scss', | 15 | '../../shared/shared-video-miniature/abstract-video-list.scss', |
23 | './video-channel-videos.component.scss' | 16 | './video-channel-videos.component.scss' |
24 | ] | 17 | ] |
25 | }) | 18 | }) |
diff --git a/client/src/app/+video-channels/video-channels-routing.module.ts b/client/src/app/+video-channels/video-channels-routing.module.ts index d4872a0a5..e79e6a680 100644 --- a/client/src/app/+video-channels/video-channels-routing.module.ts +++ b/client/src/app/+video-channels/video-channels-routing.module.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | import { MetaGuard } from '@ngx-meta/core' | 3 | import { MetaGuard } from '@ngx-meta/core' |
4 | import { VideoChannelsComponent } from './video-channels.component' | ||
5 | import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component' | ||
6 | import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component' | 4 | import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component' |
7 | import { VideoChannelPlaylistsComponent } from '@app/+video-channels/video-channel-playlists/video-channel-playlists.component' | 5 | import { VideoChannelPlaylistsComponent } from './video-channel-playlists/video-channel-playlists.component' |
6 | import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component' | ||
7 | import { VideoChannelsComponent } from './video-channels.component' | ||
8 | 8 | ||
9 | const videoChannelsRoutes: Routes = [ | 9 | const videoChannelsRoutes: Routes = [ |
10 | { | 10 | { |
diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts index a3563c747..cae442ee7 100644 --- a/client/src/app/+video-channels/video-channels.component.ts +++ b/client/src/app/+video-channels/video-channels.component.ts | |||
@@ -1,16 +1,12 @@ | |||
1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
2 | import { Subscription } from 'rxjs' | ||
3 | import { catchError, distinctUntilChanged, map, switchMap } from 'rxjs/operators' | ||
1 | import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core' | 4 | import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core' |
2 | import { ActivatedRoute } from '@angular/router' | 5 | import { ActivatedRoute } from '@angular/router' |
3 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 6 | import { AuthService, Notifier, RestExtractor, ScreenService } from '@app/core' |
4 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 7 | import { ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main' |
5 | import { RestExtractor } from '@app/shared' | 8 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' |
6 | import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators' | ||
7 | import { Subscription } from 'rxjs' | ||
8 | import { AuthService, Notifier } from '@app/core' | ||
9 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
10 | import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component' | ||
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
12 | import { ListOverflowItem } from '@app/shared/misc/list-overflow.component' | ||
13 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
14 | 10 | ||
15 | @Component({ | 11 | @Component({ |
16 | templateUrl: './video-channels.component.html', | 12 | templateUrl: './video-channels.component.html', |
diff --git a/client/src/app/+video-channels/video-channels.module.ts b/client/src/app/+video-channels/video-channels.module.ts index 6975d05b2..05236ff85 100644 --- a/client/src/app/+video-channels/video-channels.module.ts +++ b/client/src/app/+video-channels/video-channels.module.ts | |||
@@ -1,15 +1,26 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { SharedModule } from '../shared' | 2 | import { SharedFormModule } from '@app/shared/shared-forms' |
3 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | ||
4 | import { SharedMainModule } from '@app/shared/shared-main' | ||
5 | import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' | ||
6 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' | ||
7 | import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist' | ||
8 | import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component' | ||
9 | import { VideoChannelPlaylistsComponent } from './video-channel-playlists/video-channel-playlists.component' | ||
10 | import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component' | ||
3 | import { VideoChannelsRoutingModule } from './video-channels-routing.module' | 11 | import { VideoChannelsRoutingModule } from './video-channels-routing.module' |
4 | import { VideoChannelsComponent } from './video-channels.component' | 12 | import { VideoChannelsComponent } from './video-channels.component' |
5 | import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component' | ||
6 | import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component' | ||
7 | import { VideoChannelPlaylistsComponent } from '@app/+video-channels/video-channel-playlists/video-channel-playlists.component' | ||
8 | 13 | ||
9 | @NgModule({ | 14 | @NgModule({ |
10 | imports: [ | 15 | imports: [ |
11 | VideoChannelsRoutingModule, | 16 | VideoChannelsRoutingModule, |
12 | SharedModule | 17 | |
18 | SharedMainModule, | ||
19 | SharedFormModule, | ||
20 | SharedVideoPlaylistModule, | ||
21 | SharedVideoMiniatureModule, | ||
22 | SharedUserSubscriptionModule, | ||
23 | SharedGlobalIconModule | ||
13 | ], | 24 | ], |
14 | 25 | ||
15 | declarations: [ | 26 | declarations: [ |
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index a87f4ce1b..ceda41415 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' | 2 | import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' |
3 | |||
4 | import { PreloadSelectedModulesList } from './core' | ||
5 | import { AppComponent } from '@app/app.component' | 3 | import { AppComponent } from '@app/app.component' |
6 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' | 4 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' |
7 | import { MenuGuards } from '@app/core/routing/menu-guard.service' | 5 | import { MenuGuards } from '@app/core/routing/menu-guard.service' |
6 | import { PreloadSelectedModulesList } from './core' | ||
8 | 7 | ||
9 | const routes: Routes = [ | 8 | const routes: Routes = [ |
10 | { | 9 | { |
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index c77dc97de..a62aa4870 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -1,28 +1,22 @@ | |||
1 | import { Component, OnInit, ViewChild, AfterViewInit, Inject, LOCALE_ID } from '@angular/core' | 1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' |
2 | import { concat } from 'rxjs' | ||
3 | import { filter, first, map, pairwise } from 'rxjs/operators' | ||
4 | import { DOCUMENT, PlatformLocation, ViewportScroller } from '@angular/common' | ||
5 | import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core' | ||
2 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' | 6 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' |
3 | import { Event, GuardsCheckStart, NavigationEnd, Router, Scroll } from '@angular/router' | 7 | import { Event, GuardsCheckStart, NavigationEnd, Router, Scroll } from '@angular/router' |
4 | import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core' | 8 | import { AuthService, MarkdownService, RedirectService, ScreenService, ServerService, ThemeService, User } from '@app/core' |
5 | import { is18nPath, getShortLocale } from '../../../shared/models/i18n' | ||
6 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
7 | import { filter, map, pairwise, first } from 'rxjs/operators' | ||
8 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
10 | import { PlatformLocation, ViewportScroller, DOCUMENT } from '@angular/common' | ||
11 | import { PluginService } from '@app/core/plugins/plugin.service' | ||
12 | import { HooksService } from '@app/core/plugins/hooks.service' | 9 | import { HooksService } from '@app/core/plugins/hooks.service' |
13 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 10 | import { PluginService } from '@app/core/plugins/plugin.service' |
14 | import { POP_STATE_MODAL_DISMISS } from '@app/shared/misc/constants' | ||
15 | import { WelcomeModalComponent } from '@app/modal/welcome-modal.component' | ||
16 | import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component' | ||
17 | import { CustomModalComponent } from '@app/modal/custom-modal.component' | 11 | import { CustomModalComponent } from '@app/modal/custom-modal.component' |
18 | import { ServerConfig, UserRole } from '@shared/models' | 12 | import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component' |
19 | import { User } from '@app/shared' | 13 | import { WelcomeModalComponent } from '@app/modal/welcome-modal.component' |
20 | import { InstanceService } from '@app/shared/instance/instance.service' | 14 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
15 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
16 | import { BroadcastMessageLevel, getShortLocale, is18nPath, ServerConfig, UserRole } from '@shared/models' | ||
21 | import { MenuService } from './core/menu/menu.service' | 17 | import { MenuService } from './core/menu/menu.service' |
22 | import { BroadcastMessageLevel } from '@shared/models/server' | 18 | import { peertubeLocalStorage, POP_STATE_MODAL_DISMISS } from './helpers' |
23 | import { MarkdownService } from './shared/renderer' | 19 | import { InstanceService } from './shared/shared-instance' |
24 | import { concat } from 'rxjs' | ||
25 | import { peertubeLocalStorage } from './shared/misc/peertube-web-storage' | ||
26 | 20 | ||
27 | @Component({ | 21 | @Component({ |
28 | selector: 'my-app', | 22 | selector: 'my-app', |
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 89332ec5f..7fbc6463b 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts | |||
@@ -1,31 +1,36 @@ | |||
1 | import 'focus-visible' | ||
2 | import { APP_BASE_HREF, registerLocaleData } from '@angular/common' | ||
1 | import { LOCALE_ID, NgModule, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular/core' | 3 | import { LOCALE_ID, NgModule, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular/core' |
2 | import { BrowserModule } from '@angular/platform-browser' | 4 | import { BrowserModule } from '@angular/platform-browser' |
3 | import { ServerService } from '@app/core' | 5 | import { ServerService } from '@app/core' |
6 | import localeOc from '@app/helpers/locales/oc' | ||
4 | import { ResetPasswordModule } from '@app/reset-password' | 7 | import { ResetPasswordModule } from '@app/reset-password' |
8 | import { SearchModule } from '@app/search' | ||
5 | import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' | 9 | import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' |
6 | import 'focus-visible' | 10 | import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/models' |
7 | |||
8 | import { AppRoutingModule } from './app-routing.module' | 11 | import { AppRoutingModule } from './app-routing.module' |
9 | import { AppComponent } from './app.component' | 12 | import { AppComponent } from './app.component' |
10 | import { CoreModule } from './core' | 13 | import { CoreModule } from './core' |
11 | import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' | 14 | import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' |
12 | import { LoginModule } from './login' | 15 | import { LoginModule } from './login' |
13 | import { AvatarNotificationComponent, LanguageChooserComponent, MenuComponent } from './menu' | 16 | import { AvatarNotificationComponent, LanguageChooserComponent, MenuComponent } from './menu' |
14 | import { SharedModule } from './shared' | 17 | import { ConfirmComponent } from './modal/confirm.component' |
18 | import { CustomModalComponent } from './modal/custom-modal.component' | ||
19 | import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component' | ||
20 | import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component' | ||
21 | import { WelcomeModalComponent } from './modal/welcome-modal.component' | ||
22 | import { SharedFormModule } from './shared/shared-forms' | ||
23 | import { SharedGlobalIconModule } from './shared/shared-icons' | ||
24 | import { SharedInstanceModule } from './shared/shared-instance' | ||
25 | import { SharedMainModule } from './shared/shared-main' | ||
26 | import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings' | ||
15 | import { VideosModule } from './videos' | 27 | import { VideosModule } from './videos' |
16 | import { SearchModule } from '@app/search' | ||
17 | import { WelcomeModalComponent } from '@app/modal/welcome-modal.component' | ||
18 | import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component' | ||
19 | import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/models' | ||
20 | import { APP_BASE_HREF, registerLocaleData } from '@angular/common' | ||
21 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' | ||
22 | import { CustomModalComponent } from '@app/modal/custom-modal.component' | ||
23 | import localeOc from '@app/shared/locale/oc' | ||
24 | 28 | ||
25 | registerLocaleData(localeOc, 'oc') | 29 | registerLocaleData(localeOc, 'oc') |
26 | 30 | ||
27 | @NgModule({ | 31 | @NgModule({ |
28 | bootstrap: [ AppComponent ], | 32 | bootstrap: [ AppComponent ], |
33 | |||
29 | declarations: [ | 34 | declarations: [ |
30 | AppComponent, | 35 | AppComponent, |
31 | 36 | ||
@@ -39,19 +44,24 @@ registerLocaleData(localeOc, 'oc') | |||
39 | 44 | ||
40 | CustomModalComponent, | 45 | CustomModalComponent, |
41 | WelcomeModalComponent, | 46 | WelcomeModalComponent, |
42 | InstanceConfigWarningModalComponent | 47 | InstanceConfigWarningModalComponent, |
48 | ConfirmComponent | ||
43 | ], | 49 | ], |
50 | |||
44 | imports: [ | 51 | imports: [ |
45 | BrowserModule, | 52 | BrowserModule, |
46 | 53 | ||
47 | CoreModule, | 54 | CoreModule, |
48 | SharedModule, | 55 | SharedMainModule, |
56 | SharedFormModule, | ||
57 | SharedUserInterfaceSettingsModule, | ||
58 | SharedGlobalIconModule, | ||
59 | SharedInstanceModule, | ||
49 | 60 | ||
50 | CoreModule, | ||
51 | LoginModule, | 61 | LoginModule, |
52 | ResetPasswordModule, | 62 | ResetPasswordModule, |
53 | SearchModule, | 63 | SearchModule, |
54 | SharedModule, | 64 | |
55 | VideosModule, | 65 | VideosModule, |
56 | 66 | ||
57 | MetaModule.forRoot({ | 67 | MetaModule.forRoot({ |
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts index 4ad904beb..4e7801550 100644 --- a/client/src/app/core/auth/auth-user.model.ts +++ b/client/src/app/core/auth/auth-user.model.ts | |||
@@ -1,10 +1,14 @@ | |||
1 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | 1 | import { User } from '@app/core/users/user.model' |
2 | import { UserRight } from '../../../../../shared/models/users/user-right.enum' | 2 | import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' |
3 | import { MyUser as ServerMyUserModel, User as ServerUserModel, MyUserSpecialPlaylist } from '../../../../../shared/models/users/user.model' | 3 | import { |
4 | // Do not use the barrel (dependency loop) | 4 | hasUserRight, |
5 | import { hasUserRight, UserRole } from '../../../../../shared/models/users/user-role' | 5 | MyUser as ServerMyUserModel, |
6 | import { User } from '../../shared/users/user.model' | 6 | MyUserSpecialPlaylist, |
7 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' | 7 | NSFWPolicyType, |
8 | User as ServerUserModel, | ||
9 | UserRight, | ||
10 | UserRole | ||
11 | } from '@shared/models' | ||
8 | 12 | ||
9 | export type TokenOptions = { | 13 | export type TokenOptions = { |
10 | accessToken: string | 14 | accessToken: string |
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index de8c509d1..94262b9aa 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts | |||
@@ -1,20 +1,17 @@ | |||
1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
1 | import { Observable, ReplaySubject, Subject, throwError as observableThrowError } from 'rxjs' | 2 | import { Observable, ReplaySubject, Subject, throwError as observableThrowError } from 'rxjs' |
2 | import { catchError, map, mergeMap, share, tap } from 'rxjs/operators' | 3 | import { catchError, map, mergeMap, share, tap } from 'rxjs/operators' |
3 | import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' |
4 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
5 | import { Router } from '@angular/router' | 6 | import { Router } from '@angular/router' |
6 | import { Notifier } from '@app/core/notification/notifier.service' | 7 | import { Notifier } from '@app/core/notification/notifier.service' |
7 | import { OAuthClientLocal, MyUser as UserServerModel, UserRefreshToken } from '../../../../../shared' | 8 | import { objectToUrlEncoded, peertubeLocalStorage } from '@app/helpers' |
8 | import { User } from '../../../../../shared/models/users' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
9 | import { UserLogin } from '../../../../../shared/models/users/user-login.model' | 10 | import { MyUser as UserServerModel, OAuthClientLocal, User, UserLogin, UserRefreshToken } from '@shared/models' |
10 | import { environment } from '../../../environments/environment' | 11 | import { environment } from '../../../environments/environment' |
11 | import { RestExtractor } from '../../shared/rest/rest-extractor.service' | 12 | import { RestExtractor } from '../rest/rest-extractor.service' |
12 | import { AuthStatus } from './auth-status.model' | 13 | import { AuthStatus } from './auth-status.model' |
13 | import { AuthUser } from './auth-user.model' | 14 | import { AuthUser } from './auth-user.model' |
14 | import { objectToUrlEncoded } from '@app/shared/misc/utils' | ||
15 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | ||
16 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
17 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
18 | 15 | ||
19 | interface UserLoginWithUsername extends UserLogin { | 16 | interface UserLoginWithUsername extends UserLogin { |
20 | access_token: string | 17 | access_token: string |
diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts index a1734ad80..22896e2e9 100644 --- a/client/src/app/core/core.module.ts +++ b/client/src/app/core/core.module.ts | |||
@@ -1,35 +1,35 @@ | |||
1 | import { HotkeyModule } from 'angular2-hotkeys' | ||
2 | import { MessageService } from 'primeng/api' | ||
3 | import { ToastModule } from 'primeng/toast' | ||
1 | import { CommonModule } from '@angular/common' | 4 | import { CommonModule } from '@angular/common' |
2 | import { NgModule, Optional, SkipSelf } from '@angular/core' | 5 | import { NgModule, Optional, SkipSelf } from '@angular/core' |
3 | import { FormsModule } from '@angular/forms' | ||
4 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations' | 6 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations' |
5 | import { RouterModule } from '@angular/router' | 7 | import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service' |
8 | import { HooksService } from '@app/core/plugins/hooks.service' | ||
9 | import { PluginService } from '@app/core/plugins/plugin.service' | ||
10 | import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service' | ||
6 | import { LoadingBarModule } from '@ngx-loading-bar/core' | 11 | import { LoadingBarModule } from '@ngx-loading-bar/core' |
7 | import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client' | 12 | import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client' |
8 | import { LoadingBarRouterModule } from '@ngx-loading-bar/router' | 13 | import { LoadingBarRouterModule } from '@ngx-loading-bar/router' |
9 | |||
10 | import { AuthService } from './auth' | 14 | import { AuthService } from './auth' |
11 | import { ConfirmService } from './confirm' | 15 | import { ConfirmService } from './confirm' |
16 | import { CheatSheetComponent } from './hotkeys' | ||
17 | import { MenuService } from './menu' | ||
12 | import { throwIfAlreadyLoaded } from './module-import-guard' | 18 | import { throwIfAlreadyLoaded } from './module-import-guard' |
19 | import { Notifier } from './notification' | ||
20 | import { HtmlRendererService, LinkifierService, MarkdownService } from './renderer' | ||
21 | import { RestExtractor, RestService } from './rest' | ||
13 | import { LoginGuard, RedirectService, UserRightGuard } from './routing' | 22 | import { LoginGuard, RedirectService, UserRightGuard } from './routing' |
23 | import { CanDeactivateGuard } from './routing/can-deactivate-guard.service' | ||
24 | import { ServerConfigResolver } from './routing/server-config-resolver.service' | ||
14 | import { ServerService } from './server' | 25 | import { ServerService } from './server' |
15 | import { ThemeService } from './theme' | 26 | import { ThemeService } from './theme' |
16 | import { MenuService } from './menu' | 27 | import { UserService } from './users' |
17 | import { HotkeyModule } from 'angular2-hotkeys' | 28 | import { LocalStorageService, ScreenService, SessionStorageService } from './wrappers' |
18 | import { CheatSheetComponent } from './hotkeys' | ||
19 | import { ToastModule } from 'primeng/toast' | ||
20 | import { Notifier } from './notification' | ||
21 | import { MessageService } from 'primeng/api' | ||
22 | import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service' | ||
23 | import { ServerConfigResolver } from './routing/server-config-resolver.service' | ||
24 | import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service' | ||
25 | import { PluginService } from '@app/core/plugins/plugin.service' | ||
26 | import { HooksService } from '@app/core/plugins/hooks.service' | ||
27 | 29 | ||
28 | @NgModule({ | 30 | @NgModule({ |
29 | imports: [ | 31 | imports: [ |
30 | CommonModule, | 32 | CommonModule, |
31 | RouterModule, | ||
32 | FormsModule, | ||
33 | BrowserAnimationsModule, | 33 | BrowserAnimationsModule, |
34 | 34 | ||
35 | LoadingBarHttpClientModule, | 35 | LoadingBarHttpClientModule, |
@@ -68,11 +68,25 @@ import { HooksService } from '@app/core/plugins/hooks.service' | |||
68 | PluginService, | 68 | PluginService, |
69 | HooksService, | 69 | HooksService, |
70 | 70 | ||
71 | HtmlRendererService, | ||
72 | LinkifierService, | ||
73 | MarkdownService, | ||
74 | |||
75 | RestExtractor, | ||
76 | RestService, | ||
77 | |||
78 | UserService, | ||
79 | |||
80 | ScreenService, | ||
81 | LocalStorageService, | ||
82 | SessionStorageService, | ||
83 | |||
71 | RedirectService, | 84 | RedirectService, |
72 | Notifier, | 85 | Notifier, |
73 | MessageService, | 86 | MessageService, |
74 | UserNotificationSocket, | 87 | UserNotificationSocket, |
75 | ServerConfigResolver | 88 | ServerConfigResolver, |
89 | CanDeactivateGuard | ||
76 | ] | 90 | ] |
77 | }) | 91 | }) |
78 | export class CoreModule { | 92 | export class CoreModule { |
diff --git a/client/src/app/core/index.ts b/client/src/app/core/index.ts index f664aff41..a0c34543d 100644 --- a/client/src/app/core/index.ts +++ b/client/src/app/core/index.ts | |||
@@ -1,8 +1,15 @@ | |||
1 | export * from './auth' | 1 | export * from './auth' |
2 | export * from './confirm' | 2 | export * from './confirm' |
3 | export * from './hotkeys' | ||
4 | export * from './menu' | ||
5 | export * from './notification' | ||
6 | export * from './plugins' | ||
7 | export * from './renderer' | ||
8 | export * from './rest' | ||
3 | export * from './routing' | 9 | export * from './routing' |
4 | export * from './server' | 10 | export * from './server' |
5 | export * from './notification' | ||
6 | export * from './theme' | 11 | export * from './theme' |
12 | export * from './users' | ||
13 | export * from './wrappers' | ||
7 | 14 | ||
8 | export * from './core.module' | 15 | export * from './core.module' |
diff --git a/client/src/app/core/menu/menu.service.ts b/client/src/app/core/menu/menu.service.ts index 81093c666..ef5271f97 100644 --- a/client/src/app/core/menu/menu.service.ts +++ b/client/src/app/core/menu/menu.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
3 | import { fromEvent } from 'rxjs' | 1 | import { fromEvent } from 'rxjs' |
4 | import { debounceTime } from 'rxjs/operators' | 2 | import { debounceTime } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | ||
4 | import { ScreenService } from '../wrappers' | ||
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class MenuService { | 7 | export class MenuService { |
diff --git a/client/src/app/core/notification/user-notification-socket.service.ts b/client/src/app/core/notification/user-notification-socket.service.ts index 3f22da476..37f0bc32c 100644 --- a/client/src/app/core/notification/user-notification-socket.service.ts +++ b/client/src/app/core/notification/user-notification-socket.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Subject } from 'rxjs' | ||
1 | import { Injectable, NgZone } from '@angular/core' | 2 | import { Injectable, NgZone } from '@angular/core' |
3 | import { UserNotification as UserNotificationServer } from '@shared/models' | ||
2 | import { environment } from '../../../environments/environment' | 4 | import { environment } from '../../../environments/environment' |
3 | import { UserNotification as UserNotificationServer } from '../../../../../shared' | ||
4 | import { Subject } from 'rxjs' | ||
5 | import { AuthService } from '../auth' | 5 | import { AuthService } from '../auth' |
6 | 6 | ||
7 | export type NotificationEvent = 'new' | 'read' | 'read-all' | 7 | export type NotificationEvent = 'new' | 'read' | 'read-all' |
diff --git a/client/src/app/core/plugins/hooks.service.ts b/client/src/app/core/plugins/hooks.service.ts index 2fbf406d1..ec47aa48c 100644 --- a/client/src/app/core/plugins/hooks.service.ts +++ b/client/src/app/core/plugins/hooks.service.ts | |||
@@ -2,8 +2,7 @@ import { from, Observable } from 'rxjs' | |||
2 | import { mergeMap, switchMap } from 'rxjs/operators' | 2 | import { mergeMap, switchMap } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { PluginService } from '@app/core/plugins/plugin.service' | 4 | import { PluginService } from '@app/core/plugins/plugin.service' |
5 | import { ClientActionHookName, ClientFilterHookName } from '@shared/models/plugins/client-hook.model' | 5 | import { ClientActionHookName, ClientFilterHookName, PluginClientScope } from '@shared/models' |
6 | import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type' | ||
7 | 6 | ||
8 | type RawFunction<U, T> = (params: U) => T | 7 | type RawFunction<U, T> = (params: U) => T |
9 | type ObservableFunction<U, T> = RawFunction<U, Observable<T>> | 8 | type ObservableFunction<U, T> = RawFunction<U, Observable<T>> |
diff --git a/client/src/app/core/plugins/index.ts b/client/src/app/core/plugins/index.ts new file mode 100644 index 000000000..b3239f1f3 --- /dev/null +++ b/client/src/app/core/plugins/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './hooks.service' | ||
2 | export * from './plugin.service' | ||
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index c6efcac6d..3cab64142 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts | |||
@@ -1,28 +1,33 @@ | |||
1 | import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core' | ||
2 | import { Router } from '@angular/router' | ||
3 | import { getCompleteLocale, isDefaultLocale, peertubeTranslate, ServerConfigPlugin } from '@shared/models' | ||
4 | import { ServerService } from '@app/core/server/server.service' | ||
5 | import { ClientScript } from '@shared/models/plugins/plugin-package-json.model' | ||
6 | import { ClientScript as ClientScriptModule } from '../../../types/client-script.model' | ||
7 | import { environment } from '../../../environments/environment' | ||
8 | import { Observable, of, ReplaySubject } from 'rxjs' | 1 | import { Observable, of, ReplaySubject } from 'rxjs' |
9 | import { catchError, first, map, shareReplay } from 'rxjs/operators' | 2 | import { catchError, first, map, shareReplay } from 'rxjs/operators' |
10 | import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks' | ||
11 | import { ClientHook, ClientHookName, clientHookObject } from '@shared/models/plugins/client-hook.model' | ||
12 | import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type' | ||
13 | import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model' | ||
14 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient } from '@angular/common/http' |
4 | import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core' | ||
15 | import { AuthService } from '@app/core/auth' | 5 | import { AuthService } from '@app/core/auth' |
16 | import { Notifier } from '@app/core/notification' | 6 | import { Notifier } from '@app/core/notification' |
17 | import { RestExtractor } from '@app/shared/rest' | 7 | import { MarkdownService } from '@app/core/renderer' |
18 | import { MarkdownService } from '@app/shared/renderer' | 8 | import { RestExtractor } from '@app/core/rest' |
19 | import { PluginType } from '@shared/models/plugins/plugin.type' | 9 | import { ServerService } from '@app/core/server/server.service' |
20 | import { PublicServerSetting } from '@shared/models/plugins/public-server.setting' | 10 | import { getDevLocale, importModule, isOnDevLocale } from '@app/helpers' |
21 | import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' | ||
22 | import { RegisterClientHelpers } from '../../../types/register-client-option.model' | ||
23 | import { PluginTranslation } from '@shared/models/plugins/plugin-translation.model' | ||
24 | import { importModule } from '@app/shared/misc/utils' | ||
25 | import { CustomModalComponent } from '@app/modal/custom-modal.component' | 11 | import { CustomModalComponent } from '@app/modal/custom-modal.component' |
12 | import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks' | ||
13 | import { | ||
14 | ClientHook, | ||
15 | ClientHookName, | ||
16 | clientHookObject, | ||
17 | ClientScript, | ||
18 | getCompleteLocale, | ||
19 | isDefaultLocale, | ||
20 | peertubeTranslate, | ||
21 | PluginClientScope, | ||
22 | PluginTranslation, | ||
23 | PluginType, | ||
24 | PublicServerSetting, | ||
25 | RegisterClientHookOptions, | ||
26 | ServerConfigPlugin | ||
27 | } from '@shared/models' | ||
28 | import { environment } from '../../../environments/environment' | ||
29 | import { ClientScript as ClientScriptModule } from '../../../types/client-script.model' | ||
30 | import { RegisterClientHelpers } from '../../../types/register-client-option.model' | ||
26 | 31 | ||
27 | interface HookStructValue extends RegisterClientHookOptions { | 32 | interface HookStructValue extends RegisterClientHookOptions { |
28 | plugin: ServerConfigPlugin | 33 | plugin: ServerConfigPlugin |
@@ -64,7 +69,6 @@ export class PluginService implements ClientHook { | |||
64 | private hooks: { [ name: string ]: HookStructValue[] } = {} | 69 | private hooks: { [ name: string ]: HookStructValue[] } = {} |
65 | 70 | ||
66 | constructor ( | 71 | constructor ( |
67 | private router: Router, | ||
68 | private authService: AuthService, | 72 | private authService: AuthService, |
69 | private notifier: Notifier, | 73 | private notifier: Notifier, |
70 | private markdownRenderer: MarkdownService, | 74 | private markdownRenderer: MarkdownService, |
diff --git a/client/src/app/shared/renderer/html-renderer.service.ts b/client/src/app/core/renderer/html-renderer.service.ts index 1ddd8fe2f..f0527c759 100644 --- a/client/src/app/shared/renderer/html-renderer.service.ts +++ b/client/src/app/core/renderer/html-renderer.service.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { LinkifierService } from '@app/shared/renderer/linkifier.service' | 2 | import { LinkifierService } from './linkifier.service' |
3 | 3 | ||
4 | @Injectable() | 4 | @Injectable() |
5 | export class HtmlRendererService { | 5 | export class HtmlRendererService { |
diff --git a/client/src/app/shared/renderer/index.ts b/client/src/app/core/renderer/index.ts index 39202b385..39202b385 100644 --- a/client/src/app/shared/renderer/index.ts +++ b/client/src/app/core/renderer/index.ts | |||
diff --git a/client/src/app/shared/renderer/linkifier.service.ts b/client/src/app/core/renderer/linkifier.service.ts index 95d5f17cc..46d5b0089 100644 --- a/client/src/app/shared/renderer/linkifier.service.ts +++ b/client/src/app/core/renderer/linkifier.service.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { getAbsoluteAPIUrl } from '@app/shared/misc/utils' | 2 | import { getAbsoluteAPIUrl } from '@app/helpers/utils' |
3 | import * as linkify from 'linkifyjs' | 3 | import * as linkify from 'linkifyjs' |
4 | import linkifyHtml from 'linkifyjs/html' | 4 | import linkifyHtml from 'linkifyjs/html' |
5 | 5 | ||
diff --git a/client/src/app/shared/renderer/markdown.service.ts b/client/src/app/core/renderer/markdown.service.ts index f0c87326f..0c43bebab 100644 --- a/client/src/app/shared/renderer/markdown.service.ts +++ b/client/src/app/core/renderer/markdown.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { buildVideoLink } from '../../../assets/player/utils' | ||
3 | import { HtmlRendererService } from '@app/shared/renderer/html-renderer.service' | ||
4 | import * as MarkdownIt from 'markdown-it' | 1 | import * as MarkdownIt from 'markdown-it' |
2 | import { buildVideoLink } from 'src/assets/player/utils' | ||
3 | import { Injectable } from '@angular/core' | ||
4 | import { HtmlRendererService } from './html-renderer.service' | ||
5 | 5 | ||
6 | type MarkdownParsers = { | 6 | type MarkdownParsers = { |
7 | textMarkdownIt: MarkdownIt | 7 | textMarkdownIt: MarkdownIt |
diff --git a/client/src/app/shared/rest/component-pagination.model.ts b/client/src/app/core/rest/component-pagination.model.ts index bcb73ed0f..bcb73ed0f 100644 --- a/client/src/app/shared/rest/component-pagination.model.ts +++ b/client/src/app/core/rest/component-pagination.model.ts | |||
diff --git a/client/src/app/shared/rest/index.ts b/client/src/app/core/rest/index.ts index f00cda2b8..93899beaf 100644 --- a/client/src/app/shared/rest/index.ts +++ b/client/src/app/core/rest/index.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | export * from './component-pagination.model' | ||
1 | export * from './rest-extractor.service' | 2 | export * from './rest-extractor.service' |
2 | export * from './rest-pagination' | 3 | export * from './rest-pagination' |
3 | export * from './rest.service' | ||
4 | export * from './rest-table' | 4 | export * from './rest-table' |
5 | export * from './rest.service' | ||
diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/core/rest/rest-extractor.service.ts index e6518dd1d..9de964f79 100644 --- a/client/src/app/shared/rest/rest-extractor.service.ts +++ b/client/src/app/core/rest/rest-extractor.service.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { throwError as observableThrowError } from 'rxjs' | 1 | import { throwError as observableThrowError } from 'rxjs' |
2 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
3 | import { dateToHuman } from '@app/shared/misc/utils' | ||
4 | import { ResultList } from '../../../../../shared' | ||
5 | import { Router } from '@angular/router' | 3 | import { Router } from '@angular/router' |
4 | import { dateToHuman } from '@app/helpers' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { ResultList } from '@shared/models' | ||
7 | 7 | ||
8 | @Injectable() | 8 | @Injectable() |
9 | export class RestExtractor { | 9 | export class RestExtractor { |
diff --git a/client/src/app/shared/rest/rest-pagination.ts b/client/src/app/core/rest/rest-pagination.ts index 0faa59303..0faa59303 100644 --- a/client/src/app/shared/rest/rest-pagination.ts +++ b/client/src/app/core/rest/rest-pagination.ts | |||
diff --git a/client/src/app/shared/rest/rest-table.ts b/client/src/app/core/rest/rest-table.ts index d4e6cf5f2..1b35ad47d 100644 --- a/client/src/app/shared/rest/rest-table.ts +++ b/client/src/app/core/rest/rest-table.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | 1 | import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' |
2 | import { LazyLoadEvent, SortMeta } from 'primeng/api' | 2 | import { LazyLoadEvent, SortMeta } from 'primeng/api' |
3 | import { RestPagination } from './rest-pagination' | 3 | import { RestPagination } from './rest-pagination' |
4 | import { Subject } from 'rxjs' | 4 | import { Subject } from 'rxjs' |
diff --git a/client/src/app/shared/rest/rest.service.ts b/client/src/app/core/rest/rest.service.ts index 78558851a..78558851a 100644 --- a/client/src/app/shared/rest/rest.service.ts +++ b/client/src/app/core/rest/rest.service.ts | |||
diff --git a/client/src/app/shared/guards/can-deactivate-guard.service.ts b/client/src/app/core/routing/can-deactivate-guard.service.ts index 3a35fcfb3..e0405293a 100644 --- a/client/src/app/shared/guards/can-deactivate-guard.service.ts +++ b/client/src/app/core/routing/can-deactivate-guard.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Observable } from 'rxjs' | ||
1 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
2 | import { CanDeactivate } from '@angular/router' | 3 | import { CanDeactivate } from '@angular/router' |
3 | import { Observable } from 'rxjs' | 4 | import { ConfirmService } from '@app/core/confirm' |
4 | import { ConfirmService } from '../../core/index' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | 6 | ||
7 | export type CanComponentDeactivateResult = { text?: string, canDeactivate: Observable<boolean> | boolean } | 7 | export type CanComponentDeactivateResult = { text?: string, canDeactivate: Observable<boolean> | boolean } |
diff --git a/client/src/app/core/routing/index.ts b/client/src/app/core/routing/index.ts index 58b83bb2a..239c27caf 100644 --- a/client/src/app/core/routing/index.ts +++ b/client/src/app/core/routing/index.ts | |||
@@ -1,5 +1,10 @@ | |||
1 | export * from './can-deactivate-guard.service' | ||
2 | export * from './custom-reuse-strategy' | ||
3 | export * from './disable-for-reuse-hook' | ||
1 | export * from './login-guard.service' | 4 | export * from './login-guard.service' |
2 | export * from './user-right-guard.service' | 5 | export * from './menu-guard.service' |
3 | export * from './preload-selected-modules-list' | 6 | export * from './preload-selected-modules-list' |
4 | export * from './redirect.service' | 7 | export * from './redirect.service' |
5 | export * from './menu-guard.service' | 8 | export * from './server-config-resolver.service' |
9 | export * from './unlogged-guard.service' | ||
10 | export * from './user-right-guard.service' | ||
diff --git a/client/src/app/core/routing/login-guard.service.ts b/client/src/app/core/routing/login-guard.service.ts index 7b1c37ee8..a949be14c 100644 --- a/client/src/app/core/routing/login-guard.service.ts +++ b/client/src/app/core/routing/login-guard.service.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router' | 2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router' |
3 | |||
4 | import { AuthService } from '../auth/auth.service' | 3 | import { AuthService } from '../auth/auth.service' |
5 | 4 | ||
6 | @Injectable() | 5 | @Injectable() |
diff --git a/client/src/app/core/routing/menu-guard.service.ts b/client/src/app/core/routing/menu-guard.service.ts index 907d145fd..9df285635 100644 --- a/client/src/app/core/routing/menu-guard.service.ts +++ b/client/src/app/core/routing/menu-guard.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { CanActivate, CanDeactivate } from '@angular/router' | 2 | import { CanActivate, CanDeactivate } from '@angular/router' |
3 | import { MenuService } from '@app/core/menu' | 3 | import { MenuService } from '../menu' |
4 | import { ScreenService } from '@app/shared/misc/screen.service' | 4 | import { ScreenService } from '../wrappers' |
5 | 5 | ||
6 | abstract class MenuGuard implements CanActivate, CanDeactivate<any> { | 6 | abstract class MenuGuard implements CanActivate, CanDeactivate<any> { |
7 | display = true | 7 | display = true |
diff --git a/client/src/app/core/routing/preload-selected-modules-list.ts b/client/src/app/core/routing/preload-selected-modules-list.ts index 64af68225..b494a40bc 100644 --- a/client/src/app/core/routing/preload-selected-modules-list.ts +++ b/client/src/app/core/routing/preload-selected-modules-list.ts | |||
@@ -5,6 +5,7 @@ import { Injectable } from '@angular/core' | |||
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class PreloadSelectedModulesList implements PreloadingStrategy { | 7 | export class PreloadSelectedModulesList implements PreloadingStrategy { |
8 | |||
8 | preload (route: Route, load: Function): Observable<any> { | 9 | preload (route: Route, load: Function): Observable<any> { |
9 | if (!route.data || !route.data.preload) return ofObservable(null) | 10 | if (!route.data || !route.data.preload) return ofObservable(null) |
10 | 11 | ||
diff --git a/client/src/app/core/routing/server-config-resolver.service.ts b/client/src/app/core/routing/server-config-resolver.service.ts index 3b7ed99bf..0ce2023a0 100644 --- a/client/src/app/core/routing/server-config-resolver.service.ts +++ b/client/src/app/core/routing/server-config-resolver.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { Resolve } from '@angular/router' | 2 | import { Resolve } from '@angular/router' |
3 | import { ServerService } from '@app/core/server' | 3 | import { ServerService } from '../server' |
4 | import { ServerConfig } from '@shared/models' | 4 | import { ServerConfig } from '@shared/models' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
diff --git a/client/src/app/core/routing/unlogged-guard.service.ts b/client/src/app/core/routing/unlogged-guard.service.ts index 3132a1a77..0be7911a0 100644 --- a/client/src/app/core/routing/unlogged-guard.service.ts +++ b/client/src/app/core/routing/unlogged-guard.service.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router' | 2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router' |
3 | import { AuthService } from '../auth/auth.service' | 3 | import { AuthService } from '../auth/auth.service' |
4 | import { RedirectService } from './redirect.service' | 4 | import { RedirectService } from './redirect.service' |
5 | 5 | ||
@@ -7,7 +7,6 @@ import { RedirectService } from './redirect.service' | |||
7 | export class UnloggedGuard implements CanActivate, CanActivateChild { | 7 | export class UnloggedGuard implements CanActivate, CanActivateChild { |
8 | 8 | ||
9 | constructor ( | 9 | constructor ( |
10 | private router: Router, | ||
11 | private auth: AuthService, | 10 | private auth: AuthService, |
12 | private redirectService: RedirectService | 11 | private redirectService: RedirectService |
13 | ) {} | 12 | ) {} |
diff --git a/client/src/app/core/routing/user-right-guard.service.ts b/client/src/app/core/routing/user-right-guard.service.ts index 50c3d8c19..a2ce772db 100644 --- a/client/src/app/core/routing/user-right-guard.service.ts +++ b/client/src/app/core/routing/user-right-guard.service.ts | |||
@@ -1,12 +1,5 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { | 2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router' |
3 | ActivatedRouteSnapshot, | ||
4 | CanActivateChild, | ||
5 | RouterStateSnapshot, | ||
6 | CanActivate, | ||
7 | Router | ||
8 | } from '@angular/router' | ||
9 | |||
10 | import { AuthService } from '../auth/auth.service' | 3 | import { AuthService } from '../auth/auth.service' |
11 | 4 | ||
12 | @Injectable() | 5 | @Injectable() |
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index a804efd28..32a135203 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts | |||
@@ -2,14 +2,16 @@ import { Observable, of, Subject } from 'rxjs' | |||
2 | import { first, map, share, shareReplay, switchMap, tap } from 'rxjs/operators' | 2 | import { first, map, share, shareReplay, switchMap, tap } from 'rxjs/operators' |
3 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient } from '@angular/common/http' |
4 | import { Inject, Injectable, LOCALE_ID } from '@angular/core' | 4 | import { Inject, Injectable, LOCALE_ID } from '@angular/core' |
5 | import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' | 5 | import { getDevLocale, isOnDevLocale, peertubeLocalStorage, sortBy } from '@app/helpers' |
6 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | 6 | import { |
7 | import { sortBy } from '@app/shared/misc/utils' | 7 | getCompleteLocale, |
8 | import { SearchTargetType } from '@shared/models/search/search-target-query.model' | 8 | isDefaultLocale, |
9 | import { ServerStats } from '@shared/models/server' | 9 | peertubeTranslate, |
10 | import { getCompleteLocale, ServerConfig } from '../../../../../shared' | 10 | SearchTargetType, |
11 | import { isDefaultLocale, peertubeTranslate } from '../../../../../shared/models/i18n' | 11 | ServerConfig, |
12 | import { VideoConstant } from '../../../../../shared/models/videos' | 12 | ServerStats, |
13 | VideoConstant | ||
14 | } from '@shared/models' | ||
13 | import { environment } from '../../../environments/environment' | 15 | import { environment } from '../../../environments/environment' |
14 | 16 | ||
15 | @Injectable() | 17 | @Injectable() |
diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.ts index c0189ad32..9dbf22e20 100644 --- a/client/src/app/core/theme/theme.service.ts +++ b/client/src/app/core/theme/theme.service.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import { first } from 'rxjs/operators' | ||
1 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
2 | import { AuthService } from '@app/core/auth' | 3 | import { AuthService } from '../auth' |
3 | import { ServerService } from '@app/core/server' | 4 | import { PluginService } from '../plugins/plugin.service' |
4 | import { environment } from '../../../environments/environment' | 5 | import { ServerService } from '../server' |
5 | import { PluginService } from '@app/core/plugins/plugin.service' | 6 | import { LocalStorageService } from '../wrappers/storage.service' |
7 | import { User } from '../users/user.model' | ||
8 | import { UserService } from '../users/user.service' | ||
6 | import { ServerConfig, ServerConfigTheme } from '@shared/models' | 9 | import { ServerConfig, ServerConfigTheme } from '@shared/models' |
7 | import { first } from 'rxjs/operators' | 10 | import { environment } from '../../../environments/environment' |
8 | import { User } from '@app/shared/users/user.model' | ||
9 | import { UserService } from '@app/shared/users/user.service' | ||
10 | import { LocalStorageService } from '@app/shared/misc/storage.service' | ||
11 | 11 | ||
12 | @Injectable() | 12 | @Injectable() |
13 | export class ThemeService { | 13 | export class ThemeService { |
diff --git a/client/src/app/shared/users/index.ts b/client/src/app/core/users/index.ts index ebd715fb1..7b5a67bc7 100644 --- a/client/src/app/shared/users/index.ts +++ b/client/src/app/core/users/index.ts | |||
@@ -1,3 +1,2 @@ | |||
1 | export * from './user.model' | 1 | export * from './user.model' |
2 | export * from './user.service' | 2 | export * from './user.service' |
3 | export * from './user-notifications.component' | ||
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/core/users/user.model.ts index 3348fe75f..8ecdf9fcd 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | import { Account } from '@app/shared/shared-main/account/account.model' | ||
1 | import { | 2 | import { |
3 | Avatar, | ||
2 | hasUserRight, | 4 | hasUserRight, |
5 | NSFWPolicyType, | ||
3 | User as UserServerModel, | 6 | User as UserServerModel, |
7 | UserAdminFlag, | ||
4 | UserNotificationSetting, | 8 | UserNotificationSetting, |
5 | UserRight, | 9 | UserRight, |
6 | UserRole | 10 | UserRole, |
7 | } from '../../../../../shared/models/users' | 11 | VideoChannel |
8 | import { VideoChannel } from '../../../../../shared/models/videos' | 12 | } from '@shared/models' |
9 | import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' | ||
10 | import { Account } from '@app/shared/account/account.model' | ||
11 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | ||
12 | import { UserAdminFlag } from '@shared/models/users/user-flag.model' | ||
13 | 13 | ||
14 | export class User implements UserServerModel { | 14 | export class User implements UserServerModel { |
15 | static KEYS = { | 15 | static KEYS = { |
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/core/users/user.service.ts index de1c8ec94..ab395b1f9 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/core/users/user.service.ts | |||
@@ -2,18 +2,26 @@ import { has } from 'lodash-es' | |||
2 | import { BytesPipe } from 'ngx-pipes' | 2 | import { BytesPipe } from 'ngx-pipes' |
3 | import { SortMeta } from 'primeng/api' | 3 | import { SortMeta } from 'primeng/api' |
4 | import { from, Observable, of } from 'rxjs' | 4 | import { from, Observable, of } from 'rxjs' |
5 | import { catchError, concatMap, first, map, shareReplay, toArray, throttleTime, filter } from 'rxjs/operators' | 5 | import { catchError, concatMap, filter, first, map, shareReplay, throttleTime, toArray } from 'rxjs/operators' |
6 | import { HttpClient, HttpParams } from '@angular/common/http' | 6 | import { HttpClient, HttpParams } from '@angular/common/http' |
7 | import { Injectable } from '@angular/core' | 7 | import { Injectable } from '@angular/core' |
8 | import { AuthService } from '@app/core/auth' | 8 | import { AuthService } from '@app/core/auth' |
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
10 | import { UserRegister } from '@shared/models/users/user-register.model' | 10 | import { |
11 | import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' | 11 | Avatar, |
12 | import { ResultList, User as UserServerModel, UserCreate, UserRole, UserUpdate, UserUpdateMe, UserVideoQuota } from '../../../../../shared' | 12 | NSFWPolicyType, |
13 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | 13 | ResultList, |
14 | User as UserServerModel, | ||
15 | UserCreate, | ||
16 | UserRegister, | ||
17 | UserRole, | ||
18 | UserUpdate, | ||
19 | UserUpdateMe, | ||
20 | UserVideoQuota | ||
21 | } from '@shared/models' | ||
14 | import { environment } from '../../../environments/environment' | 22 | import { environment } from '../../../environments/environment' |
15 | import { LocalStorageService, SessionStorageService } from '../misc/storage.service' | ||
16 | import { RestExtractor, RestPagination, RestService } from '../rest' | 23 | import { RestExtractor, RestPagination, RestService } from '../rest' |
24 | import { LocalStorageService, SessionStorageService } from '../wrappers/storage.service' | ||
17 | import { User } from './user.model' | 25 | import { User } from './user.model' |
18 | 26 | ||
19 | @Injectable() | 27 | @Injectable() |
diff --git a/client/src/app/core/wrappers/index.ts b/client/src/app/core/wrappers/index.ts new file mode 100644 index 000000000..d82b70070 --- /dev/null +++ b/client/src/app/core/wrappers/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './screen.service' | ||
2 | export * from './storage.service' | ||
diff --git a/client/src/app/shared/misc/screen.service.ts b/client/src/app/core/wrappers/screen.service.ts index a69fad31d..a69fad31d 100644 --- a/client/src/app/shared/misc/screen.service.ts +++ b/client/src/app/core/wrappers/screen.service.ts | |||
diff --git a/client/src/app/shared/misc/storage.service.ts b/client/src/app/core/wrappers/storage.service.ts index 0d4a8ab53..9a60b9785 100644 --- a/client/src/app/shared/misc/storage.service.ts +++ b/client/src/app/core/wrappers/storage.service.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Observable, Subject } from 'rxjs' | 1 | import { Observable, Subject } from 'rxjs' |
3 | import { | ||
4 | peertubeLocalStorage, | ||
5 | peertubeSessionStorage | ||
6 | } from './peertube-web-storage' | ||
7 | import { filter } from 'rxjs/operators' | 2 | import { filter } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | ||
4 | import { peertubeLocalStorage, peertubeSessionStorage } from '@app/helpers' | ||
8 | 5 | ||
9 | abstract class StorageService { | 6 | abstract class StorageService { |
10 | protected instance: Storage | 7 | protected instance: Storage |
diff --git a/client/src/app/header/search-typeahead.component.ts b/client/src/app/header/search-typeahead.component.ts index 7d04e0f6d..c546628ee 100644 --- a/client/src/app/header/search-typeahead.component.ts +++ b/client/src/app/header/search-typeahead.component.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import { of } from 'rxjs' | 1 | import { of } from 'rxjs' |
2 | import { first, tap, delay } from 'rxjs/operators' | 2 | import { first, tap } from 'rxjs/operators' |
3 | import { ListKeyManager } from '@angular/cdk/a11y' | 3 | import { ListKeyManager } from '@angular/cdk/a11y' |
4 | import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren, AfterViewChecked } from '@angular/core' | 4 | import { AfterViewChecked, AfterViewInit, Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core' |
5 | import { ActivatedRoute, Params, Router } from '@angular/router' | 5 | import { ActivatedRoute, Params, Router } from '@angular/router' |
6 | import { AuthService, ServerService } from '@app/core' | 6 | import { AuthService, ServerService } from '@app/core' |
7 | import { ServerConfig } from '@shared/models' | 7 | import { SearchTargetType, ServerConfig } from '@shared/models' |
8 | import { SearchTargetType } from '@shared/models/search/search-target-query.model' | ||
9 | import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from './suggestion.component' | 8 | import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from './suggestion.component' |
10 | 9 | ||
11 | @Component({ | 10 | @Component({ |
diff --git a/client/src/app/header/suggestion.component.ts b/client/src/app/header/suggestion.component.ts index 250a5411e..c874212a5 100644 --- a/client/src/app/header/suggestion.component.ts +++ b/client/src/app/header/suggestion.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Input, Component, Output, EventEmitter, OnInit, ChangeDetectionStrategy, OnChanges } from '@angular/core' | ||
2 | import { RouterLink } from '@angular/router' | ||
3 | import { ListKeyManagerOption } from '@angular/cdk/a11y' | 1 | import { ListKeyManagerOption } from '@angular/cdk/a11y' |
2 | import { Component, Input, OnInit } from '@angular/core' | ||
3 | import { RouterLink } from '@angular/router' | ||
4 | 4 | ||
5 | export type SuggestionPayload = { | 5 | export type SuggestionPayload = { |
6 | text: string | 6 | text: string |
diff --git a/client/src/app/shared/misc/constants.ts b/client/src/app/helpers/constants.ts index bb4a0884e..bb4a0884e 100644 --- a/client/src/app/shared/misc/constants.ts +++ b/client/src/app/helpers/constants.ts | |||
diff --git a/client/src/app/shared/i18n/i18n-utils.ts b/client/src/app/helpers/i18n-utils.ts index 30d65a2a2..bbfb12959 100644 --- a/client/src/app/shared/i18n/i18n-utils.ts +++ b/client/src/app/helpers/i18n-utils.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { environment } from '../../../environments/environment' | 1 | import { environment } from '../../environments/environment' |
2 | 2 | ||
3 | function isOnDevLocale () { | 3 | function isOnDevLocale () { |
4 | return environment.production === false && window.location.search === '?lang=fr' | 4 | return environment.production === false && window.location.search === '?lang=fr' |
diff --git a/client/src/app/helpers/index.ts b/client/src/app/helpers/index.ts new file mode 100644 index 000000000..06806402e --- /dev/null +++ b/client/src/app/helpers/index.ts | |||
@@ -0,0 +1,6 @@ | |||
1 | export * from './locales' | ||
2 | export * from './constants' | ||
3 | export * from './i18n-utils' | ||
4 | export * from './peertube-web-storage' | ||
5 | export * from './utils' | ||
6 | export * from './zone' | ||
diff --git a/client/src/app/helpers/locales/index.ts b/client/src/app/helpers/locales/index.ts new file mode 100644 index 000000000..b0e4d6148 --- /dev/null +++ b/client/src/app/helpers/locales/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './oc' | |||
diff --git a/client/src/app/shared/locale/oc.ts b/client/src/app/helpers/locales/oc.ts index d3b2e8407..d3b2e8407 100644 --- a/client/src/app/shared/locale/oc.ts +++ b/client/src/app/helpers/locales/oc.ts | |||
diff --git a/client/src/app/shared/misc/peertube-web-storage.ts b/client/src/app/helpers/peertube-web-storage.ts index 0db1301bd..0db1301bd 100644 --- a/client/src/app/shared/misc/peertube-web-storage.ts +++ b/client/src/app/helpers/peertube-web-storage.ts | |||
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/helpers/utils.ts index bc3ab85b3..879f697f4 100644 --- a/client/src/app/shared/misc/utils.ts +++ b/client/src/app/helpers/utils.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { DatePipe } from '@angular/common' | 1 | import { DatePipe } from '@angular/common' |
2 | import { environment } from '../../../environments/environment' | 2 | import { environment } from '../../environments/environment' |
3 | import { AuthService } from '../../core/auth' | 3 | import { AuthService } from '../core/auth' |
4 | 4 | ||
5 | // Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript | 5 | // Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript |
6 | function getParameterByName (name: string, url: string) { | 6 | function getParameterByName (name: string, url: string) { |
diff --git a/client/src/app/shared/rxjs/zone.ts b/client/src/app/helpers/zone.ts index 74eed7032..74eed7032 100644 --- a/client/src/app/shared/rxjs/zone.ts +++ b/client/src/app/helpers/zone.ts | |||
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index fff4b43f6..cbc51ee21 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -1,16 +1,12 @@ | |||
1 | import { Component, ElementRef, OnInit, ViewChild, AfterViewInit } from '@angular/core' | ||
2 | import { Notifier, RedirectService } from '@app/core' | ||
3 | import { UserService } from '@app/shared' | ||
4 | import { AuthService } from '../core' | ||
5 | import { FormReactive } from '../shared' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
8 | import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' | ||
9 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | ||
10 | import { ActivatedRoute } from '@angular/router' | ||
11 | import { ServerConfig, RegisteredExternalAuthConfig } from '@shared/models/server/server-config.model' | ||
12 | import { environment } from 'src/environments/environment' | 1 | import { environment } from 'src/environments/environment' |
2 | import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core' | ||
3 | import { ActivatedRoute } from '@angular/router' | ||
4 | import { AuthService, Notifier, RedirectService, UserService } from '@app/core' | ||
13 | import { HooksService } from '@app/core/plugins/hooks.service' | 5 | import { HooksService } from '@app/core/plugins/hooks.service' |
6 | import { FormReactive, FormValidatorService, LoginValidatorsService } from '@app/shared/shared-forms' | ||
7 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { RegisteredExternalAuthConfig, ServerConfig } from '@shared/models' | ||
14 | 10 | ||
15 | @Component({ | 11 | @Component({ |
16 | selector: 'my-login', | 12 | selector: 'my-login', |
diff --git a/client/src/app/login/login.module.ts b/client/src/app/login/login.module.ts index 1de72dbaa..c41902426 100644 --- a/client/src/app/login/login.module.ts +++ b/client/src/app/login/login.module.ts | |||
@@ -1,13 +1,17 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | 2 | import { SharedFormModule } from '@app/shared/shared-forms' | |
3 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | ||
4 | import { SharedMainModule } from '@app/shared/shared-main' | ||
3 | import { LoginRoutingModule } from './login-routing.module' | 5 | import { LoginRoutingModule } from './login-routing.module' |
4 | import { LoginComponent } from './login.component' | 6 | import { LoginComponent } from './login.component' |
5 | import { SharedModule } from '../shared' | ||
6 | 7 | ||
7 | @NgModule({ | 8 | @NgModule({ |
8 | imports: [ | 9 | imports: [ |
9 | LoginRoutingModule, | 10 | LoginRoutingModule, |
10 | SharedModule | 11 | |
12 | SharedMainModule, | ||
13 | SharedFormModule, | ||
14 | SharedGlobalIconModule | ||
11 | ], | 15 | ], |
12 | 16 | ||
13 | declarations: [ | 17 | declarations: [ |
diff --git a/client/src/app/menu/avatar-notification.component.ts b/client/src/app/menu/avatar-notification.component.ts index c447f031c..9a64faa6a 100644 --- a/client/src/app/menu/avatar-notification.component.ts +++ b/client/src/app/menu/avatar-notification.component.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core' | ||
2 | import { User } from '../shared/users/user.model' | ||
3 | import { UserNotificationService } from '@app/shared/users/user-notification.service' | ||
4 | import { Subject, Subscription } from 'rxjs' | 1 | import { Subject, Subscription } from 'rxjs' |
5 | import { Notifier, UserNotificationSocket } from '@app/core' | ||
6 | import { NgbPopover } from '@ng-bootstrap/ng-bootstrap' | ||
7 | import { NavigationEnd, Router } from '@angular/router' | ||
8 | import { filter } from 'rxjs/operators' | 2 | import { filter } from 'rxjs/operators' |
3 | import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core' | ||
4 | import { NavigationEnd, Router } from '@angular/router' | ||
5 | import { Notifier, User, UserNotificationSocket } from '@app/core' | ||
6 | import { UserNotificationService } from '@app/shared/shared-main' | ||
7 | import { NgbPopover } from '@ng-bootstrap/ng-bootstrap' | ||
9 | 8 | ||
10 | @Component({ | 9 | @Component({ |
11 | selector: 'my-avatar-notification', | 10 | selector: 'my-avatar-notification', |
diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts index c9b775921..3e89f72b8 100644 --- a/client/src/app/menu/language-chooser.component.ts +++ b/client/src/app/menu/language-chooser.component.ts | |||
@@ -1,9 +1,7 @@ | |||
1 | import { Component, ElementRef, ViewChild, Inject, LOCALE_ID } from '@angular/core' | 1 | import { Component, ElementRef, Inject, LOCALE_ID, ViewChild } from '@angular/core' |
2 | import { I18N_LOCALES, getShortLocale } from '../../../../shared' | 2 | import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { sortBy } from '@app/shared/misc/utils' | 4 | import { getCompleteLocale, getShortLocale, I18N_LOCALES } from '@shared/models' |
5 | import { getCompleteLocale } from '@shared/models/i18n' | ||
6 | import { isOnDevLocale, getDevLocale } from '@app/shared/i18n/i18n-utils' | ||
7 | 5 | ||
8 | @Component({ | 6 | @Component({ |
9 | selector: 'my-language-chooser', | 7 | selector: 'my-language-chooser', |
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts index ba3342541..2dbe695c9 100644 --- a/client/src/app/menu/menu.component.ts +++ b/client/src/app/menu/menu.component.ts | |||
@@ -1,14 +1,10 @@ | |||
1 | import { HotkeysService } from 'angular2-hotkeys' | ||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | 2 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { UserRight } from '../../../../shared/models/users/user-right.enum' | 3 | import { AuthService, AuthStatus, RedirectService, ScreenService, ServerService, User, UserService } from '@app/core' |
3 | import { AuthService, AuthStatus, RedirectService, ServerService } from '../core' | ||
4 | import { User } from '@app/shared/users/user.model' | ||
5 | import { UserService } from '@app/shared/users/user.service' | ||
6 | import { LanguageChooserComponent } from '@app/menu/language-chooser.component' | 4 | import { LanguageChooserComponent } from '@app/menu/language-chooser.component' |
7 | import { HotkeysService } from 'angular2-hotkeys' | ||
8 | import { ServerConfig, VideoConstant } from '@shared/models' | ||
9 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' | 5 | import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { ScreenService } from '@app/shared/misc/screen.service' | 7 | import { ServerConfig, UserRight, VideoConstant } from '@shared/models' |
12 | 8 | ||
13 | @Component({ | 9 | @Component({ |
14 | selector: 'my-menu', | 10 | selector: 'my-menu', |
diff --git a/client/src/app/shared/confirm/confirm.component.html b/client/src/app/modal/confirm.component.html index dbc8c23e3..dbc8c23e3 100644 --- a/client/src/app/shared/confirm/confirm.component.html +++ b/client/src/app/modal/confirm.component.html | |||
diff --git a/client/src/app/shared/confirm/confirm.component.scss b/client/src/app/modal/confirm.component.scss index ed226bc09..ed226bc09 100644 --- a/client/src/app/shared/confirm/confirm.component.scss +++ b/client/src/app/modal/confirm.component.scss | |||
diff --git a/client/src/app/shared/confirm/confirm.component.ts b/client/src/app/modal/confirm.component.ts index c6e40fe72..2c7ef46c4 100644 --- a/client/src/app/shared/confirm/confirm.component.ts +++ b/client/src/app/modal/confirm.component.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' |
2 | import { ConfirmService } from '@app/core/confirm/confirm.service' | 2 | import { ConfirmService } from '@app/core/confirm/confirm.service' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { POP_STATE_MODAL_DISMISS } from '@app/helpers' |
4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
5 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 5 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
6 | import { POP_STATE_MODAL_DISMISS } from '@app/shared/misc/constants' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
9 | selector: 'my-confirm', | 9 | selector: 'my-confirm', |
diff --git a/client/src/app/modal/instance-config-warning-modal.component.ts b/client/src/app/modal/instance-config-warning-modal.component.ts index 5e1433548..1c90f190a 100644 --- a/client/src/app/modal/instance-config-warning-modal.component.ts +++ b/client/src/app/modal/instance-config-warning-modal.component.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import { Component, ElementRef, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, ViewChild } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier, UserService } from '@app/core' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { About } from '@shared/models/server' | 4 | import { About } from '@shared/models/server' |
5 | import { UserService } from '@app/shared' | ||
6 | 5 | ||
7 | @Component({ | 6 | @Component({ |
8 | selector: 'my-instance-config-warning-modal', | 7 | selector: 'my-instance-config-warning-modal', |
diff --git a/client/src/app/modal/quick-settings-modal.component.html b/client/src/app/modal/quick-settings-modal.component.html index 188a51173..b95c14309 100644 --- a/client/src/app/modal/quick-settings-modal.component.html +++ b/client/src/app/modal/quick-settings-modal.component.html | |||
@@ -7,7 +7,7 @@ | |||
7 | <div class="modal-body"> | 7 | <div class="modal-body"> |
8 | <div i18n class="mb-4 quick-settings-title">Display settings</div> | 8 | <div i18n class="mb-4 quick-settings-title">Display settings</div> |
9 | 9 | ||
10 | <my-account-video-settings | 10 | <my-user-video-settings |
11 | *ngIf="!isUserLoggedIn()" | 11 | *ngIf="!isUserLoggedIn()" |
12 | [user]="user" [userInformationLoaded]="userInformationLoaded" [reactiveUpdate]="true" [notifyOnUpdate]="true" | 12 | [user]="user" [userInformationLoaded]="userInformationLoaded" [reactiveUpdate]="true" [notifyOnUpdate]="true" |
13 | > | 13 | > |
@@ -15,13 +15,13 @@ | |||
15 | <ng-container ngProjectAs="inner-title"> | 15 | <ng-container ngProjectAs="inner-title"> |
16 | <div i18n class="mb-4 mt-4 quick-settings-title">Video settings</div> | 16 | <div i18n class="mb-4 mt-4 quick-settings-title">Video settings</div> |
17 | </ng-container> | 17 | </ng-container> |
18 | </my-account-video-settings> | 18 | </my-user-video-settings> |
19 | 19 | ||
20 | <div i18n class="mb-4 mt-4 quick-settings-title">Interface settings</div> | 20 | <div i18n class="mb-4 mt-4 quick-settings-title">Interface settings</div> |
21 | 21 | ||
22 | <my-account-interface-settings | 22 | <my-user-interface-settings |
23 | *ngIf="!isUserLoggedIn()" | 23 | *ngIf="!isUserLoggedIn()" |
24 | [user]="user" [userInformationLoaded]="userInformationLoaded" [reactiveUpdate]="true" [notifyOnUpdate]="true" | 24 | [user]="user" [userInformationLoaded]="userInformationLoaded" [reactiveUpdate]="true" [notifyOnUpdate]="true" |
25 | ></my-account-interface-settings> | 25 | ></my-user-interface-settings> |
26 | </div> | 26 | </div> |
27 | </ng-template> | 27 | </ng-template> |
diff --git a/client/src/app/modal/quick-settings-modal.component.ts b/client/src/app/modal/quick-settings-modal.component.ts index 155794d1b..95726ab63 100644 --- a/client/src/app/modal/quick-settings-modal.component.ts +++ b/client/src/app/modal/quick-settings-modal.component.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import { Component, ViewChild, OnInit } from '@angular/core' | ||
2 | import { AuthService, AuthStatus } from '@app/core' | ||
3 | import { FormReactive, FormValidatorService, UserService, User } from '@app/shared' | ||
4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||
5 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | ||
6 | import { ReplaySubject } from 'rxjs' | 1 | import { ReplaySubject } from 'rxjs' |
7 | import { LocalStorageService } from '@app/shared/misc/storage.service' | ||
8 | import { filter } from 'rxjs/operators' | 2 | import { filter } from 'rxjs/operators' |
3 | import { Component, OnInit, ViewChild } from '@angular/core' | ||
4 | import { AuthService, AuthStatus, LocalStorageService, User, UserService } from '@app/core' | ||
5 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | ||
6 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||
7 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | ||
9 | 8 | ||
10 | @Component({ | 9 | @Component({ |
11 | selector: 'my-quick-settings', | 10 | selector: 'my-quick-settings', |
diff --git a/client/src/app/modal/welcome-modal.component.ts b/client/src/app/modal/welcome-modal.component.ts index e022776e3..c2f289600 100644 --- a/client/src/app/modal/welcome-modal.component.ts +++ b/client/src/app/modal/welcome-modal.component.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Component, ElementRef, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, ViewChild } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier, UserService } from '@app/core' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { UserService } from '@app/shared' | ||
5 | 4 | ||
6 | @Component({ | 5 | @Component({ |
7 | selector: 'my-welcome-modal', | 6 | selector: 'my-welcome-modal', |
diff --git a/client/src/app/reset-password/reset-password-routing.module.ts b/client/src/app/reset-password/reset-password-routing.module.ts index b41069568..d443b51d6 100644 --- a/client/src/app/reset-password/reset-password-routing.module.ts +++ b/client/src/app/reset-password/reset-password-routing.module.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | |||
4 | import { MetaGuard } from '@ngx-meta/core' | 3 | import { MetaGuard } from '@ngx-meta/core' |
5 | |||
6 | import { ResetPasswordComponent } from './reset-password.component' | 4 | import { ResetPasswordComponent } from './reset-password.component' |
7 | 5 | ||
8 | const resetPasswordRoutes: Routes = [ | 6 | const resetPasswordRoutes: Routes = [ |
diff --git a/client/src/app/reset-password/reset-password.component.ts b/client/src/app/reset-password/reset-password.component.ts index 07b93ee73..8d50e9839 100644 --- a/client/src/app/reset-password/reset-password.component.ts +++ b/client/src/app/reset-password/reset-password.component.ts | |||
@@ -1,10 +1,8 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { UserService, UserValidatorsService, FormReactive } from '@app/shared' | 3 | import { Notifier, UserService } from '@app/core' |
4 | import { Notifier } from '@app/core' | 4 | import { FormReactive, FormValidatorService, ResetPasswordValidatorsService, UserValidatorsService } from '@app/shared/shared-forms' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
7 | import { ResetPasswordValidatorsService } from '@app/shared/forms/form-validators/reset-password-validators.service' | ||
8 | 6 | ||
9 | @Component({ | 7 | @Component({ |
10 | selector: 'my-login', | 8 | selector: 'my-login', |
diff --git a/client/src/app/reset-password/reset-password.module.ts b/client/src/app/reset-password/reset-password.module.ts index c2711981a..c77f1c4b0 100644 --- a/client/src/app/reset-password/reset-password.module.ts +++ b/client/src/app/reset-password/reset-password.module.ts | |||
@@ -1,13 +1,15 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | 2 | import { SharedFormModule } from '@app/shared/shared-forms' | |
3 | import { SharedMainModule } from '@app/shared/shared-main' | ||
3 | import { ResetPasswordRoutingModule } from './reset-password-routing.module' | 4 | import { ResetPasswordRoutingModule } from './reset-password-routing.module' |
4 | import { ResetPasswordComponent } from './reset-password.component' | 5 | import { ResetPasswordComponent } from './reset-password.component' |
5 | import { SharedModule } from '../shared' | ||
6 | 6 | ||
7 | @NgModule({ | 7 | @NgModule({ |
8 | imports: [ | 8 | imports: [ |
9 | ResetPasswordRoutingModule, | 9 | ResetPasswordRoutingModule, |
10 | SharedModule | 10 | |
11 | SharedMainModule, | ||
12 | SharedFormModule | ||
11 | ], | 13 | ], |
12 | 14 | ||
13 | declarations: [ | 15 | declarations: [ |
diff --git a/client/src/app/search/advanced-search.model.ts b/client/src/app/search/advanced-search.model.ts index 643cc9a29..516854a8c 100644 --- a/client/src/app/search/advanced-search.model.ts +++ b/client/src/app/search/advanced-search.model.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import { SearchTargetType } from '@shared/models/search/search-target-query.model' | 1 | import { NSFWQuery, SearchTargetType } from '@shared/models' |
2 | import { NSFWQuery } from '../../../../shared/models/search' | ||
3 | 2 | ||
4 | export class AdvancedSearch { | 3 | export class AdvancedSearch { |
5 | startDate: string // ISO 8601 | 4 | startDate: string // ISO 8601 |
diff --git a/client/src/app/shared/angular/highlight.pipe.ts b/client/src/app/search/highlight.pipe.ts index 50ee5c1bd..50ee5c1bd 100644 --- a/client/src/app/shared/angular/highlight.pipe.ts +++ b/client/src/app/search/highlight.pipe.ts | |||
diff --git a/client/src/app/search/search-filters.component.ts b/client/src/app/search/search-filters.component.ts index af76260a7..14a5d0484 100644 --- a/client/src/app/search/search-filters.component.ts +++ b/client/src/app/search/search-filters.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { ValidatorFn } from '@angular/forms' | 2 | import { ValidatorFn } from '@angular/forms' |
3 | import { VideoValidatorsService } from '@app/shared' | ||
4 | import { ServerService } from '@app/core' | 3 | import { ServerService } from '@app/core' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
6 | import { AdvancedSearch } from '@app/search/advanced-search.model' | 4 | import { AdvancedSearch } from '@app/search/advanced-search.model' |
7 | import { ServerConfig, VideoConstant } from '../../../../shared' | 5 | import { VideoValidatorsService } from '@app/shared/shared-forms' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { ServerConfig, VideoConstant } from '@shared/models' | ||
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-search-filters', | 10 | selector: 'my-search-filters', |
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts index 6486085be..83b06e0ce 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/search/search.component.ts | |||
@@ -1,20 +1,15 @@ | |||
1 | import { forkJoin, of, Subscription } from 'rxjs' | 1 | import { forkJoin, of, Subscription } from 'rxjs' |
2 | import { Component, OnDestroy, OnInit } from '@angular/core' | 2 | import { Component, OnDestroy, OnInit } from '@angular/core' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { AuthService, Notifier, ServerService } from '@app/core' | 4 | import { AuthService, ComponentPagination, HooksService, Notifier, ServerService, User, UserService } from '@app/core' |
5 | import { HooksService } from '@app/core/plugins/hooks.service' | 5 | import { immutableAssign } from '@app/helpers' |
6 | import { AdvancedSearch } from '@app/search/advanced-search.model' | 6 | import { Video, VideoChannel } from '@app/shared/shared-main' |
7 | import { SearchService } from '@app/search/search.service' | 7 | import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature' |
8 | import { User, UserService } from '@app/shared' | ||
9 | import { immutableAssign } from '@app/shared/misc/utils' | ||
10 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | ||
11 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
12 | import { MiniatureDisplayOptions } from '@app/shared/video/video-miniature.component' | ||
13 | import { Video } from '@app/shared/video/video.model' | ||
14 | import { MetaService } from '@ngx-meta/core' | 8 | import { MetaService } from '@ngx-meta/core' |
15 | import { I18n } from '@ngx-translate/i18n-polyfill' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
16 | import { ServerConfig } from '@shared/models' | 10 | import { SearchTargetType, ServerConfig } from '@shared/models' |
17 | import { SearchTargetType } from '@shared/models/search/search-target-query.model' | 11 | import { AdvancedSearch } from './advanced-search.model' |
12 | import { SearchService } from './search.service' | ||
18 | 13 | ||
19 | @Component({ | 14 | @Component({ |
20 | selector: 'my-search', | 15 | selector: 'my-search', |
diff --git a/client/src/app/search/search.module.ts b/client/src/app/search/search.module.ts index df5459802..65c954de8 100644 --- a/client/src/app/search/search.module.ts +++ b/client/src/app/search/search.module.ts | |||
@@ -1,11 +1,15 @@ | |||
1 | import { TagInputModule } from 'ngx-chips' | 1 | import { TagInputModule } from 'ngx-chips' |
2 | import { NgModule } from '@angular/core' | 2 | import { NgModule } from '@angular/core' |
3 | import { SearchFiltersComponent } from '@app/search/search-filters.component' | 3 | import { SharedFormModule } from '@app/shared/shared-forms' |
4 | import { SearchRoutingModule } from '@app/search/search-routing.module' | 4 | import { SharedMainModule } from '@app/shared/shared-main' |
5 | import { SearchComponent } from '@app/search/search.component' | 5 | import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' |
6 | import { SearchService } from '@app/search/search.service' | 6 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' |
7 | import { SharedModule } from '../shared' | ||
8 | import { ChannelLazyLoadResolver } from './channel-lazy-load.resolver' | 7 | import { ChannelLazyLoadResolver } from './channel-lazy-load.resolver' |
8 | import { HighlightPipe } from './highlight.pipe' | ||
9 | import { SearchFiltersComponent } from './search-filters.component' | ||
10 | import { SearchRoutingModule } from './search-routing.module' | ||
11 | import { SearchComponent } from './search.component' | ||
12 | import { SearchService } from './search.service' | ||
9 | import { VideoLazyLoadResolver } from './video-lazy-load.resolver' | 13 | import { VideoLazyLoadResolver } from './video-lazy-load.resolver' |
10 | 14 | ||
11 | @NgModule({ | 15 | @NgModule({ |
@@ -13,7 +17,10 @@ import { VideoLazyLoadResolver } from './video-lazy-load.resolver' | |||
13 | TagInputModule, | 17 | TagInputModule, |
14 | 18 | ||
15 | SearchRoutingModule, | 19 | SearchRoutingModule, |
16 | SharedModule | 20 | SharedMainModule, |
21 | SharedFormModule, | ||
22 | SharedUserSubscriptionModule, | ||
23 | SharedVideoMiniatureModule | ||
17 | ], | 24 | ], |
18 | 25 | ||
19 | declarations: [ | 26 | declarations: [ |
@@ -29,7 +36,8 @@ import { VideoLazyLoadResolver } from './video-lazy-load.resolver' | |||
29 | providers: [ | 36 | providers: [ |
30 | SearchService, | 37 | SearchService, |
31 | VideoLazyLoadResolver, | 38 | VideoLazyLoadResolver, |
32 | ChannelLazyLoadResolver | 39 | ChannelLazyLoadResolver, |
40 | HighlightPipe | ||
33 | ] | 41 | ] |
34 | }) | 42 | }) |
35 | export class SearchModule { } | 43 | export class SearchModule { } |
diff --git a/client/src/app/search/search.service.ts b/client/src/app/search/search.service.ts index fdb12ea2c..36342034f 100644 --- a/client/src/app/search/search.service.ts +++ b/client/src/app/search/search.service.ts | |||
@@ -2,17 +2,13 @@ import { Observable } from 'rxjs' | |||
2 | import { catchError, map, switchMap } from 'rxjs/operators' | 2 | import { catchError, map, switchMap } from 'rxjs/operators' |
3 | import { HttpClient, HttpParams } from '@angular/common/http' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
4 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core' | ||
6 | import { peertubeLocalStorage } from '@app/helpers' | ||
5 | import { AdvancedSearch } from '@app/search/advanced-search.model' | 7 | import { AdvancedSearch } from '@app/search/advanced-search.model' |
6 | import { RestExtractor, RestPagination, RestService } from '@app/shared' | 8 | import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' |
7 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | 9 | import { ResultList, Video as VideoServerModel, VideoChannel as VideoChannelServerModel } from '@shared/models' |
8 | import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model' | ||
9 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
10 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
11 | import { Video } from '@app/shared/video/video.model' | ||
12 | import { VideoService } from '@app/shared/video/video.service' | ||
13 | import { ResultList, Video as VideoServerModel, VideoChannel as VideoChannelServerModel } from '../../../../shared' | ||
14 | import { environment } from '../../environments/environment' | ||
15 | import { SearchTargetType } from '@shared/models/search/search-target-query.model' | 10 | import { SearchTargetType } from '@shared/models/search/search-target-query.model' |
11 | import { environment } from '../../environments/environment' | ||
16 | 12 | ||
17 | @Injectable() | 13 | @Injectable() |
18 | export class SearchService { | 14 | export class SearchService { |
diff --git a/client/src/app/shared/angular/object-length.pipe.ts b/client/src/app/shared/angular/object-length.pipe.ts deleted file mode 100644 index 84d182052..000000000 --- a/client/src/app/shared/angular/object-length.pipe.ts +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | import { Pipe, PipeTransform } from '@angular/core' | ||
2 | |||
3 | @Pipe({ name: 'myObjectLength' }) | ||
4 | export class ObjectLengthPipe implements PipeTransform { | ||
5 | transform (value: Object) { | ||
6 | return Object.keys(value).length | ||
7 | } | ||
8 | } | ||
diff --git a/client/src/app/shared/blocklist/index.ts b/client/src/app/shared/blocklist/index.ts deleted file mode 100644 index 188057b19..000000000 --- a/client/src/app/shared/blocklist/index.ts +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | export * from './blocklist.service' | ||
2 | export * from './account-block.model' | ||
3 | export * from './server-blocklist.component' | ||
4 | export * from './account-blocklist.component' | ||
diff --git a/client/src/app/shared/forms/index.ts b/client/src/app/shared/forms/index.ts deleted file mode 100644 index 8febbfee9..000000000 --- a/client/src/app/shared/forms/index.ts +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | export * from './form-validators' | ||
2 | export * from './form-reactive' | ||
3 | export * from './reactive-file.component' | ||
4 | export * from './textarea-autoresize.directive' | ||
diff --git a/client/src/app/shared/index.ts b/client/src/app/shared/index.ts deleted file mode 100644 index 8be578d9f..000000000 --- a/client/src/app/shared/index.ts +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | export * from './auth' | ||
2 | export * from './forms' | ||
3 | export * from './rest' | ||
4 | export * from './users' | ||
5 | export * from './video-abuse' | ||
6 | export * from './video-block' | ||
7 | export * from './shared.module' | ||
diff --git a/client/src/app/shared/moderation/index.ts b/client/src/app/shared/moderation/index.ts deleted file mode 100644 index 9a77c64c0..000000000 --- a/client/src/app/shared/moderation/index.ts +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | export * from './user-ban-modal.component' | ||
2 | export * from './user-moderation-dropdown.component' | ||
diff --git a/client/src/app/shared/overview/index.ts b/client/src/app/shared/overview/index.ts deleted file mode 100644 index 2f7e41298..000000000 --- a/client/src/app/shared/overview/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './overview.service' | ||
diff --git a/client/src/app/shared/forms/form-reactive.ts b/client/src/app/shared/shared-forms/form-reactive.ts index 6aec2937d..caa31d831 100644 --- a/client/src/app/shared/forms/form-reactive.ts +++ b/client/src/app/shared/shared-forms/form-reactive.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { FormGroup } from '@angular/forms' | 1 | import { FormGroup } from '@angular/forms' |
2 | import { BuildFormArgument, BuildFormDefaultValues, FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 2 | import { BuildFormArgument, BuildFormDefaultValues, FormValidatorService } from './form-validators' |
3 | 3 | ||
4 | export type FormReactiveErrors = { [ id: string ]: string | FormReactiveErrors } | 4 | export type FormReactiveErrors = { [ id: string ]: string | FormReactiveErrors } |
5 | export type FormReactiveValidationMessages = { | 5 | export type FormReactiveValidationMessages = { |
diff --git a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/batch-domains-validators.service.ts index 46fa6514d..f270b602b 100644 --- a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/batch-domains-validators.service.ts | |||
@@ -1,7 +1,8 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
2 | import { Validators, ValidatorFn } from '@angular/forms' | ||
3 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator, validateHost } from '@app/shared/forms/form-validators' | 2 | import { ValidatorFn, Validators } from '@angular/forms' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
4 | import { BuildFormValidator } from './form-validator.service' | ||
5 | import { validateHost } from './host' | ||
5 | 6 | ||
6 | @Injectable() | 7 | @Injectable() |
7 | export class BatchDomainsValidatorsService { | 8 | export class BatchDomainsValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/custom-config-validators.service.ts index fdb19e06a..c77aba6a1 100644 --- a/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/custom-config-validators.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Validators } from '@angular/forms' | 1 | import { Validators } from '@angular/forms' |
2 | import { I18n } from '@ngx-translate/i18n-polyfill' | 2 | import { I18n } from '@ngx-translate/i18n-polyfill' |
3 | import { BuildFormValidator } from '@app/shared' | 3 | import { BuildFormValidator } from './form-validator.service' |
4 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
diff --git a/client/src/app/shared/forms/form-validators/form-validator.service.ts b/client/src/app/shared/shared-forms/form-validators/form-validator.service.ts index 249fdf119..dec7d8d9a 100644 --- a/client/src/app/shared/forms/form-validators/form-validator.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/form-validator.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { FormBuilder, FormControl, FormGroup, ValidatorFn } from '@angular/forms' | 1 | import { FormBuilder, FormControl, FormGroup, ValidatorFn } from '@angular/forms' |
2 | import { Injectable } from '@angular/core' | 2 | import { Injectable } from '@angular/core' |
3 | import { FormReactiveErrors, FormReactiveValidationMessages } from '@app/shared/forms/form-reactive' | 3 | import { FormReactiveErrors, FormReactiveValidationMessages } from '../form-reactive' |
4 | 4 | ||
5 | export type BuildFormValidator = { | 5 | export type BuildFormValidator = { |
6 | VALIDATORS: ValidatorFn[], | 6 | VALIDATORS: ValidatorFn[], |
diff --git a/client/src/app/shared/forms/form-validators/host.ts b/client/src/app/shared/shared-forms/form-validators/host.ts index c18a35f9b..c18a35f9b 100644 --- a/client/src/app/shared/forms/form-validators/host.ts +++ b/client/src/app/shared/shared-forms/form-validators/host.ts | |||
diff --git a/client/src/app/shared/forms/form-validators/index.ts b/client/src/app/shared/shared-forms/form-validators/index.ts index 4a01b1622..8b71841a9 100644 --- a/client/src/app/shared/forms/form-validators/index.ts +++ b/client/src/app/shared/shared-forms/form-validators/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './batch-domains-validators.service' | ||
1 | export * from './custom-config-validators.service' | 2 | export * from './custom-config-validators.service' |
2 | export * from './form-validator.service' | 3 | export * from './form-validator.service' |
3 | export * from './host' | 4 | export * from './host' |
@@ -6,11 +7,11 @@ export * from './login-validators.service' | |||
6 | export * from './reset-password-validators.service' | 7 | export * from './reset-password-validators.service' |
7 | export * from './user-validators.service' | 8 | export * from './user-validators.service' |
8 | export * from './video-abuse-validators.service' | 9 | export * from './video-abuse-validators.service' |
10 | export * from './video-accept-ownership-validators.service' | ||
9 | export * from './video-block-validators.service' | 11 | export * from './video-block-validators.service' |
12 | export * from './video-captions-validators.service' | ||
13 | export * from './video-change-ownership-validators.service' | ||
10 | export * from './video-channel-validators.service' | 14 | export * from './video-channel-validators.service' |
11 | export * from './video-comment-validators.service' | 15 | export * from './video-comment-validators.service' |
12 | export * from './video-validators.service' | ||
13 | export * from './video-playlist-validators.service' | 16 | export * from './video-playlist-validators.service' |
14 | export * from './video-captions-validators.service' | 17 | export * from './video-validators.service' |
15 | export * from './video-change-ownership-validators.service' | ||
16 | export * from './video-accept-ownership-validators.service' | ||
diff --git a/client/src/app/shared/forms/form-validators/instance-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts index cc5f3c5a1..96a35a48f 100644 --- a/client/src/app/shared/forms/form-validators/instance-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { BuildFormValidator } from '@app/shared' | 3 | import { BuildFormValidator } from './form-validator.service' |
4 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
diff --git a/client/src/app/shared/forms/form-validators/login-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts index 9d68f830c..a5837357e 100644 --- a/client/src/app/shared/forms/form-validators/login-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class LoginValidatorsService { | 7 | export class LoginValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/reset-password-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/reset-password-validators.service.ts index df206254d..d2085a309 100644 --- a/client/src/app/shared/forms/form-validators/reset-password-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/reset-password-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class ResetPasswordValidatorsService { | 7 | export class ResetPasswordValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/user-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/user-validators.service.ts index 13b9228d4..bd3030a54 100644 --- a/client/src/app/shared/forms/form-validators/user-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/user-validators.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { BuildFormValidator } from '@app/shared' | 3 | import { BuildFormValidator } from './form-validator.service' |
4 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
diff --git a/client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-abuse-validators.service.ts index fcc966b84..aae56d607 100644 --- a/client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-abuse-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class VideoAbuseValidatorsService { | 7 | export class VideoAbuseValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/video-accept-ownership-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-accept-ownership-validators.service.ts index 48c7054a4..998d616ec 100644 --- a/client/src/app/shared/forms/form-validators/video-accept-ownership-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-accept-ownership-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class VideoAcceptOwnershipValidatorsService { | 7 | export class VideoAcceptOwnershipValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/video-block-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts index dc8257761..ddf0ab5eb 100644 --- a/client/src/app/shared/forms/form-validators/video-block-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class VideoBlockValidatorsService { | 7 | export class VideoBlockValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/video-captions-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-captions-validators.service.ts index d1b4667bb..280d28414 100644 --- a/client/src/app/shared/forms/form-validators/video-captions-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-captions-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class VideoCaptionsValidatorsService { | 7 | export class VideoCaptionsValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/video-change-ownership-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts index c6fbb7538..59659defd 100644 --- a/client/src/app/shared/forms/form-validators/video-change-ownership-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { AbstractControl, ValidationErrors, Validators } from '@angular/forms' | 2 | import { AbstractControl, ValidationErrors, Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class VideoChangeOwnershipValidatorsService { | 7 | export class VideoChangeOwnershipValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/video-channel-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts index 1c519c10a..bb650b149 100644 --- a/client/src/app/shared/forms/form-validators/video-channel-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class VideoChannelValidatorsService { | 7 | export class VideoChannelValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/video-comment-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts index 45c7081ef..97c8e967e 100644 --- a/client/src/app/shared/forms/form-validators/video-comment-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class VideoCommentValidatorsService { | 7 | export class VideoCommentValidatorsService { |
diff --git a/client/src/app/shared/forms/form-validators/video-playlist-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts index a2c9a5368..ab9c43625 100644 --- a/client/src/app/shared/forms/form-validators/video-playlist-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { AbstractControl, FormControl, Validators } from '@angular/forms' | 2 | import { AbstractControl, FormControl, Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | import { VideoPlaylistPrivacy } from '@shared/models' | 5 | import { VideoPlaylistPrivacy } from '@shared/models' |
6 | 6 | ||
7 | @Injectable() | 7 | @Injectable() |
diff --git a/client/src/app/shared/forms/form-validators/video-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-validators.service.ts index e3f7a0969..9b24e4f62 100644 --- a/client/src/app/shared/forms/form-validators/video-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-validators.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { I18n } from '@ngx-translate/i18n-polyfill' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from '@app/shared' | 4 | import { BuildFormValidator } from './form-validator.service' |
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class VideoValidatorsService { | 7 | export class VideoValidatorsService { |
diff --git a/client/src/app/shared/shared-forms/index.ts b/client/src/app/shared/shared-forms/index.ts new file mode 100644 index 000000000..aa0ee015a --- /dev/null +++ b/client/src/app/shared/shared-forms/index.ts | |||
@@ -0,0 +1,10 @@ | |||
1 | export * from './form-validators' | ||
2 | export * from './form-reactive' | ||
3 | export * from './input-readonly-copy.component' | ||
4 | export * from './markdown-textarea.component' | ||
5 | export * from './peertube-checkbox.component' | ||
6 | export * from './preview-upload.component' | ||
7 | export * from './reactive-file.component' | ||
8 | export * from './textarea-autoresize.directive' | ||
9 | export * from './timestamp-input.component' | ||
10 | export * from './shared-form.module' | ||
diff --git a/client/src/app/shared/forms/input-readonly-copy.component.html b/client/src/app/shared/shared-forms/input-readonly-copy.component.html index 9566e9741..9566e9741 100644 --- a/client/src/app/shared/forms/input-readonly-copy.component.html +++ b/client/src/app/shared/shared-forms/input-readonly-copy.component.html | |||
diff --git a/client/src/app/shared/forms/input-readonly-copy.component.scss b/client/src/app/shared/shared-forms/input-readonly-copy.component.scss index 8dc4f113c..8dc4f113c 100644 --- a/client/src/app/shared/forms/input-readonly-copy.component.scss +++ b/client/src/app/shared/shared-forms/input-readonly-copy.component.scss | |||
diff --git a/client/src/app/shared/forms/input-readonly-copy.component.ts b/client/src/app/shared/shared-forms/input-readonly-copy.component.ts index 7528fb7a1..7528fb7a1 100644 --- a/client/src/app/shared/forms/input-readonly-copy.component.ts +++ b/client/src/app/shared/shared-forms/input-readonly-copy.component.ts | |||
diff --git a/client/src/app/shared/forms/markdown-textarea.component.html b/client/src/app/shared/shared-forms/markdown-textarea.component.html index a519f3e0a..a519f3e0a 100644 --- a/client/src/app/shared/forms/markdown-textarea.component.html +++ b/client/src/app/shared/shared-forms/markdown-textarea.component.html | |||
diff --git a/client/src/app/shared/forms/markdown-textarea.component.scss b/client/src/app/shared/shared-forms/markdown-textarea.component.scss index f2c76f7a1..f2c76f7a1 100644 --- a/client/src/app/shared/forms/markdown-textarea.component.scss +++ b/client/src/app/shared/shared-forms/markdown-textarea.component.scss | |||
diff --git a/client/src/app/shared/forms/markdown-textarea.component.ts b/client/src/app/shared/shared-forms/markdown-textarea.component.ts index dde7b4d98..8dad5314c 100644 --- a/client/src/app/shared/forms/markdown-textarea.component.ts +++ b/client/src/app/shared/shared-forms/markdown-textarea.component.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import truncate from 'lodash-es/truncate' | ||
2 | import { Subject } from 'rxjs' | ||
1 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' | 3 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' |
2 | import { Component, forwardRef, Input, OnInit, ViewChild, ElementRef } from '@angular/core' | 4 | import { Component, ElementRef, forwardRef, Input, OnInit, ViewChild } from '@angular/core' |
3 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | 5 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' |
4 | import { Subject } from 'rxjs' | 6 | import { MarkdownService } from '@app/core' |
5 | import truncate from 'lodash-es/truncate' | ||
6 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
7 | import { MarkdownService } from '@app/shared/renderer' | ||
8 | 7 | ||
9 | @Component({ | 8 | @Component({ |
10 | selector: 'my-markdown-textarea', | 9 | selector: 'my-markdown-textarea', |
@@ -37,10 +36,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit { | |||
37 | 36 | ||
38 | private contentChanged = new Subject<string>() | 37 | private contentChanged = new Subject<string>() |
39 | 38 | ||
40 | constructor ( | 39 | constructor (private markdownService: MarkdownService) {} |
41 | private screenService: ScreenService, | ||
42 | private markdownService: MarkdownService | ||
43 | ) {} | ||
44 | 40 | ||
45 | ngOnInit () { | 41 | ngOnInit () { |
46 | this.contentChanged | 42 | this.contentChanged |
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.html b/client/src/app/shared/shared-forms/peertube-checkbox.component.html index 704f3e696..704f3e696 100644 --- a/client/src/app/shared/forms/peertube-checkbox.component.html +++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.html | |||
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.scss b/client/src/app/shared/shared-forms/peertube-checkbox.component.scss index cf8540dc3..cf8540dc3 100644 --- a/client/src/app/shared/forms/peertube-checkbox.component.scss +++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.scss | |||
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.ts b/client/src/app/shared/shared-forms/peertube-checkbox.component.ts index 89e79fecd..76ef77e5a 100644 --- a/client/src/app/shared/forms/peertube-checkbox.component.ts +++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { AfterContentInit, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core' | 1 | import { AfterContentInit, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core' |
2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | 2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' |
3 | import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive' | 3 | import { PeerTubeTemplateDirective } from '@app/shared/shared-main' |
4 | 4 | ||
5 | @Component({ | 5 | @Component({ |
6 | selector: 'my-peertube-checkbox', | 6 | selector: 'my-peertube-checkbox', |
diff --git a/client/src/app/shared/images/preview-upload.component.html b/client/src/app/shared/shared-forms/preview-upload.component.html index 7c3a2b588..7c3a2b588 100644 --- a/client/src/app/shared/images/preview-upload.component.html +++ b/client/src/app/shared/shared-forms/preview-upload.component.html | |||
diff --git a/client/src/app/shared/images/preview-upload.component.scss b/client/src/app/shared/shared-forms/preview-upload.component.scss index 88eccd5f7..88eccd5f7 100644 --- a/client/src/app/shared/images/preview-upload.component.scss +++ b/client/src/app/shared/shared-forms/preview-upload.component.scss | |||
diff --git a/client/src/app/shared/images/preview-upload.component.ts b/client/src/app/shared/shared-forms/preview-upload.component.ts index 7519734ba..7519734ba 100644 --- a/client/src/app/shared/images/preview-upload.component.ts +++ b/client/src/app/shared/shared-forms/preview-upload.component.ts | |||
diff --git a/client/src/app/shared/forms/reactive-file.component.html b/client/src/app/shared/shared-forms/reactive-file.component.html index f6bf5f9ae..f6bf5f9ae 100644 --- a/client/src/app/shared/forms/reactive-file.component.html +++ b/client/src/app/shared/shared-forms/reactive-file.component.html | |||
diff --git a/client/src/app/shared/forms/reactive-file.component.scss b/client/src/app/shared/shared-forms/reactive-file.component.scss index 84c23c1d6..84c23c1d6 100644 --- a/client/src/app/shared/forms/reactive-file.component.scss +++ b/client/src/app/shared/shared-forms/reactive-file.component.scss | |||
diff --git a/client/src/app/shared/forms/reactive-file.component.ts b/client/src/app/shared/shared-forms/reactive-file.component.ts index b7a821d4f..9ebf487ce 100644 --- a/client/src/app/shared/forms/reactive-file.component.ts +++ b/client/src/app/shared/shared-forms/reactive-file.component.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Component, EventEmitter, forwardRef, Input, OnInit, Output } from '@angular/core' | 1 | import { Component, EventEmitter, forwardRef, Input, OnInit, Output } from '@angular/core' |
2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | 2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' |
3 | import { Notifier } from '@app/core' | 3 | import { Notifier } from '@app/core' |
4 | import { GlobalIconName } from '@app/shared/shared-icons' | ||
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { GlobalIconName } from '@app/shared/images/global-icon.component' | ||
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-reactive-file', | 8 | selector: 'my-reactive-file', |
diff --git a/client/src/app/shared/shared-forms/shared-form.module.ts b/client/src/app/shared/shared-forms/shared-form.module.ts new file mode 100644 index 000000000..e82fa97d4 --- /dev/null +++ b/client/src/app/shared/shared-forms/shared-form.module.ts | |||
@@ -0,0 +1,84 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||
4 | import { BatchDomainsValidatorsService } from '@app/shared/shared-forms/form-validators/batch-domains-validators.service' | ||
5 | import { SharedGlobalIconModule } from '../shared-icons' | ||
6 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
7 | import { | ||
8 | CustomConfigValidatorsService, | ||
9 | FormValidatorService, | ||
10 | InstanceValidatorsService, | ||
11 | LoginValidatorsService, | ||
12 | ResetPasswordValidatorsService, | ||
13 | UserValidatorsService, | ||
14 | VideoAbuseValidatorsService, | ||
15 | VideoAcceptOwnershipValidatorsService, | ||
16 | VideoBlockValidatorsService, | ||
17 | VideoCaptionsValidatorsService, | ||
18 | VideoChangeOwnershipValidatorsService, | ||
19 | VideoChannelValidatorsService, | ||
20 | VideoCommentValidatorsService, | ||
21 | VideoPlaylistValidatorsService, | ||
22 | VideoValidatorsService | ||
23 | } from './form-validators' | ||
24 | import { InputReadonlyCopyComponent } from './input-readonly-copy.component' | ||
25 | import { MarkdownTextareaComponent } from './markdown-textarea.component' | ||
26 | import { PeertubeCheckboxComponent } from './peertube-checkbox.component' | ||
27 | import { PreviewUploadComponent } from './preview-upload.component' | ||
28 | import { ReactiveFileComponent } from './reactive-file.component' | ||
29 | import { TextareaAutoResizeDirective } from './textarea-autoresize.directive' | ||
30 | import { TimestampInputComponent } from './timestamp-input.component' | ||
31 | |||
32 | @NgModule({ | ||
33 | imports: [ | ||
34 | FormsModule, | ||
35 | ReactiveFormsModule, | ||
36 | |||
37 | SharedMainModule, | ||
38 | SharedGlobalIconModule | ||
39 | ], | ||
40 | |||
41 | declarations: [ | ||
42 | InputReadonlyCopyComponent, | ||
43 | MarkdownTextareaComponent, | ||
44 | PeertubeCheckboxComponent, | ||
45 | PreviewUploadComponent, | ||
46 | ReactiveFileComponent, | ||
47 | TextareaAutoResizeDirective, | ||
48 | TimestampInputComponent | ||
49 | ], | ||
50 | |||
51 | exports: [ | ||
52 | FormsModule, | ||
53 | ReactiveFormsModule, | ||
54 | |||
55 | InputReadonlyCopyComponent, | ||
56 | MarkdownTextareaComponent, | ||
57 | PeertubeCheckboxComponent, | ||
58 | PreviewUploadComponent, | ||
59 | ReactiveFileComponent, | ||
60 | TextareaAutoResizeDirective, | ||
61 | TimestampInputComponent | ||
62 | ], | ||
63 | |||
64 | providers: [ | ||
65 | CustomConfigValidatorsService, | ||
66 | FormValidatorService, | ||
67 | LoginValidatorsService, | ||
68 | InstanceValidatorsService, | ||
69 | LoginValidatorsService, | ||
70 | ResetPasswordValidatorsService, | ||
71 | UserValidatorsService, | ||
72 | VideoAbuseValidatorsService, | ||
73 | VideoAcceptOwnershipValidatorsService, | ||
74 | VideoBlockValidatorsService, | ||
75 | VideoCaptionsValidatorsService, | ||
76 | VideoChangeOwnershipValidatorsService, | ||
77 | VideoChannelValidatorsService, | ||
78 | VideoCommentValidatorsService, | ||
79 | VideoPlaylistValidatorsService, | ||
80 | VideoValidatorsService, | ||
81 | BatchDomainsValidatorsService | ||
82 | ] | ||
83 | }) | ||
84 | export class SharedFormModule { } | ||
diff --git a/client/src/app/shared/forms/textarea-autoresize.directive.ts b/client/src/app/shared/shared-forms/textarea-autoresize.directive.ts index f8c855c16..f8c855c16 100644 --- a/client/src/app/shared/forms/textarea-autoresize.directive.ts +++ b/client/src/app/shared/shared-forms/textarea-autoresize.directive.ts | |||
diff --git a/client/src/app/shared/forms/timestamp-input.component.html b/client/src/app/shared/shared-forms/timestamp-input.component.html index c57a4b32c..c57a4b32c 100644 --- a/client/src/app/shared/forms/timestamp-input.component.html +++ b/client/src/app/shared/shared-forms/timestamp-input.component.html | |||
diff --git a/client/src/app/shared/forms/timestamp-input.component.scss b/client/src/app/shared/shared-forms/timestamp-input.component.scss index 8092b095b..8092b095b 100644 --- a/client/src/app/shared/forms/timestamp-input.component.scss +++ b/client/src/app/shared/shared-forms/timestamp-input.component.scss | |||
diff --git a/client/src/app/shared/forms/timestamp-input.component.ts b/client/src/app/shared/shared-forms/timestamp-input.component.ts index 8d67a96ac..8d67a96ac 100644 --- a/client/src/app/shared/forms/timestamp-input.component.ts +++ b/client/src/app/shared/shared-forms/timestamp-input.component.ts | |||
diff --git a/client/src/app/shared/images/global-icon.component.scss b/client/src/app/shared/shared-icons/global-icon.component.scss index 6795d6628..6795d6628 100644 --- a/client/src/app/shared/images/global-icon.component.scss +++ b/client/src/app/shared/shared-icons/global-icon.component.scss | |||
diff --git a/client/src/app/shared/images/global-icon.component.ts b/client/src/app/shared/shared-icons/global-icon.component.ts index 169882685..169882685 100644 --- a/client/src/app/shared/images/global-icon.component.ts +++ b/client/src/app/shared/shared-icons/global-icon.component.ts | |||
diff --git a/client/src/app/shared/shared-icons/index.ts b/client/src/app/shared/shared-icons/index.ts new file mode 100644 index 000000000..478e5c97d --- /dev/null +++ b/client/src/app/shared/shared-icons/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './global-icon.component' | ||
2 | |||
3 | export * from './shared-global-icon.module' | ||
diff --git a/client/src/app/shared/shared-icons/shared-global-icon.module.ts b/client/src/app/shared/shared-icons/shared-global-icon.module.ts new file mode 100644 index 000000000..b3020c78d --- /dev/null +++ b/client/src/app/shared/shared-icons/shared-global-icon.module.ts | |||
@@ -0,0 +1,21 @@ | |||
1 | |||
2 | import { CommonModule } from '@angular/common' | ||
3 | import { NgModule } from '@angular/core' | ||
4 | import { GlobalIconComponent } from './global-icon.component' | ||
5 | |||
6 | @NgModule({ | ||
7 | imports: [ | ||
8 | CommonModule | ||
9 | ], | ||
10 | |||
11 | declarations: [ | ||
12 | GlobalIconComponent | ||
13 | ], | ||
14 | |||
15 | exports: [ | ||
16 | GlobalIconComponent | ||
17 | ], | ||
18 | |||
19 | providers: [ ] | ||
20 | }) | ||
21 | export class SharedGlobalIconModule { } | ||
diff --git a/client/src/app/shared/instance/feature-boolean.component.html b/client/src/app/shared/shared-instance/feature-boolean.component.html index ccb8a30cc..ccb8a30cc 100644 --- a/client/src/app/shared/instance/feature-boolean.component.html +++ b/client/src/app/shared/shared-instance/feature-boolean.component.html | |||
diff --git a/client/src/app/shared/instance/feature-boolean.component.scss b/client/src/app/shared/shared-instance/feature-boolean.component.scss index 56d08af06..56d08af06 100644 --- a/client/src/app/shared/instance/feature-boolean.component.scss +++ b/client/src/app/shared/shared-instance/feature-boolean.component.scss | |||
diff --git a/client/src/app/shared/instance/feature-boolean.component.ts b/client/src/app/shared/shared-instance/feature-boolean.component.ts index d02d513d6..d02d513d6 100644 --- a/client/src/app/shared/instance/feature-boolean.component.ts +++ b/client/src/app/shared/shared-instance/feature-boolean.component.ts | |||
diff --git a/client/src/app/shared/shared-instance/index.ts b/client/src/app/shared/shared-instance/index.ts new file mode 100644 index 000000000..1aeed357e --- /dev/null +++ b/client/src/app/shared/shared-instance/index.ts | |||
@@ -0,0 +1,6 @@ | |||
1 | export * from './feature-boolean.component' | ||
2 | export * from './instance-features-table.component' | ||
3 | export * from './instance-follow.service' | ||
4 | export * from './instance-statistics.component' | ||
5 | export * from './instance.service' | ||
6 | export * from './shared-instance.module' | ||
diff --git a/client/src/app/shared/instance/instance-features-table.component.html b/client/src/app/shared/shared-instance/instance-features-table.component.html index f6a3b7f0b..f6a3b7f0b 100644 --- a/client/src/app/shared/instance/instance-features-table.component.html +++ b/client/src/app/shared/shared-instance/instance-features-table.component.html | |||
diff --git a/client/src/app/shared/instance/instance-features-table.component.scss b/client/src/app/shared/shared-instance/instance-features-table.component.scss index a51574741..a51574741 100644 --- a/client/src/app/shared/instance/instance-features-table.component.scss +++ b/client/src/app/shared/shared-instance/instance-features-table.component.scss | |||
diff --git a/client/src/app/shared/instance/instance-features-table.component.ts b/client/src/app/shared/shared-instance/instance-features-table.component.ts index 8fd15ebad..8fd15ebad 100644 --- a/client/src/app/shared/instance/instance-features-table.component.ts +++ b/client/src/app/shared/shared-instance/instance-features-table.component.ts | |||
diff --git a/client/src/app/shared/instance/follow.service.ts b/client/src/app/shared/shared-instance/instance-follow.service.ts index ef4c09583..3c9ccc40f 100644 --- a/client/src/app/shared/instance/follow.service.ts +++ b/client/src/app/shared/shared-instance/instance-follow.service.ts | |||
@@ -1,14 +1,14 @@ | |||
1 | import { SortMeta } from 'primeng/api' | ||
2 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map } from 'rxjs/operators' | 3 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
4 | import { Observable } from 'rxjs' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
5 | import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index' | 7 | import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index' |
6 | import { environment } from '../../../environments/environment' | 8 | import { environment } from '../../../environments/environment' |
7 | import { RestExtractor, RestPagination, RestService } from '../rest' | ||
8 | import { SortMeta } from 'primeng/api' | ||
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class FollowService { | 11 | export class InstanceFollowService { |
12 | private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/server' | 12 | private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/server' |
13 | 13 | ||
14 | constructor ( | 14 | constructor ( |
@@ -34,7 +34,7 @@ export class FollowService { | |||
34 | if (state) params = params.append('state', state) | 34 | if (state) params = params.append('state', state) |
35 | if (actorType) params = params.append('actorType', actorType) | 35 | if (actorType) params = params.append('actorType', actorType) |
36 | 36 | ||
37 | return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/following', { params }) | 37 | return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/following', { params }) |
38 | .pipe( | 38 | .pipe( |
39 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | 39 | map(res => this.restExtractor.convertResultListDateToHuman(res)), |
40 | catchError(res => this.restExtractor.handleError(res)) | 40 | catchError(res => this.restExtractor.handleError(res)) |
@@ -57,7 +57,7 @@ export class FollowService { | |||
57 | if (state) params = params.append('state', state) | 57 | if (state) params = params.append('state', state) |
58 | if (actorType) params = params.append('actorType', actorType) | 58 | if (actorType) params = params.append('actorType', actorType) |
59 | 59 | ||
60 | return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/followers', { params }) | 60 | return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/followers', { params }) |
61 | .pipe( | 61 | .pipe( |
62 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | 62 | map(res => this.restExtractor.convertResultListDateToHuman(res)), |
63 | catchError(res => this.restExtractor.handleError(res)) | 63 | catchError(res => this.restExtractor.handleError(res)) |
@@ -69,7 +69,7 @@ export class FollowService { | |||
69 | hosts: notEmptyHosts | 69 | hosts: notEmptyHosts |
70 | } | 70 | } |
71 | 71 | ||
72 | return this.authHttp.post(FollowService.BASE_APPLICATION_URL + '/following', body) | 72 | return this.authHttp.post(InstanceFollowService.BASE_APPLICATION_URL + '/following', body) |
73 | .pipe( | 73 | .pipe( |
74 | map(this.restExtractor.extractDataBool), | 74 | map(this.restExtractor.extractDataBool), |
75 | catchError(res => this.restExtractor.handleError(res)) | 75 | catchError(res => this.restExtractor.handleError(res)) |
@@ -77,7 +77,7 @@ export class FollowService { | |||
77 | } | 77 | } |
78 | 78 | ||
79 | unfollow (follow: ActorFollow) { | 79 | unfollow (follow: ActorFollow) { |
80 | return this.authHttp.delete(FollowService.BASE_APPLICATION_URL + '/following/' + follow.following.host) | 80 | return this.authHttp.delete(InstanceFollowService.BASE_APPLICATION_URL + '/following/' + follow.following.host) |
81 | .pipe( | 81 | .pipe( |
82 | map(this.restExtractor.extractDataBool), | 82 | map(this.restExtractor.extractDataBool), |
83 | catchError(res => this.restExtractor.handleError(res)) | 83 | catchError(res => this.restExtractor.handleError(res)) |
@@ -87,7 +87,7 @@ export class FollowService { | |||
87 | acceptFollower (follow: ActorFollow) { | 87 | acceptFollower (follow: ActorFollow) { |
88 | const handle = follow.follower.name + '@' + follow.follower.host | 88 | const handle = follow.follower.name + '@' + follow.follower.host |
89 | 89 | ||
90 | return this.authHttp.post(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {}) | 90 | return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {}) |
91 | .pipe( | 91 | .pipe( |
92 | map(this.restExtractor.extractDataBool), | 92 | map(this.restExtractor.extractDataBool), |
93 | catchError(res => this.restExtractor.handleError(res)) | 93 | catchError(res => this.restExtractor.handleError(res)) |
@@ -97,7 +97,7 @@ export class FollowService { | |||
97 | rejectFollower (follow: ActorFollow) { | 97 | rejectFollower (follow: ActorFollow) { |
98 | const handle = follow.follower.name + '@' + follow.follower.host | 98 | const handle = follow.follower.name + '@' + follow.follower.host |
99 | 99 | ||
100 | return this.authHttp.post(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {}) | 100 | return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {}) |
101 | .pipe( | 101 | .pipe( |
102 | map(this.restExtractor.extractDataBool), | 102 | map(this.restExtractor.extractDataBool), |
103 | catchError(res => this.restExtractor.handleError(res)) | 103 | catchError(res => this.restExtractor.handleError(res)) |
@@ -107,7 +107,7 @@ export class FollowService { | |||
107 | removeFollower (follow: ActorFollow) { | 107 | removeFollower (follow: ActorFollow) { |
108 | const handle = follow.follower.name + '@' + follow.follower.host | 108 | const handle = follow.follower.name + '@' + follow.follower.host |
109 | 109 | ||
110 | return this.authHttp.delete(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}`) | 110 | return this.authHttp.delete(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}`) |
111 | .pipe( | 111 | .pipe( |
112 | map(this.restExtractor.extractDataBool), | 112 | map(this.restExtractor.extractDataBool), |
113 | catchError(res => this.restExtractor.handleError(res)) | 113 | catchError(res => this.restExtractor.handleError(res)) |
diff --git a/client/src/app/shared/instance/instance-statistics.component.html b/client/src/app/shared/shared-instance/instance-statistics.component.html index 399cf10fe..399cf10fe 100644 --- a/client/src/app/shared/instance/instance-statistics.component.html +++ b/client/src/app/shared/shared-instance/instance-statistics.component.html | |||
diff --git a/client/src/app/shared/instance/instance-statistics.component.scss b/client/src/app/shared/shared-instance/instance-statistics.component.scss index 5286ab03a..5286ab03a 100644 --- a/client/src/app/shared/instance/instance-statistics.component.scss +++ b/client/src/app/shared/shared-instance/instance-statistics.component.scss | |||
diff --git a/client/src/app/shared/instance/instance-statistics.component.ts b/client/src/app/shared/shared-instance/instance-statistics.component.ts index 40aa8a4c0..40aa8a4c0 100644 --- a/client/src/app/shared/instance/instance-statistics.component.ts +++ b/client/src/app/shared/shared-instance/instance-statistics.component.ts | |||
diff --git a/client/src/app/shared/instance/instance.service.ts b/client/src/app/shared/shared-instance/instance.service.ts index 8b26063fb..ba9797bb5 100644 --- a/client/src/app/shared/instance/instance.service.ts +++ b/client/src/app/shared/shared-instance/instance.service.ts | |||
@@ -1,13 +1,10 @@ | |||
1 | import { forkJoin } from 'rxjs' | ||
1 | import { catchError, map } from 'rxjs/operators' | 2 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | import { MarkdownService, RestExtractor, ServerService } from '@app/core' | ||
6 | import { About, peertubeTranslate } from '@shared/models' | ||
4 | import { environment } from '../../../environments/environment' | 7 | import { environment } from '../../../environments/environment' |
5 | import { RestExtractor, RestService } from '../rest' | ||
6 | import { About } from '../../../../../shared/models/server' | ||
7 | import { MarkdownService } from '@app/shared/renderer' | ||
8 | import { peertubeTranslate } from '@shared/models' | ||
9 | import { ServerService } from '@app/core' | ||
10 | import { forkJoin } from 'rxjs' | ||
11 | 8 | ||
12 | @Injectable() | 9 | @Injectable() |
13 | export class InstanceService { | 10 | export class InstanceService { |
@@ -16,7 +13,6 @@ export class InstanceService { | |||
16 | 13 | ||
17 | constructor ( | 14 | constructor ( |
18 | private authHttp: HttpClient, | 15 | private authHttp: HttpClient, |
19 | private restService: RestService, | ||
20 | private restExtractor: RestExtractor, | 16 | private restExtractor: RestExtractor, |
21 | private markdownService: MarkdownService, | 17 | private markdownService: MarkdownService, |
22 | private serverService: ServerService | 18 | private serverService: ServerService |
diff --git a/client/src/app/shared/shared-instance/shared-instance.module.ts b/client/src/app/shared/shared-instance/shared-instance.module.ts new file mode 100644 index 000000000..b75ad1a12 --- /dev/null +++ b/client/src/app/shared/shared-instance/shared-instance.module.ts | |||
@@ -0,0 +1,32 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
4 | import { FeatureBooleanComponent } from './feature-boolean.component' | ||
5 | import { InstanceFeaturesTableComponent } from './instance-features-table.component' | ||
6 | import { InstanceFollowService } from './instance-follow.service' | ||
7 | import { InstanceStatisticsComponent } from './instance-statistics.component' | ||
8 | import { InstanceService } from './instance.service' | ||
9 | |||
10 | @NgModule({ | ||
11 | imports: [ | ||
12 | SharedMainModule | ||
13 | ], | ||
14 | |||
15 | declarations: [ | ||
16 | FeatureBooleanComponent, | ||
17 | InstanceFeaturesTableComponent, | ||
18 | InstanceStatisticsComponent | ||
19 | ], | ||
20 | |||
21 | exports: [ | ||
22 | FeatureBooleanComponent, | ||
23 | InstanceFeaturesTableComponent, | ||
24 | InstanceStatisticsComponent | ||
25 | ], | ||
26 | |||
27 | providers: [ | ||
28 | InstanceFollowService, | ||
29 | InstanceService | ||
30 | ] | ||
31 | }) | ||
32 | export class SharedInstanceModule { } | ||
diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/shared-main/account/account.model.ts index 61f09fc06..6df2e9d10 100644 --- a/client/src/app/shared/account/account.model.ts +++ b/client/src/app/shared/shared-main/account/account.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' | 1 | import { Account as ServerAccount } from '@shared/models/actors/account.model' |
2 | import { Actor } from '../actor/actor.model' | 2 | import { Actor } from './actor.model' |
3 | 3 | ||
4 | export class Account extends Actor implements ServerAccount { | 4 | export class Account extends Actor implements ServerAccount { |
5 | displayName: string | 5 | displayName: string |
diff --git a/client/src/app/shared/account/account.service.ts b/client/src/app/shared/shared-main/account/account.service.ts index 6b261cf53..8f4abf070 100644 --- a/client/src/app/shared/account/account.service.ts +++ b/client/src/app/shared/shared-main/account/account.service.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { map, tap, catchError } from 'rxjs/operators' | ||
2 | import { Injectable } from '@angular/core' | ||
3 | import { environment } from '../../../environments/environment' | ||
4 | import { Observable, ReplaySubject } from 'rxjs' | 1 | import { Observable, ReplaySubject } from 'rxjs' |
5 | import { Account } from '@app/shared/account/account.model' | 2 | import { catchError, map, tap } from 'rxjs/operators' |
6 | import { RestExtractor } from '@app/shared/rest/rest-extractor.service' | ||
7 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient } from '@angular/common/http' |
8 | import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' | 4 | import { Injectable } from '@angular/core' |
5 | import { RestExtractor } from '@app/core' | ||
6 | import { Account as ServerAccount } from '@shared/models' | ||
7 | import { environment } from '../../../../environments/environment' | ||
8 | import { Account } from './account.model' | ||
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class AccountService { | 11 | export class AccountService { |
diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.html b/client/src/app/shared/shared-main/account/actor-avatar-info.component.html index d01b9ac7f..d01b9ac7f 100644 --- a/client/src/app/+my-account/shared/actor-avatar-info.component.html +++ b/client/src/app/shared/shared-main/account/actor-avatar-info.component.html | |||
diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.scss b/client/src/app/shared/shared-main/account/actor-avatar-info.component.scss index 5a66ecfd2..5a66ecfd2 100644 --- a/client/src/app/+my-account/shared/actor-avatar-info.component.scss +++ b/client/src/app/shared/shared-main/account/actor-avatar-info.component.scss | |||
diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.ts b/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts index 8e4a7a602..0c04ae4a6 100644 --- a/client/src/app/+my-account/shared/actor-avatar-info.component.ts +++ b/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | ||
2 | import { ServerService } from '../../core/server' | ||
3 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
4 | import { Account } from '@app/shared/account/account.model' | ||
5 | import { Notifier } from '@app/core' | ||
6 | import { ServerConfig } from '@shared/models' | ||
7 | import { BytesPipe } from 'ngx-pipes' | 1 | import { BytesPipe } from 'ngx-pipes' |
2 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | ||
3 | import { Notifier, ServerService } from '@app/core' | ||
4 | import { Account, VideoChannel } from '@app/shared/shared-main' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { ServerConfig } from '@shared/models' | ||
9 | 7 | ||
10 | @Component({ | 8 | @Component({ |
11 | selector: 'my-actor-avatar-info', | 9 | selector: 'my-actor-avatar-info', |
diff --git a/client/src/app/shared/actor/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts index a78303a2f..5fc7989dd 100644 --- a/client/src/app/shared/actor/actor.model.ts +++ b/client/src/app/shared/shared-main/account/actor.model.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { Actor as ActorServer } from '../../../../../shared/models/actors/actor.model' | 1 | import { Actor as ActorServer, Avatar } from '@shared/models' |
2 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | 2 | import { getAbsoluteAPIUrl } from '@app/helpers' |
3 | import { getAbsoluteAPIUrl } from '@app/shared/misc/utils' | ||
4 | 3 | ||
5 | export abstract class Actor implements ActorServer { | 4 | export abstract class Actor implements ActorServer { |
6 | id: number | 5 | id: number |
diff --git a/client/src/app/shared/channel/avatar.component.html b/client/src/app/shared/shared-main/account/avatar.component.html index 09871fca4..09871fca4 100644 --- a/client/src/app/shared/channel/avatar.component.html +++ b/client/src/app/shared/shared-main/account/avatar.component.html | |||
diff --git a/client/src/app/shared/channel/avatar.component.scss b/client/src/app/shared/shared-main/account/avatar.component.scss index 37709fce6..37709fce6 100644 --- a/client/src/app/shared/channel/avatar.component.scss +++ b/client/src/app/shared/shared-main/account/avatar.component.scss | |||
diff --git a/client/src/app/shared/channel/avatar.component.ts b/client/src/app/shared/shared-main/account/avatar.component.ts index 31f39c200..31f39c200 100644 --- a/client/src/app/shared/channel/avatar.component.ts +++ b/client/src/app/shared/shared-main/account/avatar.component.ts | |||
diff --git a/client/src/app/shared/shared-main/account/index.ts b/client/src/app/shared/shared-main/account/index.ts new file mode 100644 index 000000000..f5b9f3634 --- /dev/null +++ b/client/src/app/shared/shared-main/account/index.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export * from './account.model' | ||
2 | export * from './account.service' | ||
3 | export * from './actor-avatar-info.component' | ||
4 | export * from './actor.model' | ||
5 | export * from './avatar.component' | ||
diff --git a/client/src/app/shared/angular/from-now.pipe.ts b/client/src/app/shared/shared-main/angular/from-now.pipe.ts index 9851468ee..9851468ee 100644 --- a/client/src/app/shared/angular/from-now.pipe.ts +++ b/client/src/app/shared/shared-main/angular/from-now.pipe.ts | |||
diff --git a/client/src/app/shared/shared-main/angular/index.ts b/client/src/app/shared/shared-main/angular/index.ts new file mode 100644 index 000000000..3b072fb84 --- /dev/null +++ b/client/src/app/shared/shared-main/angular/index.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export * from './from-now.pipe' | ||
2 | export * from './infinite-scroller.directive' | ||
3 | export * from './number-formatter.pipe' | ||
4 | export * from './peertube-template.directive' | ||
diff --git a/client/src/app/shared/video/infinite-scroller.directive.ts b/client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts index f09c3d1fc..f09c3d1fc 100644 --- a/client/src/app/shared/video/infinite-scroller.directive.ts +++ b/client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts | |||
diff --git a/client/src/app/shared/angular/number-formatter.pipe.ts b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts index 8a0756a36..8a0756a36 100644 --- a/client/src/app/shared/angular/number-formatter.pipe.ts +++ b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts | |||
diff --git a/client/src/app/shared/angular/peertube-template.directive.ts b/client/src/app/shared/shared-main/angular/peertube-template.directive.ts index e04c25d9a..e04c25d9a 100644 --- a/client/src/app/shared/angular/peertube-template.directive.ts +++ b/client/src/app/shared/shared-main/angular/peertube-template.directive.ts | |||
diff --git a/client/src/app/shared/auth/auth-interceptor.service.ts b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts index bb236bf8c..68a4acdb5 100644 --- a/client/src/app/shared/auth/auth-interceptor.service.ts +++ b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Observable, throwError as observableThrowError } from 'rxjs' | 1 | import { Observable, throwError as observableThrowError } from 'rxjs' |
2 | import { catchError, switchMap } from 'rxjs/operators' | 2 | import { catchError, switchMap } from 'rxjs/operators' |
3 | import { Injectable, Injector } from '@angular/core' | ||
4 | import { HTTP_INTERCEPTORS, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http' | 3 | import { HTTP_INTERCEPTORS, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http' |
5 | import { AuthService } from '../../core' | 4 | import { Injectable, Injector } from '@angular/core' |
5 | import { AuthService } from '@app/core/auth/auth.service' | ||
6 | 6 | ||
7 | @Injectable() | 7 | @Injectable() |
8 | export class AuthInterceptor implements HttpInterceptor { | 8 | export class AuthInterceptor implements HttpInterceptor { |
diff --git a/client/src/app/shared/auth/index.ts b/client/src/app/shared/shared-main/auth/index.ts index 84a07196f..84a07196f 100644 --- a/client/src/app/shared/auth/index.ts +++ b/client/src/app/shared/shared-main/auth/index.ts | |||
diff --git a/client/src/app/shared/buttons/action-dropdown.component.html b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html index 12933d4ca..12933d4ca 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.html +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html | |||
diff --git a/client/src/app/shared/buttons/action-dropdown.component.scss b/client/src/app/shared/shared-main/buttons/action-dropdown.component.scss index 724a04efc..724a04efc 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.scss +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.scss | |||
diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts index 15f9556dc..36d7d6229 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { GlobalIconName } from '@app/shared/images/global-icon.component' | 2 | import { GlobalIconName } from '@app/shared/shared-icons' |
3 | 3 | ||
4 | export type DropdownAction<T> = { | 4 | export type DropdownAction<T> = { |
5 | label?: string | 5 | label?: string |
diff --git a/client/src/app/shared/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html index d2b0eb81a..d2b0eb81a 100644 --- a/client/src/app/shared/buttons/button.component.html +++ b/client/src/app/shared/shared-main/buttons/button.component.html | |||
diff --git a/client/src/app/shared/buttons/button.component.scss b/client/src/app/shared/shared-main/buttons/button.component.scss index 3ccfefd7e..3ccfefd7e 100644 --- a/client/src/app/shared/buttons/button.component.scss +++ b/client/src/app/shared/shared-main/buttons/button.component.scss | |||
diff --git a/client/src/app/shared/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts index cac5ad210..e23b90945 100644 --- a/client/src/app/shared/buttons/button.component.ts +++ b/client/src/app/shared/shared-main/buttons/button.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { GlobalIconName } from '@app/shared/images/global-icon.component' | 2 | import { GlobalIconName } from '@app/shared/shared-icons' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-button', | 5 | selector: 'my-button', |
diff --git a/client/src/app/shared/buttons/delete-button.component.html b/client/src/app/shared/shared-main/buttons/delete-button.component.html index 398b6db1e..398b6db1e 100644 --- a/client/src/app/shared/buttons/delete-button.component.html +++ b/client/src/app/shared/shared-main/buttons/delete-button.component.html | |||
diff --git a/client/src/app/shared/buttons/delete-button.component.ts b/client/src/app/shared/shared-main/buttons/delete-button.component.ts index 39e31900f..39e31900f 100644 --- a/client/src/app/shared/buttons/delete-button.component.ts +++ b/client/src/app/shared/shared-main/buttons/delete-button.component.ts | |||
diff --git a/client/src/app/shared/buttons/edit-button.component.html b/client/src/app/shared/shared-main/buttons/edit-button.component.html index b852bb38a..b852bb38a 100644 --- a/client/src/app/shared/buttons/edit-button.component.html +++ b/client/src/app/shared/shared-main/buttons/edit-button.component.html | |||
diff --git a/client/src/app/shared/buttons/edit-button.component.ts b/client/src/app/shared/shared-main/buttons/edit-button.component.ts index 9cfe1a3bb..9cfe1a3bb 100644 --- a/client/src/app/shared/buttons/edit-button.component.ts +++ b/client/src/app/shared/shared-main/buttons/edit-button.component.ts | |||
diff --git a/client/src/app/shared/shared-main/buttons/index.ts b/client/src/app/shared/shared-main/buttons/index.ts new file mode 100644 index 000000000..775a47a39 --- /dev/null +++ b/client/src/app/shared/shared-main/buttons/index.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export * from './action-dropdown.component' | ||
2 | export * from './button.component' | ||
3 | export * from './delete-button.component' | ||
4 | export * from './edit-button.component' | ||
diff --git a/client/src/app/shared/date/date-toggle.component.html b/client/src/app/shared/shared-main/date/date-toggle.component.html index ebd4ce442..ebd4ce442 100644 --- a/client/src/app/shared/date/date-toggle.component.html +++ b/client/src/app/shared/shared-main/date/date-toggle.component.html | |||
diff --git a/client/src/app/shared/date/date-toggle.component.scss b/client/src/app/shared/shared-main/date/date-toggle.component.scss index 86700d1d4..86700d1d4 100644 --- a/client/src/app/shared/date/date-toggle.component.scss +++ b/client/src/app/shared/shared-main/date/date-toggle.component.scss | |||
diff --git a/client/src/app/shared/date/date-toggle.component.ts b/client/src/app/shared/shared-main/date/date-toggle.component.ts index fa48da8e8..bedf0ba4e 100644 --- a/client/src/app/shared/date/date-toggle.component.ts +++ b/client/src/app/shared/shared-main/date/date-toggle.component.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import { Component, Input, OnInit, OnChanges } from '@angular/core' | ||
2 | import { DatePipe } from '@angular/common' | 1 | import { DatePipe } from '@angular/common' |
2 | import { Component, Input, OnChanges, OnInit } from '@angular/core' | ||
3 | import { FromNowPipe } from '../angular/from-now.pipe' | 3 | import { FromNowPipe } from '../angular/from-now.pipe' |
4 | 4 | ||
5 | @Component({ | 5 | @Component({ |
6 | selector: 'my-date-toggle', | 6 | selector: 'my-date-toggle', |
7 | templateUrl: './date-toggle.component.html', | 7 | templateUrl: './date-toggle.component.html', |
8 | styleUrls: [ './date-toggle.component.scss' ], | 8 | styleUrls: [ './date-toggle.component.scss' ] |
9 | providers: [ DatePipe, FromNowPipe ] | ||
10 | }) | 9 | }) |
11 | export class DateToggleComponent implements OnInit, OnChanges { | 10 | export class DateToggleComponent implements OnInit, OnChanges { |
12 | @Input() date: Date | 11 | @Input() date: Date |
diff --git a/client/src/app/shared/shared-main/date/index.ts b/client/src/app/shared/shared-main/date/index.ts new file mode 100644 index 000000000..db00aef52 --- /dev/null +++ b/client/src/app/shared/shared-main/date/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './date-toggle.component' | |||
diff --git a/client/src/app/shared/video/feed.component.html b/client/src/app/shared/shared-main/feeds/feed.component.html index ac0b1f454..ac0b1f454 100644 --- a/client/src/app/shared/video/feed.component.html +++ b/client/src/app/shared/shared-main/feeds/feed.component.html | |||
diff --git a/client/src/app/shared/video/feed.component.scss b/client/src/app/shared/shared-main/feeds/feed.component.scss index 34dd0e937..34dd0e937 100644 --- a/client/src/app/shared/video/feed.component.scss +++ b/client/src/app/shared/shared-main/feeds/feed.component.scss | |||
diff --git a/client/src/app/shared/video/feed.component.ts b/client/src/app/shared/shared-main/feeds/feed.component.ts index 12507458f..ee3731c1d 100644 --- a/client/src/app/shared/video/feed.component.ts +++ b/client/src/app/shared/shared-main/feeds/feed.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { Syndication } from '@app/shared/video/syndication.model' | 2 | import { Syndication } from './syndication.model' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-feed', | 5 | selector: 'my-feed', |
diff --git a/client/src/app/shared/shared-main/feeds/index.ts b/client/src/app/shared/shared-main/feeds/index.ts new file mode 100644 index 000000000..6bc396699 --- /dev/null +++ b/client/src/app/shared/shared-main/feeds/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './feed.component' | ||
2 | export * from './syndication.model' | ||
diff --git a/client/src/app/shared/video/syndication.model.ts b/client/src/app/shared/shared-main/feeds/syndication.model.ts index c59ab01e8..2466ae7c6 100644 --- a/client/src/app/shared/video/syndication.model.ts +++ b/client/src/app/shared/shared-main/feeds/syndication.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum' | 1 | import { FeedFormat } from '@shared/models' |
2 | 2 | ||
3 | export interface Syndication { | 3 | export interface Syndication { |
4 | format: FeedFormat, | 4 | format: FeedFormat, |
diff --git a/client/src/app/shared/shared-main/index.ts b/client/src/app/shared/shared-main/index.ts new file mode 100644 index 000000000..a4d813c06 --- /dev/null +++ b/client/src/app/shared/shared-main/index.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | export * from './account' | ||
2 | export * from './angular' | ||
3 | export * from './buttons' | ||
4 | export * from './date' | ||
5 | export * from './feeds' | ||
6 | export * from './loaders' | ||
7 | export * from './misc' | ||
8 | export * from './users' | ||
9 | export * from './video' | ||
10 | export * from './video-caption' | ||
11 | export * from './video-channel' | ||
12 | export * from './shared-main.module' | ||
diff --git a/client/src/app/shared/shared-main/loaders/index.ts b/client/src/app/shared/shared-main/loaders/index.ts new file mode 100644 index 000000000..a061914d5 --- /dev/null +++ b/client/src/app/shared/shared-main/loaders/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './loader.component' | ||
2 | export * from './small-loader.component' | ||
diff --git a/client/src/app/shared/misc/loader.component.html b/client/src/app/shared/shared-main/loaders/loader.component.html index ca8ed063e..ca8ed063e 100644 --- a/client/src/app/shared/misc/loader.component.html +++ b/client/src/app/shared/shared-main/loaders/loader.component.html | |||
diff --git a/client/src/app/shared/misc/loader.component.scss b/client/src/app/shared/shared-main/loaders/loader.component.scss index ffac9c707..ffac9c707 100644 --- a/client/src/app/shared/misc/loader.component.scss +++ b/client/src/app/shared/shared-main/loaders/loader.component.scss | |||
diff --git a/client/src/app/shared/misc/loader.component.ts b/client/src/app/shared/shared-main/loaders/loader.component.ts index e3b1eea3a..e3b1eea3a 100644 --- a/client/src/app/shared/misc/loader.component.ts +++ b/client/src/app/shared/shared-main/loaders/loader.component.ts | |||
diff --git a/client/src/app/shared/misc/small-loader.component.html b/client/src/app/shared/shared-main/loaders/small-loader.component.html index 7886f8918..7886f8918 100644 --- a/client/src/app/shared/misc/small-loader.component.html +++ b/client/src/app/shared/shared-main/loaders/small-loader.component.html | |||
diff --git a/client/src/app/shared/misc/small-loader.component.ts b/client/src/app/shared/shared-main/loaders/small-loader.component.ts index 191877f14..191877f14 100644 --- a/client/src/app/shared/misc/small-loader.component.ts +++ b/client/src/app/shared/shared-main/loaders/small-loader.component.ts | |||
diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/shared-main/misc/help.component.html index 9a6d3e48e..9a6d3e48e 100644 --- a/client/src/app/shared/misc/help.component.html +++ b/client/src/app/shared/shared-main/misc/help.component.html | |||
diff --git a/client/src/app/shared/misc/help.component.scss b/client/src/app/shared/shared-main/misc/help.component.scss index 43f33a53a..43f33a53a 100644 --- a/client/src/app/shared/misc/help.component.scss +++ b/client/src/app/shared/shared-main/misc/help.component.scss | |||
diff --git a/client/src/app/shared/misc/help.component.ts b/client/src/app/shared/shared-main/misc/help.component.ts index e8c199e7d..0825b96de 100644 --- a/client/src/app/shared/misc/help.component.ts +++ b/client/src/app/shared/shared-main/misc/help.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' | 1 | import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' |
2 | import { MarkdownService } from '@app/core' | ||
2 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { I18n } from '@ngx-translate/i18n-polyfill' |
3 | import { MarkdownService } from '@app/shared/renderer' | 4 | import { PeerTubeTemplateDirective } from '../angular' |
4 | import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive' | ||
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'my-help', | 7 | selector: 'my-help', |
diff --git a/client/src/app/shared/shared-main/misc/index.ts b/client/src/app/shared/shared-main/misc/index.ts new file mode 100644 index 000000000..d3e7e4be7 --- /dev/null +++ b/client/src/app/shared/shared-main/misc/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './help.component' | ||
2 | export * from './list-overflow.component' | ||
diff --git a/client/src/app/shared/misc/list-overflow.component.html b/client/src/app/shared/shared-main/misc/list-overflow.component.html index 986572801..986572801 100644 --- a/client/src/app/shared/misc/list-overflow.component.html +++ b/client/src/app/shared/shared-main/misc/list-overflow.component.html | |||
diff --git a/client/src/app/shared/misc/list-overflow.component.scss b/client/src/app/shared/shared-main/misc/list-overflow.component.scss index 1ec044489..1ec044489 100644 --- a/client/src/app/shared/misc/list-overflow.component.scss +++ b/client/src/app/shared/shared-main/misc/list-overflow.component.scss | |||
diff --git a/client/src/app/shared/misc/list-overflow.component.ts b/client/src/app/shared/shared-main/misc/list-overflow.component.ts index 30f43ba43..144e0f156 100644 --- a/client/src/app/shared/misc/list-overflow.component.ts +++ b/client/src/app/shared/shared-main/misc/list-overflow.component.ts | |||
@@ -1,3 +1,5 @@ | |||
1 | import { lowerFirst, uniqueId } from 'lodash-es' | ||
2 | import { take } from 'rxjs/operators' | ||
1 | import { | 3 | import { |
2 | AfterViewInit, | 4 | AfterViewInit, |
3 | ChangeDetectionStrategy, | 5 | ChangeDetectionStrategy, |
@@ -11,10 +13,8 @@ import { | |||
11 | ViewChild, | 13 | ViewChild, |
12 | ViewChildren | 14 | ViewChildren |
13 | } from '@angular/core' | 15 | } from '@angular/core' |
16 | import { ScreenService } from '@app/core' | ||
14 | import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' | 17 | import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' |
15 | import { lowerFirst, uniqueId } from 'lodash-es' | ||
16 | import { ScreenService } from './screen.service' | ||
17 | import { take } from 'rxjs/operators' | ||
18 | 18 | ||
19 | export interface ListOverflowItem { | 19 | export interface ListOverflowItem { |
20 | label: string | 20 | label: string |
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts new file mode 100644 index 000000000..fd96a42a0 --- /dev/null +++ b/client/src/app/shared/shared-main/shared-main.module.ts | |||
@@ -0,0 +1,164 @@ | |||
1 | import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes' | ||
2 | import { SharedModule as PrimeSharedModule } from 'primeng/api' | ||
3 | import { InputMaskModule } from 'primeng/inputmask' | ||
4 | import { InputSwitchModule } from 'primeng/inputswitch' | ||
5 | import { MultiSelectModule } from 'primeng/multiselect' | ||
6 | import { ClipboardModule } from '@angular/cdk/clipboard' | ||
7 | import { CommonModule, DatePipe } from '@angular/common' | ||
8 | import { HttpClientModule } from '@angular/common/http' | ||
9 | import { NgModule } from '@angular/core' | ||
10 | import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||
11 | import { RouterModule } from '@angular/router' | ||
12 | import { | ||
13 | NgbCollapseModule, | ||
14 | NgbDropdownModule, | ||
15 | NgbModalModule, | ||
16 | NgbNavModule, | ||
17 | NgbPopoverModule, | ||
18 | NgbTooltipModule | ||
19 | } from '@ng-bootstrap/ng-bootstrap' | ||
20 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
21 | import { SharedGlobalIconModule } from '../shared-icons' | ||
22 | import { AccountService, ActorAvatarInfoComponent, AvatarComponent } from './account' | ||
23 | import { FromNowPipe, InfiniteScrollerDirective, NumberFormatterPipe, PeerTubeTemplateDirective } from './angular' | ||
24 | import { ActionDropdownComponent, ButtonComponent, DeleteButtonComponent, EditButtonComponent } from './buttons' | ||
25 | import { DateToggleComponent } from './date' | ||
26 | import { FeedComponent } from './feeds' | ||
27 | import { LoaderComponent, SmallLoaderComponent } from './loaders' | ||
28 | import { HelpComponent, ListOverflowComponent } from './misc' | ||
29 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService } from './users' | ||
30 | import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video' | ||
31 | import { VideoCaptionService } from './video-caption' | ||
32 | import { VideoChannelService } from './video-channel' | ||
33 | import { AUTH_INTERCEPTOR_PROVIDER } from './auth' | ||
34 | |||
35 | @NgModule({ | ||
36 | imports: [ | ||
37 | CommonModule, | ||
38 | FormsModule, | ||
39 | ReactiveFormsModule, | ||
40 | RouterModule, | ||
41 | HttpClientModule, | ||
42 | |||
43 | NgbDropdownModule, | ||
44 | NgbModalModule, | ||
45 | NgbPopoverModule, | ||
46 | NgbNavModule, | ||
47 | NgbTooltipModule, | ||
48 | NgbCollapseModule, | ||
49 | |||
50 | ClipboardModule, | ||
51 | |||
52 | PrimeSharedModule, | ||
53 | InputMaskModule, | ||
54 | NgPipesModule, | ||
55 | MultiSelectModule, | ||
56 | InputSwitchModule, | ||
57 | |||
58 | SharedGlobalIconModule | ||
59 | ], | ||
60 | |||
61 | declarations: [ | ||
62 | AvatarComponent, | ||
63 | ActorAvatarInfoComponent, | ||
64 | |||
65 | FromNowPipe, | ||
66 | InfiniteScrollerDirective, | ||
67 | NumberFormatterPipe, | ||
68 | PeerTubeTemplateDirective, | ||
69 | |||
70 | ActionDropdownComponent, | ||
71 | ButtonComponent, | ||
72 | DeleteButtonComponent, | ||
73 | EditButtonComponent, | ||
74 | |||
75 | DateToggleComponent, | ||
76 | |||
77 | FeedComponent, | ||
78 | |||
79 | LoaderComponent, | ||
80 | SmallLoaderComponent, | ||
81 | |||
82 | HelpComponent, | ||
83 | ListOverflowComponent, | ||
84 | |||
85 | UserNotificationsComponent, | ||
86 | |||
87 | FeedComponent | ||
88 | ], | ||
89 | |||
90 | exports: [ | ||
91 | CommonModule, | ||
92 | FormsModule, | ||
93 | ReactiveFormsModule, | ||
94 | RouterModule, | ||
95 | HttpClientModule, | ||
96 | |||
97 | NgbDropdownModule, | ||
98 | NgbModalModule, | ||
99 | NgbPopoverModule, | ||
100 | NgbNavModule, | ||
101 | NgbTooltipModule, | ||
102 | NgbCollapseModule, | ||
103 | |||
104 | ClipboardModule, | ||
105 | |||
106 | PrimeSharedModule, | ||
107 | InputMaskModule, | ||
108 | BytesPipe, | ||
109 | KeysPipe, | ||
110 | MultiSelectModule, | ||
111 | |||
112 | AvatarComponent, | ||
113 | ActorAvatarInfoComponent, | ||
114 | |||
115 | FromNowPipe, | ||
116 | InfiniteScrollerDirective, | ||
117 | NumberFormatterPipe, | ||
118 | PeerTubeTemplateDirective, | ||
119 | |||
120 | ActionDropdownComponent, | ||
121 | ButtonComponent, | ||
122 | DeleteButtonComponent, | ||
123 | EditButtonComponent, | ||
124 | |||
125 | DateToggleComponent, | ||
126 | |||
127 | FeedComponent, | ||
128 | |||
129 | LoaderComponent, | ||
130 | SmallLoaderComponent, | ||
131 | |||
132 | HelpComponent, | ||
133 | ListOverflowComponent, | ||
134 | |||
135 | UserNotificationsComponent, | ||
136 | |||
137 | FeedComponent | ||
138 | ], | ||
139 | |||
140 | providers: [ | ||
141 | I18n, | ||
142 | |||
143 | DatePipe, | ||
144 | |||
145 | FromNowPipe, | ||
146 | |||
147 | AUTH_INTERCEPTOR_PROVIDER, | ||
148 | |||
149 | AccountService, | ||
150 | |||
151 | UserHistoryService, | ||
152 | UserNotificationService, | ||
153 | |||
154 | RedundancyService, | ||
155 | VideoImportService, | ||
156 | VideoOwnershipService, | ||
157 | VideoService, | ||
158 | |||
159 | VideoCaptionService, | ||
160 | |||
161 | VideoChannelService | ||
162 | ] | ||
163 | }) | ||
164 | export class SharedMainModule { } | ||
diff --git a/client/src/app/shared/shared-main/users/index.ts b/client/src/app/shared/shared-main/users/index.ts new file mode 100644 index 000000000..83401ab52 --- /dev/null +++ b/client/src/app/shared/shared-main/users/index.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export * from './user-history.service' | ||
2 | export * from './user-notification.model' | ||
3 | export * from './user-notification.service' | ||
4 | export * from './user-notifications.component' | ||
diff --git a/client/src/app/shared/users/user-history.service.ts b/client/src/app/shared/shared-main/users/user-history.service.ts index b358cdf20..43970dc5b 100644 --- a/client/src/app/shared/users/user-history.service.ts +++ b/client/src/app/shared/shared-main/users/user-history.service.ts | |||
@@ -1,13 +1,11 @@ | |||
1 | import { catchError, map, switchMap } from 'rxjs/operators' | ||
1 | import { HttpClient, HttpParams } from '@angular/common/http' | 2 | import { HttpClient, HttpParams } from '@angular/common/http' |
2 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
3 | import { environment } from '../../../environments/environment' | 4 | import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core' |
4 | import { RestExtractor } from '../rest/rest-extractor.service' | 5 | import { ResultList } from '@shared/models' |
5 | import { RestService } from '../rest/rest.service' | 6 | import { environment } from '../../../../environments/environment' |
6 | import { Video } from '../video/video.model' | 7 | import { Video } from '../video/video.model' |
7 | import { catchError, map, switchMap } from 'rxjs/operators' | 8 | import { VideoService } from '../video/video.service' |
8 | import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model' | ||
9 | import { VideoService } from '@app/shared/video/video.service' | ||
10 | import { ResultList } from '../../../../../shared' | ||
11 | 9 | ||
12 | @Injectable() | 10 | @Injectable() |
13 | export class UserHistoryService { | 11 | export class UserHistoryService { |
diff --git a/client/src/app/shared/users/user-notification.model.ts b/client/src/app/shared/shared-main/users/user-notification.model.ts index 7b8368d87..de25d3ab9 100644 --- a/client/src/app/shared/users/user-notification.model.ts +++ b/client/src/app/shared/shared-main/users/user-notification.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ActorInfo, FollowState, UserNotification as UserNotificationServer, UserNotificationType, VideoInfo, Avatar } from '../../../../../shared' | 1 | import { Actor } from '../account/actor.model' |
2 | import { Actor } from '@app/shared/actor/actor.model' | 2 | import { ActorInfo, Avatar, FollowState, UserNotification as UserNotificationServer, UserNotificationType, VideoInfo } from '@shared/models' |
3 | 3 | ||
4 | export class UserNotification implements UserNotificationServer { | 4 | export class UserNotification implements UserNotificationServer { |
5 | id: number | 5 | id: number |
diff --git a/client/src/app/shared/users/user-notification.service.ts b/client/src/app/shared/shared-main/users/user-notification.service.ts index e525a1d58..8dd9472fe 100644 --- a/client/src/app/shared/users/user-notification.service.ts +++ b/client/src/app/shared/shared-main/users/user-notification.service.ts | |||
@@ -1,14 +1,10 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { HttpClient, HttpParams } from '@angular/common/http' | ||
3 | import { RestExtractor, RestService } from '../rest' | ||
4 | import { catchError, map, tap } from 'rxjs/operators' | 1 | import { catchError, map, tap } from 'rxjs/operators' |
5 | import { environment } from '../../../environments/environment' | 2 | import { HttpClient, HttpParams } from '@angular/common/http' |
6 | import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '../../../../../shared' | 3 | import { Injectable } from '@angular/core' |
4 | import { ComponentPaginationLight, RestExtractor, RestService, User, UserNotificationSocket } from '@app/core' | ||
5 | import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models' | ||
6 | import { environment } from '../../../../environments/environment' | ||
7 | import { UserNotification } from './user-notification.model' | 7 | import { UserNotification } from './user-notification.model' |
8 | import { AuthService } from '../../core' | ||
9 | import { ComponentPaginationLight } from '../rest/component-pagination.model' | ||
10 | import { User } from '../users/user.model' | ||
11 | import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service' | ||
12 | 8 | ||
13 | @Injectable() | 9 | @Injectable() |
14 | export class UserNotificationService { | 10 | export class UserNotificationService { |
@@ -16,7 +12,6 @@ export class UserNotificationService { | |||
16 | static BASE_NOTIFICATION_SETTINGS = environment.apiUrl + '/api/v1/users/me/notification-settings' | 12 | static BASE_NOTIFICATION_SETTINGS = environment.apiUrl + '/api/v1/users/me/notification-settings' |
17 | 13 | ||
18 | constructor ( | 14 | constructor ( |
19 | private auth: AuthService, | ||
20 | private authHttp: HttpClient, | 15 | private authHttp: HttpClient, |
21 | private restExtractor: RestExtractor, | 16 | private restExtractor: RestExtractor, |
22 | private restService: RestService, | 17 | private restService: RestService, |
diff --git a/client/src/app/shared/users/user-notifications.component.html b/client/src/app/shared/shared-main/users/user-notifications.component.html index 08771110d..08771110d 100644 --- a/client/src/app/shared/users/user-notifications.component.html +++ b/client/src/app/shared/shared-main/users/user-notifications.component.html | |||
diff --git a/client/src/app/shared/users/user-notifications.component.scss b/client/src/app/shared/shared-main/users/user-notifications.component.scss index 5166bd559..5166bd559 100644 --- a/client/src/app/shared/users/user-notifications.component.scss +++ b/client/src/app/shared/shared-main/users/user-notifications.component.scss | |||
diff --git a/client/src/app/shared/users/user-notifications.component.ts b/client/src/app/shared/shared-main/users/user-notifications.component.ts index 977dd8925..6abd8b7d8 100644 --- a/client/src/app/shared/users/user-notifications.component.ts +++ b/client/src/app/shared/shared-main/users/user-notifications.component.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | ||
2 | import { UserNotificationService } from '@app/shared/users/user-notification.service' | ||
3 | import { UserNotificationType } from '../../../../../shared' | ||
4 | import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' | ||
5 | import { Notifier } from '@app/core' | ||
6 | import { UserNotification } from '@app/shared/users/user-notification.model' | ||
7 | import { Subject } from 'rxjs' | 1 | import { Subject } from 'rxjs' |
2 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | ||
3 | import { ComponentPagination, hasMoreItems, Notifier } from '@app/core' | ||
4 | import { UserNotificationType } from '@shared/models' | ||
5 | import { UserNotification } from './user-notification.model' | ||
6 | import { UserNotificationService } from './user-notification.service' | ||
8 | 7 | ||
9 | @Component({ | 8 | @Component({ |
10 | selector: 'my-user-notifications', | 9 | selector: 'my-user-notifications', |
diff --git a/client/src/app/shared/shared-main/video-caption/index.ts b/client/src/app/shared/shared-main/video-caption/index.ts new file mode 100644 index 000000000..308200f27 --- /dev/null +++ b/client/src/app/shared/shared-main/video-caption/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './video-caption-edit.model' | ||
2 | export * from './video-caption.service' | ||
diff --git a/client/src/app/shared/video-caption/video-caption-edit.model.ts b/client/src/app/shared/shared-main/video-caption/video-caption-edit.model.ts index 732f20158..732f20158 100644 --- a/client/src/app/shared/video-caption/video-caption-edit.model.ts +++ b/client/src/app/shared/shared-main/video-caption/video-caption-edit.model.ts | |||
diff --git a/client/src/app/shared/video-caption/video-caption.service.ts b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts index 6bfe67435..d45fb837a 100644 --- a/client/src/app/shared/video-caption/video-caption.service.ts +++ b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts | |||
@@ -1,14 +1,12 @@ | |||
1 | import { Observable, of } from 'rxjs' | ||
1 | import { catchError, map, switchMap } from 'rxjs/operators' | 2 | import { catchError, map, switchMap } from 'rxjs/operators' |
2 | import { HttpClient } from '@angular/common/http' | 3 | import { HttpClient } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
4 | import { Observable, of } from 'rxjs' | 5 | import { RestExtractor, ServerService } from '@app/core' |
5 | import { peertubeTranslate, ResultList } from '../../../../../shared' | 6 | import { objectToFormData, sortBy } from '@app/helpers' |
6 | import { RestExtractor } from '../rest' | 7 | import { VideoService } from '@app/shared/shared-main/video' |
7 | import { VideoService } from '@app/shared/video/video.service' | 8 | import { peertubeTranslate, ResultList, VideoCaption } from '@shared/models' |
8 | import { objectToFormData, sortBy } from '@app/shared/misc/utils' | 9 | import { VideoCaptionEdit } from './video-caption-edit.model' |
9 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' | ||
10 | import { VideoCaption } from '../../../../../shared/models/videos/caption/video-caption.model' | ||
11 | import { ServerService } from '@app/core' | ||
12 | 10 | ||
13 | @Injectable() | 11 | @Injectable() |
14 | export class VideoCaptionService { | 12 | export class VideoCaptionService { |
diff --git a/client/src/app/shared/shared-main/video-channel/index.ts b/client/src/app/shared/shared-main/video-channel/index.ts new file mode 100644 index 000000000..1fcf6d3be --- /dev/null +++ b/client/src/app/shared/shared-main/video-channel/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './video-channel.model' | ||
2 | export * from './video-channel.service' | ||
diff --git a/client/src/app/shared/video-channel/video-channel.model.ts b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts index 2f4597343..123389afb 100644 --- a/client/src/app/shared/video-channel/video-channel.model.ts +++ b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { VideoChannel as ServerVideoChannel, ViewsPerDate } from '../../../../../shared/models/videos' | 1 | import { VideoChannel as ServerVideoChannel, ViewsPerDate, Account } from '@shared/models' |
2 | import { Actor } from '../actor/actor.model' | 2 | import { Actor } from '../account/actor.model' |
3 | import { Account } from '../../../../../shared/models/actors' | ||
4 | 3 | ||
5 | export class VideoChannel extends Actor implements ServerVideoChannel { | 4 | export class VideoChannel extends Actor implements ServerVideoChannel { |
6 | displayName: string | 5 | displayName: string |
diff --git a/client/src/app/shared/video-channel/video-channel.service.ts b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts index 0e036bda7..5483e305f 100644 --- a/client/src/app/shared/video-channel/video-channel.service.ts +++ b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts | |||
@@ -1,17 +1,13 @@ | |||
1 | import { catchError, map, tap } from 'rxjs/operators' | ||
2 | import { Injectable } from '@angular/core' | ||
3 | import { Observable, ReplaySubject } from 'rxjs' | 1 | import { Observable, ReplaySubject } from 'rxjs' |
4 | import { RestExtractor } from '../rest/rest-extractor.service' | 2 | import { catchError, map, tap } from 'rxjs/operators' |
5 | import { HttpClient, HttpParams } from '@angular/common/http' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
6 | import { VideoChannel as VideoChannelServer, VideoChannelCreate, VideoChannelUpdate } from '../../../../../shared/models/videos' | 4 | import { Injectable } from '@angular/core' |
5 | import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core' | ||
6 | import { Avatar, ResultList, VideoChannel as VideoChannelServer, VideoChannelCreate, VideoChannelUpdate } from '@shared/models' | ||
7 | import { environment } from '../../../../environments/environment' | ||
8 | import { Account } from '../account' | ||
7 | import { AccountService } from '../account/account.service' | 9 | import { AccountService } from '../account/account.service' |
8 | import { ResultList } from '../../../../../shared' | ||
9 | import { VideoChannel } from './video-channel.model' | 10 | import { VideoChannel } from './video-channel.model' |
10 | import { environment } from '../../../environments/environment' | ||
11 | import { Account } from '@app/shared/account/account.model' | ||
12 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | ||
13 | import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model' | ||
14 | import { RestService } from '@app/shared/rest' | ||
15 | 11 | ||
16 | @Injectable() | 12 | @Injectable() |
17 | export class VideoChannelService { | 13 | export class VideoChannelService { |
diff --git a/client/src/app/shared/shared-main/video/index.ts b/client/src/app/shared/shared-main/video/index.ts new file mode 100644 index 000000000..3053df4ef --- /dev/null +++ b/client/src/app/shared/shared-main/video/index.ts | |||
@@ -0,0 +1,7 @@ | |||
1 | export * from './redundancy.service' | ||
2 | export * from './video-details.model' | ||
3 | export * from './video-edit.model' | ||
4 | export * from './video-import.service' | ||
5 | export * from './video-ownership.service' | ||
6 | export * from './video.model' | ||
7 | export * from './video.service' | ||
diff --git a/client/src/app/shared/video/redundancy.service.ts b/client/src/app/shared/shared-main/video/redundancy.service.ts index fb918d73b..6e839e655 100644 --- a/client/src/app/shared/video/redundancy.service.ts +++ b/client/src/app/shared/shared-main/video/redundancy.service.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { SortMeta } from 'primeng/api' | ||
2 | import { concat, Observable } from 'rxjs' | ||
1 | import { catchError, map, toArray } from 'rxjs/operators' | 3 | import { catchError, map, toArray } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
4 | import { RestExtractor, RestPagination, RestService } from '@app/shared/rest' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
5 | import { SortMeta } from 'primeng/api' | ||
6 | import { ResultList, Video, VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' | 7 | import { ResultList, Video, VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' |
7 | import { concat, Observable } from 'rxjs' | 8 | import { environment } from '../../../../environments/environment' |
8 | import { environment } from '../../../environments/environment' | ||
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class RedundancyService { | 11 | export class RedundancyService { |
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/shared-main/video/video-details.model.ts index 14347a109..a1cb051e9 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/shared-main/video/video-details.model.ts | |||
@@ -1,9 +1,14 @@ | |||
1 | import { VideoConstant, VideoDetails as VideoDetailsServerModel, VideoFile, VideoState } from '../../../../../shared' | 1 | import { Account } from '@app/shared/shared-main/account/account.model' |
2 | import { Video } from '../../shared/video/video.model' | 2 | import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model' |
3 | import { Account } from '@app/shared/account/account.model' | 3 | import { |
4 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 4 | VideoConstant, |
5 | import { VideoStreamingPlaylist } from '../../../../../shared/models/videos/video-streaming-playlist.model' | 5 | VideoDetails as VideoDetailsServerModel, |
6 | import { VideoStreamingPlaylistType } from '../../../../../shared/models/videos/video-streaming-playlist.type' | 6 | VideoFile, |
7 | VideoState, | ||
8 | VideoStreamingPlaylist, | ||
9 | VideoStreamingPlaylistType | ||
10 | } from '@shared/models' | ||
11 | import { Video } from './video.model' | ||
7 | 12 | ||
8 | export class VideoDetails extends Video implements VideoDetailsServerModel { | 13 | export class VideoDetails extends Video implements VideoDetailsServerModel { |
9 | descriptionPath: string | 14 | descriptionPath: string |
diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/shared-main/video/video-edit.model.ts index 67d8e7711..6a529e052 100644 --- a/client/src/app/shared/video/video-edit.model.ts +++ b/client/src/app/shared/shared-main/video/video-edit.model.ts | |||
@@ -1,7 +1,4 @@ | |||
1 | import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' | 1 | import { Video, VideoPrivacy, VideoScheduleUpdate, VideoUpdate } from '@shared/models' |
2 | import { VideoUpdate } from '../../../../../shared/models/videos' | ||
3 | import { VideoScheduleUpdate } from '../../../../../shared/models/videos/video-schedule-update.model' | ||
4 | import { Video } from '../../../../../shared/models/videos/video.model' | ||
5 | 2 | ||
6 | export class VideoEdit implements VideoUpdate { | 3 | export class VideoEdit implements VideoUpdate { |
7 | static readonly SPECIAL_SCHEDULED_PRIVACY = -1 | 4 | static readonly SPECIAL_SCHEDULED_PRIVACY = -1 |
diff --git a/client/src/app/shared/video-import/video-import.service.ts b/client/src/app/shared/shared-main/video/video-import.service.ts index afd9e3fb5..a700abacb 100644 --- a/client/src/app/shared/video-import/video-import.service.ts +++ b/client/src/app/shared/shared-main/video/video-import.service.ts | |||
@@ -1,17 +1,12 @@ | |||
1 | import { SortMeta } from 'primeng/api' | ||
2 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map, switchMap } from 'rxjs/operators' | 3 | import { catchError, map, switchMap } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
4 | import { Observable } from 'rxjs' | 6 | import { RestExtractor, RestPagination, RestService, ServerService, UserService } from '@app/core' |
5 | import { peertubeTranslate, VideoImport } from '../../../../../shared' | 7 | import { objectToFormData } from '@app/helpers' |
6 | import { environment } from '../../../environments/environment' | 8 | import { peertubeTranslate, ResultList, VideoImport, VideoImportCreate, VideoUpdate } from '@shared/models' |
7 | import { RestExtractor, RestService } from '../rest' | 9 | import { environment } from '../../../../environments/environment' |
8 | import { VideoImportCreate, VideoUpdate } from '../../../../../shared/models/videos' | ||
9 | import { objectToFormData } from '@app/shared/misc/utils' | ||
10 | import { ResultList } from '../../../../../shared/models/result-list.model' | ||
11 | import { UserService } from '@app/shared/users/user.service' | ||
12 | import { SortMeta } from 'primeng/api' | ||
13 | import { RestPagination } from '@app/shared/rest' | ||
14 | import { ServerService } from '@app/core' | ||
15 | 10 | ||
16 | @Injectable() | 11 | @Injectable() |
17 | export class VideoImportService { | 12 | export class VideoImportService { |
diff --git a/client/src/app/shared/video-ownership/video-ownership.service.ts b/client/src/app/shared/shared-main/video/video-ownership.service.ts index b95d5b792..273930a6c 100644 --- a/client/src/app/shared/video-ownership/video-ownership.service.ts +++ b/client/src/app/shared/shared-main/video/video-ownership.service.ts | |||
@@ -1,14 +1,11 @@ | |||
1 | import { SortMeta } from 'primeng/api' | ||
2 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map } from 'rxjs/operators' | 3 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
4 | import { environment } from '../../../environments/environment' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
5 | import { RestExtractor, RestService } from '../rest' | 7 | import { ResultList, VideoChangeOwnership, VideoChangeOwnershipAccept, VideoChangeOwnershipCreate } from '@shared/models' |
6 | import { VideoChangeOwnershipCreate } from '../../../../../shared/models/videos' | 8 | import { environment } from '../../../../environments/environment' |
7 | import { Observable } from 'rxjs/index' | ||
8 | import { SortMeta } from 'primeng/api' | ||
9 | import { ResultList, VideoChangeOwnership } from '../../../../../shared' | ||
10 | import { RestPagination } from '@app/shared/rest' | ||
11 | import { VideoChangeOwnershipAccept } from '../../../../../shared/models/videos/video-change-ownership-accept.model' | ||
12 | 9 | ||
13 | @Injectable() | 10 | @Injectable() |
14 | export class VideoOwnershipService { | 11 | export class VideoOwnershipService { |
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index dc5f45626..3e6d6a38d 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts | |||
@@ -1,13 +1,19 @@ | |||
1 | import { User } from '../' | ||
2 | import { UserRight, Video as VideoServerModel, VideoPrivacy, VideoState } from '../../../../../shared' | ||
3 | import { Avatar } from '../../../../../shared/models/avatars/avatar.model' | ||
4 | import { VideoConstant } from '../../../../../shared/models/videos/video-constant.model' | ||
5 | import { durationToString, getAbsoluteAPIUrl } from '../misc/utils' | ||
6 | import { peertubeTranslate, ServerConfig } from '../../../../../shared/models' | ||
7 | import { Actor } from '@app/shared/actor/actor.model' | ||
8 | import { VideoScheduleUpdate } from '../../../../../shared/models/videos/video-schedule-update.model' | ||
9 | import { AuthUser } from '@app/core' | 1 | import { AuthUser } from '@app/core' |
10 | import { environment } from '../../../environments/environment' | 2 | import { User } from '@app/core/users/user.model' |
3 | import { durationToString, getAbsoluteAPIUrl } from '@app/helpers' | ||
4 | import { | ||
5 | Avatar, | ||
6 | peertubeTranslate, | ||
7 | ServerConfig, | ||
8 | UserRight, | ||
9 | Video as VideoServerModel, | ||
10 | VideoConstant, | ||
11 | VideoPrivacy, | ||
12 | VideoScheduleUpdate, | ||
13 | VideoState | ||
14 | } from '@shared/models' | ||
15 | import { environment } from '../../../../environments/environment' | ||
16 | import { Actor } from '../account/actor.model' | ||
11 | 17 | ||
12 | export class Video implements VideoServerModel { | 18 | export class Video implements VideoServerModel { |
13 | byVideoChannel: string | 19 | byVideoChannel: string |
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index d66a1f809..20d13fa10 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts | |||
@@ -1,38 +1,32 @@ | |||
1 | import { FfprobeData } from 'fluent-ffmpeg' | ||
2 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map, switchMap } from 'rxjs/operators' | 3 | import { catchError, map, switchMap } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' | 4 | import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
4 | import { Observable } from 'rxjs' | 6 | import { ComponentPaginationLight, RestExtractor, RestService, ServerService, UserService } from '@app/core' |
5 | import { Video as VideoServerModel, VideoDetails as VideoDetailsServerModel } from '../../../../../shared' | 7 | import { objectToFormData } from '@app/helpers' |
6 | import { ResultList } from '../../../../../shared/models/result-list.model' | 8 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { | 9 | import { |
10 | FeedFormat, | ||
11 | NSFWPolicyType, | ||
12 | ResultList, | ||
8 | UserVideoRate, | 13 | UserVideoRate, |
9 | UserVideoRateType, | 14 | UserVideoRateType, |
10 | UserVideoRateUpdate, | 15 | UserVideoRateUpdate, |
16 | Video as VideoServerModel, | ||
11 | VideoConstant, | 17 | VideoConstant, |
18 | VideoDetails as VideoDetailsServerModel, | ||
12 | VideoFilter, | 19 | VideoFilter, |
13 | VideoPrivacy, | 20 | VideoPrivacy, |
21 | VideoSortField, | ||
14 | VideoUpdate | 22 | VideoUpdate |
15 | } from '../../../../../shared/models/videos' | 23 | } from '@shared/models' |
16 | import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum' | 24 | import { environment } from '../../../../environments/environment' |
17 | import { environment } from '../../../environments/environment' | 25 | import { Account, AccountService } from '../account' |
18 | import { ComponentPaginationLight } from '../rest/component-pagination.model' | 26 | import { VideoChannel, VideoChannelService } from '../video-channel' |
19 | import { RestExtractor } from '../rest/rest-extractor.service' | ||
20 | import { RestService } from '../rest/rest.service' | ||
21 | import { UserService } from '../users/user.service' | ||
22 | import { VideoSortField } from './sort-field.type' | ||
23 | import { VideoDetails } from './video-details.model' | 27 | import { VideoDetails } from './video-details.model' |
24 | import { VideoEdit } from './video-edit.model' | 28 | import { VideoEdit } from './video-edit.model' |
25 | import { Video } from './video.model' | 29 | import { Video } from './video.model' |
26 | import { objectToFormData } from '@app/shared/misc/utils' | ||
27 | import { Account } from '@app/shared/account/account.model' | ||
28 | import { AccountService } from '@app/shared/account/account.service' | ||
29 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
30 | import { ServerService, AuthService } from '@app/core' | ||
31 | import { UserSubscriptionService } from '@app/shared/user-subscription/user-subscription.service' | ||
32 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
33 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
34 | import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' | ||
35 | import { FfprobeData } from 'fluent-ffmpeg' | ||
36 | 30 | ||
37 | export interface VideosProvider { | 31 | export interface VideosProvider { |
38 | getVideos (parameters: { | 32 | getVideos (parameters: { |
@@ -52,8 +46,6 @@ export class VideoService implements VideosProvider { | |||
52 | 46 | ||
53 | constructor ( | 47 | constructor ( |
54 | private authHttp: HttpClient, | 48 | private authHttp: HttpClient, |
55 | private authService: AuthService, | ||
56 | private userService: UserService, | ||
57 | private restExtractor: RestExtractor, | 49 | private restExtractor: RestExtractor, |
58 | private restService: RestService, | 50 | private restService: RestService, |
59 | private serverService: ServerService, | 51 | private serverService: ServerService, |
@@ -182,27 +174,6 @@ export class VideoService implements VideosProvider { | |||
182 | ) | 174 | ) |
183 | } | 175 | } |
184 | 176 | ||
185 | getUserSubscriptionVideos (parameters: { | ||
186 | videoPagination: ComponentPaginationLight, | ||
187 | sort: VideoSortField, | ||
188 | skipCount?: boolean | ||
189 | }): Observable<ResultList<Video>> { | ||
190 | const { videoPagination, sort, skipCount } = parameters | ||
191 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) | ||
192 | |||
193 | let params = new HttpParams() | ||
194 | params = this.restService.addRestGetParams(params, pagination, sort) | ||
195 | |||
196 | if (skipCount) params = params.set('skipCount', skipCount + '') | ||
197 | |||
198 | return this.authHttp | ||
199 | .get<ResultList<Video>>(UserSubscriptionService.BASE_USER_SUBSCRIPTIONS_URL + '/videos', { params }) | ||
200 | .pipe( | ||
201 | switchMap(res => this.extractVideos(res)), | ||
202 | catchError(err => this.restExtractor.handleError(err)) | ||
203 | ) | ||
204 | } | ||
205 | |||
206 | getVideos (parameters: { | 177 | getVideos (parameters: { |
207 | videoPagination: ComponentPaginationLight, | 178 | videoPagination: ComponentPaginationLight, |
208 | sort: VideoSortField, | 179 | sort: VideoSortField, |
diff --git a/client/src/app/shared/blocklist/account-block.model.ts b/client/src/app/shared/shared-moderation/account-block.model.ts index e7b433d88..8f76c69dc 100644 --- a/client/src/app/shared/blocklist/account-block.model.ts +++ b/client/src/app/shared/shared-moderation/account-block.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { AccountBlock as AccountBlockServer } from '../../../../../shared' | 1 | import { AccountBlock as AccountBlockServer } from '@shared/models' |
2 | import { Account } from '../account/account.model' | 2 | import { Account } from '@app/shared/shared-main' |
3 | 3 | ||
4 | export class AccountBlock implements AccountBlockServer { | 4 | export class AccountBlock implements AccountBlockServer { |
5 | byAccount: Account | 5 | byAccount: Account |
diff --git a/client/src/app/shared/blocklist/account-blocklist.component.html b/client/src/app/shared/shared-moderation/account-blocklist.component.html index 486785f35..486785f35 100644 --- a/client/src/app/shared/blocklist/account-blocklist.component.html +++ b/client/src/app/shared/shared-moderation/account-blocklist.component.html | |||
diff --git a/client/src/app/shared/blocklist/account-blocklist.component.scss b/client/src/app/shared/shared-moderation/account-blocklist.component.scss index aa8363ff4..aa8363ff4 100644 --- a/client/src/app/shared/blocklist/account-blocklist.component.scss +++ b/client/src/app/shared/shared-moderation/account-blocklist.component.scss | |||
diff --git a/client/src/app/shared/blocklist/account-blocklist.component.ts b/client/src/app/shared/shared-moderation/account-blocklist.component.ts index dc5ac4044..38e0d0424 100644 --- a/client/src/app/shared/blocklist/account-blocklist.component.ts +++ b/client/src/app/shared/shared-moderation/account-blocklist.component.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import { SortMeta } from 'primeng/api' | ||
1 | import { OnInit } from '@angular/core' | 2 | import { OnInit } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 3 | import { Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { Actor } from '@app/shared/shared-main' | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { RestPagination, RestTable } from '@app/shared/rest' | ||
5 | import { SortMeta } from 'primeng/api' | ||
6 | import { AccountBlock } from './account-block.model' | 6 | import { AccountBlock } from './account-block.model' |
7 | import { BlocklistService, BlocklistComponentType } from './blocklist.service' | 7 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' |
8 | import { Actor } from '@app/shared/actor/actor.model' | ||
9 | 8 | ||
10 | export class GenericAccountBlocklistComponent extends RestTable implements OnInit { | 9 | export class GenericAccountBlocklistComponent extends RestTable implements OnInit { |
11 | // @ts-ignore: "Abstract methods can only appear within an abstract class" | 10 | // @ts-ignore: "Abstract methods can only appear within an abstract class" |
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.html b/client/src/app/shared/shared-moderation/batch-domains-modal.component.html index 1b85c8f48..1b85c8f48 100644 --- a/client/src/app/+admin/config/shared/batch-domains-modal.component.html +++ b/client/src/app/shared/shared-moderation/batch-domains-modal.component.html | |||
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.scss b/client/src/app/shared/shared-moderation/batch-domains-modal.component.scss index 9621a566f..9621a566f 100644 --- a/client/src/app/+admin/config/shared/batch-domains-modal.component.scss +++ b/client/src/app/shared/shared-moderation/batch-domains-modal.component.scss | |||
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.ts b/client/src/app/shared/shared-moderation/batch-domains-modal.component.ts index 620f2726b..fdd4a79a9 100644 --- a/client/src/app/+admin/config/shared/batch-domains-modal.component.ts +++ b/client/src/app/shared/shared-moderation/batch-domains-modal.component.ts | |||
@@ -1,10 +1,8 @@ | |||
1 | import { Component, OnInit, ViewChild, Input, Output, EventEmitter } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { I18n } from '@ngx-translate/i18n-polyfill' | 2 | import { BatchDomainsValidatorsService, FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 4 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
5 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { FormReactive } from '@app/shared/forms' | ||
7 | import { BatchDomainsValidatorsService } from './batch-domains-validators.service' | ||
8 | 6 | ||
9 | @Component({ | 7 | @Component({ |
10 | selector: 'my-batch-domains-modal', | 8 | selector: 'my-batch-domains-modal', |
diff --git a/client/src/app/shared/blocklist/blocklist.service.ts b/client/src/app/shared/shared-moderation/blocklist.service.ts index c70a8173a..0caa92782 100644 --- a/client/src/app/shared/blocklist/blocklist.service.ts +++ b/client/src/app/shared/shared-moderation/blocklist.service.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { environment } from '../../../environments/environment' | ||
3 | import { HttpClient, HttpParams } from '@angular/common/http' | ||
4 | import { RestExtractor, RestPagination, RestService } from '../rest' | ||
5 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
6 | import { catchError, map } from 'rxjs/operators' | 2 | import { catchError, map } from 'rxjs/operators' |
7 | import { AccountBlock as AccountBlockServer, ResultList, ServerBlock } from '../../../../../shared' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
8 | import { Account } from '@app/shared/account/account.model' | 4 | import { Injectable } from '@angular/core' |
9 | import { AccountBlock } from '@app/shared/blocklist/account-block.model' | 5 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
6 | import { AccountBlock as AccountBlockServer, ResultList, ServerBlock } from '@shared/models' | ||
7 | import { environment } from '../../../environments/environment' | ||
8 | import { Account } from '../shared-main' | ||
9 | import { AccountBlock } from './account-block.model' | ||
10 | 10 | ||
11 | export enum BlocklistComponentType { Account, Instance } | 11 | export enum BlocklistComponentType { Account, Instance } |
12 | 12 | ||
diff --git a/client/src/app/shared/bulk/bulk.service.ts b/client/src/app/shared/shared-moderation/bulk.service.ts index b00db31ec..f0b869421 100644 --- a/client/src/app/shared/bulk/bulk.service.ts +++ b/client/src/app/shared/shared-moderation/bulk.service.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { catchError } from 'rxjs/operators' | ||
1 | import { HttpClient } from '@angular/common/http' | 2 | import { HttpClient } from '@angular/common/http' |
2 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { RestExtractor } from '@app/core' | ||
5 | import { BulkRemoveCommentsOfBody } from '@shared/models' | ||
3 | import { environment } from '../../../environments/environment' | 6 | import { environment } from '../../../environments/environment' |
4 | import { RestExtractor, RestService } from '../rest' | ||
5 | import { BulkRemoveCommentsOfBody } from '../../../../../shared' | ||
6 | import { catchError } from 'rxjs/operators' | ||
7 | 7 | ||
8 | @Injectable() | 8 | @Injectable() |
9 | export class BulkService { | 9 | export class BulkService { |
@@ -11,8 +11,7 @@ export class BulkService { | |||
11 | 11 | ||
12 | constructor ( | 12 | constructor ( |
13 | private authHttp: HttpClient, | 13 | private authHttp: HttpClient, |
14 | private restExtractor: RestExtractor, | 14 | private restExtractor: RestExtractor |
15 | private restService: RestService | ||
16 | ) { } | 15 | ) { } |
17 | 16 | ||
18 | removeCommentsOf (body: BulkRemoveCommentsOfBody) { | 17 | removeCommentsOf (body: BulkRemoveCommentsOfBody) { |
diff --git a/client/src/app/shared/shared-moderation/index.ts b/client/src/app/shared/shared-moderation/index.ts new file mode 100644 index 000000000..8e74254f6 --- /dev/null +++ b/client/src/app/shared/shared-moderation/index.ts | |||
@@ -0,0 +1,13 @@ | |||
1 | export * from './account-block.model' | ||
2 | export * from './account-blocklist.component' | ||
3 | export * from './batch-domains-modal.component' | ||
4 | export * from './blocklist.service' | ||
5 | export * from './bulk.service' | ||
6 | export * from './server-blocklist.component' | ||
7 | export * from './user-ban-modal.component' | ||
8 | export * from './user-moderation-dropdown.component' | ||
9 | export * from './video-abuse.service' | ||
10 | export * from './video-block.component' | ||
11 | export * from './video-block.service' | ||
12 | export * from './video-report.component' | ||
13 | export * from './shared-moderation.module' | ||
diff --git a/client/src/app/shared/blocklist/server-blocklist.component.html b/client/src/app/shared/shared-moderation/server-blocklist.component.html index 977e0e141..977e0e141 100644 --- a/client/src/app/shared/blocklist/server-blocklist.component.html +++ b/client/src/app/shared/shared-moderation/server-blocklist.component.html | |||
diff --git a/client/src/app/shared/blocklist/server-blocklist.component.scss b/client/src/app/shared/shared-moderation/server-blocklist.component.scss index 9ddb76850..9ddb76850 100644 --- a/client/src/app/shared/blocklist/server-blocklist.component.scss +++ b/client/src/app/shared/shared-moderation/server-blocklist.component.scss | |||
diff --git a/client/src/app/shared/blocklist/server-blocklist.component.ts b/client/src/app/shared/shared-moderation/server-blocklist.component.ts index f2b36badc..d904d0605 100644 --- a/client/src/app/shared/blocklist/server-blocklist.component.ts +++ b/client/src/app/shared/shared-moderation/server-blocklist.component.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import { SortMeta } from 'primeng/api' | ||
1 | import { OnInit, ViewChild } from '@angular/core' | 2 | import { OnInit, ViewChild } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 3 | import { BatchDomainsModalComponent } from '@app/shared/shared-moderation/batch-domains-modal.component' |
4 | import { Notifier, RestPagination, RestTable } from '@app/core' | ||
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { RestPagination, RestTable } from '@app/shared/rest' | 6 | import { ServerBlock } from '@shared/models' |
5 | import { SortMeta } from 'primeng/api' | 7 | import { BlocklistComponentType, BlocklistService } from './blocklist.service' |
6 | import { BlocklistService, BlocklistComponentType } from './blocklist.service' | ||
7 | import { ServerBlock } from '../../../../../shared/models/blocklist/server-block.model' | ||
8 | import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-domains-modal.component' | ||
9 | 8 | ||
10 | export class GenericServerBlocklistComponent extends RestTable implements OnInit { | 9 | export class GenericServerBlocklistComponent extends RestTable implements OnInit { |
11 | @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent | 10 | @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent |
@@ -26,13 +25,13 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit | |||
26 | super() | 25 | super() |
27 | } | 26 | } |
28 | 27 | ||
28 | // @ts-ignore: "Abstract methods can only appear within an abstract class" | ||
29 | public abstract getIdentifier (): string | ||
30 | |||
29 | ngOnInit () { | 31 | ngOnInit () { |
30 | this.initialize() | 32 | this.initialize() |
31 | } | 33 | } |
32 | 34 | ||
33 | // @ts-ignore: "Abstract methods can only appear within an abstract class" | ||
34 | public abstract getIdentifier (): string | ||
35 | |||
36 | unblockServer (serverBlock: ServerBlock) { | 35 | unblockServer (serverBlock: ServerBlock) { |
37 | const operation = (host: string) => this.mode === BlocklistComponentType.Account | 36 | const operation = (host: string) => this.mode === BlocklistComponentType.Account |
38 | ? this.blocklistService.unblockServerByUser(host) | 37 | ? this.blocklistService.unblockServerByUser(host) |
diff --git a/client/src/app/shared/shared-moderation/shared-moderation.module.ts b/client/src/app/shared/shared-moderation/shared-moderation.module.ts new file mode 100644 index 000000000..f7e64dfa3 --- /dev/null +++ b/client/src/app/shared/shared-moderation/shared-moderation.module.ts | |||
@@ -0,0 +1,46 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { SharedFormModule } from '../shared-forms/shared-form.module' | ||
4 | import { SharedGlobalIconModule } from '../shared-icons' | ||
5 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
6 | import { BatchDomainsModalComponent } from './batch-domains-modal.component' | ||
7 | import { BlocklistService } from './blocklist.service' | ||
8 | import { BulkService } from './bulk.service' | ||
9 | import { UserBanModalComponent } from './user-ban-modal.component' | ||
10 | import { UserModerationDropdownComponent } from './user-moderation-dropdown.component' | ||
11 | import { VideoAbuseService } from './video-abuse.service' | ||
12 | import { VideoBlockComponent } from './video-block.component' | ||
13 | import { VideoBlockService } from './video-block.service' | ||
14 | import { VideoReportComponent } from './video-report.component' | ||
15 | |||
16 | @NgModule({ | ||
17 | imports: [ | ||
18 | SharedMainModule, | ||
19 | SharedFormModule, | ||
20 | SharedGlobalIconModule | ||
21 | ], | ||
22 | |||
23 | declarations: [ | ||
24 | UserBanModalComponent, | ||
25 | UserModerationDropdownComponent, | ||
26 | VideoBlockComponent, | ||
27 | VideoReportComponent, | ||
28 | BatchDomainsModalComponent | ||
29 | ], | ||
30 | |||
31 | exports: [ | ||
32 | UserBanModalComponent, | ||
33 | UserModerationDropdownComponent, | ||
34 | VideoBlockComponent, | ||
35 | VideoReportComponent, | ||
36 | BatchDomainsModalComponent | ||
37 | ], | ||
38 | |||
39 | providers: [ | ||
40 | BlocklistService, | ||
41 | BulkService, | ||
42 | VideoAbuseService, | ||
43 | VideoBlockService | ||
44 | ] | ||
45 | }) | ||
46 | export class SharedModerationModule { } | ||
diff --git a/client/src/app/shared/moderation/user-ban-modal.component.html b/client/src/app/shared/shared-moderation/user-ban-modal.component.html index 365eb1938..365eb1938 100644 --- a/client/src/app/shared/moderation/user-ban-modal.component.html +++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.html | |||
diff --git a/client/src/app/shared/moderation/user-ban-modal.component.scss b/client/src/app/shared/shared-moderation/user-ban-modal.component.scss index 84562f15c..84562f15c 100644 --- a/client/src/app/shared/moderation/user-ban-modal.component.scss +++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.scss | |||
diff --git a/client/src/app/shared/moderation/user-ban-modal.component.ts b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts index 1647e3691..124e58669 100644 --- a/client/src/app/shared/moderation/user-ban-modal.component.ts +++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts | |||
@@ -1,12 +1,10 @@ | |||
1 | import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier, UserService } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
5 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 5 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
6 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { FormReactive, UserValidatorsService } from '@app/shared/forms' | 7 | import { User } from '@shared/models' |
8 | import { UserService } from '@app/shared/users' | ||
9 | import { User } from '../../../../../shared' | ||
10 | 8 | ||
11 | @Component({ | 9 | @Component({ |
12 | selector: 'my-user-ban-modal', | 10 | selector: 'my-user-ban-modal', |
diff --git a/client/src/app/shared/moderation/user-moderation-dropdown.component.html b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.html index 4d562387a..4d562387a 100644 --- a/client/src/app/shared/moderation/user-moderation-dropdown.component.html +++ b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.html | |||
diff --git a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts index 82f39050e..d3c37f082 100644 --- a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts +++ b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts | |||
@@ -1,14 +1,11 @@ | |||
1 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { AuthService, ConfirmService, Notifier, ServerService, UserService } from '@app/core' | ||
3 | import { Account, DropdownAction } from '@app/shared/shared-main' | ||
2 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
3 | import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' | 5 | import { BulkRemoveCommentsOfBody, ServerConfig, User, UserRight } from '@shared/models' |
4 | import { UserBanModalComponent } from '@app/shared/moderation/user-ban-modal.component' | 6 | import { BlocklistService } from './blocklist.service' |
5 | import { UserService } from '@app/shared/users' | 7 | import { BulkService } from './bulk.service' |
6 | import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' | 8 | import { UserBanModalComponent } from './user-ban-modal.component' |
7 | import { User, UserRight } from '../../../../../shared/models/users' | ||
8 | import { Account } from '@app/shared/account/account.model' | ||
9 | import { BlocklistService } from '@app/shared/blocklist' | ||
10 | import { ServerConfig, BulkRemoveCommentsOfBody } from '@shared/models' | ||
11 | import { BulkService } from '../bulk/bulk.service' | ||
12 | 9 | ||
13 | @Component({ | 10 | @Component({ |
14 | selector: 'my-user-moderation-dropdown', | 11 | selector: 'my-user-moderation-dropdown', |
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/shared-moderation/video-abuse.service.ts index 43f4674b1..44dea44a5 100644 --- a/client/src/app/shared/video-abuse/video-abuse.service.ts +++ b/client/src/app/shared/shared-moderation/video-abuse.service.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { omit } from 'lodash-es' | ||
2 | import { SortMeta } from 'primeng/api' | ||
3 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map } from 'rxjs/operators' | 4 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 5 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 6 | import { Injectable } from '@angular/core' |
4 | import { SortMeta } from 'primeng/api' | 7 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
5 | import { Observable } from 'rxjs' | 8 | import { ResultList, VideoAbuse, VideoAbuseCreate, VideoAbuseState, VideoAbuseUpdate } from '@shared/models' |
6 | import { ResultList, VideoAbuse, VideoAbuseCreate, VideoAbuseState, VideoAbuseUpdate } from '../../../../../shared' | ||
7 | import { environment } from '../../../environments/environment' | 9 | import { environment } from '../../../environments/environment' |
8 | import { RestExtractor, RestPagination, RestService } from '../rest' | ||
9 | import { omit } from 'lodash-es' | ||
10 | 10 | ||
11 | @Injectable() | 11 | @Injectable() |
12 | export class VideoAbuseService { | 12 | export class VideoAbuseService { |
diff --git a/client/src/app/shared/video/modals/video-block.component.html b/client/src/app/shared/shared-moderation/video-block.component.html index 5e73d66c5..5e73d66c5 100644 --- a/client/src/app/shared/video/modals/video-block.component.html +++ b/client/src/app/shared/shared-moderation/video-block.component.html | |||
diff --git a/client/src/app/shared/video/modals/video-block.component.scss b/client/src/app/shared/shared-moderation/video-block.component.scss index afcdb9a16..afcdb9a16 100644 --- a/client/src/app/shared/video/modals/video-block.component.scss +++ b/client/src/app/shared/shared-moderation/video-block.component.scss | |||
diff --git a/client/src/app/shared/video/modals/video-block.component.ts b/client/src/app/shared/shared-moderation/video-block.component.ts index 1a25e0578..054651e71 100644 --- a/client/src/app/shared/video/modals/video-block.component.ts +++ b/client/src/app/shared/shared-moderation/video-block.component.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Notifier, RedirectService } from '@app/core' | 2 | import { Notifier } from '@app/core' |
3 | import { VideoBlockService } from '../../video-block' | 3 | import { FormReactive, FormValidatorService, VideoBlockValidatorsService } from '@app/shared/shared-forms' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { Video } from '@app/shared/shared-main' |
5 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
6 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 5 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
7 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 6 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
8 | import { FormReactive, VideoBlockValidatorsService } from '@app/shared/forms' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
9 | import { Video } from '@app/shared/video/video.model' | 8 | import { VideoBlockService } from './video-block.service' |
10 | 9 | ||
11 | @Component({ | 10 | @Component({ |
12 | selector: 'my-video-block', | 11 | selector: 'my-video-block', |
diff --git a/client/src/app/shared/video-block/video-block.service.ts b/client/src/app/shared/shared-moderation/video-block.service.ts index d0673ddba..c22ceefcc 100644 --- a/client/src/app/shared/video-block/video-block.service.ts +++ b/client/src/app/shared/shared-moderation/video-block.service.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { catchError, map, concatMap, toArray } from 'rxjs/operators' | ||
2 | import { HttpClient, HttpParams } from '@angular/common/http' | ||
3 | import { Injectable } from '@angular/core' | ||
4 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
5 | import { from as observableFrom, Observable } from 'rxjs' | 2 | import { from as observableFrom, Observable } from 'rxjs' |
6 | import { VideoBlacklist, VideoBlacklistType, ResultList } from '../../../../../shared' | 3 | import { catchError, concatMap, map, toArray } from 'rxjs/operators' |
4 | import { HttpClient, HttpParams } from '@angular/common/http' | ||
5 | import { Injectable } from '@angular/core' | ||
6 | import { RestExtractor, RestPagination, RestService } from '@app/core' | ||
7 | import { ResultList, VideoBlacklist, VideoBlacklistType } from '@shared/models' | ||
7 | import { environment } from '../../../environments/environment' | 8 | import { environment } from '../../../environments/environment' |
8 | import { RestExtractor, RestPagination, RestService } from '../rest' | ||
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class VideoBlockService { | 11 | export class VideoBlockService { |
diff --git a/client/src/app/shared/video/modals/video-report.component.html b/client/src/app/shared/shared-moderation/video-report.component.html index d6beb6d2a..d6beb6d2a 100644 --- a/client/src/app/shared/video/modals/video-report.component.html +++ b/client/src/app/shared/shared-moderation/video-report.component.html | |||
diff --git a/client/src/app/shared/video/modals/video-report.component.scss b/client/src/app/shared/shared-moderation/video-report.component.scss index b2606cbd8..b2606cbd8 100644 --- a/client/src/app/shared/video/modals/video-report.component.scss +++ b/client/src/app/shared/shared-moderation/video-report.component.scss | |||
diff --git a/client/src/app/shared/video/modals/video-report.component.ts b/client/src/app/shared/shared-moderation/video-report.component.ts index c2d441bba..11c805636 100644 --- a/client/src/app/shared/video/modals/video-report.component.ts +++ b/client/src/app/shared/shared-moderation/video-report.component.ts | |||
@@ -1,17 +1,15 @@ | |||
1 | import { mapValues, pickBy } from 'lodash-es' | ||
2 | import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' | ||
1 | import { Component, Input, OnInit, ViewChild } from '@angular/core' | 3 | import { Component, Input, OnInit, ViewChild } from '@angular/core' |
4 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' | ||
2 | import { Notifier } from '@app/core' | 5 | import { Notifier } from '@app/core' |
3 | import { FormReactive } from '../../../shared/forms' | 6 | import { FormReactive, FormValidatorService, VideoAbuseValidatorsService } from '@app/shared/shared-forms' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
6 | import { VideoAbuseValidatorsService } from '@app/shared/forms/form-validators/video-abuse-validators.service' | ||
7 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 7 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
8 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 8 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
9 | import { VideoAbuseService } from '@app/shared/video-abuse' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
10 | import { Video } from '@app/shared/video/video.model' | 10 | import { videoAbusePredefinedReasonsMap, VideoAbusePredefinedReasonsString } from '@shared/models/videos/abuse/video-abuse-reason.model' |
11 | import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' | 11 | import { Video } from '../shared-main' |
12 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' | 12 | import { VideoAbuseService } from './video-abuse.service' |
13 | import { VideoAbusePredefinedReasonsString, videoAbusePredefinedReasonsMap } from '@shared/models/videos/abuse/video-abuse-reason.model' | ||
14 | import { mapValues, pickBy } from 'lodash-es' | ||
15 | 13 | ||
16 | @Component({ | 14 | @Component({ |
17 | selector: 'my-video-report', | 15 | selector: 'my-video-report', |
diff --git a/client/src/app/shared/shared-thumbnail/index.ts b/client/src/app/shared/shared-thumbnail/index.ts new file mode 100644 index 000000000..e09692867 --- /dev/null +++ b/client/src/app/shared/shared-thumbnail/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './video-thumbnail.component' | ||
2 | export * from './shared-thumbnail.module' | ||
diff --git a/client/src/app/shared/shared-thumbnail/shared-thumbnail.module.ts b/client/src/app/shared/shared-thumbnail/shared-thumbnail.module.ts new file mode 100644 index 000000000..8ac557c14 --- /dev/null +++ b/client/src/app/shared/shared-thumbnail/shared-thumbnail.module.ts | |||
@@ -0,0 +1,23 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { SharedGlobalIconModule } from '../shared-icons' | ||
4 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
5 | import { VideoThumbnailComponent } from './video-thumbnail.component' | ||
6 | |||
7 | @NgModule({ | ||
8 | imports: [ | ||
9 | SharedMainModule, | ||
10 | SharedGlobalIconModule | ||
11 | ], | ||
12 | |||
13 | declarations: [ | ||
14 | VideoThumbnailComponent | ||
15 | ], | ||
16 | |||
17 | exports: [ | ||
18 | VideoThumbnailComponent | ||
19 | ], | ||
20 | |||
21 | providers: [ ] | ||
22 | }) | ||
23 | export class SharedThumbnailModule { } | ||
diff --git a/client/src/app/shared/video/video-thumbnail.component.html b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html index fe5510c56..fe5510c56 100644 --- a/client/src/app/shared/video/video-thumbnail.component.html +++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html | |||
diff --git a/client/src/app/shared/video/video-thumbnail.component.scss b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss index feff78a87..feff78a87 100644 --- a/client/src/app/shared/video/video-thumbnail.component.scss +++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss | |||
diff --git a/client/src/app/shared/video/video-thumbnail.component.ts b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts index 111b4c8bb..3ff45d9b7 100644 --- a/client/src/app/shared/video/video-thumbnail.component.ts +++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component, EventEmitter, Input, Output } from '@angular/core' | 1 | import { Component, EventEmitter, Input, Output } from '@angular/core' |
2 | import { Video } from './video.model' | 2 | import { ScreenService } from '@app/core' |
3 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 3 | import { I18n } from '@ngx-translate/i18n-polyfill' |
4 | import { Video } from '../shared-main' | ||
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'my-video-thumbnail', | 7 | selector: 'my-video-thumbnail', |
diff --git a/client/src/app/shared/shared-user-settings/index.ts b/client/src/app/shared/shared-user-settings/index.ts new file mode 100644 index 000000000..dcc08bdce --- /dev/null +++ b/client/src/app/shared/shared-user-settings/index.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export * from './user-interface-settings.component' | ||
2 | export * from './user-video-settings.component' | ||
3 | |||
4 | export * from './shared-user-settings.module' | ||
diff --git a/client/src/app/shared/shared-user-settings/shared-user-settings.module.ts b/client/src/app/shared/shared-user-settings/shared-user-settings.module.ts new file mode 100644 index 000000000..395f2e3d0 --- /dev/null +++ b/client/src/app/shared/shared-user-settings/shared-user-settings.module.ts | |||
@@ -0,0 +1,26 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { SharedFormModule } from '../shared-forms' | ||
4 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
5 | import { UserInterfaceSettingsComponent } from './user-interface-settings.component' | ||
6 | import { UserVideoSettingsComponent } from './user-video-settings.component' | ||
7 | |||
8 | @NgModule({ | ||
9 | imports: [ | ||
10 | SharedMainModule, | ||
11 | SharedFormModule | ||
12 | ], | ||
13 | |||
14 | declarations: [ | ||
15 | UserInterfaceSettingsComponent, | ||
16 | UserVideoSettingsComponent | ||
17 | ], | ||
18 | |||
19 | exports: [ | ||
20 | UserInterfaceSettingsComponent, | ||
21 | UserVideoSettingsComponent | ||
22 | ], | ||
23 | |||
24 | providers: [ ] | ||
25 | }) | ||
26 | export class SharedUserInterfaceSettingsModule { } | ||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.html b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html index 0d0ddc0f2..0d0ddc0f2 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.html +++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html | |||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.scss b/client/src/app/shared/shared-user-settings/user-interface-settings.component.scss index 7818dfc02..7818dfc02 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.scss +++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.scss | |||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts index b6c17c0e3..875ffa3f1 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts +++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts | |||
@@ -1,19 +1,16 @@ | |||
1 | import { Component, Input, OnInit, OnDestroy } from '@angular/core' | ||
2 | import { Notifier, ServerService } from '@app/core' | ||
3 | import { ServerConfig, UserUpdateMe } from '../../../../../../shared' | ||
4 | import { AuthService } from '../../../core' | ||
5 | import { FormReactive } from '../../../shared/forms/form-reactive' | ||
6 | import { User, UserService } from '../../../shared/users' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
9 | import { Subject, Subscription } from 'rxjs' | 1 | import { Subject, Subscription } from 'rxjs' |
2 | import { Component, Input, OnDestroy, OnInit } from '@angular/core' | ||
3 | import { AuthService, Notifier, ServerService, UserService } from '@app/core' | ||
4 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | ||
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
6 | import { ServerConfig, User, UserUpdateMe } from '@shared/models' | ||
10 | 7 | ||
11 | @Component({ | 8 | @Component({ |
12 | selector: 'my-account-interface-settings', | 9 | selector: 'my-user-interface-settings', |
13 | templateUrl: './my-account-interface-settings.component.html', | 10 | templateUrl: './user-interface-settings.component.html', |
14 | styleUrls: [ './my-account-interface-settings.component.scss' ] | 11 | styleUrls: [ './user-interface-settings.component.scss' ] |
15 | }) | 12 | }) |
16 | export class MyAccountInterfaceSettingsComponent extends FormReactive implements OnInit, OnDestroy { | 13 | export class UserInterfaceSettingsComponent extends FormReactive implements OnInit, OnDestroy { |
17 | @Input() user: User = null | 14 | @Input() user: User = null |
18 | @Input() reactiveUpdate = false | 15 | @Input() reactiveUpdate = false |
19 | @Input() notifyOnUpdate = true | 16 | @Input() notifyOnUpdate = true |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html b/client/src/app/shared/shared-user-settings/user-video-settings.component.html index 0dda33af2..0dda33af2 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html +++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.html | |||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.scss b/client/src/app/shared/shared-user-settings/user-video-settings.component.scss index 430250b87..430250b87 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.scss +++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.scss | |||
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts b/client/src/app/shared/shared-user-settings/user-video-settings.component.ts index 0aaa54cd7..4e4539936 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts +++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.ts | |||
@@ -1,23 +1,20 @@ | |||
1 | import { Component, Input, OnInit, OnDestroy } from '@angular/core' | 1 | import { pick } from 'lodash-es' |
2 | import { Notifier, ServerService } from '@app/core' | ||
3 | import { UserUpdateMe } from '../../../../../../shared/models/users' | ||
4 | import { User, UserService } from '@app/shared/users' | ||
5 | import { AuthService } from '../../../core' | ||
6 | import { FormReactive } from '@app/shared/forms/form-reactive' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
9 | import { forkJoin, Subject, Subscription } from 'rxjs' | ||
10 | import { SelectItem } from 'primeng/api' | 2 | import { SelectItem } from 'primeng/api' |
3 | import { forkJoin, Subject, Subscription } from 'rxjs' | ||
11 | import { first } from 'rxjs/operators' | 4 | import { first } from 'rxjs/operators' |
5 | import { Component, Input, OnDestroy, OnInit } from '@angular/core' | ||
6 | import { AuthService, Notifier, ServerService, User, UserService } from '@app/core' | ||
7 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { UserUpdateMe } from '@shared/models' | ||
12 | import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' | 10 | import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' |
13 | import { pick } from 'lodash-es' | ||
14 | 11 | ||
15 | @Component({ | 12 | @Component({ |
16 | selector: 'my-account-video-settings', | 13 | selector: 'my-user-video-settings', |
17 | templateUrl: './my-account-video-settings.component.html', | 14 | templateUrl: './user-video-settings.component.html', |
18 | styleUrls: [ './my-account-video-settings.component.scss' ] | 15 | styleUrls: [ './user-video-settings.component.scss' ] |
19 | }) | 16 | }) |
20 | export class MyAccountVideoSettingsComponent extends FormReactive implements OnInit, OnDestroy { | 17 | export class UserVideoSettingsComponent extends FormReactive implements OnInit, OnDestroy { |
21 | @Input() user: User = null | 18 | @Input() user: User = null |
22 | @Input() reactiveUpdate = false | 19 | @Input() reactiveUpdate = false |
23 | @Input() notifyOnUpdate = true | 20 | @Input() notifyOnUpdate = true |
diff --git a/client/src/app/shared/user-subscription/index.ts b/client/src/app/shared/shared-user-subscription/index.ts index e76940f7b..fd53d14b5 100644 --- a/client/src/app/shared/user-subscription/index.ts +++ b/client/src/app/shared/shared-user-subscription/index.ts | |||
@@ -1,3 +1,5 @@ | |||
1 | export * from './user-subscription.service' | 1 | export * from './user-subscription.service' |
2 | export * from './subscribe-button.component' | 2 | export * from './subscribe-button.component' |
3 | export * from './remote-subscribe.component' | 3 | export * from './remote-subscribe.component' |
4 | |||
5 | export * from './shared-user-subscription.module' | ||
diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.html b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.html index acfec0a8e..acfec0a8e 100644 --- a/client/src/app/shared/user-subscription/remote-subscribe.component.html +++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.html | |||
diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.scss b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.scss index 698c5866a..698c5866a 100644 --- a/client/src/app/shared/user-subscription/remote-subscribe.component.scss +++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.scss | |||
diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.ts b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts index befdb7157..09164a5d3 100644 --- a/client/src/app/shared/user-subscription/remote-subscribe.component.ts +++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts | |||
@@ -1,9 +1,5 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { FormReactive } from '@app/shared/forms/form-reactive' | 2 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
3 | import { | ||
4 | FormValidatorService, | ||
5 | UserValidatorsService | ||
6 | } from '@app/shared/forms/form-validators' | ||
7 | 3 | ||
8 | @Component({ | 4 | @Component({ |
9 | selector: 'my-remote-subscribe', | 5 | selector: 'my-remote-subscribe', |
diff --git a/client/src/app/shared/shared-user-subscription/shared-user-subscription.module.ts b/client/src/app/shared/shared-user-subscription/shared-user-subscription.module.ts new file mode 100644 index 000000000..cddea80bf --- /dev/null +++ b/client/src/app/shared/shared-user-subscription/shared-user-subscription.module.ts | |||
@@ -0,0 +1,29 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { SharedFormModule } from '../shared-forms' | ||
4 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
5 | import { RemoteSubscribeComponent } from './remote-subscribe.component' | ||
6 | import { SubscribeButtonComponent } from './subscribe-button.component' | ||
7 | import { UserSubscriptionService } from './user-subscription.service' | ||
8 | |||
9 | @NgModule({ | ||
10 | imports: [ | ||
11 | SharedMainModule, | ||
12 | SharedFormModule | ||
13 | ], | ||
14 | |||
15 | declarations: [ | ||
16 | RemoteSubscribeComponent, | ||
17 | SubscribeButtonComponent | ||
18 | ], | ||
19 | |||
20 | exports: [ | ||
21 | RemoteSubscribeComponent, | ||
22 | SubscribeButtonComponent | ||
23 | ], | ||
24 | |||
25 | providers: [ | ||
26 | UserSubscriptionService | ||
27 | ] | ||
28 | }) | ||
29 | export class SharedUserSubscriptionModule { } | ||
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.html b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html index 85b3d1fdb..85b3d1fdb 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.html +++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html | |||
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.scss b/client/src/app/shared/shared-user-subscription/subscribe-button.component.scss index b739c5ae2..b739c5ae2 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.scss +++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.scss | |||
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.ts b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts index 947f34c85..72fa3f4fd 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.ts +++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts | |||
@@ -1,13 +1,11 @@ | |||
1 | import { Component, Input, OnInit, OnChanges } from '@angular/core' | 1 | import { concat, forkJoin, merge } from 'rxjs' |
2 | import { Component, Input, OnChanges, OnInit } from '@angular/core' | ||
2 | import { Router } from '@angular/router' | 3 | import { Router } from '@angular/router' |
3 | import { AuthService, Notifier } from '@app/core' | 4 | import { AuthService, Notifier } from '@app/core' |
4 | import { UserSubscriptionService } from '@app/shared/user-subscription/user-subscription.service' | 5 | import { Account, VideoChannel, VideoService } from '@app/shared/shared-main' |
5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { VideoService } from '@app/shared/video/video.service' | 7 | import { FeedFormat } from '@shared/models' |
8 | import { FeedFormat } from '../../../../../shared/models/feeds' | 8 | import { UserSubscriptionService } from './user-subscription.service' |
9 | import { Account } from '@app/shared/account/account.model' | ||
10 | import { concat, forkJoin, merge } from 'rxjs' | ||
11 | 9 | ||
12 | @Component({ | 10 | @Component({ |
13 | selector: 'my-subscribe-button', | 11 | selector: 'my-subscribe-button', |
diff --git a/client/src/app/shared/user-subscription/user-subscription.service.ts b/client/src/app/shared/shared-user-subscription/user-subscription.service.ts index 9af9ba23e..732ed6bcb 100644 --- a/client/src/app/shared/user-subscription/user-subscription.service.ts +++ b/client/src/app/shared/shared-user-subscription/user-subscription.service.ts | |||
@@ -1,17 +1,14 @@ | |||
1 | import { bufferTime, catchError, filter, map, observeOn, share, switchMap, tap } from 'rxjs/operators' | 1 | import * as debug from 'debug' |
2 | import { uniq } from 'lodash-es' | ||
2 | import { asyncScheduler, merge, Observable, of, ReplaySubject, Subject } from 'rxjs' | 3 | import { asyncScheduler, merge, Observable, of, ReplaySubject, Subject } from 'rxjs' |
4 | import { bufferTime, catchError, filter, map, observeOn, share, switchMap, tap } from 'rxjs/operators' | ||
3 | import { HttpClient, HttpParams } from '@angular/common/http' | 5 | import { HttpClient, HttpParams } from '@angular/common/http' |
4 | import { Injectable, NgZone } from '@angular/core' | 6 | import { Injectable, NgZone } from '@angular/core' |
5 | import { ResultList } from '../../../../../shared' | 7 | import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core' |
8 | import { enterZone, leaveZone } from '@app/helpers' | ||
9 | import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' | ||
10 | import { ResultList, VideoChannel as VideoChannelServer, VideoSortField } from '@shared/models' | ||
6 | import { environment } from '../../../environments/environment' | 11 | import { environment } from '../../../environments/environment' |
7 | import { RestExtractor, RestService } from '../rest' | ||
8 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
9 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
10 | import { VideoChannel as VideoChannelServer } from '../../../../../shared/models/videos' | ||
11 | import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model' | ||
12 | import { uniq } from 'lodash-es' | ||
13 | import * as debug from 'debug' | ||
14 | import { enterZone, leaveZone } from '@app/shared/rxjs/zone' | ||
15 | 12 | ||
16 | const logger = debug('peertube:subscriptions:UserSubscriptionService') | 13 | const logger = debug('peertube:subscriptions:UserSubscriptionService') |
17 | 14 | ||
@@ -33,6 +30,7 @@ export class UserSubscriptionService { | |||
33 | constructor ( | 30 | constructor ( |
34 | private authHttp: HttpClient, | 31 | private authHttp: HttpClient, |
35 | private restExtractor: RestExtractor, | 32 | private restExtractor: RestExtractor, |
33 | private videoService: VideoService, | ||
36 | private restService: RestService, | 34 | private restService: RestService, |
37 | private ngZone: NgZone | 35 | private ngZone: NgZone |
38 | ) { | 36 | ) { |
@@ -51,6 +49,27 @@ export class UserSubscriptionService { | |||
51 | ) | 49 | ) |
52 | } | 50 | } |
53 | 51 | ||
52 | getUserSubscriptionVideos (parameters: { | ||
53 | videoPagination: ComponentPaginationLight, | ||
54 | sort: VideoSortField, | ||
55 | skipCount?: boolean | ||
56 | }): Observable<ResultList<Video>> { | ||
57 | const { videoPagination, sort, skipCount } = parameters | ||
58 | const pagination = this.restService.componentPaginationToRestPagination(videoPagination) | ||
59 | |||
60 | let params = new HttpParams() | ||
61 | params = this.restService.addRestGetParams(params, pagination, sort) | ||
62 | |||
63 | if (skipCount) params = params.set('skipCount', skipCount + '') | ||
64 | |||
65 | return this.authHttp | ||
66 | .get<ResultList<Video>>(UserSubscriptionService.BASE_USER_SUBSCRIPTIONS_URL + '/videos', { params }) | ||
67 | .pipe( | ||
68 | switchMap(res => this.videoService.extractVideos(res)), | ||
69 | catchError(err => this.restExtractor.handleError(err)) | ||
70 | ) | ||
71 | } | ||
72 | |||
54 | /** | 73 | /** |
55 | * Subscription part | 74 | * Subscription part |
56 | */ | 75 | */ |
diff --git a/client/src/app/shared/video/abstract-video-list.html b/client/src/app/shared/shared-video-miniature/abstract-video-list.html index 1e919ee72..1e919ee72 100644 --- a/client/src/app/shared/video/abstract-video-list.html +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.html | |||
diff --git a/client/src/app/shared/video/abstract-video-list.scss b/client/src/app/shared/shared-video-miniature/abstract-video-list.scss index 7f23098aa..7f23098aa 100644 --- a/client/src/app/shared/video/abstract-video-list.scss +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.scss | |||
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts index 0bc339ff6..0ef842652 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts | |||
@@ -1,23 +1,25 @@ | |||
1 | import { fromEvent, Observable, of, Subject, Subscription } from 'rxjs' | 1 | import { fromEvent, Observable, Subject, Subscription } from 'rxjs' |
2 | import { debounceTime, tap, throttleTime, switchMap } from 'rxjs/operators' | 2 | import { debounceTime, switchMap, tap } from 'rxjs/operators' |
3 | import { OnDestroy, OnInit } from '@angular/core' | 3 | import { OnDestroy, OnInit } from '@angular/core' |
4 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
5 | import { Notifier, ServerService } from '@app/core' | 5 | import { |
6 | AuthService, | ||
7 | ComponentPaginationLight, | ||
8 | LocalStorageService, | ||
9 | Notifier, | ||
10 | ScreenService, | ||
11 | ServerService, | ||
12 | User, | ||
13 | UserService | ||
14 | } from '@app/core' | ||
6 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' | 15 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' |
7 | import { GlobalIconName } from '@app/shared/images/global-icon.component' | 16 | import { GlobalIconName } from '@app/shared/shared-icons' |
8 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
9 | import { Syndication } from '@app/shared/video/syndication.model' | ||
10 | import { MiniatureDisplayOptions, OwnerDisplayType } from '@app/shared/video/video-miniature.component' | ||
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | 17 | import { I18n } from '@ngx-translate/i18n-polyfill' |
12 | import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date' | 18 | import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date' |
13 | import { ServerConfig } from '@shared/models' | 19 | import { ServerConfig, VideoSortField } from '@shared/models' |
14 | import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' | 20 | import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' |
15 | import { AuthService } from '../../core/auth' | 21 | import { Syndication, Video } from '../shared-main' |
16 | import { LocalStorageService } from '../misc/storage.service' | 22 | import { MiniatureDisplayOptions, OwnerDisplayType } from './video-miniature.component' |
17 | import { ComponentPaginationLight } from '../rest/component-pagination.model' | ||
18 | import { User, UserService } from '../users' | ||
19 | import { VideoSortField } from './sort-field.type' | ||
20 | import { Video } from './video.model' | ||
21 | 23 | ||
22 | enum GroupDate { | 24 | enum GroupDate { |
23 | UNKNOWN = 0, | 25 | UNKNOWN = 0, |
diff --git a/client/src/app/shared/shared-video-miniature/index.ts b/client/src/app/shared/shared-video-miniature/index.ts new file mode 100644 index 000000000..47ca6f51b --- /dev/null +++ b/client/src/app/shared/shared-video-miniature/index.ts | |||
@@ -0,0 +1,7 @@ | |||
1 | export * from './abstract-video-list' | ||
2 | export * from './video-actions-dropdown.component' | ||
3 | export * from './video-download.component' | ||
4 | export * from './video-miniature.component' | ||
5 | export * from './videos-selection.component' | ||
6 | |||
7 | export * from './shared-video-miniature.module' | ||
diff --git a/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts new file mode 100644 index 000000000..666144864 --- /dev/null +++ b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts | |||
@@ -0,0 +1,40 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { SharedFormModule } from '../shared-forms' | ||
4 | import { SharedGlobalIconModule } from '../shared-icons' | ||
5 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
6 | import { SharedModerationModule } from '../shared-moderation' | ||
7 | import { SharedThumbnailModule } from '../shared-thumbnail' | ||
8 | import { SharedVideoPlaylistModule } from '../shared-video-playlist/shared-video-playlist.module' | ||
9 | import { VideoActionsDropdownComponent } from './video-actions-dropdown.component' | ||
10 | import { VideoDownloadComponent } from './video-download.component' | ||
11 | import { VideoMiniatureComponent } from './video-miniature.component' | ||
12 | import { VideosSelectionComponent } from './videos-selection.component' | ||
13 | |||
14 | @NgModule({ | ||
15 | imports: [ | ||
16 | SharedMainModule, | ||
17 | SharedFormModule, | ||
18 | SharedModerationModule, | ||
19 | SharedVideoPlaylistModule, | ||
20 | SharedThumbnailModule, | ||
21 | SharedGlobalIconModule | ||
22 | ], | ||
23 | |||
24 | declarations: [ | ||
25 | VideoActionsDropdownComponent, | ||
26 | VideoDownloadComponent, | ||
27 | VideoMiniatureComponent, | ||
28 | VideosSelectionComponent | ||
29 | ], | ||
30 | |||
31 | exports: [ | ||
32 | VideoActionsDropdownComponent, | ||
33 | VideoDownloadComponent, | ||
34 | VideoMiniatureComponent, | ||
35 | VideosSelectionComponent | ||
36 | ], | ||
37 | |||
38 | providers: [ ] | ||
39 | }) | ||
40 | export class SharedVideoMiniatureModule { } | ||
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.html b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html index 3c8271b65..3c8271b65 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.html +++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html | |||
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.scss b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss index 67d7ee86a..67d7ee86a 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.scss +++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss | |||
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts index 1f5763610..db8d1c309 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts | |||
@@ -1,19 +1,12 @@ | |||
1 | import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' |
2 | import { I18n } from '@ngx-translate/i18n-polyfill' | 2 | import { AuthService, ConfirmService, Notifier, ScreenService } from '@app/core' |
3 | import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component' | 3 | import { VideoBlockComponent, VideoBlockService, VideoReportComponent } from '@app/shared/shared-moderation' |
4 | import { AuthService, ConfirmService, Notifier } from '@app/core' | ||
5 | import { Video } from '@app/shared/video/video.model' | ||
6 | import { VideoService } from '@app/shared/video/video.service' | ||
7 | import { VideoDetails } from '@app/shared/video/video-details.model' | ||
8 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' |
9 | import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
10 | import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component' | ||
11 | import { VideoReportComponent } from '@app/shared/video/modals/video-report.component' | ||
12 | import { VideoBlockComponent } from '@app/shared/video/modals/video-block.component' | ||
13 | import { VideoBlockService } from '@app/shared/video-block' | ||
14 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
15 | import { VideoCaption } from '@shared/models' | 6 | import { VideoCaption } from '@shared/models' |
16 | import { RedundancyService } from '@app/shared/video/redundancy.service' | 7 | import { DropdownAction, DropdownButtonSize, DropdownDirection, RedundancyService, Video, VideoDetails, VideoService } from '../shared-main' |
8 | import { VideoAddToPlaylistComponent } from '../shared-video-playlist' | ||
9 | import { VideoDownloadComponent } from './video-download.component' | ||
17 | 10 | ||
18 | export type VideoActionsDisplayType = { | 11 | export type VideoActionsDisplayType = { |
19 | playlist?: boolean | 12 | playlist?: boolean |
diff --git a/client/src/app/shared/video/modals/video-download.component.html b/client/src/app/shared/shared-video-miniature/video-download.component.html index c65e371ee..c65e371ee 100644 --- a/client/src/app/shared/video/modals/video-download.component.html +++ b/client/src/app/shared/shared-video-miniature/video-download.component.html | |||
diff --git a/client/src/app/shared/video/modals/video-download.component.scss b/client/src/app/shared/shared-video-miniature/video-download.component.scss index b09078bea..b09078bea 100644 --- a/client/src/app/shared/video/modals/video-download.component.scss +++ b/client/src/app/shared/shared-video-miniature/video-download.component.scss | |||
diff --git a/client/src/app/shared/video/modals/video-download.component.ts b/client/src/app/shared/shared-video-miniature/video-download.component.ts index d77187821..21df8b674 100644 --- a/client/src/app/shared/video/modals/video-download.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-download.component.ts | |||
@@ -1,14 +1,12 @@ | |||
1 | import { Component, ElementRef, ViewChild } from '@angular/core' | ||
2 | import { VideoDetails } from '../../../shared/video/video-details.model' | ||
3 | import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | import { AuthService, Notifier } from '@app/core' | ||
6 | import { VideoPrivacy, VideoCaption, VideoFile } from '@shared/models' | ||
7 | import { FfprobeFormat, FfprobeStream } from 'fluent-ffmpeg' | 1 | import { FfprobeFormat, FfprobeStream } from 'fluent-ffmpeg' |
8 | import { mapValues, pick } from 'lodash-es' | 2 | import { mapValues, pick } from 'lodash-es' |
9 | import { NumberFormatterPipe } from '@app/shared/angular/number-formatter.pipe' | ||
10 | import { BytesPipe } from 'ngx-pipes' | 3 | import { BytesPipe } from 'ngx-pipes' |
11 | import { VideoService } from '../video.service' | 4 | import { Component, ElementRef, ViewChild } from '@angular/core' |
5 | import { AuthService, Notifier } from '@app/core' | ||
6 | import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { VideoCaption, VideoFile, VideoPrivacy } from '@shared/models' | ||
9 | import { NumberFormatterPipe, VideoDetails, VideoService } from '../shared-main' | ||
12 | 10 | ||
13 | type DownloadType = 'video' | 'subtitles' | 11 | type DownloadType = 'video' | 'subtitles' |
14 | type FileMetadata = { [key: string]: { label: string, value: string }} | 12 | type FileMetadata = { [key: string]: { label: string, value: string }} |
diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html index 82afc866f..82afc866f 100644 --- a/client/src/app/shared/video/video-miniature.component.html +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html | |||
diff --git a/client/src/app/shared/video/video-miniature.component.scss b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss index 38cac5b6e..38cac5b6e 100644 --- a/client/src/app/shared/video/video-miniature.component.scss +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss | |||
diff --git a/client/src/app/shared/video/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts index a08c3fc8d..6f32977b3 100644 --- a/client/src/app/shared/video/video-miniature.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts | |||
@@ -10,14 +10,12 @@ import { | |||
10 | OnInit, | 10 | OnInit, |
11 | Output | 11 | Output |
12 | } from '@angular/core' | 12 | } from '@angular/core' |
13 | import { AuthService, ServerService } from '@app/core' | 13 | import { AuthService, ScreenService, ServerService, User } from '@app/core' |
14 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
15 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
16 | import { VideoActionsDisplayType } from '@app/shared/video/video-actions-dropdown.component' | ||
17 | import { I18n } from '@ngx-translate/i18n-polyfill' | 14 | import { I18n } from '@ngx-translate/i18n-polyfill' |
18 | import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '../../../../../shared' | 15 | import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '../../../../../shared' |
19 | import { User } from '../users' | 16 | import { Video } from '../shared-main' |
20 | import { Video } from './video.model' | 17 | import { VideoPlaylistService } from '../shared-video-playlist' |
18 | import { VideoActionsDisplayType } from './video-actions-dropdown.component' | ||
21 | 19 | ||
22 | export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto' | 20 | export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto' |
23 | export type MiniatureDisplayOptions = { | 21 | export type MiniatureDisplayOptions = { |
diff --git a/client/src/app/shared/video/videos-selection.component.html b/client/src/app/shared/shared-video-miniature/videos-selection.component.html index 44aa567b9..44aa567b9 100644 --- a/client/src/app/shared/video/videos-selection.component.html +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.html | |||
diff --git a/client/src/app/shared/video/videos-selection.component.scss b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss index d3cbabf23..d3cbabf23 100644 --- a/client/src/app/shared/video/videos-selection.component.scss +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss | |||
diff --git a/client/src/app/shared/video/videos-selection.component.ts b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts index 9453664dd..3e0e3b983 100644 --- a/client/src/app/shared/video/videos-selection.component.ts +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | import { Observable } from 'rxjs' | ||
1 | import { | 2 | import { |
2 | AfterContentInit, | 3 | AfterContentInit, |
3 | Component, | 4 | Component, |
@@ -11,19 +12,12 @@ import { | |||
11 | TemplateRef | 12 | TemplateRef |
12 | } from '@angular/core' | 13 | } from '@angular/core' |
13 | import { ActivatedRoute, Router } from '@angular/router' | 14 | import { ActivatedRoute, Router } from '@angular/router' |
14 | import { AbstractVideoList } from '@app/shared/video/abstract-video-list' | 15 | import { AuthService, ComponentPagination, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
15 | import { AuthService, Notifier, ServerService } from '@app/core' | ||
16 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
17 | import { MiniatureDisplayOptions, OwnerDisplayType } from '@app/shared/video/video-miniature.component' | ||
18 | import { Observable } from 'rxjs' | ||
19 | import { Video } from '@app/shared/video/video.model' | ||
20 | import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive' | ||
21 | import { VideoSortField } from '@app/shared/video/sort-field.type' | ||
22 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | ||
23 | import { I18n } from '@ngx-translate/i18n-polyfill' | 16 | import { I18n } from '@ngx-translate/i18n-polyfill' |
24 | import { ResultList } from '@shared/models' | 17 | import { ResultList, VideoSortField } from '@shared/models' |
25 | import { UserService } from '../users' | 18 | import { PeerTubeTemplateDirective, Video } from '../shared-main' |
26 | import { LocalStorageService } from '../misc/storage.service' | 19 | import { AbstractVideoList } from './abstract-video-list' |
20 | import { MiniatureDisplayOptions, OwnerDisplayType } from './video-miniature.component' | ||
27 | 21 | ||
28 | export type SelectionType = { [ id: number ]: boolean } | 22 | export type SelectionType = { [ id: number ]: boolean } |
29 | 23 | ||
diff --git a/client/src/app/shared/shared-video-playlist/index.ts b/client/src/app/shared/shared-video-playlist/index.ts new file mode 100644 index 000000000..63bb046c6 --- /dev/null +++ b/client/src/app/shared/shared-video-playlist/index.ts | |||
@@ -0,0 +1,8 @@ | |||
1 | export * from './video-add-to-playlist.component' | ||
2 | export * from './video-playlist-element-miniature.component' | ||
3 | export * from './video-playlist-element.model' | ||
4 | export * from './video-playlist-miniature.component' | ||
5 | export * from './video-playlist.model' | ||
6 | export * from './video-playlist.service' | ||
7 | |||
8 | export * from './shared-video-playlist.module' | ||
diff --git a/client/src/app/shared/shared-video-playlist/shared-video-playlist.module.ts b/client/src/app/shared/shared-video-playlist/shared-video-playlist.module.ts new file mode 100644 index 000000000..0566b1592 --- /dev/null +++ b/client/src/app/shared/shared-video-playlist/shared-video-playlist.module.ts | |||
@@ -0,0 +1,36 @@ | |||
1 | |||
2 | import { NgModule } from '@angular/core' | ||
3 | import { SharedFormModule } from '../shared-forms' | ||
4 | import { SharedGlobalIconModule } from '../shared-icons' | ||
5 | import { SharedMainModule } from '../shared-main/shared-main.module' | ||
6 | import { SharedThumbnailModule } from '../shared-thumbnail' | ||
7 | import { VideoAddToPlaylistComponent } from './video-add-to-playlist.component' | ||
8 | import { VideoPlaylistElementMiniatureComponent } from './video-playlist-element-miniature.component' | ||
9 | import { VideoPlaylistMiniatureComponent } from './video-playlist-miniature.component' | ||
10 | import { VideoPlaylistService } from './video-playlist.service' | ||
11 | |||
12 | @NgModule({ | ||
13 | imports: [ | ||
14 | SharedMainModule, | ||
15 | SharedFormModule, | ||
16 | SharedThumbnailModule, | ||
17 | SharedGlobalIconModule | ||
18 | ], | ||
19 | |||
20 | declarations: [ | ||
21 | VideoAddToPlaylistComponent, | ||
22 | VideoPlaylistElementMiniatureComponent, | ||
23 | VideoPlaylistMiniatureComponent | ||
24 | ], | ||
25 | |||
26 | exports: [ | ||
27 | VideoAddToPlaylistComponent, | ||
28 | VideoPlaylistElementMiniatureComponent, | ||
29 | VideoPlaylistMiniatureComponent | ||
30 | ], | ||
31 | |||
32 | providers: [ | ||
33 | VideoPlaylistService | ||
34 | ] | ||
35 | }) | ||
36 | export class SharedVideoPlaylistModule { } | ||
diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.html b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html index a40e0699e..a40e0699e 100644 --- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.html +++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html | |||
diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.scss b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss index 47baa997b..47baa997b 100644 --- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.scss +++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss | |||
diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts index 0c593a79a..f611fc46b 100644 --- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts | |||
@@ -1,15 +1,13 @@ | |||
1 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core' | 1 | import * as debug from 'debug' |
2 | import { CachedPlaylist, VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
3 | import { AuthService, Notifier } from '@app/core' | ||
4 | import { Subject, Subscription } from 'rxjs' | 2 | import { Subject, Subscription } from 'rxjs' |
5 | import { debounceTime, filter } from 'rxjs/operators' | 3 | import { debounceTime, filter } from 'rxjs/operators' |
6 | import { Video, VideoPlaylistCreate, VideoPlaylistElementCreate, VideoPlaylistPrivacy } from '@shared/models' | 4 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core' |
7 | import { FormReactive, FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/forms' | 5 | import { AuthService, DisableForReuseHook, Notifier } from '@app/core' |
6 | import { FormReactive, FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { Video, VideoExistInPlaylist, VideoPlaylistCreate, VideoPlaylistElementCreate, VideoPlaylistPrivacy } from '@shared/models' | ||
9 | import { secondsToTime } from '../../../assets/player/utils' | 9 | import { secondsToTime } from '../../../assets/player/utils' |
10 | import * as debug from 'debug' | 10 | import { CachedPlaylist, VideoPlaylistService } from './video-playlist.service' |
11 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' | ||
12 | import { VideoExistInPlaylist } from '@shared/models/videos/playlist/video-exist-in-playlist.model' | ||
13 | 11 | ||
14 | const logger = debug('peertube:playlists:VideoAddToPlaylistComponent') | 12 | const logger = debug('peertube:playlists:VideoAddToPlaylistComponent') |
15 | 13 | ||
diff --git a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html index e3f7ef017..e3f7ef017 100644 --- a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.html +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html | |||
diff --git a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.scss b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss index afd775b25..afd775b25 100644 --- a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.scss +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss | |||
diff --git a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts index fad03e045..57a5fbe61 100644 --- a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts | |||
@@ -1,15 +1,13 @@ | |||
1 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Video } from '@app/shared/video/video.model' | 2 | import { AuthService, Notifier, ServerService } from '@app/core' |
3 | import { ServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models' | 3 | import { Video } from '@app/shared/shared-main' |
4 | import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' | ||
5 | import { ActivatedRoute } from '@angular/router' | ||
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { VideoService } from '@app/shared/video/video.service' | ||
8 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
9 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' |
10 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { ServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models' | ||
11 | import { secondsToTime } from '../../../assets/player/utils' | 7 | import { secondsToTime } from '../../../assets/player/utils' |
12 | import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model' | 8 | import { VideoPlaylistElement } from './video-playlist-element.model' |
9 | import { VideoPlaylist } from './video-playlist.model' | ||
10 | import { VideoPlaylistService } from './video-playlist.service' | ||
13 | 11 | ||
14 | @Component({ | 12 | @Component({ |
15 | selector: 'my-video-playlist-element-miniature', | 13 | selector: 'my-video-playlist-element-miniature', |
@@ -46,10 +44,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit { | |||
46 | private authService: AuthService, | 44 | private authService: AuthService, |
47 | private serverService: ServerService, | 45 | private serverService: ServerService, |
48 | private notifier: Notifier, | 46 | private notifier: Notifier, |
49 | private confirmService: ConfirmService, | ||
50 | private route: ActivatedRoute, | ||
51 | private i18n: I18n, | 47 | private i18n: I18n, |
52 | private videoService: VideoService, | ||
53 | private videoPlaylistService: VideoPlaylistService, | 48 | private videoPlaylistService: VideoPlaylistService, |
54 | private cdr: ChangeDetectorRef | 49 | private cdr: ChangeDetectorRef |
55 | ) {} | 50 | ) {} |
diff --git a/client/src/app/shared/video-playlist/video-playlist-element.model.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts index f1c46d1eb..27a79d1fd 100644 --- a/client/src/app/shared/video-playlist/video-playlist-element.model.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '../../../../../shared/models/videos' | 1 | import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '../../../../../shared/models/videos' |
2 | import { Video } from '@app/shared/video/video.model' | 2 | import { Video } from '@app/shared/shared-main' |
3 | 3 | ||
4 | export class VideoPlaylistElement implements ServerVideoPlaylistElement { | 4 | export class VideoPlaylistElement implements ServerVideoPlaylistElement { |
5 | id: number | 5 | id: number |
diff --git a/client/src/app/shared/video-playlist/video-playlist-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html index 86f6664cb..86f6664cb 100644 --- a/client/src/app/shared/video-playlist/video-playlist-miniature.component.html +++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html | |||
diff --git a/client/src/app/shared/video-playlist/video-playlist-miniature.component.scss b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss index 1b16dbb01..1b16dbb01 100644 --- a/client/src/app/shared/video-playlist/video-playlist-miniature.component.scss +++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss | |||
diff --git a/client/src/app/shared/video-playlist/video-playlist-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts index 523e96f2a..4b0669a32 100644 --- a/client/src/app/shared/video-playlist/video-playlist-miniature.component.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | 2 | import { VideoPlaylist } from './video-playlist.model' |
3 | 3 | ||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-video-playlist-miniature', | 5 | selector: 'my-video-playlist-miniature', |
diff --git a/client/src/app/shared/video-playlist/video-playlist.model.ts b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts index 6f27e7475..8f63d2abd 100644 --- a/client/src/app/shared/video-playlist/video-playlist.model.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts | |||
@@ -1,13 +1,14 @@ | |||
1 | import { getAbsoluteAPIUrl } from '@app/helpers' | ||
2 | import { Actor } from '@app/shared/shared-main' | ||
1 | import { | 3 | import { |
4 | AccountSummary, | ||
5 | peertubeTranslate, | ||
2 | VideoChannelSummary, | 6 | VideoChannelSummary, |
3 | VideoConstant, | 7 | VideoConstant, |
4 | VideoPlaylist as ServerVideoPlaylist, | 8 | VideoPlaylist as ServerVideoPlaylist, |
5 | VideoPlaylistPrivacy, | 9 | VideoPlaylistPrivacy, |
6 | VideoPlaylistType | 10 | VideoPlaylistType |
7 | } from '../../../../../shared/models/videos' | 11 | } from '@shared/models' |
8 | import { AccountSummary, peertubeTranslate } from '@shared/models' | ||
9 | import { Actor } from '@app/shared/actor/actor.model' | ||
10 | import { getAbsoluteAPIUrl } from '@app/shared/misc/utils' | ||
11 | 12 | ||
12 | export class VideoPlaylist implements ServerVideoPlaylist { | 13 | export class VideoPlaylist implements ServerVideoPlaylist { |
13 | id: number | 14 | id: number |
diff --git a/client/src/app/shared/video-playlist/video-playlist.service.ts b/client/src/app/shared/shared-video-playlist/video-playlist.service.ts index 38d915c6b..cc3d04b9e 100644 --- a/client/src/app/shared/video-playlist/video-playlist.service.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist.service.ts | |||
@@ -1,29 +1,27 @@ | |||
1 | import { bufferTime, catchError, filter, map, observeOn, share, switchMap, tap } from 'rxjs/operators' | 1 | import * as debug from 'debug' |
2 | import { Injectable, NgZone } from '@angular/core' | 2 | import { uniq } from 'lodash-es' |
3 | import { asyncScheduler, merge, Observable, of, ReplaySubject, Subject } from 'rxjs' | 3 | import { asyncScheduler, merge, Observable, of, ReplaySubject, Subject } from 'rxjs' |
4 | import { RestExtractor } from '../rest/rest-extractor.service' | 4 | import { bufferTime, catchError, filter, map, observeOn, share, switchMap, tap } from 'rxjs/operators' |
5 | import { HttpClient, HttpParams } from '@angular/common/http' | 5 | import { HttpClient, HttpParams } from '@angular/common/http' |
6 | import { ResultList, VideoPlaylistElementCreate, VideoPlaylistElementUpdate } from '../../../../../shared' | 6 | import { Injectable, NgZone } from '@angular/core' |
7 | import { AuthUser, ComponentPaginationLight, RestExtractor, RestService, ServerService } from '@app/core' | ||
8 | import { enterZone, leaveZone, objectToFormData } from '@app/helpers' | ||
9 | import { Account, AccountService, VideoChannel, VideoChannelService } from '@app/shared/shared-main' | ||
10 | import { | ||
11 | ResultList, | ||
12 | VideoExistInPlaylist, | ||
13 | VideoPlaylist as VideoPlaylistServerModel, | ||
14 | VideoPlaylistCreate, | ||
15 | VideoPlaylistElement as ServerVideoPlaylistElement, | ||
16 | VideoPlaylistElementCreate, | ||
17 | VideoPlaylistElementUpdate, | ||
18 | VideoPlaylistReorder, | ||
19 | VideoPlaylistUpdate, | ||
20 | VideosExistInPlaylists | ||
21 | } from '@shared/models' | ||
7 | import { environment } from '../../../environments/environment' | 22 | import { environment } from '../../../environments/environment' |
8 | import { VideoPlaylist as VideoPlaylistServerModel } from '@shared/models/videos/playlist/video-playlist.model' | 23 | import { VideoPlaylistElement } from './video-playlist-element.model' |
9 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 24 | import { VideoPlaylist } from './video-playlist.model' |
10 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | ||
11 | import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' | ||
12 | import { VideoPlaylistUpdate } from '@shared/models/videos/playlist/video-playlist-update.model' | ||
13 | import { objectToFormData } from '@app/shared/misc/utils' | ||
14 | import { AuthUser, ServerService } from '@app/core' | ||
15 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | ||
16 | import { AccountService } from '@app/shared/account/account.service' | ||
17 | import { Account } from '@app/shared/account/account.model' | ||
18 | import { RestService } from '@app/shared/rest' | ||
19 | import { VideoExistInPlaylist, VideosExistInPlaylists } from '@shared/models/videos/playlist/video-exist-in-playlist.model' | ||
20 | import { VideoPlaylistReorder } from '@shared/models/videos/playlist/video-playlist-reorder.model' | ||
21 | import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model' | ||
22 | import { VideoPlaylistElement as ServerVideoPlaylistElement } from '@shared/models/videos/playlist/video-playlist-element.model' | ||
23 | import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model' | ||
24 | import { uniq } from 'lodash-es' | ||
25 | import * as debug from 'debug' | ||
26 | import { enterZone, leaveZone } from '@app/shared/rxjs/zone' | ||
27 | 25 | ||
28 | const logger = debug('peertube:playlists:VideoPlaylistService') | 26 | const logger = debug('peertube:playlists:VideoPlaylistService') |
29 | 27 | ||
diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts deleted file mode 100644 index 98fab9e16..000000000 --- a/client/src/app/shared/shared.module.ts +++ /dev/null | |||
@@ -1,337 +0,0 @@ | |||
1 | import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes' | ||
2 | import { SharedModule as PrimeSharedModule } from 'primeng/api' | ||
3 | import { InputMaskModule } from 'primeng/inputmask' | ||
4 | import { InputSwitchModule } from 'primeng/inputswitch' | ||
5 | import { MultiSelectModule } from 'primeng/multiselect' | ||
6 | import { ClipboardModule } from '@angular/cdk/clipboard' | ||
7 | import { CommonModule } from '@angular/common' | ||
8 | import { HttpClientModule } from '@angular/common/http' | ||
9 | import { NgModule } from '@angular/core' | ||
10 | import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||
11 | import { RouterModule } from '@angular/router' | ||
12 | import { BatchDomainsValidatorsService } from '@app/+admin/config/shared/batch-domains-validators.service' | ||
13 | import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-domains-modal.component' | ||
14 | import { MyAccountInterfaceSettingsComponent } from '@app/+my-account/my-account-settings/my-account-interface' | ||
15 | import { MyAccountVideoSettingsComponent } from '@app/+my-account/my-account-settings/my-account-video-settings' | ||
16 | import { ActorAvatarInfoComponent } from '@app/+my-account/shared/actor-avatar-info.component' | ||
17 | import { AccountService } from '@app/shared/account/account.service' | ||
18 | import { FromNowPipe } from '@app/shared/angular/from-now.pipe' | ||
19 | import { HighlightPipe } from '@app/shared/angular/highlight.pipe' | ||
20 | import { NumberFormatterPipe } from '@app/shared/angular/number-formatter.pipe' | ||
21 | import { ObjectLengthPipe } from '@app/shared/angular/object-length.pipe' | ||
22 | import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive' | ||
23 | import { VideoDurationPipe } from '@app/shared/angular/video-duration-formatter.pipe' | ||
24 | import { BlocklistService } from '@app/shared/blocklist' | ||
25 | import { ActionDropdownComponent } from '@app/shared/buttons/action-dropdown.component' | ||
26 | import { AvatarComponent } from '@app/shared/channel/avatar.component' | ||
27 | import { ConfirmComponent } from '@app/shared/confirm/confirm.component' | ||
28 | import { DateToggleComponent } from '@app/shared/date/date-toggle.component' | ||
29 | import { | ||
30 | CustomConfigValidatorsService, | ||
31 | InstanceValidatorsService, | ||
32 | LoginValidatorsService, | ||
33 | ReactiveFileComponent, | ||
34 | ResetPasswordValidatorsService, | ||
35 | TextareaAutoResizeDirective, | ||
36 | UserValidatorsService, | ||
37 | VideoAbuseValidatorsService, | ||
38 | VideoAcceptOwnershipValidatorsService, | ||
39 | VideoBlockValidatorsService, | ||
40 | VideoChangeOwnershipValidatorsService, | ||
41 | VideoChannelValidatorsService, | ||
42 | VideoCommentValidatorsService, | ||
43 | VideoPlaylistValidatorsService, | ||
44 | VideoValidatorsService | ||
45 | } from '@app/shared/forms' | ||
46 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
47 | import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validators/video-captions-validators.service' | ||
48 | import { InputReadonlyCopyComponent } from '@app/shared/forms/input-readonly-copy.component' | ||
49 | import { MarkdownTextareaComponent } from '@app/shared/forms/markdown-textarea.component' | ||
50 | import { PeertubeCheckboxComponent } from '@app/shared/forms/peertube-checkbox.component' | ||
51 | import { TimestampInputComponent } from '@app/shared/forms/timestamp-input.component' | ||
52 | import { I18nPrimengCalendarService } from '@app/shared/i18n/i18n-primeng-calendar' | ||
53 | import { GlobalIconComponent } from '@app/shared/images/global-icon.component' | ||
54 | import { PreviewUploadComponent } from '@app/shared/images/preview-upload.component' | ||
55 | import { FeatureBooleanComponent } from '@app/shared/instance/feature-boolean.component' | ||
56 | import { FollowService } from '@app/shared/instance/follow.service' | ||
57 | import { InstanceFeaturesTableComponent } from '@app/shared/instance/instance-features-table.component' | ||
58 | import { InstanceStatisticsComponent } from '@app/shared/instance/instance-statistics.component' | ||
59 | import { InstanceService } from '@app/shared/instance/instance.service' | ||
60 | import { TopMenuDropdownComponent } from '@app/shared/menu/top-menu-dropdown.component' | ||
61 | import { HelpComponent } from '@app/shared/misc/help.component' | ||
62 | import { ListOverflowComponent } from '@app/shared/misc/list-overflow.component' | ||
63 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
64 | import { SmallLoaderComponent } from '@app/shared/misc/small-loader.component' | ||
65 | import { LocalStorageService, SessionStorageService } from '@app/shared/misc/storage.service' | ||
66 | import { UserBanModalComponent } from '@app/shared/moderation' | ||
67 | import { UserModerationDropdownComponent } from '@app/shared/moderation/user-moderation-dropdown.component' | ||
68 | import { OverviewService } from '@app/shared/overview' | ||
69 | import { HtmlRendererService, LinkifierService, MarkdownService } from '@app/shared/renderer' | ||
70 | import { RemoteSubscribeComponent, SubscribeButtonComponent, UserSubscriptionService } from '@app/shared/user-subscription' | ||
71 | import { UserHistoryService } from '@app/shared/users/user-history.service' | ||
72 | import { UserNotificationService } from '@app/shared/users/user-notification.service' | ||
73 | import { UserNotificationsComponent } from '@app/shared/users/user-notifications.component' | ||
74 | import { VideoCaptionService } from '@app/shared/video-caption' | ||
75 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
76 | import { VideoImportService } from '@app/shared/video-import/video-import.service' | ||
77 | import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component' | ||
78 | import { VideoPlaylistElementMiniatureComponent } from '@app/shared/video-playlist/video-playlist-element-miniature.component' | ||
79 | import { VideoPlaylistMiniatureComponent } from '@app/shared/video-playlist/video-playlist-miniature.component' | ||
80 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
81 | import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive' | ||
82 | import { VideoBlockComponent } from '@app/shared/video/modals/video-block.component' | ||
83 | import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component' | ||
84 | import { VideoReportComponent } from '@app/shared/video/modals/video-report.component' | ||
85 | import { RedundancyService } from '@app/shared/video/redundancy.service' | ||
86 | import { VideoActionsDropdownComponent } from '@app/shared/video/video-actions-dropdown.component' | ||
87 | import { VideosSelectionComponent } from '@app/shared/video/videos-selection.component' | ||
88 | import { | ||
89 | NgbCollapseModule, | ||
90 | NgbDropdownModule, | ||
91 | NgbModalModule, | ||
92 | NgbNavModule, | ||
93 | NgbPopoverModule, | ||
94 | NgbTooltipModule | ||
95 | } from '@ng-bootstrap/ng-bootstrap' | ||
96 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
97 | import { AUTH_INTERCEPTOR_PROVIDER } from './auth' | ||
98 | import { BulkService } from './bulk/bulk.service' | ||
99 | import { ButtonComponent } from './buttons/button.component' | ||
100 | import { DeleteButtonComponent } from './buttons/delete-button.component' | ||
101 | import { EditButtonComponent } from './buttons/edit-button.component' | ||
102 | import { LoaderComponent } from './misc/loader.component' | ||
103 | import { RestExtractor, RestService } from './rest' | ||
104 | import { UserService } from './users' | ||
105 | import { VideoAbuseService } from './video-abuse' | ||
106 | import { VideoBlockService } from './video-block' | ||
107 | import { VideoOwnershipService } from './video-ownership' | ||
108 | import { FeedComponent } from './video/feed.component' | ||
109 | import { VideoMiniatureComponent } from './video/video-miniature.component' | ||
110 | import { VideoThumbnailComponent } from './video/video-thumbnail.component' | ||
111 | import { VideoService } from './video/video.service' | ||
112 | |||
113 | @NgModule({ | ||
114 | imports: [ | ||
115 | CommonModule, | ||
116 | FormsModule, | ||
117 | ReactiveFormsModule, | ||
118 | RouterModule, | ||
119 | HttpClientModule, | ||
120 | |||
121 | NgbDropdownModule, | ||
122 | NgbModalModule, | ||
123 | NgbPopoverModule, | ||
124 | NgbNavModule, | ||
125 | NgbTooltipModule, | ||
126 | NgbCollapseModule, | ||
127 | |||
128 | ClipboardModule, | ||
129 | |||
130 | PrimeSharedModule, | ||
131 | InputMaskModule, | ||
132 | NgPipesModule, | ||
133 | MultiSelectModule, | ||
134 | InputSwitchModule | ||
135 | ], | ||
136 | |||
137 | declarations: [ | ||
138 | LoaderComponent, | ||
139 | SmallLoaderComponent, | ||
140 | |||
141 | VideoThumbnailComponent, | ||
142 | VideoMiniatureComponent, | ||
143 | VideoPlaylistMiniatureComponent, | ||
144 | VideoAddToPlaylistComponent, | ||
145 | VideoPlaylistElementMiniatureComponent, | ||
146 | VideosSelectionComponent, | ||
147 | VideoActionsDropdownComponent, | ||
148 | |||
149 | VideoDownloadComponent, | ||
150 | VideoReportComponent, | ||
151 | VideoBlockComponent, | ||
152 | |||
153 | FeedComponent, | ||
154 | |||
155 | ButtonComponent, | ||
156 | DeleteButtonComponent, | ||
157 | EditButtonComponent, | ||
158 | |||
159 | NumberFormatterPipe, | ||
160 | ObjectLengthPipe, | ||
161 | FromNowPipe, | ||
162 | HighlightPipe, | ||
163 | PeerTubeTemplateDirective, | ||
164 | VideoDurationPipe, | ||
165 | |||
166 | ActionDropdownComponent, | ||
167 | MarkdownTextareaComponent, | ||
168 | InfiniteScrollerDirective, | ||
169 | TextareaAutoResizeDirective, | ||
170 | HelpComponent, | ||
171 | ListOverflowComponent, | ||
172 | |||
173 | ReactiveFileComponent, | ||
174 | PeertubeCheckboxComponent, | ||
175 | TimestampInputComponent, | ||
176 | InputReadonlyCopyComponent, | ||
177 | |||
178 | AvatarComponent, | ||
179 | SubscribeButtonComponent, | ||
180 | RemoteSubscribeComponent, | ||
181 | InstanceFeaturesTableComponent, | ||
182 | InstanceStatisticsComponent, | ||
183 | FeatureBooleanComponent, | ||
184 | UserBanModalComponent, | ||
185 | UserModerationDropdownComponent, | ||
186 | TopMenuDropdownComponent, | ||
187 | UserNotificationsComponent, | ||
188 | ConfirmComponent, | ||
189 | DateToggleComponent, | ||
190 | |||
191 | GlobalIconComponent, | ||
192 | PreviewUploadComponent, | ||
193 | |||
194 | MyAccountVideoSettingsComponent, | ||
195 | MyAccountInterfaceSettingsComponent, | ||
196 | ActorAvatarInfoComponent, | ||
197 | BatchDomainsModalComponent | ||
198 | ], | ||
199 | |||
200 | exports: [ | ||
201 | CommonModule, | ||
202 | FormsModule, | ||
203 | ReactiveFormsModule, | ||
204 | RouterModule, | ||
205 | HttpClientModule, | ||
206 | |||
207 | NgbDropdownModule, | ||
208 | NgbModalModule, | ||
209 | NgbPopoverModule, | ||
210 | NgbNavModule, | ||
211 | NgbTooltipModule, | ||
212 | NgbCollapseModule, | ||
213 | |||
214 | ClipboardModule, | ||
215 | |||
216 | PrimeSharedModule, | ||
217 | InputMaskModule, | ||
218 | BytesPipe, | ||
219 | KeysPipe, | ||
220 | MultiSelectModule, | ||
221 | |||
222 | LoaderComponent, | ||
223 | SmallLoaderComponent, | ||
224 | |||
225 | VideoThumbnailComponent, | ||
226 | VideoMiniatureComponent, | ||
227 | VideoPlaylistMiniatureComponent, | ||
228 | VideoAddToPlaylistComponent, | ||
229 | VideoPlaylistElementMiniatureComponent, | ||
230 | VideosSelectionComponent, | ||
231 | VideoActionsDropdownComponent, | ||
232 | |||
233 | VideoDownloadComponent, | ||
234 | VideoReportComponent, | ||
235 | VideoBlockComponent, | ||
236 | |||
237 | FeedComponent, | ||
238 | |||
239 | ButtonComponent, | ||
240 | DeleteButtonComponent, | ||
241 | EditButtonComponent, | ||
242 | |||
243 | ActionDropdownComponent, | ||
244 | MarkdownTextareaComponent, | ||
245 | InfiniteScrollerDirective, | ||
246 | TextareaAutoResizeDirective, | ||
247 | HelpComponent, | ||
248 | ListOverflowComponent, | ||
249 | InputReadonlyCopyComponent, | ||
250 | |||
251 | ReactiveFileComponent, | ||
252 | PeertubeCheckboxComponent, | ||
253 | TimestampInputComponent, | ||
254 | |||
255 | AvatarComponent, | ||
256 | SubscribeButtonComponent, | ||
257 | RemoteSubscribeComponent, | ||
258 | InstanceFeaturesTableComponent, | ||
259 | InstanceStatisticsComponent, | ||
260 | UserBanModalComponent, | ||
261 | UserModerationDropdownComponent, | ||
262 | TopMenuDropdownComponent, | ||
263 | UserNotificationsComponent, | ||
264 | ConfirmComponent, | ||
265 | DateToggleComponent, | ||
266 | |||
267 | GlobalIconComponent, | ||
268 | PreviewUploadComponent, | ||
269 | |||
270 | NumberFormatterPipe, | ||
271 | ObjectLengthPipe, | ||
272 | FromNowPipe, | ||
273 | HighlightPipe, | ||
274 | PeerTubeTemplateDirective, | ||
275 | VideoDurationPipe, | ||
276 | |||
277 | MyAccountVideoSettingsComponent, | ||
278 | MyAccountInterfaceSettingsComponent, | ||
279 | ActorAvatarInfoComponent, | ||
280 | BatchDomainsModalComponent | ||
281 | ], | ||
282 | |||
283 | providers: [ | ||
284 | AUTH_INTERCEPTOR_PROVIDER, | ||
285 | RestExtractor, | ||
286 | RestService, | ||
287 | VideoAbuseService, | ||
288 | VideoBlockService, | ||
289 | VideoOwnershipService, | ||
290 | UserService, | ||
291 | VideoService, | ||
292 | AccountService, | ||
293 | VideoChannelService, | ||
294 | VideoPlaylistService, | ||
295 | VideoCaptionService, | ||
296 | VideoImportService, | ||
297 | UserSubscriptionService, | ||
298 | |||
299 | FormValidatorService, | ||
300 | CustomConfigValidatorsService, | ||
301 | LoginValidatorsService, | ||
302 | ResetPasswordValidatorsService, | ||
303 | UserValidatorsService, | ||
304 | BatchDomainsValidatorsService, | ||
305 | VideoPlaylistValidatorsService, | ||
306 | VideoAbuseValidatorsService, | ||
307 | VideoChannelValidatorsService, | ||
308 | VideoCommentValidatorsService, | ||
309 | VideoValidatorsService, | ||
310 | VideoCaptionsValidatorsService, | ||
311 | VideoBlockValidatorsService, | ||
312 | OverviewService, | ||
313 | VideoChangeOwnershipValidatorsService, | ||
314 | VideoAcceptOwnershipValidatorsService, | ||
315 | InstanceValidatorsService, | ||
316 | BlocklistService, | ||
317 | UserHistoryService, | ||
318 | InstanceService, | ||
319 | BulkService, | ||
320 | |||
321 | MarkdownService, | ||
322 | LinkifierService, | ||
323 | HtmlRendererService, | ||
324 | |||
325 | I18nPrimengCalendarService, | ||
326 | ScreenService, | ||
327 | LocalStorageService, SessionStorageService, | ||
328 | |||
329 | UserNotificationService, | ||
330 | |||
331 | FollowService, | ||
332 | RedundancyService, | ||
333 | |||
334 | I18n | ||
335 | ] | ||
336 | }) | ||
337 | export class SharedModule { } | ||
diff --git a/client/src/app/shared/video-abuse/index.ts b/client/src/app/shared/video-abuse/index.ts deleted file mode 100644 index 92cbfb5f9..000000000 --- a/client/src/app/shared/video-abuse/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './video-abuse.service' | ||
diff --git a/client/src/app/shared/video-block/index.ts b/client/src/app/shared/video-block/index.ts deleted file mode 100644 index a99551a38..000000000 --- a/client/src/app/shared/video-block/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './video-block.service' | ||
diff --git a/client/src/app/shared/video-caption/index.ts b/client/src/app/shared/video-caption/index.ts deleted file mode 100644 index c48a70558..000000000 --- a/client/src/app/shared/video-caption/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './video-caption.service' | ||
diff --git a/client/src/app/shared/video-import/index.ts b/client/src/app/shared/video-import/index.ts deleted file mode 100644 index 9bb73ec2c..000000000 --- a/client/src/app/shared/video-import/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './video-import.service' | ||
diff --git a/client/src/app/shared/video-ownership/index.ts b/client/src/app/shared/video-ownership/index.ts deleted file mode 100644 index fe8902ee2..000000000 --- a/client/src/app/shared/video-ownership/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './video-ownership.service' | ||
diff --git a/client/src/app/shared/video/sort-field.type.ts b/client/src/app/shared/video/sort-field.type.ts deleted file mode 100644 index 65b24d946..000000000 --- a/client/src/app/shared/video/sort-field.type.ts +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | export type VideoSortField = 'name' | '-name' | ||
2 | | 'duration' | '-duration' | ||
3 | | 'publishedAt' | '-publishedAt' | ||
4 | | 'createdAt' | '-createdAt' | ||
5 | | 'views' | '-views' | ||
6 | | 'likes' | '-likes' | ||
7 | | 'trending' | '-trending' | ||
8 | |||
9 | export type CommentSortField = 'createdAt' | '-createdAt' | ||
10 | | 'totalReplies' | '-totalReplies' | ||
diff --git a/client/src/app/shared/i18n/i18n-primeng-calendar.ts b/client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts index b05852ff8..b05852ff8 100644 --- a/client/src/app/shared/i18n/i18n-primeng-calendar.ts +++ b/client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts | |||
diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts index 9856aac9e..a90d04ce8 100644 --- a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { FormReactive } from '@app/shared' | ||
3 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
4 | import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validators/video-captions-validators.service' | ||
5 | import { ServerService } from '@app/core' | 2 | import { ServerService } from '@app/core' |
6 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' | 3 | import { FormReactive, FormValidatorService, VideoCaptionsValidatorsService } from '@app/shared/shared-forms' |
4 | import { VideoCaptionEdit } from '@app/shared/shared-main' | ||
7 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | 5 | import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' |
8 | import { ServerConfig, VideoConstant } from '../../../../../../shared' | 6 | import { ServerConfig, VideoConstant } from '@shared/models' |
9 | 7 | ||
10 | @Component({ | 8 | @Component({ |
11 | selector: 'my-video-caption-add-modal', | 9 | selector: 'my-video-caption-add-modal', |
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 15073fc44..239e453ad 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 | |||
@@ -1,19 +1,13 @@ | |||
1 | import { map } from 'rxjs/operators' | ||
1 | import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' | 2 | import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' |
2 | import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms' | 3 | import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ServerService } from '@app/core' |
4 | import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared' | 5 | import { removeElementFromArray } from '@app/helpers' |
5 | import { Notifier } from '@app/core' | 6 | import { FormReactiveValidationMessages, FormValidatorService, VideoValidatorsService } from '@app/shared/shared-forms' |
6 | import { ServerService } from '../../../core/server' | 7 | import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' |
7 | import { VideoEdit } from '../../../shared/video/video-edit.model' | 8 | import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' |
8 | import { map } from 'rxjs/operators' | 9 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' |
9 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 10 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' |
10 | import { I18nPrimengCalendarService } from '@app/shared/i18n/i18n-primeng-calendar' | ||
11 | import { VideoCaptionService } from '@app/shared/video-caption' | ||
12 | import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/video-caption-add-modal.component' | ||
13 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' | ||
14 | import { removeElementFromArray } from '@app/shared/misc/utils' | ||
15 | import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared' | ||
16 | import { VideoService } from '@app/shared/video/video.service' | ||
17 | 11 | ||
18 | @Component({ | 12 | @Component({ |
19 | selector: 'my-video-edit', | 13 | selector: 'my-video-edit', |
@@ -60,11 +54,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
60 | constructor ( | 54 | constructor ( |
61 | private formValidatorService: FormValidatorService, | 55 | private formValidatorService: FormValidatorService, |
62 | private videoValidatorsService: VideoValidatorsService, | 56 | private videoValidatorsService: VideoValidatorsService, |
63 | private videoCaptionService: VideoCaptionService, | ||
64 | private videoService: VideoService, | 57 | private videoService: VideoService, |
65 | private route: ActivatedRoute, | ||
66 | private router: Router, | ||
67 | private notifier: Notifier, | ||
68 | private serverService: ServerService, | 58 | private serverService: ServerService, |
69 | private i18nPrimengCalendarService: I18nPrimengCalendarService, | 59 | private i18nPrimengCalendarService: I18nPrimengCalendarService, |
70 | private ngZone: NgZone | 60 | private ngZone: NgZone |
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.module.ts b/client/src/app/videos/+video-edit/shared/video-edit.module.ts index 1357d607c..96061a300 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.module.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.module.ts | |||
@@ -1,16 +1,20 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | import { TagInputModule } from 'ngx-chips' | 1 | import { TagInputModule } from 'ngx-chips' |
3 | import { SharedModule } from '../../../shared/' | ||
4 | import { VideoEditComponent } from './video-edit.component' | ||
5 | import { CalendarModule } from 'primeng/calendar' | 2 | import { CalendarModule } from 'primeng/calendar' |
3 | import { NgModule } from '@angular/core' | ||
4 | import { SharedFormModule } from '@app/shared/shared-forms' | ||
5 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | ||
6 | import { SharedMainModule } from '@app/shared/shared-main' | ||
6 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' | 7 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' |
8 | import { VideoEditComponent } from './video-edit.component' | ||
7 | 9 | ||
8 | @NgModule({ | 10 | @NgModule({ |
9 | imports: [ | 11 | imports: [ |
10 | TagInputModule, | 12 | TagInputModule, |
11 | CalendarModule, | 13 | CalendarModule, |
12 | 14 | ||
13 | SharedModule | 15 | SharedMainModule, |
16 | SharedFormModule, | ||
17 | SharedGlobalIconModule | ||
14 | ], | 18 | ], |
15 | 19 | ||
16 | declarations: [ | 20 | declarations: [ |
@@ -22,6 +26,10 @@ import { VideoCaptionAddModalComponent } from './video-caption-add-modal.compone | |||
22 | TagInputModule, | 26 | TagInputModule, |
23 | CalendarModule, | 27 | CalendarModule, |
24 | 28 | ||
29 | SharedMainModule, | ||
30 | SharedFormModule, | ||
31 | SharedGlobalIconModule, | ||
32 | |||
25 | VideoEditComponent | 33 | VideoEditComponent |
26 | ], | 34 | ], |
27 | 35 | ||
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts index 4d0b0b080..5b453a1d9 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts | |||
@@ -1,17 +1,13 @@ | |||
1 | import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Router } from '@angular/router' | 2 | import { Router } from '@angular/router' |
3 | import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos' | 3 | import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core' |
4 | import { AuthService, Notifier, ServerService } from '../../../core' | 4 | import { scrollToTop } from '@app/helpers' |
5 | import { VideoService } from '../../../shared/video/video.service' | 5 | import { FormValidatorService } from '@app/shared/shared-forms' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' |
7 | import { LoadingBarService } from '@ngx-loading-bar/core' | ||
8 | import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' | 7 | import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' |
9 | import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' | 8 | import { LoadingBarService } from '@ngx-loading-bar/core' |
10 | import { VideoEdit } from '@app/shared/video/video-edit.model' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { FormValidatorService } from '@app/shared' | 10 | import { VideoPrivacy, VideoUpdate } from '@shared/models' |
12 | import { VideoCaptionService } from '@app/shared/video-caption' | ||
13 | import { VideoImportService } from '@app/shared/video-import' | ||
14 | import { scrollToTop } from '@app/shared/misc/utils' | ||
15 | 11 | ||
16 | @Component({ | 12 | @Component({ |
17 | selector: 'my-video-import-torrent', | 13 | selector: 'my-video-import-torrent', |
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts index 213c42333..d0bd1f54d 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts | |||
@@ -1,18 +1,14 @@ | |||
1 | import { map, switchMap } from 'rxjs/operators' | ||
1 | import { Component, EventEmitter, OnInit, Output } from '@angular/core' | 2 | import { Component, EventEmitter, OnInit, Output } from '@angular/core' |
2 | import { Router } from '@angular/router' | 3 | import { Router } from '@angular/router' |
3 | import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos' | 4 | import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core' |
4 | import { AuthService, Notifier, ServerService } from '../../../core' | 5 | import { getAbsoluteAPIUrl, scrollToTop } from '@app/helpers' |
5 | import { VideoService } from '../../../shared/video/video.service' | 6 | import { FormValidatorService } from '@app/shared/shared-forms' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' |
7 | import { LoadingBarService } from '@ngx-loading-bar/core' | ||
8 | import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' | 8 | import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' |
9 | import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' | 9 | import { LoadingBarService } from '@ngx-loading-bar/core' |
10 | import { VideoEdit } from '@app/shared/video/video-edit.model' | 10 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { FormValidatorService } from '@app/shared' | 11 | import { VideoPrivacy, VideoUpdate } from '@shared/models' |
12 | import { VideoCaptionService } from '@app/shared/video-caption' | ||
13 | import { VideoImportService } from '@app/shared/video-import' | ||
14 | import { scrollToTop, getAbsoluteAPIUrl } from '@app/shared/misc/utils' | ||
15 | import { switchMap, map } from 'rxjs/operators' | ||
16 | 12 | ||
17 | @Component({ | 13 | @Component({ |
18 | selector: 'my-video-import-url', | 14 | selector: 'my-video-import-url', |
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-send.ts b/client/src/app/videos/+video-edit/video-add-components/video-send.ts index b32f16950..94479321d 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-send.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-send.ts | |||
@@ -1,15 +1,11 @@ | |||
1 | import { catchError, switchMap, tap } from 'rxjs/operators' | ||
1 | import { EventEmitter, OnInit } from '@angular/core' | 2 | import { EventEmitter, OnInit } from '@angular/core' |
3 | import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core' | ||
4 | import { populateAsyncUserVideoChannels } from '@app/helpers' | ||
5 | import { FormReactive } from '@app/shared/shared-forms' | ||
6 | import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' | ||
2 | import { LoadingBarService } from '@ngx-loading-bar/core' | 7 | import { LoadingBarService } from '@ngx-loading-bar/core' |
3 | import { AuthService, Notifier, ServerService } from '@app/core' | 8 | import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' |
4 | import { catchError, switchMap, tap } from 'rxjs/operators' | ||
5 | import { FormReactive } from '@app/shared' | ||
6 | import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared' | ||
7 | import { VideoService } from '@app/shared/video/video.service' | ||
8 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' | ||
9 | import { VideoCaptionService } from '@app/shared/video-caption' | ||
10 | import { VideoEdit } from '@app/shared/video/video-edit.model' | ||
11 | import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils' | ||
12 | import { CanComponentDeactivateResult } from '@app/shared/guards/can-deactivate-guard.service' | ||
13 | 9 | ||
14 | export abstract class VideoSend extends FormReactive implements OnInit { | 10 | export abstract class VideoSend extends FormReactive implements OnInit { |
15 | userVideoChannels: { id: number, label: string, support: string }[] = [] | 11 | userVideoChannels: { id: number, label: string, support: string }[] = [] |
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts index 9ce3fbc6d..eb7ac32ae 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts | |||
@@ -1,19 +1,16 @@ | |||
1 | import { BytesPipe } from 'ngx-pipes' | ||
2 | import { Subscription } from 'rxjs' | ||
1 | import { HttpEventType, HttpResponse } from '@angular/common/http' | 3 | import { HttpEventType, HttpResponse } from '@angular/common/http' |
2 | import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' | 4 | import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' |
3 | import { Router } from '@angular/router' | 5 | import { Router } from '@angular/router' |
6 | import { AuthService, CanComponentDeactivate, Notifier, ServerService, UserService } from '@app/core' | ||
7 | import { scrollToTop } from '@app/helpers' | ||
8 | import { FormValidatorService } from '@app/shared/shared-forms' | ||
9 | import { VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' | ||
10 | import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' | ||
4 | import { LoadingBarService } from '@ngx-loading-bar/core' | 11 | import { LoadingBarService } from '@ngx-loading-bar/core' |
5 | import { BytesPipe } from 'ngx-pipes' | ||
6 | import { Subscription } from 'rxjs' | ||
7 | import { VideoPrivacy } from '../../../../../../shared/models/videos' | ||
8 | import { AuthService, Notifier, ServerService } from '../../../core' | ||
9 | import { VideoEdit } from '../../../shared/video/video-edit.model' | ||
10 | import { VideoService } from '../../../shared/video/video.service' | ||
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | 12 | import { I18n } from '@ngx-translate/i18n-polyfill' |
12 | import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' | 13 | import { VideoPrivacy } from '@shared/models' |
13 | import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' | ||
14 | import { FormValidatorService, UserService } from '@app/shared' | ||
15 | import { VideoCaptionService } from '@app/shared/video-caption' | ||
16 | import { scrollToTop } from '@app/shared/misc/utils' | ||
17 | 14 | ||
18 | @Component({ | 15 | @Component({ |
19 | selector: 'my-video-upload', | 16 | selector: 'my-video-upload', |
diff --git a/client/src/app/videos/+video-edit/video-add-routing.module.ts b/client/src/app/videos/+video-edit/video-add-routing.module.ts index e0fef7158..9ff66bea0 100644 --- a/client/src/app/videos/+video-edit/video-add-routing.module.ts +++ b/client/src/app/videos/+video-edit/video-add-routing.module.ts | |||
@@ -1,10 +1,7 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | 3 | import { CanDeactivateGuard, LoginGuard } from '@app/core' | |
4 | import { MetaGuard } from '@ngx-meta/core' | 4 | import { MetaGuard } from '@ngx-meta/core' |
5 | |||
6 | import { LoginGuard } from '../../core' | ||
7 | import { CanDeactivateGuard } from '../../shared/guards/can-deactivate-guard.service' | ||
8 | import { VideoAddComponent } from './video-add.component' | 5 | import { VideoAddComponent } from './video-add.component' |
9 | 6 | ||
10 | const videoAddRoutes: Routes = [ | 7 | const videoAddRoutes: Routes = [ |
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 30ab08ea0..5bd768809 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts | |||
@@ -1,10 +1,9 @@ | |||
1 | import { Component, HostListener, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, HostListener, OnInit, ViewChild } from '@angular/core' |
2 | import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' | 2 | import { AuthService, CanComponentDeactivate, ServerService } from '@app/core' |
3 | import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' | ||
4 | import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' | ||
5 | import { AuthService, ServerService } from '@app/core' | ||
6 | import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' | ||
7 | import { ServerConfig } from '@shared/models' | 3 | import { ServerConfig } from '@shared/models' |
4 | import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component' | ||
5 | import { VideoImportUrlComponent } from './video-add-components/video-import-url.component' | ||
6 | import { VideoUploadComponent } from './video-add-components/video-upload.component' | ||
8 | 7 | ||
9 | @Component({ | 8 | @Component({ |
10 | selector: 'my-videos-add', | 9 | selector: 'my-videos-add', |
diff --git a/client/src/app/videos/+video-edit/video-add.module.ts b/client/src/app/videos/+video-edit/video-add.module.ts index b8f5a9a47..477c1cf5e 100644 --- a/client/src/app/videos/+video-edit/video-add.module.ts +++ b/client/src/app/videos/+video-edit/video-add.module.ts | |||
@@ -1,20 +1,20 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { SharedModule } from '../../shared' | 2 | import { CanDeactivateGuard } from '@app/core' |
3 | import { VideoEditModule } from './shared/video-edit.module' | 3 | import { VideoEditModule } from './shared/video-edit.module' |
4 | import { DragDropDirective } from './video-add-components/drag-drop.directive' | ||
5 | import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component' | ||
6 | import { VideoImportUrlComponent } from './video-add-components/video-import-url.component' | ||
7 | import { VideoUploadComponent } from './video-add-components/video-upload.component' | ||
4 | import { VideoAddRoutingModule } from './video-add-routing.module' | 8 | import { VideoAddRoutingModule } from './video-add-routing.module' |
5 | import { VideoAddComponent } from './video-add.component' | 9 | import { VideoAddComponent } from './video-add.component' |
6 | import { DragDropDirective } from './video-add-components/drag-drop.directive' | ||
7 | import { CanDeactivateGuard } from '../../shared/guards/can-deactivate-guard.service' | ||
8 | import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' | ||
9 | import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' | ||
10 | import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' | ||
11 | 10 | ||
12 | @NgModule({ | 11 | @NgModule({ |
13 | imports: [ | 12 | imports: [ |
14 | VideoAddRoutingModule, | 13 | VideoAddRoutingModule, |
15 | VideoEditModule, | 14 | |
16 | SharedModule | 15 | VideoEditModule |
17 | ], | 16 | ], |
17 | |||
18 | declarations: [ | 18 | declarations: [ |
19 | VideoAddComponent, | 19 | VideoAddComponent, |
20 | VideoUploadComponent, | 20 | VideoUploadComponent, |
@@ -22,10 +22,9 @@ import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-c | |||
22 | VideoImportTorrentComponent, | 22 | VideoImportTorrentComponent, |
23 | DragDropDirective | 23 | DragDropDirective |
24 | ], | 24 | ], |
25 | exports: [ | 25 | |
26 | VideoAddComponent, | 26 | exports: [ ], |
27 | DragDropDirective | 27 | |
28 | ], | ||
29 | providers: [ | 28 | providers: [ |
30 | CanDeactivateGuard | 29 | CanDeactivateGuard |
31 | ] | 30 | ] |
diff --git a/client/src/app/videos/+video-edit/video-update-routing.module.ts b/client/src/app/videos/+video-edit/video-update-routing.module.ts index 564b8fb45..a04351b05 100644 --- a/client/src/app/videos/+video-edit/video-update-routing.module.ts +++ b/client/src/app/videos/+video-edit/video-update-routing.module.ts | |||
@@ -1,12 +1,9 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | 3 | import { CanDeactivateGuard, LoginGuard } from '@app/core' | |
4 | import { MetaGuard } from '@ngx-meta/core' | 4 | import { MetaGuard } from '@ngx-meta/core' |
5 | |||
6 | import { LoginGuard } from '../../core' | ||
7 | import { VideoUpdateComponent } from './video-update.component' | 5 | import { VideoUpdateComponent } from './video-update.component' |
8 | import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver' | 6 | import { VideoUpdateResolver } from './video-update.resolver' |
9 | import { CanDeactivateGuard } from '@app/shared/guards/can-deactivate-guard.service' | ||
10 | 7 | ||
11 | const videoUpdateRoutes: Routes = [ | 8 | const videoUpdateRoutes: Routes = [ |
12 | { | 9 | { |
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 20a607134..7bd6eb553 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts | |||
@@ -1,17 +1,11 @@ | |||
1 | import { map, switchMap } from 'rxjs/operators' | 1 | import { map, switchMap } from 'rxjs/operators' |
2 | import { Component, HostListener, OnInit } from '@angular/core' | 2 | import { Component, HostListener, OnInit } from '@angular/core' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { LoadingBarService } from '@ngx-loading-bar/core' | ||
5 | import { Notifier } from '@app/core' | 4 | import { Notifier } from '@app/core' |
6 | import { ServerService } from '../../core' | 5 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
7 | import { FormReactive } from '../../shared' | 6 | import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main' |
8 | import { VideoEdit } from '../../shared/video/video-edit.model' | 7 | import { LoadingBarService } from '@ngx-loading-bar/core' |
9 | import { VideoService } from '../../shared/video/video.service' | ||
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 8 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
12 | import { VideoCaptionService } from '@app/shared/video-caption' | ||
13 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' | ||
14 | import { VideoDetails } from '@app/shared/video/video-details.model' | ||
15 | import { VideoPrivacy } from '@shared/models' | 9 | import { VideoPrivacy } from '@shared/models' |
16 | 10 | ||
17 | @Component({ | 11 | @Component({ |
diff --git a/client/src/app/videos/+video-edit/video-update.module.ts b/client/src/app/videos/+video-edit/video-update.module.ts index d60aa699f..322c69629 100644 --- a/client/src/app/videos/+video-edit/video-update.module.ts +++ b/client/src/app/videos/+video-edit/video-update.module.ts | |||
@@ -1,25 +1,22 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { SharedModule } from '../../shared' | 2 | import { CanDeactivateGuard } from '@app/core' |
3 | import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver' | ||
3 | import { VideoEditModule } from './shared/video-edit.module' | 4 | import { VideoEditModule } from './shared/video-edit.module' |
4 | import { VideoUpdateRoutingModule } from './video-update-routing.module' | 5 | import { VideoUpdateRoutingModule } from './video-update-routing.module' |
5 | import { VideoUpdateComponent } from './video-update.component' | 6 | import { VideoUpdateComponent } from './video-update.component' |
6 | import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver' | ||
7 | import { CanDeactivateGuard } from '@app/shared/guards/can-deactivate-guard.service' | ||
8 | 7 | ||
9 | @NgModule({ | 8 | @NgModule({ |
10 | imports: [ | 9 | imports: [ |
11 | VideoUpdateRoutingModule, | 10 | VideoUpdateRoutingModule, |
12 | VideoEditModule, | 11 | |
13 | SharedModule | 12 | VideoEditModule |
14 | ], | 13 | ], |
15 | 14 | ||
16 | declarations: [ | 15 | declarations: [ |
17 | VideoUpdateComponent | 16 | VideoUpdateComponent |
18 | ], | 17 | ], |
19 | 18 | ||
20 | exports: [ | 19 | exports: [ ], |
21 | VideoUpdateComponent | ||
22 | ], | ||
23 | 20 | ||
24 | providers: [ | 21 | providers: [ |
25 | VideoUpdateResolver, | 22 | VideoUpdateResolver, |
diff --git a/client/src/app/videos/+video-edit/video-update.resolver.ts b/client/src/app/videos/+video-edit/video-update.resolver.ts index 4ac517d96..30bcf4d74 100644 --- a/client/src/app/videos/+video-edit/video-update.resolver.ts +++ b/client/src/app/videos/+video-edit/video-update.resolver.ts | |||
@@ -1,10 +1,8 @@ | |||
1 | import { forkJoin } from 'rxjs' | ||
2 | import { map, switchMap } from 'rxjs/operators' | ||
1 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
2 | import { VideoService } from '@app/shared/video/video.service' | ||
3 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' | 4 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' |
4 | import { map, switchMap } from 'rxjs/operators' | 5 | import { VideoCaptionService, VideoChannelService, VideoService } from '@app/shared/shared-main' |
5 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | ||
6 | import { VideoCaptionService } from '@app/shared/video-caption' | ||
7 | import { forkJoin } from 'rxjs' | ||
8 | 6 | ||
9 | @Injectable() | 7 | @Injectable() |
10 | export class VideoUpdateResolver implements Resolve<any> { | 8 | export class VideoUpdateResolver implements Resolve<any> { |
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts index e1a8f6260..79505c779 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts | |||
@@ -1,16 +1,13 @@ | |||
1 | import { Observable } from 'rxjs' | ||
1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 2 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Router } from '@angular/router' | 3 | import { Router } from '@angular/router' |
3 | import { Notifier } from '@app/core' | 4 | import { Notifier, User } from '@app/core' |
4 | import { Observable } from 'rxjs' | 5 | import { FormReactive, FormValidatorService, VideoCommentValidatorsService } from '@app/shared/shared-forms' |
5 | import { VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model' | 6 | import { Video } from '@app/shared/shared-main' |
6 | import { FormReactive } from '../../../shared' | 7 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
7 | import { User } from '../../../shared/users' | 8 | import { VideoCommentCreate } from '@shared/models' |
8 | import { Video } from '../../../shared/video/video.model' | ||
9 | import { VideoComment } from './video-comment.model' | 9 | import { VideoComment } from './video-comment.model' |
10 | import { VideoCommentService } from './video-comment.service' | 10 | import { VideoCommentService } from './video-comment.service' |
11 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | ||
12 | import { VideoCommentValidatorsService } from '@app/shared/forms/form-validators/video-comment-validators.service' | ||
13 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||
14 | 11 | ||
15 | @Component({ | 12 | @Component({ |
16 | selector: 'my-video-comment-add', | 13 | selector: 'my-video-comment-add', |
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts b/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts index 1566d7369..7c2aaeadd 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '../../../../../../shared/models/videos/video-comment.model' | 1 | import { VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '@shared/models' |
2 | import { VideoComment } from '@app/videos/+video-watch/comment/video-comment.model' | 2 | import { VideoComment } from './video-comment.model' |
3 | 3 | ||
4 | export class VideoCommentThreadTree implements VideoCommentThreadTreeServerModel { | 4 | export class VideoCommentThreadTree implements VideoCommentThreadTreeServerModel { |
5 | comment: VideoComment | 5 | comment: VideoComment |
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts index 868addd58..27846c1ad 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts | |||
@@ -1,15 +1,10 @@ | |||
1 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' |
2 | import { User, UserRight } from '../../../../../../shared/models/users' | 2 | import { MarkdownService, Notifier, UserService } from '@app/core' |
3 | import { AuthService } from '@app/core/auth' | 3 | import { AuthService } from '@app/core/auth' |
4 | import { AccountService } from '@app/shared/account/account.service' | 4 | import { Account, Actor, Video } from '@app/shared/shared-main' |
5 | import { Video } from '@app/shared/video/video.model' | 5 | import { User, UserRight } from '@shared/models' |
6 | import { VideoCommentThreadTree } from './video-comment-thread-tree.model' | ||
6 | import { VideoComment } from './video-comment.model' | 7 | import { VideoComment } from './video-comment.model' |
7 | import { MarkdownService } from '@app/shared/renderer' | ||
8 | import { Account } from '@app/shared/account/account.model' | ||
9 | import { Notifier } from '@app/core' | ||
10 | import { UserService } from '@app/shared' | ||
11 | import { Actor } from '@app/shared/actor/actor.model' | ||
12 | import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model' | ||
13 | 8 | ||
14 | @Component({ | 9 | @Component({ |
15 | selector: 'my-video-comment', | 10 | selector: 'my-video-comment', |
@@ -40,7 +35,6 @@ export class VideoCommentComponent implements OnInit, OnChanges { | |||
40 | constructor ( | 35 | constructor ( |
41 | private markdownService: MarkdownService, | 36 | private markdownService: MarkdownService, |
42 | private authService: AuthService, | 37 | private authService: AuthService, |
43 | private accountService: AccountService, | ||
44 | private userService: UserService, | 38 | private userService: UserService, |
45 | private notifier: Notifier | 39 | private notifier: Notifier |
46 | ) {} | 40 | ) {} |
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.model.ts b/client/src/app/videos/+video-watch/comment/video-comment.model.ts index 171fc4acc..e85443196 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.model.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.model.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Account as AccountInterface } from '../../../../../../shared/models/actors' | 1 | import { getAbsoluteAPIUrl } from '@app/helpers' |
2 | import { VideoComment as VideoCommentServerModel, VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model' | 2 | import { Actor } from '@app/shared/shared-main' |
3 | import { Actor } from '@app/shared/actor/actor.model' | 3 | import { Account as AccountInterface, VideoComment as VideoCommentServerModel } from '@shared/models' |
4 | import { getAbsoluteAPIUrl } from '@app/shared/misc/utils' | ||
5 | 4 | ||
6 | export class VideoComment implements VideoCommentServerModel { | 5 | export class VideoComment implements VideoCommentServerModel { |
7 | id: number | 6 | id: number |
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.service.ts b/client/src/app/videos/+video-watch/comment/video-comment.service.ts index 0b0715390..a73fb9ca8 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.service.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.service.ts | |||
@@ -1,20 +1,19 @@ | |||
1 | import { Observable } from 'rxjs' | ||
1 | import { catchError, map } from 'rxjs/operators' | 2 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
4 | import { objectLineFeedToHtml } from '@app/shared/misc/utils' | 5 | import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core' |
5 | import { Observable } from 'rxjs' | 6 | import { objectLineFeedToHtml } from '@app/helpers' |
6 | import { FeedFormat, ResultList } from '../../../../../../shared/models' | ||
7 | import { | 7 | import { |
8 | FeedFormat, | ||
9 | ResultList, | ||
8 | VideoComment as VideoCommentServerModel, | 10 | VideoComment as VideoCommentServerModel, |
9 | VideoCommentCreate, | 11 | VideoCommentCreate, |
10 | VideoCommentThreadTree as VideoCommentThreadTreeServerModel | 12 | VideoCommentThreadTree as VideoCommentThreadTreeServerModel |
11 | } from '../../../../../../shared/models/videos/video-comment.model' | 13 | } from '@shared/models' |
12 | import { environment } from '../../../../environments/environment' | 14 | import { environment } from '../../../../environments/environment' |
13 | import { RestExtractor, RestService } from '../../../shared/rest' | 15 | import { VideoCommentThreadTree } from './video-comment-thread-tree.model' |
14 | import { ComponentPaginationLight } from '../../../shared/rest/component-pagination.model' | ||
15 | import { CommentSortField } from '../../../shared/video/sort-field.type' | ||
16 | import { VideoComment } from './video-comment.model' | 16 | import { VideoComment } from './video-comment.model' |
17 | import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model' | ||
18 | 17 | ||
19 | @Injectable() | 18 | @Injectable() |
20 | export class VideoCommentService { | 19 | export class VideoCommentService { |
@@ -52,7 +51,7 @@ export class VideoCommentService { | |||
52 | getVideoCommentThreads (parameters: { | 51 | getVideoCommentThreads (parameters: { |
53 | videoId: number | string, | 52 | videoId: number | string, |
54 | componentPagination: ComponentPaginationLight, | 53 | componentPagination: ComponentPaginationLight, |
55 | sort: CommentSortField | 54 | sort: string |
56 | }): Observable<ResultList<VideoComment>> { | 55 | }): Observable<ResultList<VideoComment>> { |
57 | const { videoId, componentPagination, sort } = parameters | 56 | const { videoId, componentPagination, sort } = parameters |
58 | 57 | ||
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts index bba9f1372..df0018ec6 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts | |||
@@ -1,18 +1,13 @@ | |||
1 | import { Subject, Subscription } from 'rxjs' | ||
1 | import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' | 2 | import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' |
2 | import { ActivatedRoute } from '@angular/router' | 3 | import { ActivatedRoute } from '@angular/router' |
3 | import { ConfirmService, Notifier } from '@app/core' | 4 | import { AuthService, ComponentPagination, ConfirmService, hasMoreItems, Notifier, User } from '@app/core' |
4 | import { Subject, Subscription } from 'rxjs' | 5 | import { HooksService } from '@app/core/plugins/hooks.service' |
5 | import { AuthService } from '../../../core/auth' | 6 | import { Syndication, VideoDetails } from '@app/shared/shared-main' |
6 | import { ComponentPagination, hasMoreItems } from '../../../shared/rest/component-pagination.model' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
7 | import { User } from '../../../shared/users' | 8 | import { VideoCommentThreadTree } from './video-comment-thread-tree.model' |
8 | import { CommentSortField } from '../../../shared/video/sort-field.type' | ||
9 | import { VideoDetails } from '../../../shared/video/video-details.model' | ||
10 | import { VideoComment } from './video-comment.model' | 9 | import { VideoComment } from './video-comment.model' |
11 | import { VideoCommentService } from './video-comment.service' | 10 | import { VideoCommentService } from './video-comment.service' |
12 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
13 | import { Syndication } from '@app/shared/video/syndication.model' | ||
14 | import { HooksService } from '@app/core/plugins/hooks.service' | ||
15 | import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model' | ||
16 | 11 | ||
17 | @Component({ | 12 | @Component({ |
18 | selector: 'my-video-comments', | 13 | selector: 'my-video-comments', |
@@ -28,7 +23,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
28 | 23 | ||
29 | comments: VideoComment[] = [] | 24 | comments: VideoComment[] = [] |
30 | highlightedThread: VideoComment | 25 | highlightedThread: VideoComment |
31 | sort: CommentSortField = '-createdAt' | 26 | sort = '-createdAt' |
32 | componentPagination: ComponentPagination = { | 27 | componentPagination: ComponentPagination = { |
33 | currentPage: 1, | 28 | currentPage: 1, |
34 | itemsPerPage: 10, | 29 | itemsPerPage: 10, |
@@ -154,7 +149,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
154 | this.viewReplies(commentTree.comment.id) | 149 | this.viewReplies(commentTree.comment.id) |
155 | } | 150 | } |
156 | 151 | ||
157 | handleSortChange (sort: CommentSortField) { | 152 | handleSortChange (sort: string) { |
158 | if (this.sort === sort) return | 153 | if (this.sort === sort) return |
159 | 154 | ||
160 | this.sort = sort | 155 | this.sort = sort |
diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.ts b/client/src/app/videos/+video-watch/modal/video-share.component.ts index 3550556a0..b42b775c1 100644 --- a/client/src/app/videos/+video-watch/modal/video-share.component.ts +++ b/client/src/app/videos/+video-watch/modal/video-share.component.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { Component, ElementRef, Input, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, Input, ViewChild } from '@angular/core' |
2 | import { VideoDetails } from '../../../shared/video/video-details.model' | ||
3 | import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils' | 2 | import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils' |
4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
5 | import { VideoCaption } from '@shared/models' | 4 | import { VideoCaption } from '@shared/models' |
6 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | 5 | import { VideoDetails } from '@app/shared/shared-main' |
6 | import { VideoPlaylist } from '@app/shared/shared-video-playlist' | ||
7 | 7 | ||
8 | type Customizations = { | 8 | type Customizations = { |
9 | startAtCheckbox: boolean | 9 | startAtCheckbox: boolean |
@@ -40,13 +40,9 @@ export class VideoShareComponent { | |||
40 | isAdvancedCustomizationCollapsed = true | 40 | isAdvancedCustomizationCollapsed = true |
41 | includeVideoInPlaylist = false | 41 | includeVideoInPlaylist = false |
42 | 42 | ||
43 | private currentVideoTimestamp: number | ||
44 | |||
45 | constructor (private modalService: NgbModal) { } | 43 | constructor (private modalService: NgbModal) { } |
46 | 44 | ||
47 | show (currentVideoTimestamp?: number) { | 45 | show (currentVideoTimestamp?: number) { |
48 | this.currentVideoTimestamp = currentVideoTimestamp | ||
49 | |||
50 | let subtitle: string | 46 | let subtitle: string |
51 | if (this.videoCaptions.length !== 0) { | 47 | if (this.videoCaptions.length !== 0) { |
52 | subtitle = this.videoCaptions[0].language.id | 48 | subtitle = this.videoCaptions[0].language.id |
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.ts b/client/src/app/videos/+video-watch/modal/video-support.component.ts index 0058172f2..48d5f2948 100644 --- a/client/src/app/videos/+video-watch/modal/video-support.component.ts +++ b/client/src/app/videos/+video-watch/modal/video-support.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component, Input, ViewChild } from '@angular/core' | 1 | import { Component, Input, ViewChild } from '@angular/core' |
2 | import { VideoDetails } from '../../../shared/video/video-details.model' | 2 | import { MarkdownService } from '@app/core' |
3 | import { VideoDetails } from '@app/shared/shared-main' | ||
3 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
4 | import { MarkdownService } from '@app/shared/renderer' | ||
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'my-video-support', | 7 | selector: 'my-video-support', |
diff --git a/client/src/app/shared/angular/timestamp-route-transformer.directive.ts b/client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts index 45e023695..45e023695 100644 --- a/client/src/app/shared/angular/timestamp-route-transformer.directive.ts +++ b/client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts | |||
diff --git a/client/src/app/shared/angular/video-duration-formatter.pipe.ts b/client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts index 4b6767415..4b6767415 100644 --- a/client/src/app/shared/angular/video-duration-formatter.pipe.ts +++ b/client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts | |||
diff --git a/client/src/app/videos/+video-watch/video-watch-playlist.component.ts b/client/src/app/videos/+video-watch/video-watch-playlist.component.ts index 827c34d41..2c21be643 100644 --- a/client/src/app/videos/+video-watch/video-watch-playlist.component.ts +++ b/client/src/app/videos/+video-watch/video-watch-playlist.component.ts | |||
@@ -1,15 +1,10 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | ||
3 | import { ComponentPagination } from '@app/shared/rest/component-pagination.model' | ||
4 | import { VideoDetails, VideoPlaylistPrivacy } from '@shared/models' | ||
5 | import { Router } from '@angular/router' | 2 | import { Router } from '@angular/router' |
6 | import { UserService } from '@app/shared' | 3 | import { AuthService, ComponentPagination, LocalStorageService, Notifier, SessionStorageService, UserService } from '@app/core' |
7 | import { AuthService, Notifier } from '@app/core' | 4 | import { peertubeLocalStorage, peertubeSessionStorage } from '@app/helpers/peertube-web-storage' |
8 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | 5 | import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
9 | import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model' | ||
10 | import { peertubeLocalStorage, peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage' | ||
11 | import { I18n } from '@ngx-translate/i18n-polyfill' | 6 | import { I18n } from '@ngx-translate/i18n-polyfill' |
12 | import { SessionStorageService, LocalStorageService } from '@app/shared/misc/storage.service' | 7 | import { VideoDetails, VideoPlaylistPrivacy } from '@shared/models' |
13 | 8 | ||
14 | @Component({ | 9 | @Component({ |
15 | selector: 'my-video-watch-playlist', | 10 | selector: 'my-video-watch-playlist', |
diff --git a/client/src/app/videos/+video-watch/video-watch-routing.module.ts b/client/src/app/videos/+video-watch/video-watch-routing.module.ts index ce9250bdc..d8fecb87d 100644 --- a/client/src/app/videos/+video-watch/video-watch-routing.module.ts +++ b/client/src/app/videos/+video-watch/video-watch-routing.module.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | |||
4 | import { MetaGuard } from '@ngx-meta/core' | 3 | import { MetaGuard } from '@ngx-meta/core' |
5 | |||
6 | import { VideoWatchComponent } from './video-watch.component' | 4 | import { VideoWatchComponent } from './video-watch.component' |
7 | 5 | ||
8 | const videoWatchRoutes: Routes = [ | 6 | const videoWatchRoutes: Routes = [ |
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 df0c1058c..5b0b34c80 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -1,41 +1,33 @@ | |||
1 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
2 | import { forkJoin, Observable, Subscription } from 'rxjs' | ||
1 | import { catchError } from 'rxjs/operators' | 3 | import { catchError } from 'rxjs/operators' |
4 | import { PlatformLocation } from '@angular/common' | ||
2 | import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' | 5 | import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 6 | import { ActivatedRoute, Router } from '@angular/router' |
7 | import { AuthService, AuthUser, ConfirmService, MarkdownService, Notifier, RestExtractor, ServerService, UserService } from '@app/core' | ||
8 | import { HooksService } from '@app/core/plugins/hooks.service' | ||
4 | import { RedirectService } from '@app/core/routing/redirect.service' | 9 | import { RedirectService } from '@app/core/routing/redirect.service' |
5 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' | 10 | import { isXPercentInViewport, peertubeLocalStorage, scrollToTop } from '@app/helpers' |
6 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' | 11 | import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main' |
12 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' | ||
13 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' | ||
7 | import { MetaService } from '@ngx-meta/core' | 14 | import { MetaService } from '@ngx-meta/core' |
8 | import { AuthUser, Notifier, ServerService } from '@app/core' | ||
9 | import { forkJoin, Observable, Subscription } from 'rxjs' | ||
10 | import { Hotkey, HotkeysService } from 'angular2-hotkeys' | ||
11 | import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '../../../../../shared' | ||
12 | import { AuthService, ConfirmService } from '../../core' | ||
13 | import { RestExtractor, UserService } from '../../shared' | ||
14 | import { VideoDetails } from '../../shared/video/video-details.model' | ||
15 | import { VideoService } from '../../shared/video/video.service' | ||
16 | import { VideoShareComponent } from './modal/video-share.component' | ||
17 | import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component' | ||
18 | import { I18n } from '@ngx-translate/i18n-polyfill' | 15 | import { I18n } from '@ngx-translate/i18n-polyfill' |
19 | import { environment } from '../../../environments/environment' | 16 | import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models' |
20 | import { VideoCaptionService } from '@app/shared/video-caption' | 17 | import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage' |
21 | import { MarkdownService } from '@app/shared/renderer' | ||
22 | import { | 18 | import { |
23 | videojs, | ||
24 | CustomizationOptions, | 19 | CustomizationOptions, |
25 | P2PMediaLoaderOptions, | 20 | P2PMediaLoaderOptions, |
26 | PeertubePlayerManager, | 21 | PeertubePlayerManager, |
27 | PeertubePlayerManagerOptions, | 22 | PeertubePlayerManagerOptions, |
28 | PlayerMode | 23 | PlayerMode, |
24 | videojs | ||
29 | } from '../../../assets/player/peertube-player-manager' | 25 | } from '../../../assets/player/peertube-player-manager' |
30 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | ||
31 | import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' | ||
32 | import { Video } from '@app/shared/video/video.model' | ||
33 | import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils' | 26 | import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils' |
34 | import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component' | 27 | import { environment } from '../../../environments/environment' |
35 | import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage' | 28 | import { VideoShareComponent } from './modal/video-share.component' |
36 | import { HooksService } from '@app/core/plugins/hooks.service' | 29 | import { VideoSupportComponent } from './modal/video-support.component' |
37 | import { PlatformLocation } from '@angular/common' | 30 | import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' |
38 | import { scrollToTop, isXPercentInViewport } from '@app/shared/misc/utils' | ||
39 | 31 | ||
40 | @Component({ | 32 | @Component({ |
41 | selector: 'my-video-watch', | 33 | selector: 'my-video-watch', |
diff --git a/client/src/app/videos/+video-watch/video-watch.module.ts b/client/src/app/videos/+video-watch/video-watch.module.ts index 9b445269d..a1c54f065 100644 --- a/client/src/app/videos/+video-watch/video-watch.module.ts +++ b/client/src/app/videos/+video-watch/video-watch.module.ts | |||
@@ -1,26 +1,40 @@ | |||
1 | import { QRCodeModule } from 'angularx-qrcode' | ||
1 | import { NgModule } from '@angular/core' | 2 | import { NgModule } from '@angular/core' |
2 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' | 3 | import { SharedFormModule } from '@app/shared/shared-forms' |
3 | import { SharedModule } from '../../shared' | 4 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' |
5 | import { SharedMainModule } from '@app/shared/shared-main' | ||
6 | import { SharedModerationModule } from '@app/shared/shared-moderation' | ||
7 | import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' | ||
8 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' | ||
9 | import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist' | ||
10 | import { RecommendationsModule } from '@app/videos/recommendations/recommendations.module' | ||
11 | import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap' | ||
4 | import { VideoCommentAddComponent } from './comment/video-comment-add.component' | 12 | import { VideoCommentAddComponent } from './comment/video-comment-add.component' |
5 | import { VideoCommentComponent } from './comment/video-comment.component' | 13 | import { VideoCommentComponent } from './comment/video-comment.component' |
6 | import { VideoCommentService } from './comment/video-comment.service' | 14 | import { VideoCommentService } from './comment/video-comment.service' |
7 | import { VideoCommentsComponent } from './comment/video-comments.component' | 15 | import { VideoCommentsComponent } from './comment/video-comments.component' |
8 | import { VideoShareComponent } from './modal/video-share.component' | 16 | import { VideoShareComponent } from './modal/video-share.component' |
17 | import { VideoSupportComponent } from './modal/video-support.component' | ||
18 | import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive' | ||
19 | import { VideoDurationPipe } from './video-duration-formatter.pipe' | ||
20 | import { VideoWatchPlaylistComponent } from './video-watch-playlist.component' | ||
9 | import { VideoWatchRoutingModule } from './video-watch-routing.module' | 21 | import { VideoWatchRoutingModule } from './video-watch-routing.module' |
10 | import { VideoWatchComponent } from './video-watch.component' | 22 | import { VideoWatchComponent } from './video-watch.component' |
11 | import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap' | ||
12 | import { RecommendationsModule } from '@app/videos/recommendations/recommendations.module' | ||
13 | import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component' | ||
14 | import { QRCodeModule } from 'angularx-qrcode' | ||
15 | import { TimestampRouteTransformerDirective } from '@app/shared/angular/timestamp-route-transformer.directive' | ||
16 | 23 | ||
17 | @NgModule({ | 24 | @NgModule({ |
18 | imports: [ | 25 | imports: [ |
19 | VideoWatchRoutingModule, | 26 | VideoWatchRoutingModule, |
20 | SharedModule, | ||
21 | NgbTooltipModule, | 27 | NgbTooltipModule, |
22 | QRCodeModule, | 28 | QRCodeModule, |
23 | RecommendationsModule | 29 | RecommendationsModule, |
30 | |||
31 | SharedMainModule, | ||
32 | SharedFormModule, | ||
33 | SharedVideoMiniatureModule, | ||
34 | SharedVideoPlaylistModule, | ||
35 | SharedUserSubscriptionModule, | ||
36 | SharedModerationModule, | ||
37 | SharedGlobalIconModule | ||
24 | ], | 38 | ], |
25 | 39 | ||
26 | declarations: [ | 40 | declarations: [ |
@@ -33,6 +47,8 @@ import { TimestampRouteTransformerDirective } from '@app/shared/angular/timestam | |||
33 | VideoCommentAddComponent, | 47 | VideoCommentAddComponent, |
34 | VideoCommentComponent, | 48 | VideoCommentComponent, |
35 | 49 | ||
50 | TimestampRouteTransformerDirective, | ||
51 | VideoDurationPipe, | ||
36 | TimestampRouteTransformerDirective | 52 | TimestampRouteTransformerDirective |
37 | ], | 53 | ], |
38 | 54 | ||
diff --git a/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts b/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts index 0abf938b7..a376453bf 100644 --- a/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts +++ b/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts | |||
@@ -1,15 +1,13 @@ | |||
1 | import { Observable, of } from 'rxjs' | 1 | import { Observable, of } from 'rxjs' |
2 | import { map, switchMap } from 'rxjs/operators' | 2 | import { map, switchMap } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { ServerService } from '@app/core' | 4 | import { ServerService, UserService } from '@app/core' |
5 | import { AdvancedSearch } from '@app/search/advanced-search.model' | 5 | import { AdvancedSearch } from '@app/search/advanced-search.model' |
6 | import { SearchService } from '@app/search/search.service' | 6 | import { SearchService } from '@app/search/search.service' |
7 | import { UserService } from '@app/shared' | 7 | import { Video, VideoService } from '@app/shared/shared-main' |
8 | import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' | ||
9 | import { Video } from '@app/shared/video/video.model' | ||
10 | import { VideoService } from '@app/shared/video/video.service' | ||
11 | import { RecommendationService } from '@app/videos/recommendations/recommendations.service' | ||
12 | import { ServerConfig } from '@shared/models' | 8 | import { ServerConfig } from '@shared/models' |
9 | import { RecommendationInfo } from './recommendation-info.model' | ||
10 | import { RecommendationService } from './recommendations.service' | ||
13 | 11 | ||
14 | /** | 12 | /** |
15 | * Provides "recommendations" by providing the most recently uploaded videos. | 13 | * Provides "recommendations" by providing the most recently uploaded videos. |
diff --git a/client/src/app/shared/video/recommendation-info.model.ts b/client/src/app/videos/recommendations/recommendation-info.model.ts index 0233563bb..0233563bb 100644 --- a/client/src/app/shared/video/recommendation-info.model.ts +++ b/client/src/app/videos/recommendations/recommendation-info.model.ts | |||
diff --git a/client/src/app/videos/recommendations/recommendations.module.ts b/client/src/app/videos/recommendations/recommendations.module.ts index 3e279cc29..03cc272ca 100644 --- a/client/src/app/videos/recommendations/recommendations.module.ts +++ b/client/src/app/videos/recommendations/recommendations.module.ts | |||
@@ -1,16 +1,21 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | import { InputSwitchModule } from 'primeng/inputswitch' | 1 | import { InputSwitchModule } from 'primeng/inputswitch' |
3 | import { RecommendedVideosComponent } from '@app/videos/recommendations/recommended-videos.component' | ||
4 | import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store' | ||
5 | import { CommonModule } from '@angular/common' | 2 | import { CommonModule } from '@angular/common' |
6 | import { SharedModule } from '@app/shared' | 3 | import { NgModule } from '@angular/core' |
7 | import { RecentVideosRecommendationService } from '@app/videos/recommendations/recent-videos-recommendation.service' | 4 | import { SharedMainModule } from '@app/shared/shared-main' |
5 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' | ||
6 | import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist' | ||
7 | import { RecentVideosRecommendationService } from './recent-videos-recommendation.service' | ||
8 | import { RecommendedVideosComponent } from './recommended-videos.component' | ||
9 | import { RecommendedVideosStore } from './recommended-videos.store' | ||
8 | 10 | ||
9 | @NgModule({ | 11 | @NgModule({ |
10 | imports: [ | 12 | imports: [ |
13 | CommonModule, | ||
11 | InputSwitchModule, | 14 | InputSwitchModule, |
12 | SharedModule, | 15 | |
13 | CommonModule | 16 | SharedMainModule, |
17 | SharedVideoPlaylistModule, | ||
18 | SharedVideoMiniatureModule | ||
14 | ], | 19 | ], |
15 | declarations: [ | 20 | declarations: [ |
16 | RecommendedVideosComponent | 21 | RecommendedVideosComponent |
diff --git a/client/src/app/videos/recommendations/recommendations.service.ts b/client/src/app/videos/recommendations/recommendations.service.ts index a547e289d..1d79d35f6 100644 --- a/client/src/app/videos/recommendations/recommendations.service.ts +++ b/client/src/app/videos/recommendations/recommendations.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Video } from '@app/shared/video/video.model' | ||
2 | import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' | ||
3 | import { Observable } from 'rxjs' | 1 | import { Observable } from 'rxjs' |
2 | import { Video } from '@app/shared/shared-main' | ||
3 | import { RecommendationInfo } from './recommendation-info.model' | ||
4 | 4 | ||
5 | export interface RecommendationService { | 5 | export interface RecommendationService { |
6 | getRecommendations (recommendation: RecommendationInfo): Observable<Video[]> | 6 | getRecommendations (recommendation: RecommendationInfo): Observable<Video[]> |
diff --git a/client/src/app/videos/recommendations/recommended-videos.component.ts b/client/src/app/videos/recommendations/recommended-videos.component.ts index a6f3bce3d..016975341 100644 --- a/client/src/app/videos/recommendations/recommended-videos.component.ts +++ b/client/src/app/videos/recommendations/recommended-videos.component.ts | |||
@@ -1,15 +1,12 @@ | |||
1 | import { Observable } from 'rxjs' | 1 | import { Observable } from 'rxjs' |
2 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' | 2 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' |
3 | import { AuthService, Notifier } from '@app/core' | 3 | import { AuthService, Notifier, SessionStorageService, User, UserService } from '@app/core' |
4 | import { User } from '@app/shared' | 4 | import { Video } from '@app/shared/shared-main' |
5 | import { SessionStorageService } from '@app/shared/misc/storage.service' | 5 | import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature' |
6 | import { UserService } from '@app/shared/users/user.service' | 6 | import { VideoPlaylist } from '@app/shared/shared-video-playlist' |
7 | import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' | ||
8 | import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' | ||
9 | import { MiniatureDisplayOptions } from '@app/shared/video/video-miniature.component' | ||
10 | import { Video } from '@app/shared/video/video.model' | ||
11 | import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store' | ||
12 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { RecommendationInfo } from './recommendation-info.model' | ||
9 | import { RecommendedVideosStore } from './recommended-videos.store' | ||
13 | 10 | ||
14 | @Component({ | 11 | @Component({ |
15 | selector: 'my-recommended-videos', | 12 | selector: 'my-recommended-videos', |
diff --git a/client/src/app/videos/recommendations/recommended-videos.store.ts b/client/src/app/videos/recommendations/recommended-videos.store.ts index 858ec3a27..8c3fb6480 100644 --- a/client/src/app/videos/recommendations/recommended-videos.store.ts +++ b/client/src/app/videos/recommendations/recommended-videos.store.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Inject, Injectable } from '@angular/core' | ||
2 | import { Observable, ReplaySubject } from 'rxjs' | 1 | import { Observable, ReplaySubject } from 'rxjs' |
3 | import { Video } from '@app/shared/video/video.model' | ||
4 | import { RecommendationInfo } from '@app/shared/video/recommendation-info.model' | ||
5 | import { RecentVideosRecommendationService } from '@app/videos/recommendations/recent-videos-recommendation.service' | ||
6 | import { RecommendationService } from '@app/videos/recommendations/recommendations.service' | ||
7 | import { map, shareReplay, switchMap, take } from 'rxjs/operators' | 2 | import { map, shareReplay, switchMap, take } from 'rxjs/operators' |
3 | import { Inject, Injectable } from '@angular/core' | ||
4 | import { Video } from '@app/shared/shared-main' | ||
5 | import { RecentVideosRecommendationService } from './recent-videos-recommendation.service' | ||
6 | import { RecommendationInfo } from './recommendation-info.model' | ||
7 | import { RecommendationService } from './recommendations.service' | ||
8 | 8 | ||
9 | /** | 9 | /** |
10 | * This store is intended to provide data for the RecommendedVideosComponent. | 10 | * This store is intended to provide data for the RecommendedVideosComponent. |
@@ -20,7 +20,7 @@ export class RecommendedVideosStore { | |||
20 | ) { | 20 | ) { |
21 | this.recommendations$ = this.requestsForLoad$$.pipe( | 21 | this.recommendations$ = this.requestsForLoad$$.pipe( |
22 | switchMap(requestedRecommendation => { | 22 | switchMap(requestedRecommendation => { |
23 | return recommendations.getRecommendations(requestedRecommendation) | 23 | return this.recommendations.getRecommendations(requestedRecommendation) |
24 | .pipe(take(1)) | 24 | .pipe(take(1)) |
25 | }), | 25 | }), |
26 | shareReplay() | 26 | shareReplay() |
diff --git a/client/src/app/videos/video-list/index.ts b/client/src/app/videos/video-list/index.ts index b367110ae..af1bd58b7 100644 --- a/client/src/app/videos/video-list/index.ts +++ b/client/src/app/videos/video-list/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './overview' | ||
1 | export * from './video-local.component' | 2 | export * from './video-local.component' |
2 | export * from './video-recently-added.component' | 3 | export * from './video-recently-added.component' |
3 | export * from './video-trending.component' | 4 | export * from './video-trending.component' |
diff --git a/client/src/app/videos/video-list/overview/index.ts b/client/src/app/videos/video-list/overview/index.ts new file mode 100644 index 000000000..e6cfa4802 --- /dev/null +++ b/client/src/app/videos/video-list/overview/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './overview.service' | ||
2 | export * from './video-overview.component' | ||
3 | export * from './videos-overview.model' | ||
diff --git a/client/src/app/shared/overview/overview.service.ts b/client/src/app/videos/video-list/overview/overview.service.ts index 6d8af8052..4458454d5 100644 --- a/client/src/app/shared/overview/overview.service.ts +++ b/client/src/app/videos/video-list/overview/overview.service.ts | |||
@@ -1,14 +1,13 @@ | |||
1 | import { forkJoin, Observable, of } from 'rxjs' | ||
1 | import { catchError, map, switchMap, tap } from 'rxjs/operators' | 2 | import { catchError, map, switchMap, tap } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 3 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
4 | import { forkJoin, Observable, of } from 'rxjs' | 5 | import { RestExtractor, ServerService } from '@app/core' |
5 | import { VideosOverview as VideosOverviewServer, peertubeTranslate } from '../../../../../shared/models' | 6 | import { immutableAssign } from '@app/helpers' |
6 | import { environment } from '../../../environments/environment' | 7 | import { VideoService } from '@app/shared/shared-main' |
7 | import { RestExtractor } from '../rest/rest-extractor.service' | 8 | import { peertubeTranslate, VideosOverview as VideosOverviewServer } from '@shared/models' |
8 | import { VideosOverview } from '@app/shared/overview/videos-overview.model' | 9 | import { environment } from '../../../../environments/environment' |
9 | import { VideoService } from '@app/shared/video/video.service' | 10 | import { VideosOverview } from './videos-overview.model' |
10 | import { ServerService } from '@app/core' | ||
11 | import { immutableAssign } from '@app/shared/misc/utils' | ||
12 | 11 | ||
13 | @Injectable() | 12 | @Injectable() |
14 | export class OverviewService { | 13 | export class OverviewService { |
diff --git a/client/src/app/videos/video-list/video-overview.component.html b/client/src/app/videos/video-list/overview/video-overview.component.html index ca986c634..ca986c634 100644 --- a/client/src/app/videos/video-list/video-overview.component.html +++ b/client/src/app/videos/video-list/overview/video-overview.component.html | |||
diff --git a/client/src/app/videos/video-list/video-overview.component.scss b/client/src/app/videos/video-list/overview/video-overview.component.scss index c1d10188a..c1d10188a 100644 --- a/client/src/app/videos/video-list/video-overview.component.scss +++ b/client/src/app/videos/video-list/overview/video-overview.component.scss | |||
diff --git a/client/src/app/videos/video-list/video-overview.component.ts b/client/src/app/videos/video-list/overview/video-overview.component.ts index 8ff8400db..b3be1d7b5 100644 --- a/client/src/app/videos/video-list/video-overview.component.ts +++ b/client/src/app/videos/video-list/overview/video-overview.component.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | import { Subject } from 'rxjs' | 1 | import { Subject } from 'rxjs' |
2 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
3 | import { Notifier } from '@app/core' | 3 | import { Notifier, ScreenService, User, UserService } from '@app/core' |
4 | import { User, UserService } from '@app/shared' | 4 | import { Video } from '@app/shared/shared-main' |
5 | import { ScreenService } from '@app/shared/misc/screen.service' | 5 | import { OverviewService } from './overview.service' |
6 | import { OverviewService } from '@app/shared/overview' | 6 | import { VideosOverview } from './videos-overview.model' |
7 | import { VideosOverview } from '@app/shared/overview/videos-overview.model' | ||
8 | import { Video } from '@app/shared/video/video.model' | ||
9 | 7 | ||
10 | @Component({ | 8 | @Component({ |
11 | selector: 'my-video-overview', | 9 | selector: 'my-video-overview', |
diff --git a/client/src/app/shared/overview/videos-overview.model.ts b/client/src/app/videos/video-list/overview/videos-overview.model.ts index 21abe1697..6765ad9b7 100644 --- a/client/src/app/shared/overview/videos-overview.model.ts +++ b/client/src/app/videos/video-list/overview/videos-overview.model.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoChannelSummary, VideoConstant, VideosOverview as VideosOverviewServer } from '../../../../../shared/models' | 1 | import { Video } from '@app/shared/shared-main' |
2 | import { Video } from '@app/shared/video/video.model' | 2 | import { VideoChannelSummary, VideoConstant, VideosOverview as VideosOverviewServer } from '@shared/models' |
3 | 3 | ||
4 | export class VideosOverview implements VideosOverviewServer { | 4 | export class VideosOverview implements VideosOverviewServer { |
5 | channels: { | 5 | channels: { |
diff --git a/client/src/app/videos/video-list/video-local.component.ts b/client/src/app/videos/video-list/video-local.component.ts index 960523cd7..b4c71ac49 100644 --- a/client/src/app/videos/video-list/video-local.component.ts +++ b/client/src/app/videos/video-list/video-local.component.ts | |||
@@ -1,23 +1,17 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 3 | import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
4 | import { AuthService } from '../../core/auth' | ||
5 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | ||
6 | import { VideoSortField } from '../../shared/video/sort-field.type' | ||
7 | import { VideoService } from '../../shared/video/video.service' | ||
8 | import { VideoFilter } from '../../../../../shared/models/videos/video-query.type' | ||
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
10 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
11 | import { UserRight } from '../../../../../shared/models/users' | ||
12 | import { Notifier, ServerService } from '@app/core' | ||
13 | import { HooksService } from '@app/core/plugins/hooks.service' | 4 | import { HooksService } from '@app/core/plugins/hooks.service' |
14 | import { UserService } from '@app/shared' | 5 | import { immutableAssign } from '@app/helpers' |
15 | import { LocalStorageService } from '@app/shared/misc/storage.service' | 6 | import { VideoService } from '@app/shared/shared-main' |
7 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { UserRight, VideoFilter, VideoSortField } from '@shared/models' | ||
16 | 10 | ||
17 | @Component({ | 11 | @Component({ |
18 | selector: 'my-videos-local', | 12 | selector: 'my-videos-local', |
19 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], | 13 | styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ], |
20 | templateUrl: '../../shared/video/abstract-video-list.html' | 14 | templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html' |
21 | }) | 15 | }) |
22 | export class VideoLocalComponent extends AbstractVideoList implements OnInit, OnDestroy { | 16 | export class VideoLocalComponent extends AbstractVideoList implements OnInit, OnDestroy { |
23 | titlePage: string | 17 | titlePage: string |
diff --git a/client/src/app/videos/video-list/video-most-liked.component.ts b/client/src/app/videos/video-list/video-most-liked.component.ts index cc91a2330..ca14851bb 100644 --- a/client/src/app/videos/video-list/video-most-liked.component.ts +++ b/client/src/app/videos/video-list/video-most-liked.component.ts | |||
@@ -1,21 +1,17 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 3 | import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
4 | import { AuthService } from '../../core/auth' | ||
5 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | ||
6 | import { VideoSortField } from '../../shared/video/sort-field.type' | ||
7 | import { VideoService } from '../../shared/video/video.service' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
10 | import { Notifier, ServerService } from '@app/core' | ||
11 | import { HooksService } from '@app/core/plugins/hooks.service' | 4 | import { HooksService } from '@app/core/plugins/hooks.service' |
12 | import { UserService } from '@app/shared' | 5 | import { immutableAssign } from '@app/helpers' |
13 | import { LocalStorageService } from '@app/shared/misc/storage.service' | 6 | import { VideoService } from '@app/shared/shared-main' |
7 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { VideoSortField } from '@shared/models' | ||
14 | 10 | ||
15 | @Component({ | 11 | @Component({ |
16 | selector: 'my-videos-most-liked', | 12 | selector: 'my-videos-most-liked', |
17 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], | 13 | styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ], |
18 | templateUrl: '../../shared/video/abstract-video-list.html' | 14 | templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html' |
19 | }) | 15 | }) |
20 | export class VideoMostLikedComponent extends AbstractVideoList implements OnInit { | 16 | export class VideoMostLikedComponent extends AbstractVideoList implements OnInit { |
21 | titlePage: string | 17 | titlePage: string |
diff --git a/client/src/app/videos/video-list/video-recently-added.component.ts b/client/src/app/videos/video-list/video-recently-added.component.ts index 9f57a61e3..c9395133f 100644 --- a/client/src/app/videos/video-list/video-recently-added.component.ts +++ b/client/src/app/videos/video-list/video-recently-added.component.ts | |||
@@ -1,21 +1,17 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 3 | import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
4 | import { AuthService } from '../../core/auth' | ||
5 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | ||
6 | import { VideoSortField } from '../../shared/video/sort-field.type' | ||
7 | import { VideoService } from '../../shared/video/video.service' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
10 | import { Notifier, ServerService } from '@app/core' | ||
11 | import { HooksService } from '@app/core/plugins/hooks.service' | 4 | import { HooksService } from '@app/core/plugins/hooks.service' |
12 | import { UserService } from '@app/shared' | 5 | import { immutableAssign } from '@app/helpers' |
13 | import { LocalStorageService } from '@app/shared/misc/storage.service' | 6 | import { VideoService } from '@app/shared/shared-main' |
7 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { VideoSortField } from '@shared/models' | ||
14 | 10 | ||
15 | @Component({ | 11 | @Component({ |
16 | selector: 'my-videos-recently-added', | 12 | selector: 'my-videos-recently-added', |
17 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], | 13 | styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ], |
18 | templateUrl: '../../shared/video/abstract-video-list.html' | 14 | templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html' |
19 | }) | 15 | }) |
20 | export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy { | 16 | export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy { |
21 | titlePage: string | 17 | titlePage: string |
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index 62e0f4e69..10eab18de 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts | |||
@@ -1,21 +1,17 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 3 | import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
4 | import { AuthService } from '../../core/auth' | ||
5 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | ||
6 | import { VideoSortField } from '../../shared/video/sort-field.type' | ||
7 | import { VideoService } from '../../shared/video/video.service' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
10 | import { Notifier, ServerService } from '@app/core' | ||
11 | import { HooksService } from '@app/core/plugins/hooks.service' | 4 | import { HooksService } from '@app/core/plugins/hooks.service' |
12 | import { UserService } from '@app/shared' | 5 | import { immutableAssign } from '@app/helpers' |
13 | import { LocalStorageService } from '@app/shared/misc/storage.service' | 6 | import { VideoService } from '@app/shared/shared-main' |
7 | import { AbstractVideoList } from '@app/shared/shared-video-miniature' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { VideoSortField } from '@shared/models' | ||
14 | 10 | ||
15 | @Component({ | 11 | @Component({ |
16 | selector: 'my-videos-trending', | 12 | selector: 'my-videos-trending', |
17 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], | 13 | styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ], |
18 | templateUrl: '../../shared/video/abstract-video-list.html' | 14 | templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html' |
19 | }) | 15 | }) |
20 | export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy { | 16 | export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy { |
21 | titlePage: string | 17 | titlePage: string |
diff --git a/client/src/app/videos/video-list/video-user-subscriptions.component.ts b/client/src/app/videos/video-list/video-user-subscriptions.component.ts index 036fd8dcb..41ad9b277 100644 --- a/client/src/app/videos/video-list/video-user-subscriptions.component.ts +++ b/client/src/app/videos/video-list/video-user-subscriptions.component.ts | |||
@@ -1,22 +1,18 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { immutableAssign } from '@app/shared/misc/utils' | 3 | import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
4 | import { AuthService } from '../../core/auth' | ||
5 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | ||
6 | import { VideoSortField } from '../../shared/video/sort-field.type' | ||
7 | import { VideoService } from '../../shared/video/video.service' | ||
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { ScreenService } from '@app/shared/misc/screen.service' | ||
10 | import { OwnerDisplayType } from '@app/shared/video/video-miniature.component' | ||
11 | import { Notifier, ServerService } from '@app/core' | ||
12 | import { HooksService } from '@app/core/plugins/hooks.service' | 4 | import { HooksService } from '@app/core/plugins/hooks.service' |
13 | import { UserService } from '@app/shared' | 5 | import { immutableAssign } from '@app/helpers' |
14 | import { LocalStorageService } from '@app/shared/misc/storage.service' | 6 | import { VideoService } from '@app/shared/shared-main' |
7 | import { UserSubscriptionService } from '@app/shared/shared-user-subscription' | ||
8 | import { AbstractVideoList, OwnerDisplayType } from '@app/shared/shared-video-miniature' | ||
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
10 | import { VideoSortField } from '@shared/models' | ||
15 | 11 | ||
16 | @Component({ | 12 | @Component({ |
17 | selector: 'my-videos-user-subscriptions', | 13 | selector: 'my-videos-user-subscriptions', |
18 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], | 14 | styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ], |
19 | templateUrl: '../../shared/video/abstract-video-list.html' | 15 | templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html' |
20 | }) | 16 | }) |
21 | export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy { | 17 | export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy { |
22 | titlePage: string | 18 | titlePage: string |
@@ -34,6 +30,7 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement | |||
34 | protected userService: UserService, | 30 | protected userService: UserService, |
35 | protected screenService: ScreenService, | 31 | protected screenService: ScreenService, |
36 | protected storageService: LocalStorageService, | 32 | protected storageService: LocalStorageService, |
33 | private userSubscription: UserSubscriptionService, | ||
37 | private videoService: VideoService, | 34 | private videoService: VideoService, |
38 | private hooks: HooksService | 35 | private hooks: HooksService |
39 | ) { | 36 | ) { |
@@ -64,7 +61,7 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement | |||
64 | } | 61 | } |
65 | 62 | ||
66 | return this.hooks.wrapObsFun( | 63 | return this.hooks.wrapObsFun( |
67 | this.videoService.getUserSubscriptionVideos.bind(this.videoService), | 64 | this.userSubscription.getUserSubscriptionVideos.bind(this.userSubscription), |
68 | params, | 65 | params, |
69 | 'common', | 66 | 'common', |
70 | 'filter:api.user-subscriptions-videos.videos.list.params', | 67 | 'filter:api.user-subscriptions-videos.videos.list.params', |
diff --git a/client/src/app/videos/videos-routing.module.ts b/client/src/app/videos/videos-routing.module.ts index 11a087d0a..16b65be63 100644 --- a/client/src/app/videos/videos-routing.module.ts +++ b/client/src/app/videos/videos-routing.module.ts | |||
@@ -6,8 +6,8 @@ import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.c | |||
6 | import { VideoTrendingComponent } from './video-list/video-trending.component' | 6 | import { VideoTrendingComponent } from './video-list/video-trending.component' |
7 | import { VideoMostLikedComponent } from './video-list/video-most-liked.component' | 7 | import { VideoMostLikedComponent } from './video-list/video-most-liked.component' |
8 | import { VideosComponent } from './videos.component' | 8 | import { VideosComponent } from './videos.component' |
9 | import { VideoUserSubscriptionsComponent } from '@app/videos/video-list/video-user-subscriptions.component' | 9 | import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component' |
10 | import { VideoOverviewComponent } from '@app/videos/video-list/video-overview.component' | 10 | import { VideoOverviewComponent } from './video-list/overview/video-overview.component' |
11 | 11 | ||
12 | const videosRoutes: Routes = [ | 12 | const videosRoutes: Routes = [ |
13 | { | 13 | { |
diff --git a/client/src/app/videos/videos.module.ts b/client/src/app/videos/videos.module.ts index 95078a734..217e5bb50 100644 --- a/client/src/app/videos/videos.module.ts +++ b/client/src/app/videos/videos.module.ts | |||
@@ -1,18 +1,27 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { VideoLocalComponent } from '@app/videos/video-list/video-local.component' | 2 | import { SharedFormModule } from '@app/shared/shared-forms' |
3 | import { SharedModule } from '../shared' | 3 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' |
4 | import { SharedMainModule } from '@app/shared/shared-main' | ||
5 | import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' | ||
6 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' | ||
7 | import { VideoOverviewComponent } from './video-list/overview/video-overview.component' | ||
8 | import { VideoLocalComponent } from './video-list/video-local.component' | ||
9 | import { VideoMostLikedComponent } from './video-list/video-most-liked.component' | ||
4 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' | 10 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' |
5 | import { VideoTrendingComponent } from './video-list/video-trending.component' | 11 | import { VideoTrendingComponent } from './video-list/video-trending.component' |
6 | import { VideoMostLikedComponent } from './video-list/video-most-liked.component' | 12 | import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component' |
7 | import { VideosRoutingModule } from './videos-routing.module' | 13 | import { VideosRoutingModule } from './videos-routing.module' |
8 | import { VideosComponent } from './videos.component' | 14 | import { VideosComponent } from './videos.component' |
9 | import { VideoUserSubscriptionsComponent } from '@app/videos/video-list/video-user-subscriptions.component' | ||
10 | import { VideoOverviewComponent } from '@app/videos/video-list/video-overview.component' | ||
11 | 15 | ||
12 | @NgModule({ | 16 | @NgModule({ |
13 | imports: [ | 17 | imports: [ |
14 | VideosRoutingModule, | 18 | VideosRoutingModule, |
15 | SharedModule | 19 | |
20 | SharedMainModule, | ||
21 | SharedFormModule, | ||
22 | SharedVideoMiniatureModule, | ||
23 | SharedUserSubscriptionModule, | ||
24 | SharedGlobalIconModule | ||
16 | ], | 25 | ], |
17 | 26 | ||
18 | declarations: [ | 27 | declarations: [ |
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts index 23890e20c..914c52e27 100644 --- a/server/controllers/api/users/me.ts +++ b/server/controllers/api/users/me.ts | |||
@@ -1,9 +1,15 @@ | |||
1 | import * as express from 'express' | ||
2 | import 'multer' | 1 | import 'multer' |
3 | import { UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared' | 2 | import * as express from 'express' |
3 | import { UserUpdateMe, UserVideoRate as FormattedUserVideoRate, VideoSortField } from '../../../../shared' | ||
4 | import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' | ||
5 | import { createReqFiles } from '../../../helpers/express-utils' | ||
4 | import { getFormattedObjects } from '../../../helpers/utils' | 6 | import { getFormattedObjects } from '../../../helpers/utils' |
7 | import { CONFIG } from '../../../initializers/config' | ||
5 | import { MIMETYPES } from '../../../initializers/constants' | 8 | import { MIMETYPES } from '../../../initializers/constants' |
9 | import { sequelizeTypescript } from '../../../initializers/database' | ||
6 | import { sendUpdateActor } from '../../../lib/activitypub/send' | 10 | import { sendUpdateActor } from '../../../lib/activitypub/send' |
11 | import { updateActorAvatarFile } from '../../../lib/avatar' | ||
12 | import { sendVerifyUserEmail } from '../../../lib/user' | ||
7 | import { | 13 | import { |
8 | asyncMiddleware, | 14 | asyncMiddleware, |
9 | asyncRetryTransactionMiddleware, | 15 | asyncRetryTransactionMiddleware, |
@@ -15,19 +21,12 @@ import { | |||
15 | usersVideoRatingValidator | 21 | usersVideoRatingValidator |
16 | } from '../../../middlewares' | 22 | } from '../../../middlewares' |
17 | import { deleteMeValidator, videoImportsSortValidator, videosSortValidator } from '../../../middlewares/validators' | 23 | import { deleteMeValidator, videoImportsSortValidator, videosSortValidator } from '../../../middlewares/validators' |
24 | import { updateAvatarValidator } from '../../../middlewares/validators/avatar' | ||
25 | import { AccountModel } from '../../../models/account/account' | ||
18 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' | 26 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' |
19 | import { UserModel } from '../../../models/account/user' | 27 | import { UserModel } from '../../../models/account/user' |
20 | import { VideoModel } from '../../../models/video/video' | 28 | import { VideoModel } from '../../../models/video/video' |
21 | import { VideoSortField } from '../../../../client/src/app/shared/video/sort-field.type' | ||
22 | import { createReqFiles } from '../../../helpers/express-utils' | ||
23 | import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' | ||
24 | import { updateAvatarValidator } from '../../../middlewares/validators/avatar' | ||
25 | import { updateActorAvatarFile } from '../../../lib/avatar' | ||
26 | import { VideoImportModel } from '../../../models/video/video-import' | 29 | import { VideoImportModel } from '../../../models/video/video-import' |
27 | import { AccountModel } from '../../../models/account/account' | ||
28 | import { CONFIG } from '../../../initializers/config' | ||
29 | import { sequelizeTypescript } from '../../../initializers/database' | ||
30 | import { sendVerifyUserEmail } from '../../../lib/user' | ||
31 | 30 | ||
32 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) | 31 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) |
33 | 32 | ||
diff --git a/server/lib/auth.ts b/server/lib/auth.ts index 8579bdbb4..3f8e18633 100644 --- a/server/lib/auth.ts +++ b/server/lib/auth.ts | |||
@@ -10,7 +10,7 @@ import { | |||
10 | RegisterServerAuthenticatedResult, | 10 | RegisterServerAuthenticatedResult, |
11 | RegisterServerAuthPassOptions, | 11 | RegisterServerAuthPassOptions, |
12 | RegisterServerExternalAuthenticatedResult | 12 | RegisterServerExternalAuthenticatedResult |
13 | } from '@shared/models/plugins/register-server-auth.model' | 13 | } from '@server/types/plugins/register-server-auth.model' |
14 | import * as express from 'express' | 14 | import * as express from 'express' |
15 | import * as OAuthServer from 'express-oauth-server' | 15 | import * as OAuthServer from 'express-oauth-server' |
16 | 16 | ||
diff --git a/server/lib/plugins/plugin-helpers.ts b/server/lib/plugins/plugin-helpers.ts index de82b4918..39773f693 100644 --- a/server/lib/plugins/plugin-helpers.ts +++ b/server/lib/plugins/plugin-helpers.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { PeerTubeHelpers } from '@server/typings/plugins' | 1 | import { PeerTubeHelpers } from '@server/types/plugins' |
2 | import { sequelizeTypescript } from '@server/initializers/database' | 2 | import { sequelizeTypescript } from '@server/initializers/database' |
3 | import { buildLogger } from '@server/helpers/logger' | 3 | import { buildLogger } from '@server/helpers/logger' |
4 | import { VideoModel } from '@server/models/video/video' | 4 | import { VideoModel } from '@server/models/video/video' |
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index 7fda5d9a4..94b5ecc41 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts | |||
@@ -1,28 +1,26 @@ | |||
1 | import { PluginModel } from '../../models/server/plugin' | 1 | import { createReadStream, createWriteStream } from 'fs' |
2 | import { logger } from '../../helpers/logger' | 2 | import { outputFile, readJSON } from 'fs-extra' |
3 | import { basename, join } from 'path' | 3 | import { basename, join } from 'path' |
4 | import { CONFIG } from '../../initializers/config' | 4 | import { MOAuthTokenUser, MUser } from '@server/types/models' |
5 | import { isLibraryCodeValid, isPackageJSONValid } from '../../helpers/custom-validators/plugins' | 5 | import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model' |
6 | import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks' | ||
6 | import { | 7 | import { |
7 | ClientScript, | 8 | ClientScript, |
8 | PluginPackageJson, | 9 | PluginPackageJson, |
9 | PluginTranslationPaths as PackagePluginTranslations | 10 | PluginTranslationPaths as PackagePluginTranslations |
10 | } from '../../../shared/models/plugins/plugin-package-json.model' | 11 | } from '../../../shared/models/plugins/plugin-package-json.model' |
11 | import { createReadStream, createWriteStream } from 'fs' | 12 | import { PluginTranslation } from '../../../shared/models/plugins/plugin-translation.model' |
12 | import { PLUGIN_GLOBAL_CSS_PATH } from '../../initializers/constants' | ||
13 | import { PluginType } from '../../../shared/models/plugins/plugin.type' | 13 | import { PluginType } from '../../../shared/models/plugins/plugin.type' |
14 | import { installNpmPlugin, installNpmPluginFromDisk, removeNpmPlugin } from './yarn' | ||
15 | import { outputFile, readJSON } from 'fs-extra' | ||
16 | import { ServerHook, ServerHookName } from '../../../shared/models/plugins/server-hook.model' | 14 | import { ServerHook, ServerHookName } from '../../../shared/models/plugins/server-hook.model' |
17 | import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks' | 15 | import { isLibraryCodeValid, isPackageJSONValid } from '../../helpers/custom-validators/plugins' |
18 | import { RegisterServerOptions } from '../../typings/plugins/register-server-option.model' | 16 | import { logger } from '../../helpers/logger' |
19 | import { PluginLibrary } from '../../typings/plugins' | 17 | import { CONFIG } from '../../initializers/config' |
18 | import { PLUGIN_GLOBAL_CSS_PATH } from '../../initializers/constants' | ||
19 | import { PluginModel } from '../../models/server/plugin' | ||
20 | import { PluginLibrary, RegisterServerAuthExternalOptions, RegisterServerAuthPassOptions, RegisterServerOptions } from '../../types/plugins' | ||
20 | import { ClientHtml } from '../client-html' | 21 | import { ClientHtml } from '../client-html' |
21 | import { PluginTranslation } from '../../../shared/models/plugins/plugin-translation.model' | ||
22 | import { RegisterHelpersStore } from './register-helpers-store' | 22 | import { RegisterHelpersStore } from './register-helpers-store' |
23 | import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model' | 23 | import { installNpmPlugin, installNpmPluginFromDisk, removeNpmPlugin } from './yarn' |
24 | import { MOAuthTokenUser, MUser } from '@server/types/models' | ||
25 | import { RegisterServerAuthPassOptions, RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model' | ||
26 | 24 | ||
27 | export interface RegisteredPlugin { | 25 | export interface RegisteredPlugin { |
28 | npmName: string | 26 | npmName: string |
diff --git a/server/lib/plugins/register-helpers-store.ts b/server/lib/plugins/register-helpers-store.ts index e337b1cb0..c73079302 100644 --- a/server/lib/plugins/register-helpers-store.ts +++ b/server/lib/plugins/register-helpers-store.ts | |||
@@ -9,22 +9,24 @@ import { | |||
9 | } from '@server/initializers/constants' | 9 | } from '@server/initializers/constants' |
10 | import { onExternalUserAuthenticated } from '@server/lib/auth' | 10 | import { onExternalUserAuthenticated } from '@server/lib/auth' |
11 | import { PluginModel } from '@server/models/server/plugin' | 11 | import { PluginModel } from '@server/models/server/plugin' |
12 | import { RegisterServerOptions } from '@server/typings/plugins' | ||
13 | import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model' | ||
14 | import { PluginSettingsManager } from '@shared/models/plugins/plugin-settings-manager.model' | ||
15 | import { PluginStorageManager } from '@shared/models/plugins/plugin-storage-manager.model' | ||
16 | import { PluginVideoCategoryManager } from '@shared/models/plugins/plugin-video-category-manager.model' | ||
17 | import { PluginVideoLanguageManager } from '@shared/models/plugins/plugin-video-language-manager.model' | ||
18 | import { PluginVideoLicenceManager } from '@shared/models/plugins/plugin-video-licence-manager.model' | ||
19 | import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model' | ||
20 | import { | 12 | import { |
21 | RegisterServerAuthExternalOptions, | 13 | RegisterServerAuthExternalOptions, |
22 | RegisterServerAuthExternalResult, | 14 | RegisterServerAuthExternalResult, |
23 | RegisterServerAuthPassOptions, | 15 | RegisterServerAuthPassOptions, |
24 | RegisterServerExternalAuthenticatedResult | 16 | RegisterServerExternalAuthenticatedResult, |
25 | } from '@shared/models/plugins/register-server-auth.model' | 17 | RegisterServerOptions |
26 | import { RegisterServerHookOptions } from '@shared/models/plugins/register-server-hook.model' | 18 | } from '@server/types/plugins' |
27 | import { RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model' | 19 | import { |
20 | PluginPlaylistPrivacyManager, | ||
21 | PluginSettingsManager, | ||
22 | PluginStorageManager, | ||
23 | PluginVideoCategoryManager, | ||
24 | PluginVideoLanguageManager, | ||
25 | PluginVideoLicenceManager, | ||
26 | PluginVideoPrivacyManager, | ||
27 | RegisterServerHookOptions, | ||
28 | RegisterServerSettingOptions | ||
29 | } from '@shared/models' | ||
28 | import { serverHookObject } from '@shared/models/plugins/server-hook.model' | 30 | import { serverHookObject } from '@shared/models/plugins/server-hook.model' |
29 | import { buildPluginHelpers } from './plugin-helpers' | 31 | import { buildPluginHelpers } from './plugin-helpers' |
30 | 32 | ||
diff --git a/server/models/utils.ts b/server/models/utils.ts index 88c9b4adb..d706d9ea8 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts | |||
@@ -3,23 +3,6 @@ import validator from 'validator' | |||
3 | import { Col } from 'sequelize/types/lib/utils' | 3 | import { Col } from 'sequelize/types/lib/utils' |
4 | import { literal, OrderItem, Op } from 'sequelize' | 4 | import { literal, OrderItem, Op } from 'sequelize' |
5 | 5 | ||
6 | type Primitive = string | Function | number | boolean | Symbol | undefined | null | ||
7 | type DeepOmitHelper<T, K extends keyof T> = { | ||
8 | [P in K]: // extra level of indirection needed to trigger homomorhic behavior | ||
9 | T[P] extends infer TP // distribute over unions | ||
10 | ? TP extends Primitive | ||
11 | ? TP // leave primitives and functions alone | ||
12 | : TP extends any[] | ||
13 | ? DeepOmitArray<TP, K> // Array special handling | ||
14 | : DeepOmit<TP, K> | ||
15 | : never | ||
16 | } | ||
17 | type DeepOmit<T, K> = T extends Primitive ? T : DeepOmitHelper<T, Exclude<keyof T, K>> | ||
18 | |||
19 | type DeepOmitArray<T extends any[], K> = { | ||
20 | [P in keyof T]: DeepOmit<T[P], K> | ||
21 | } | ||
22 | |||
23 | type SortType = { sortModel: string, sortValue: string } | 6 | type SortType = { sortModel: string, sortValue: string } |
24 | 7 | ||
25 | // Translate for example "-name" to [ [ 'name', 'DESC' ], [ 'id', 'ASC' ] ] | 8 | // Translate for example "-name" to [ [ 'name', 'DESC' ], [ 'id', 'ASC' ] ] |
@@ -217,7 +200,6 @@ function searchAttribute (sourceField?: string, targetField?: string) { | |||
217 | // --------------------------------------------------------------------------- | 200 | // --------------------------------------------------------------------------- |
218 | 201 | ||
219 | export { | 202 | export { |
220 | DeepOmit, | ||
221 | buildBlockedAccountSQL, | 203 | buildBlockedAccountSQL, |
222 | buildLocalActorIdsIn, | 204 | buildLocalActorIdsIn, |
223 | SortType, | 205 | SortType, |
diff --git a/server/types/index.ts b/server/types/index.ts new file mode 100644 index 000000000..18d3827a5 --- /dev/null +++ b/server/types/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './plugins' | ||
2 | export * from './activitypub-processor.model' | ||
3 | export * from './sequelize' | ||
diff --git a/server/types/models/account/account-blocklist.ts b/server/types/models/account/account-blocklist.ts index 0d8bf11bd..3126fd0ab 100644 --- a/server/types/models/account/account-blocklist.ts +++ b/server/types/models/account/account-blocklist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { AccountBlocklistModel } from '../../../models/account/account-blocklist' | 1 | import { AccountBlocklistModel } from '../../../models/account/account-blocklist' |
2 | import { PickWith } from '../../utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccountDefault, MAccountFormattable } from './account' | 3 | import { MAccountDefault, MAccountFormattable } from './account' |
4 | 4 | ||
5 | type Use<K extends keyof AccountBlocklistModel, M> = PickWith<AccountBlocklistModel, K, M> | 5 | type Use<K extends keyof AccountBlocklistModel, M> = PickWith<AccountBlocklistModel, K, M> |
diff --git a/server/types/models/account/account.ts b/server/types/models/account/account.ts index 7b826ee04..d2add9810 100644 --- a/server/types/models/account/account.ts +++ b/server/types/models/account/account.ts | |||
@@ -13,7 +13,7 @@ import { | |||
13 | MActorSummaryFormattable, | 13 | MActorSummaryFormattable, |
14 | MActorUrl | 14 | MActorUrl |
15 | } from './actor' | 15 | } from './actor' |
16 | import { FunctionProperties, PickWith } from '../../utils' | 16 | import { FunctionProperties, PickWith } from '@shared/core-utils' |
17 | import { MAccountBlocklistId } from './account-blocklist' | 17 | import { MAccountBlocklistId } from './account-blocklist' |
18 | import { MChannelDefault } from '../video/video-channels' | 18 | import { MChannelDefault } from '../video/video-channels' |
19 | 19 | ||
diff --git a/server/types/models/account/actor-follow.ts b/server/types/models/account/actor-follow.ts index 5d0c03c8d..8c213d09c 100644 --- a/server/types/models/account/actor-follow.ts +++ b/server/types/models/account/actor-follow.ts | |||
@@ -8,7 +8,7 @@ import { | |||
8 | MActorHost, | 8 | MActorHost, |
9 | MActorUsername | 9 | MActorUsername |
10 | } from './actor' | 10 | } from './actor' |
11 | import { PickWith } from '../../utils' | 11 | import { PickWith } from '@shared/core-utils' |
12 | import { ActorModel } from '@server/models/activitypub/actor' | 12 | import { ActorModel } from '@server/models/activitypub/actor' |
13 | import { MChannelDefault } from '../video/video-channels' | 13 | import { MChannelDefault } from '../video/video-channels' |
14 | 14 | ||
diff --git a/server/types/models/account/actor.ts b/server/types/models/account/actor.ts index 1160e84cb..ee0d05f4e 100644 --- a/server/types/models/account/actor.ts +++ b/server/types/models/account/actor.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ActorModel } from '../../../models/activitypub/actor' | 1 | import { ActorModel } from '../../../models/activitypub/actor' |
2 | import { FunctionProperties, PickWith, PickWithOpt } from '../../utils' | 2 | import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account' | 3 | import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account' |
4 | import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server' | 4 | import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server' |
5 | import { MAvatar, MAvatarFormattable } from './avatar' | 5 | import { MAvatar, MAvatarFormattable } from './avatar' |
diff --git a/server/types/models/account/avatar.ts b/server/types/models/account/avatar.ts index 6eba59ee4..0489a8599 100644 --- a/server/types/models/account/avatar.ts +++ b/server/types/models/account/avatar.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { AvatarModel } from '../../../models/avatar/avatar' | 1 | import { AvatarModel } from '../../../models/avatar/avatar' |
2 | import { FunctionProperties } from '@server/types/utils' | 2 | import { FunctionProperties } from '@shared/core-utils' |
3 | 3 | ||
4 | export type MAvatar = AvatarModel | 4 | export type MAvatar = AvatarModel |
5 | 5 | ||
diff --git a/server/types/models/oauth/oauth-token.ts b/server/types/models/oauth/oauth-token.ts index 396cf6429..8399af8f1 100644 --- a/server/types/models/oauth/oauth-token.ts +++ b/server/types/models/oauth/oauth-token.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' | 1 | import { OAuthTokenModel } from '@server/models/oauth/oauth-token' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MUserAccountUrl } from '../user/user' | 3 | import { MUserAccountUrl } from '../user/user' |
4 | 4 | ||
5 | type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M> | 5 | type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M> |
diff --git a/server/types/models/server/server-blocklist.ts b/server/types/models/server/server-blocklist.ts index cfbf3b73a..801f179fd 100644 --- a/server/types/models/server/server-blocklist.ts +++ b/server/types/models/server/server-blocklist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' | 1 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccountDefault, MAccountFormattable } from '../account/account' | 3 | import { MAccountDefault, MAccountFormattable } from '../account/account' |
4 | import { MServer, MServerFormattable } from './server' | 4 | import { MServer, MServerFormattable } from './server' |
5 | 5 | ||
diff --git a/server/types/models/server/server.ts b/server/types/models/server/server.ts index b35e55aeb..f8b053e3b 100644 --- a/server/types/models/server/server.ts +++ b/server/types/models/server/server.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ServerModel } from '../../../models/server/server' | 1 | import { ServerModel } from '../../../models/server/server' |
2 | import { FunctionProperties, PickWith } from '../../utils' | 2 | import { FunctionProperties, PickWith } from '@shared/core-utils' |
3 | import { MAccountBlocklistId } from '../account' | 3 | import { MAccountBlocklistId } from '../account' |
4 | 4 | ||
5 | type Use<K extends keyof ServerModel, M> = PickWith<ServerModel, K, M> | 5 | type Use<K extends keyof ServerModel, M> = PickWith<ServerModel, K, M> |
diff --git a/server/types/models/user/user-notification.ts b/server/types/models/user/user-notification.ts index 2080360e1..dd3de423b 100644 --- a/server/types/models/user/user-notification.ts +++ b/server/types/models/user/user-notification.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { UserNotificationModel } from '../../../models/account/user-notification' | 1 | import { UserNotificationModel } from '../../../models/account/user-notification' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { VideoModel } from '../../../models/video/video' | 3 | import { VideoModel } from '../../../models/video/video' |
4 | import { ActorModel } from '../../../models/activitypub/actor' | 4 | import { ActorModel } from '../../../models/activitypub/actor' |
5 | import { ServerModel } from '../../../models/server/server' | 5 | import { ServerModel } from '../../../models/server/server' |
diff --git a/server/types/models/user/user.ts b/server/types/models/user/user.ts index 7938ea288..12a68accf 100644 --- a/server/types/models/user/user.ts +++ b/server/types/models/user/user.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { UserModel } from '../../../models/account/user' | 1 | import { UserModel } from '../../../models/account/user' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { | 3 | import { |
4 | MAccount, | 4 | MAccount, |
5 | MAccountDefault, | 5 | MAccountDefault, |
diff --git a/server/types/models/video/schedule-video-update.ts b/server/types/models/video/schedule-video-update.ts index 6336fdabe..5d2936000 100644 --- a/server/types/models/video/schedule-video-update.ts +++ b/server/types/models/video/schedule-video-update.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' | 1 | import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MVideoAPWithoutCaption, MVideoWithBlacklistLight } from './video' | 3 | import { MVideoAPWithoutCaption, MVideoWithBlacklistLight } from './video' |
4 | 4 | ||
5 | type Use<K extends keyof ScheduleVideoUpdateModel, M> = PickWith<ScheduleVideoUpdateModel, K, M> | 5 | type Use<K extends keyof ScheduleVideoUpdateModel, M> = PickWith<ScheduleVideoUpdateModel, K, M> |
diff --git a/server/types/models/video/video-abuse.ts b/server/types/models/video/video-abuse.ts index d60f05e4c..279a87cf3 100644 --- a/server/types/models/video/video-abuse.ts +++ b/server/types/models/video/video-abuse.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoAbuseModel } from '../../../models/video/video-abuse' | 1 | import { VideoAbuseModel } from '../../../models/video/video-abuse' |
2 | import { PickWith } from '../../utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MVideoAccountLightBlacklistAllFiles, MVideo } from './video' | 3 | import { MVideoAccountLightBlacklistAllFiles, MVideo } from './video' |
4 | import { MAccountDefault, MAccountFormattable } from '../account' | 4 | import { MAccountDefault, MAccountFormattable } from '../account' |
5 | 5 | ||
diff --git a/server/types/models/video/video-blacklist.ts b/server/types/models/video/video-blacklist.ts index 08e59284a..2ac912405 100644 --- a/server/types/models/video/video-blacklist.ts +++ b/server/types/models/video/video-blacklist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' | 1 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MVideo, MVideoFormattable } from './video' | 3 | import { MVideo, MVideoFormattable } from './video' |
4 | 4 | ||
5 | type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M> | 5 | type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M> |
diff --git a/server/types/models/video/video-caption.ts b/server/types/models/video/video-caption.ts index 9bb067001..ab80ff830 100644 --- a/server/types/models/video/video-caption.ts +++ b/server/types/models/video/video-caption.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoCaptionModel } from '../../../models/video/video-caption' | 1 | import { VideoCaptionModel } from '../../../models/video/video-caption' |
2 | import { FunctionProperties, PickWith } from '@server/types/utils' | 2 | import { FunctionProperties, PickWith } from '@shared/core-utils' |
3 | import { MVideo, MVideoUUID } from './video' | 3 | import { MVideo, MVideoUUID } from './video' |
4 | 4 | ||
5 | type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M> | 5 | type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M> |
diff --git a/server/types/models/video/video-change-ownership.ts b/server/types/models/video/video-change-ownership.ts index 7421e081e..244d1a671 100644 --- a/server/types/models/video/video-change-ownership.ts +++ b/server/types/models/video/video-change-ownership.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' | 1 | import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccountDefault, MAccountFormattable } from '../account/account' | 3 | import { MAccountDefault, MAccountFormattable } from '../account/account' |
4 | import { MVideo, MVideoWithAllFiles } from './video' | 4 | import { MVideo, MVideoWithAllFiles } from './video' |
5 | 5 | ||
diff --git a/server/types/models/video/video-channels.ts b/server/types/models/video/video-channels.ts index 50f7c2d8a..2e05d8753 100644 --- a/server/types/models/video/video-channels.ts +++ b/server/types/models/video/video-channels.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { FunctionProperties, PickWith, PickWithOpt } from '../../utils' | 1 | import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils' |
2 | import { VideoChannelModel } from '../../../models/video/video-channel' | 2 | import { VideoChannelModel } from '../../../models/video/video-channel' |
3 | import { | 3 | import { |
4 | MAccountActor, | 4 | MAccountActor, |
diff --git a/server/types/models/video/video-comment.ts b/server/types/models/video/video-comment.ts index d6e0b66f5..f1c50c753 100644 --- a/server/types/models/video/video-comment.ts +++ b/server/types/models/video/video-comment.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoCommentModel } from '../../../models/video/video-comment' | 1 | import { VideoCommentModel } from '../../../models/video/video-comment' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MAccountDefault, MAccountFormattable, MAccountUrl } from '../account' | 3 | import { MAccountDefault, MAccountFormattable, MAccountUrl } from '../account' |
4 | import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video' | 4 | import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video' |
5 | 5 | ||
diff --git a/server/types/models/video/video-file.ts b/server/types/models/video/video-file.ts index 3fcaca78f..327a148ce 100644 --- a/server/types/models/video/video-file.ts +++ b/server/types/models/video/video-file.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoFileModel } from '../../../models/video/video-file' | 1 | import { VideoFileModel } from '../../../models/video/video-file' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MVideo, MVideoUUID } from './video' | 3 | import { MVideo, MVideoUUID } from './video' |
4 | import { MVideoRedundancy, MVideoRedundancyFileUrl } from './video-redundancy' | 4 | import { MVideoRedundancy, MVideoRedundancyFileUrl } from './video-redundancy' |
5 | import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist' | 5 | import { MStreamingPlaylistVideo, MStreamingPlaylist } from './video-streaming-playlist' |
diff --git a/server/types/models/video/video-import.ts b/server/types/models/video/video-import.ts index f1385877e..759b13c6e 100644 --- a/server/types/models/video/video-import.ts +++ b/server/types/models/video/video-import.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoImportModel } from '@server/models/video/video-import' | 1 | import { VideoImportModel } from '@server/models/video/video-import' |
2 | import { PickWith, PickWithOpt } from '@server/types/utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video' | 3 | import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video' |
4 | import { MUser } from '../user/user' | 4 | import { MUser } from '../user/user' |
5 | 5 | ||
diff --git a/server/types/models/video/video-playlist-element.ts b/server/types/models/video/video-playlist-element.ts index c50992da7..f46ff4d49 100644 --- a/server/types/models/video/video-playlist-element.ts +++ b/server/types/models/video/video-playlist-element.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' | 1 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video' | 3 | import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video' |
4 | import { MVideoPlaylistPrivacy } from './video-playlist' | 4 | import { MVideoPlaylistPrivacy } from './video-playlist' |
5 | 5 | ||
diff --git a/server/types/models/video/video-playlist.ts b/server/types/models/video/video-playlist.ts index b504d1664..79e2daebf 100644 --- a/server/types/models/video/video-playlist.ts +++ b/server/types/models/video/video-playlist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' | 1 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' |
2 | import { PickWith } from '../../utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccount, MAccountDefault, MAccountSummary, MAccountSummaryFormattable } from '../account' | 3 | import { MAccount, MAccountDefault, MAccountSummary, MAccountSummaryFormattable } from '../account' |
4 | import { MThumbnail } from './thumbnail' | 4 | import { MThumbnail } from './thumbnail' |
5 | import { MChannelDefault, MChannelSummary, MChannelSummaryFormattable, MChannelUrl } from './video-channels' | 5 | import { MChannelDefault, MChannelSummary, MChannelSummaryFormattable, MChannelUrl } from './video-channels' |
diff --git a/server/types/models/video/video-rate.ts b/server/types/models/video/video-rate.ts index a7682ef31..7bd54f7b0 100644 --- a/server/types/models/video/video-rate.ts +++ b/server/types/models/video/video-rate.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { AccountVideoRateModel } from '@server/models/account/account-video-rate' | 1 | import { AccountVideoRateModel } from '@server/models/account/account-video-rate' |
2 | import { PickWith } from '@server/types/utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MAccountAudience, MAccountUrl } from '../account/account' | 3 | import { MAccountAudience, MAccountUrl } from '../account/account' |
4 | import { MVideo, MVideoFormattable } from './video' | 4 | import { MVideo, MVideoFormattable } from './video' |
5 | 5 | ||
diff --git a/server/types/models/video/video-redundancy.ts b/server/types/models/video/video-redundancy.ts index 7c7d52035..411375c81 100644 --- a/server/types/models/video/video-redundancy.ts +++ b/server/types/models/video/video-redundancy.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' | 1 | import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' |
2 | import { PickWith, PickWithOpt } from '@server/types/utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' | 3 | import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' |
4 | import { VideoFileModel } from '@server/models/video/video-file' | 4 | import { VideoFileModel } from '@server/models/video/video-file' |
5 | import { MVideoFile, MVideoFileVideo } from './video-file' | 5 | import { MVideoFile, MVideoFileVideo } from './video-file' |
diff --git a/server/types/models/video/video-share.ts b/server/types/models/video/video-share.ts index 50ca75d26..b7a783bb6 100644 --- a/server/types/models/video/video-share.ts +++ b/server/types/models/video/video-share.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoShareModel } from '../../../models/video/video-share' | 1 | import { VideoShareModel } from '../../../models/video/video-share' |
2 | import { PickWith } from '../../utils' | 2 | import { PickWith } from '@shared/core-utils' |
3 | import { MActorDefault } from '../account' | 3 | import { MActorDefault } from '../account' |
4 | import { MVideo } from './video' | 4 | import { MVideo } from './video' |
5 | 5 | ||
diff --git a/server/types/models/video/video-streaming-playlist.ts b/server/types/models/video/video-streaming-playlist.ts index 3f54aa560..8b3ef51fc 100644 --- a/server/types/models/video/video-streaming-playlist.ts +++ b/server/types/models/video/video-streaming-playlist.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' | 1 | import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy' | 3 | import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy' |
4 | import { MVideo } from './video' | 4 | import { MVideo } from './video' |
5 | import { MVideoFile } from './video-file' | 5 | import { MVideoFile } from './video-file' |
diff --git a/server/types/models/video/video.ts b/server/types/models/video/video.ts index 022a9566d..3d8f85b3d 100644 --- a/server/types/models/video/video.ts +++ b/server/types/models/video/video.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { VideoModel } from '../../../models/video/video' | 1 | import { VideoModel } from '../../../models/video/video' |
2 | import { PickWith, PickWithOpt } from '../../utils' | 2 | import { PickWith, PickWithOpt } from '@shared/core-utils' |
3 | import { | 3 | import { |
4 | MChannelAccountDefault, | 4 | MChannelAccountDefault, |
5 | MChannelAccountLight, | 5 | MChannelAccountLight, |
diff --git a/server/typings/plugins/index.d.ts b/server/types/plugins/index.ts index 9570579ef..de30ff2ab 100644 --- a/server/typings/plugins/index.d.ts +++ b/server/types/plugins/index.ts | |||
@@ -1,2 +1,3 @@ | |||
1 | export * from './register-server-option.model' | ||
2 | export * from './plugin-library.model' | 1 | export * from './plugin-library.model' |
2 | export * from './register-server-auth.model' | ||
3 | export * from './register-server-option.model' | ||
diff --git a/server/typings/plugins/plugin-library.model.ts b/server/types/plugins/plugin-library.model.ts index 5b517ee9f..5b517ee9f 100644 --- a/server/typings/plugins/plugin-library.model.ts +++ b/server/types/plugins/plugin-library.model.ts | |||
diff --git a/shared/models/plugins/register-server-auth.model.ts b/server/types/plugins/register-server-auth.model.ts index fc6f0f258..31c71b0d0 100644 --- a/shared/models/plugins/register-server-auth.model.ts +++ b/server/types/plugins/register-server-auth.model.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { UserRole } from '@shared/models' | ||
2 | import { MOAuthToken, MUser } from '@server/types/models' | ||
3 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserRole } from '@shared/models' | ||
3 | import { MOAuthToken, MUser } from '../models' | ||
4 | 4 | ||
5 | export type RegisterServerAuthOptions = RegisterServerAuthPassOptions | RegisterServerAuthExternalOptions | 5 | export type RegisterServerAuthOptions = RegisterServerAuthPassOptions | RegisterServerAuthExternalOptions |
6 | 6 | ||
diff --git a/server/typings/plugins/register-server-option.model.ts b/server/types/plugins/register-server-option.model.ts index b4594c6cd..74303d383 100644 --- a/server/typings/plugins/register-server-option.model.ts +++ b/server/types/plugins/register-server-option.model.ts | |||
@@ -2,22 +2,24 @@ import * as Bluebird from 'bluebird' | |||
2 | import { Router } from 'express' | 2 | import { Router } from 'express' |
3 | import { Logger } from 'winston' | 3 | import { Logger } from 'winston' |
4 | import { ActorModel } from '@server/models/activitypub/actor' | 4 | import { ActorModel } from '@server/models/activitypub/actor' |
5 | import { VideoBlacklistCreate } from '@shared/models' | 5 | import { |
6 | import { PluginPlaylistPrivacyManager } from '@shared/models/plugins/plugin-playlist-privacy-manager.model' | 6 | PluginPlaylistPrivacyManager, |
7 | import { PluginVideoPrivacyManager } from '@shared/models/plugins/plugin-video-privacy-manager.model' | 7 | PluginSettingsManager, |
8 | PluginStorageManager, | ||
9 | PluginVideoCategoryManager, | ||
10 | PluginVideoLanguageManager, | ||
11 | PluginVideoLicenceManager, | ||
12 | PluginVideoPrivacyManager, | ||
13 | RegisterServerHookOptions, | ||
14 | RegisterServerSettingOptions, | ||
15 | VideoBlacklistCreate | ||
16 | } from '@shared/models' | ||
17 | import { MVideoThumbnail } from '../models' | ||
8 | import { | 18 | import { |
9 | RegisterServerAuthExternalOptions, | 19 | RegisterServerAuthExternalOptions, |
10 | RegisterServerAuthExternalResult, | 20 | RegisterServerAuthExternalResult, |
11 | RegisterServerAuthPassOptions | 21 | RegisterServerAuthPassOptions |
12 | } from '@shared/models/plugins/register-server-auth.model' | 22 | } from './register-server-auth.model' |
13 | import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model' | ||
14 | import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model' | ||
15 | import { PluginVideoCategoryManager } from '../../../shared/models/plugins/plugin-video-category-manager.model' | ||
16 | import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model' | ||
17 | import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model' | ||
18 | import { RegisterServerHookOptions } from '../../../shared/models/plugins/register-server-hook.model' | ||
19 | import { RegisterServerSettingOptions } from '../../../shared/models/plugins/register-server-setting.model' | ||
20 | import { MVideoThumbnail } from '../../types/models' | ||
21 | 23 | ||
22 | export type PeerTubeHelpers = { | 24 | export type PeerTubeHelpers = { |
23 | logger: Logger | 25 | logger: Logger |
diff --git a/server/typings/express/index.d.ts b/server/typings/express/index.d.ts index ad3212340..cac801e55 100644 --- a/server/typings/express/index.d.ts +++ b/server/typings/express/index.d.ts | |||
@@ -1,3 +1,20 @@ | |||
1 | import { RegisterServerAuthExternalOptions } from '@server/types' | ||
2 | import { | ||
3 | MAccountBlocklist, | ||
4 | MActorUrl, | ||
5 | MStreamingPlaylist, | ||
6 | MVideoChangeOwnershipFull, | ||
7 | MVideoFile, | ||
8 | MVideoImmutable, | ||
9 | MVideoPlaylistFull, | ||
10 | MVideoPlaylistFullSummary | ||
11 | } from '@server/types/models' | ||
12 | import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' | ||
13 | import { MPlugin, MServer, MServerBlocklist } from '@server/types/models/server' | ||
14 | import { MVideoImportDefault } from '@server/types/models/video/video-import' | ||
15 | import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' | ||
16 | import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' | ||
17 | import { UserRole } from '@shared/models' | ||
1 | import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' | 18 | import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' |
2 | import { | 19 | import { |
3 | MAccountDefault, | 20 | MAccountDefault, |
@@ -19,17 +36,6 @@ import { | |||
19 | MVideoThumbnail, | 36 | MVideoThumbnail, |
20 | MVideoWithRights | 37 | MVideoWithRights |
21 | } from '../../types/models' | 38 | } from '../../types/models' |
22 | import { MVideoPlaylistFull, MVideoPlaylistFullSummary } from '../../types/models/video/video-playlist' | ||
23 | import { MVideoImportDefault } from '@server/types/models/video/video-import' | ||
24 | import { MAccountBlocklist, MActorUrl, MStreamingPlaylist, MVideoFile, MVideoImmutable } from '@server/types/models' | ||
25 | import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' | ||
26 | import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' | ||
27 | import { MVideoChangeOwnershipFull } from '../../types/models/video/video-change-ownership' | ||
28 | import { MPlugin, MServer } from '@server/types/models/server' | ||
29 | import { MServerBlocklist } from '../../types/models/server/server-blocklist' | ||
30 | import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' | ||
31 | import { UserRole } from '@shared/models' | ||
32 | import { RegisterServerAuthExternalOptions } from '@shared/models/plugins/register-server-auth.model' | ||
33 | 39 | ||
34 | declare module 'express' { | 40 | declare module 'express' { |
35 | export interface Request { | 41 | export interface Request { |
diff --git a/shared/core-utils/index.ts b/shared/core-utils/index.ts new file mode 100644 index 000000000..54e233522 --- /dev/null +++ b/shared/core-utils/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './logs' | ||
2 | export * from './miscs' | ||
3 | export * from './plugins' | ||
diff --git a/shared/core-utils/logs/index.ts b/shared/core-utils/logs/index.ts new file mode 100644 index 000000000..ceb5d7a7f --- /dev/null +++ b/shared/core-utils/logs/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './logs' | |||
diff --git a/shared/core-utils/miscs/index.ts b/shared/core-utils/miscs/index.ts new file mode 100644 index 000000000..afd147f24 --- /dev/null +++ b/shared/core-utils/miscs/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './date' | ||
2 | export * from './miscs' | ||
3 | export * from './types' | ||
diff --git a/server/types/utils.ts b/shared/core-utils/miscs/types.ts index 55500d8c4..bb64dc830 100644 --- a/server/types/utils.ts +++ b/shared/core-utils/miscs/types.ts | |||
@@ -22,3 +22,20 @@ export type DeepPartial<T> = { | |||
22 | ? ReadonlyArray<DeepPartial<U>> | 22 | ? ReadonlyArray<DeepPartial<U>> |
23 | : DeepPartial<T[P]> | 23 | : DeepPartial<T[P]> |
24 | } | 24 | } |
25 | |||
26 | type Primitive = string | Function | number | boolean | Symbol | undefined | null | ||
27 | export type DeepOmitHelper<T, K extends keyof T> = { | ||
28 | [P in K]: // extra level of indirection needed to trigger homomorhic behavior | ||
29 | T[P] extends infer TP // distribute over unions | ||
30 | ? TP extends Primitive | ||
31 | ? TP // leave primitives and functions alone | ||
32 | : TP extends any[] | ||
33 | ? DeepOmitArray<TP, K> // Array special handling | ||
34 | : DeepOmit<TP, K> | ||
35 | : never | ||
36 | } | ||
37 | export type DeepOmit<T, K> = T extends Primitive ? T : DeepOmitHelper<T, Exclude<keyof T, K>> | ||
38 | |||
39 | export type DeepOmitArray<T extends any[], K> = { | ||
40 | [P in keyof T]: DeepOmit<T[P], K> | ||
41 | } | ||
diff --git a/shared/core-utils/plugins/index.ts b/shared/core-utils/plugins/index.ts new file mode 100644 index 000000000..fc78d3512 --- /dev/null +++ b/shared/core-utils/plugins/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './hooks' | |||
diff --git a/shared/extra-utils/server/config.ts b/shared/extra-utils/server/config.ts index 2b04a0396..3ae1c6e67 100644 --- a/shared/extra-utils/server/config.ts +++ b/shared/extra-utils/server/config.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests' | 1 | import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests' |
2 | import { CustomConfig } from '../../models/server/custom-config.model' | 2 | import { CustomConfig } from '../../models/server/custom-config.model' |
3 | import { DeepPartial } from '@server/types/utils' | 3 | import { DeepPartial } from '@shared/core-utils' |
4 | import { merge } from 'lodash' | 4 | import { merge } from 'lodash' |
5 | 5 | ||
6 | function getConfig (url: string) { | 6 | function getConfig (url: string) { |
diff --git a/shared/models/actors/index.ts b/shared/models/actors/index.ts index 8fe437b81..c7a92399d 100644 --- a/shared/models/actors/index.ts +++ b/shared/models/actors/index.ts | |||
@@ -1,2 +1,3 @@ | |||
1 | export * from './account.model' | 1 | export * from './account.model' |
2 | export * from './actor.model' | ||
2 | export * from './follow.model' | 3 | export * from './follow.model' |
diff --git a/shared/models/index.ts b/shared/models/index.ts index b562e04a3..3d4bdedde 100644 --- a/shared/models/index.ts +++ b/shared/models/index.ts | |||
@@ -9,8 +9,9 @@ export * from './videos' | |||
9 | export * from './feeds' | 9 | export * from './feeds' |
10 | export * from './i18n' | 10 | export * from './i18n' |
11 | export * from './overviews' | 11 | export * from './overviews' |
12 | export * from './plugins' | ||
12 | export * from './search' | 13 | export * from './search' |
13 | export * from './server/job.model' | 14 | export * from './server' |
14 | export * from './oauth-client-local.model' | 15 | export * from './oauth-client-local.model' |
15 | export * from './result-list.model' | 16 | export * from './result-list.model' |
16 | export * from './server/server-config.model' | 17 | export * from './server/server-config.model' |
diff --git a/shared/models/plugins/index.ts b/shared/models/plugins/index.ts new file mode 100644 index 000000000..209fca791 --- /dev/null +++ b/shared/models/plugins/index.ts | |||
@@ -0,0 +1,24 @@ | |||
1 | export * from './client-hook.model' | ||
2 | export * from './hook-type.enum' | ||
3 | export * from './install-plugin.model' | ||
4 | export * from './manage-plugin.model' | ||
5 | export * from './peertube-plugin-index-list.model' | ||
6 | export * from './peertube-plugin-index.model' | ||
7 | export * from './peertube-plugin-latest-version.model' | ||
8 | export * from './peertube-plugin.model' | ||
9 | export * from './plugin-client-scope.type' | ||
10 | export * from './plugin-package-json.model' | ||
11 | export * from './plugin-playlist-privacy-manager.model' | ||
12 | export * from './plugin-settings-manager.model' | ||
13 | export * from './plugin-storage-manager.model' | ||
14 | export * from './plugin-translation.model' | ||
15 | export * from './plugin-video-category-manager.model' | ||
16 | export * from './plugin-video-language-manager.model' | ||
17 | export * from './plugin-video-licence-manager.model' | ||
18 | export * from './plugin-video-privacy-manager.model' | ||
19 | export * from './plugin.type' | ||
20 | export * from './public-server.setting' | ||
21 | export * from './register-client-hook.model' | ||
22 | export * from './register-server-hook.model' | ||
23 | export * from './register-server-setting.model' | ||
24 | export * from './server-hook.model' | ||
diff --git a/shared/models/plugins/plugin-playlist-privacy-manager.model.ts b/shared/models/plugins/plugin-playlist-privacy-manager.model.ts index f9630c77f..d1823ef4e 100644 --- a/shared/models/plugins/plugin-playlist-privacy-manager.model.ts +++ b/shared/models/plugins/plugin-playlist-privacy-manager.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { VideoPlaylistPrivacy } from '@shared/models' | 1 | import { VideoPlaylistPrivacy } from '../videos/playlist/video-playlist-privacy.model' |
2 | 2 | ||
3 | export interface PluginPlaylistPrivacyManager { | 3 | export interface PluginPlaylistPrivacyManager { |
4 | // PUBLIC = 1, | 4 | // PUBLIC = 1, |
diff --git a/shared/models/plugins/plugin-video-privacy-manager.model.ts b/shared/models/plugins/plugin-video-privacy-manager.model.ts index d602ba297..c0e8117b5 100644 --- a/shared/models/plugins/plugin-video-privacy-manager.model.ts +++ b/shared/models/plugins/plugin-video-privacy-manager.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { VideoPrivacy } from '@shared/models' | 1 | import { VideoPrivacy } from '@shared/models/videos/video-privacy.enum' |
2 | 2 | ||
3 | export interface PluginVideoPrivacyManager { | 3 | export interface PluginVideoPrivacyManager { |
4 | // PUBLIC = 1 | 4 | // PUBLIC = 1 |
diff --git a/shared/models/search/index.ts b/shared/models/search/index.ts index 28dd95443..e2d0ab620 100644 --- a/shared/models/search/index.ts +++ b/shared/models/search/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './nsfw-query.model' | 1 | export * from './nsfw-query.model' |
2 | export * from './search-target-query.model' | ||
2 | export * from './videos-search-query.model' | 3 | export * from './videos-search-query.model' |
3 | export * from './video-channels-search-query.model' | 4 | export * from './video-channels-search-query.model' |
diff --git a/shared/models/server/index.ts b/shared/models/server/index.ts index 2bb443d46..b079bc9a0 100644 --- a/shared/models/server/index.ts +++ b/shared/models/server/index.ts | |||
@@ -5,5 +5,6 @@ export * from './custom-config.model' | |||
5 | export * from './debug.model' | 5 | export * from './debug.model' |
6 | export * from './emailer.model' | 6 | export * from './emailer.model' |
7 | export * from './job.model' | 7 | export * from './job.model' |
8 | export * from './log-level.type' | ||
8 | export * from './server-config.model' | 9 | export * from './server-config.model' |
9 | export * from './server-stats.model' | 10 | export * from './server-stats.model' |
diff --git a/shared/models/users/index.ts b/shared/models/users/index.ts index cd07cf320..a9d578054 100644 --- a/shared/models/users/index.ts +++ b/shared/models/users/index.ts | |||
@@ -1,12 +1,14 @@ | |||
1 | export * from './user.model' | ||
2 | export * from './user-create.model' | 1 | export * from './user-create.model' |
2 | export * from './user-flag.model' | ||
3 | export * from './user-login.model' | 3 | export * from './user-login.model' |
4 | export * from './user-notification.model' | ||
5 | export * from './user-notification-setting.model' | 4 | export * from './user-notification-setting.model' |
5 | export * from './user-notification.model' | ||
6 | export * from './user-refresh-token.model' | 6 | export * from './user-refresh-token.model' |
7 | export * from './user-update.model' | 7 | export * from './user-register.model' |
8 | export * from './user-update-me.model' | ||
9 | export * from './user-right.enum' | 8 | export * from './user-right.enum' |
10 | export * from './user-role' | 9 | export * from './user-role' |
10 | export * from './user-update-me.model' | ||
11 | export * from './user-update.model' | ||
11 | export * from './user-video-quota.model' | 12 | export * from './user-video-quota.model' |
12 | export * from './user-watching-video.model' | 13 | export * from './user-watching-video.model' |
14 | export * from './user.model' | ||
diff --git a/shared/models/videos/abuse/index.ts b/shared/models/videos/abuse/index.ts new file mode 100644 index 000000000..bdeef1dad --- /dev/null +++ b/shared/models/videos/abuse/index.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export * from './video-abuse-create.model' | ||
2 | export * from './video-abuse-state.model' | ||
3 | export * from './video-abuse-update.model' | ||
4 | export * from './video-abuse-video-is.type' | ||
5 | export * from './video-abuse.model' | ||
diff --git a/shared/models/videos/blacklist/index.ts b/shared/models/videos/blacklist/index.ts new file mode 100644 index 000000000..66082be34 --- /dev/null +++ b/shared/models/videos/blacklist/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './video-blacklist.model' | ||
2 | export * from './video-blacklist-create.model' | ||
3 | export * from './video-blacklist-update.model' | ||
diff --git a/shared/models/videos/caption/index.ts b/shared/models/videos/caption/index.ts new file mode 100644 index 000000000..2a5ff512d --- /dev/null +++ b/shared/models/videos/caption/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './video-caption.model' | ||
2 | export * from './video-caption-update.model' | ||
diff --git a/shared/models/videos/channel/index.ts b/shared/models/videos/channel/index.ts new file mode 100644 index 000000000..9dbaa42da --- /dev/null +++ b/shared/models/videos/channel/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './video-channel-create.model' | ||
2 | export * from './video-channel-update.model' | ||
3 | export * from './video-channel.model' | ||
diff --git a/shared/models/videos/import/index.ts b/shared/models/videos/import/index.ts new file mode 100644 index 000000000..8884ee8f2 --- /dev/null +++ b/shared/models/videos/import/index.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export * from './video-import-create.model' | ||
2 | export * from './video-import-state.enum' | ||
3 | export * from './video-import.model' | ||
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts index 58bd1ebd7..e1d96b40a 100644 --- a/shared/models/videos/index.ts +++ b/shared/models/videos/index.ts | |||
@@ -1,41 +1,38 @@ | |||
1 | export * from './rate/user-video-rate-update.model' | 1 | export * from './abuse' |
2 | export * from './rate/user-video-rate.model' | 2 | export * from './blacklist' |
3 | export * from './rate/account-video-rate.model' | 3 | export * from './caption' |
4 | export * from './rate/user-video-rate.type' | 4 | export * from './channel' |
5 | export * from './abuse/video-abuse-state.model' | 5 | export * from './import' |
6 | export * from './abuse/video-abuse-create.model' | 6 | export * from './playlist' |
7 | export * from './abuse/video-abuse-reason.model' | 7 | export * from './rate' |
8 | export * from './abuse/video-abuse.model' | 8 | |
9 | export * from './abuse/video-abuse-update.model' | 9 | export * from './nsfw-policy.type' |
10 | export * from './blacklist/video-blacklist.model' | 10 | |
11 | export * from './blacklist/video-blacklist-create.model' | 11 | export * from './thumbnail.type' |
12 | export * from './blacklist/video-blacklist-update.model' | 12 | |
13 | export * from './channel/video-channel-create.model' | 13 | export * from './video-change-ownership-accept.model' |
14 | export * from './channel/video-channel-update.model' | ||
15 | export * from './channel/video-channel.model' | ||
16 | export * from './playlist/video-playlist-create.model' | ||
17 | export * from './playlist/video-playlist-element-create.model' | ||
18 | export * from './playlist/video-playlist-element-update.model' | ||
19 | export * from './playlist/video-playlist-privacy.model' | ||
20 | export * from './playlist/video-playlist-type.model' | ||
21 | export * from './playlist/video-playlist-update.model' | ||
22 | export * from './playlist/video-playlist.model' | ||
23 | export * from './playlist/video-playlist-element.model' | ||
24 | export * from './video-change-ownership.model' | ||
25 | export * from './video-change-ownership-create.model' | 14 | export * from './video-change-ownership-create.model' |
15 | export * from './video-change-ownership.model' | ||
16 | |||
17 | export * from './video-comment.model' | ||
18 | export * from './video-constant.model' | ||
26 | export * from './video-create.model' | 19 | export * from './video-create.model' |
20 | export * from './video-file-metadata' | ||
27 | export * from './video-file.model' | 21 | export * from './video-file.model' |
22 | |||
28 | export * from './video-privacy.enum' | 23 | export * from './video-privacy.enum' |
24 | export * from './video-query.type' | ||
29 | export * from './video-rate.type' | 25 | export * from './video-rate.type' |
30 | export * from './video-resolution.enum' | 26 | export * from './video-resolution.enum' |
31 | export * from './video-update.model' | 27 | |
32 | export * from './video.model' | 28 | export * from './video-schedule-update.model' |
33 | export * from './video-query.type' | 29 | export * from './video-sort-field.type' |
34 | export * from './video-state.enum' | 30 | export * from './video-state.enum' |
31 | |||
32 | export * from './video-streaming-playlist.model' | ||
33 | export * from './video-streaming-playlist.type' | ||
34 | |||
35 | export * from './video-transcoding-fps.model' | 35 | export * from './video-transcoding-fps.model' |
36 | export * from './caption/video-caption.model' | 36 | |
37 | export * from './caption/video-caption-update.model' | 37 | export * from './video-update.model' |
38 | export * from './import/video-import-create.model' | 38 | export * from './video.model' |
39 | export * from './import/video-import-state.enum' | ||
40 | export * from './import/video-import.model' | ||
41 | export * from './video-constant.model' | ||
diff --git a/shared/models/videos/playlist/index.ts b/shared/models/videos/playlist/index.ts new file mode 100644 index 000000000..99f7e9bab --- /dev/null +++ b/shared/models/videos/playlist/index.ts | |||
@@ -0,0 +1,10 @@ | |||
1 | export * from './video-exist-in-playlist.model' | ||
2 | export * from './video-playlist-create.model' | ||
3 | export * from './video-playlist-element-create.model' | ||
4 | export * from './video-playlist-element-update.model' | ||
5 | export * from './video-playlist-element.model' | ||
6 | export * from './video-playlist-privacy.model' | ||
7 | export * from './video-playlist-reorder.model' | ||
8 | export * from './video-playlist-type.model' | ||
9 | export * from './video-playlist-update.model' | ||
10 | export * from './video-playlist.model' | ||
diff --git a/shared/models/videos/rate/index.ts b/shared/models/videos/rate/index.ts new file mode 100644 index 000000000..06aa691bd --- /dev/null +++ b/shared/models/videos/rate/index.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | |||
2 | export * from './user-video-rate-update.model' | ||
3 | export * from './user-video-rate.model' | ||
4 | export * from './account-video-rate.model' | ||
5 | export * from './user-video-rate.type' | ||
diff --git a/shared/models/videos/video-file-metadata.ts b/shared/models/videos/video-file-metadata.ts index 15683cacf..010bf7cf5 100644 --- a/shared/models/videos/video-file-metadata.ts +++ b/shared/models/videos/video-file-metadata.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { FfprobeData } from "fluent-ffmpeg" | 1 | import { FfprobeData } from 'fluent-ffmpeg' |
2 | import { DeepOmit } from "@server/models/utils" | 2 | import { DeepOmit } from '../../core-utils' |
3 | 3 | ||
4 | export type VideoFileMetadataModel = DeepOmit<FfprobeData, 'filename'> | 4 | export type VideoFileMetadataModel = DeepOmit<FfprobeData, 'filename'> |
5 | 5 | ||
diff --git a/shared/models/videos/video-sort-field.type.ts b/shared/models/videos/video-sort-field.type.ts new file mode 100644 index 000000000..f2e70f5fa --- /dev/null +++ b/shared/models/videos/video-sort-field.type.ts | |||
@@ -0,0 +1,8 @@ | |||
1 | export type VideoSortField = | ||
2 | 'name' | '-name' | | ||
3 | 'duration' | '-duration' | | ||
4 | 'publishedAt' | '-publishedAt' | | ||
5 | 'createdAt' | '-createdAt' | | ||
6 | 'views' | '-views' | | ||
7 | 'likes' | '-likes' | | ||
8 | 'trending' | '-trending' | ||