From 1942f11d5ee6926ad93dc1b79fae18325ba5de18 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Jun 2020 14:49:20 +0200 Subject: [PATCH] Lazy load all routes --- .../video-abuse-details.component.ts | 1 + .../{login => +login}/login-routing.module.ts | 2 +- .../{login => +login}/login.component.html | 0 .../{login => +login}/login.component.scss | 0 .../app/{login => +login}/login.component.ts | 0 .../src/app/{login => +login}/login.module.ts | 0 .../reset-password-routing.module.ts | 2 +- .../reset-password.component.html | 0 .../reset-password.component.scss | 0 .../reset-password.component.ts | 0 .../reset-password.module.ts | 0 .../channel-lazy-load.resolver.ts | 2 +- .../search-filters.component.html | 0 .../search-filters.component.scss | 0 .../search-filters.component.ts | 2 +- .../search-routing.module.ts | 10 +++++----- .../{search => +search}/search.component.html | 0 .../{search => +search}/search.component.scss | 0 .../{search => +search}/search.component.ts | 3 +-- .../app/{search => +search}/search.module.ts | 9 +++++---- .../video-lazy-load.resolver.ts | 2 +- .../shared/i18n-primeng-calendar.service.ts | 0 .../video-caption-add-modal.component.html | 0 .../video-caption-add-modal.component.scss | 0 .../video-caption-add-modal.component.ts | 0 .../shared/video-edit.component.html | 0 .../shared/video-edit.component.scss | 0 .../shared/video-edit.component.ts | 0 .../+video-edit/shared/video-edit.module.ts | 0 .../drag-drop.directive.ts | 0 .../video-import-torrent.component.html | 0 .../video-import-torrent.component.scss | 0 .../video-import-torrent.component.ts | 2 +- .../video-import-url.component.html | 0 .../video-import-url.component.ts | 2 +- .../video-add-components/video-send.scss | 0 .../video-add-components/video-send.ts | 0 .../video-upload.component.html | 0 .../video-upload.component.scss | 0 .../video-upload.component.ts | 2 +- .../+video-edit/video-add-routing.module.ts | 0 .../+video-edit/video-add.component.html | 0 .../+video-edit/video-add.component.scss | 0 .../+video-edit/video-add.component.ts | 0 .../+video-edit/video-add.module.ts | 0 .../video-update-routing.module.ts | 0 .../+video-edit/video-update.component.html | 0 .../+video-edit/video-update.component.ts | 0 .../+video-edit/video-update.module.ts | 2 +- .../+video-edit/video-update.resolver.ts | 0 .../comment/video-comment-add.component.html | 0 .../comment/video-comment-add.component.scss | 0 .../comment/video-comment-add.component.ts | 0 .../video-comment-thread-tree.model.ts | 0 .../comment/video-comment.component.html | 0 .../comment/video-comment.component.scss | 0 .../comment/video-comment.component.ts | 0 .../comment/video-comment.model.ts | 0 .../comment/video-comment.service.ts | 0 .../comment/video-comments.component.html | 0 .../comment/video-comments.component.scss | 0 .../comment/video-comments.component.ts | 0 .../modal/video-share.component.html | 0 .../modal/video-share.component.scss | 0 .../modal/video-share.component.ts | 0 .../modal/video-support.component.html | 0 .../modal/video-support.component.scss | 0 .../modal/video-support.component.ts | 0 .../recent-videos-recommendation.service.ts | 3 +-- .../recommendation-info.model.ts | 0 .../recommendations/recommendations.module.ts | 2 ++ .../recommendations.service.ts | 0 .../recommended-videos.component.html | 0 .../recommended-videos.component.scss | 0 .../recommended-videos.component.ts | 0 .../recommended-videos.store.ts | 0 .../timestamp-route-transformer.directive.ts | 0 .../video-duration-formatter.pipe.ts | 0 .../video-watch-playlist.component.html | 0 .../video-watch-playlist.component.scss | 0 .../video-watch-playlist.component.ts | 0 .../video-watch-routing.module.ts | 0 .../+video-watch/video-watch.component.html | 0 .../+video-watch/video-watch.component.scss | 0 .../+video-watch/video-watch.component.ts | 0 .../+video-watch/video-watch.module.ts | 2 +- client/src/app/{videos => +videos}/index.ts | 0 .../{videos => +videos}/video-list/index.ts | 0 .../video-list/overview/index.ts | 0 .../video-list/overview/overview.service.ts | 0 .../overview/video-overview.component.html | 0 .../overview/video-overview.component.scss | 0 .../overview/video-overview.component.ts | 0 .../overview/videos-overview.model.ts | 0 .../video-list/video-local.component.ts | 0 .../video-list/video-most-liked.component.ts | 0 .../video-recently-added.component.ts | 0 .../video-list/video-trending.component.ts | 0 .../video-user-subscriptions.component.ts | 0 .../videos-routing.module.ts | 16 +++++++-------- .../{videos => +videos}/videos.component.ts | 0 .../app/{videos => +videos}/videos.module.ts | 5 ++++- client/src/app/app-routing.module.ts | 19 +++++++++++++++++- client/src/app/app.module.ts | 12 ++--------- client/src/app/empty.component.ts | 10 ++++++++++ .../app/{search => header}/highlight.pipe.ts | 0 client/src/app/login/index.ts | 3 --- client/src/app/reset-password/index.ts | 3 --- client/src/app/search/index.ts | 3 --- .../shared-search}/advanced-search.model.ts | 0 client/src/app/shared/shared-search/index.ts | 3 +++ .../shared-search}/search.service.ts | 7 +++---- .../shared-search/shared-search.module.ts | 20 +++++++++++++++++++ shared/models/videos/abuse/index.ts | 1 + 114 files changed, 94 insertions(+), 56 deletions(-) rename client/src/app/{login => +login}/login-routing.module.ts (97%) rename client/src/app/{login => +login}/login.component.html (100%) rename client/src/app/{login => +login}/login.component.scss (100%) rename client/src/app/{login => +login}/login.component.ts (100%) rename client/src/app/{login => +login}/login.module.ts (100%) rename client/src/app/{reset-password => +reset-password}/reset-password-routing.module.ts (95%) rename client/src/app/{reset-password => +reset-password}/reset-password.component.html (100%) rename client/src/app/{reset-password => +reset-password}/reset-password.component.scss (100%) rename client/src/app/{reset-password => +reset-password}/reset-password.component.ts (100%) rename client/src/app/{reset-password => +reset-password}/reset-password.module.ts (100%) rename client/src/app/{search => +search}/channel-lazy-load.resolver.ts (95%) rename client/src/app/{search => +search}/search-filters.component.html (100%) rename client/src/app/{search => +search}/search-filters.component.scss (100%) rename client/src/app/{search => +search}/search-filters.component.ts (99%) rename client/src/app/{search => +search}/search-routing.module.ts (84%) rename client/src/app/{search => +search}/search.component.html (100%) rename client/src/app/{search => +search}/search.component.scss (100%) rename client/src/app/{search => +search}/search.component.ts (98%) rename client/src/app/{search => +search}/search.module.ts (85%) rename client/src/app/{search => +search}/video-lazy-load.resolver.ts (95%) rename client/src/app/{videos => +videos}/+video-edit/shared/i18n-primeng-calendar.service.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/shared/video-caption-add-modal.component.html (100%) rename client/src/app/{videos => +videos}/+video-edit/shared/video-caption-add-modal.component.scss (100%) rename client/src/app/{videos => +videos}/+video-edit/shared/video-caption-add-modal.component.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/shared/video-edit.component.html (100%) rename client/src/app/{videos => +videos}/+video-edit/shared/video-edit.component.scss (100%) rename client/src/app/{videos => +videos}/+video-edit/shared/video-edit.component.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/shared/video-edit.module.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/drag-drop.directive.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-import-torrent.component.html (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-import-torrent.component.scss (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-import-torrent.component.ts (97%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-import-url.component.html (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-import-url.component.ts (98%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-send.scss (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-send.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-upload.component.html (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-upload.component.scss (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add-components/video-upload.component.ts (99%) rename client/src/app/{videos => +videos}/+video-edit/video-add-routing.module.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add.component.html (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add.component.scss (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add.component.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/video-add.module.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/video-update-routing.module.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/video-update.component.html (100%) rename client/src/app/{videos => +videos}/+video-edit/video-update.component.ts (100%) rename client/src/app/{videos => +videos}/+video-edit/video-update.module.ts (86%) rename client/src/app/{videos => +videos}/+video-edit/video-update.resolver.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment-add.component.html (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment-add.component.scss (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment-add.component.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment-thread-tree.model.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment.component.html (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment.component.scss (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment.component.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment.model.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comment.service.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comments.component.html (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comments.component.scss (100%) rename client/src/app/{videos => +videos}/+video-watch/comment/video-comments.component.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/modal/video-share.component.html (100%) rename client/src/app/{videos => +videos}/+video-watch/modal/video-share.component.scss (100%) rename client/src/app/{videos => +videos}/+video-watch/modal/video-share.component.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/modal/video-support.component.html (100%) rename client/src/app/{videos => +videos}/+video-watch/modal/video-support.component.scss (100%) rename client/src/app/{videos => +videos}/+video-watch/modal/video-support.component.ts (100%) rename client/src/app/{videos => +videos/+video-watch}/recommendations/recent-videos-recommendation.service.ts (95%) rename client/src/app/{videos => +videos/+video-watch}/recommendations/recommendation-info.model.ts (100%) rename client/src/app/{videos => +videos/+video-watch}/recommendations/recommendations.module.ts (91%) rename client/src/app/{videos => +videos/+video-watch}/recommendations/recommendations.service.ts (100%) rename client/src/app/{videos => +videos/+video-watch}/recommendations/recommended-videos.component.html (100%) rename client/src/app/{videos => +videos/+video-watch}/recommendations/recommended-videos.component.scss (100%) rename client/src/app/{videos => +videos/+video-watch}/recommendations/recommended-videos.component.ts (100%) rename client/src/app/{videos => +videos/+video-watch}/recommendations/recommended-videos.store.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/timestamp-route-transformer.directive.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/video-duration-formatter.pipe.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/video-watch-playlist.component.html (100%) rename client/src/app/{videos => +videos}/+video-watch/video-watch-playlist.component.scss (100%) rename client/src/app/{videos => +videos}/+video-watch/video-watch-playlist.component.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/video-watch-routing.module.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/video-watch.component.html (100%) rename client/src/app/{videos => +videos}/+video-watch/video-watch.component.scss (100%) rename client/src/app/{videos => +videos}/+video-watch/video-watch.component.ts (100%) rename client/src/app/{videos => +videos}/+video-watch/video-watch.module.ts (96%) rename client/src/app/{videos => +videos}/index.ts (100%) rename client/src/app/{videos => +videos}/video-list/index.ts (100%) rename client/src/app/{videos => +videos}/video-list/overview/index.ts (100%) rename client/src/app/{videos => +videos}/video-list/overview/overview.service.ts (100%) rename client/src/app/{videos => +videos}/video-list/overview/video-overview.component.html (100%) rename client/src/app/{videos => +videos}/video-list/overview/video-overview.component.scss (100%) rename client/src/app/{videos => +videos}/video-list/overview/video-overview.component.ts (100%) rename client/src/app/{videos => +videos}/video-list/overview/videos-overview.model.ts (100%) rename client/src/app/{videos => +videos}/video-list/video-local.component.ts (100%) rename client/src/app/{videos => +videos}/video-list/video-most-liked.component.ts (100%) rename client/src/app/{videos => +videos}/video-list/video-recently-added.component.ts (100%) rename client/src/app/{videos => +videos}/video-list/video-trending.component.ts (100%) rename client/src/app/{videos => +videos}/video-list/video-user-subscriptions.component.ts (100%) rename client/src/app/{videos => +videos}/videos-routing.module.ts (86%) rename client/src/app/{videos => +videos}/videos.component.ts (100%) rename client/src/app/{videos => +videos}/videos.module.ts (94%) create mode 100644 client/src/app/empty.component.ts rename client/src/app/{search => header}/highlight.pipe.ts (100%) delete mode 100644 client/src/app/login/index.ts delete mode 100644 client/src/app/reset-password/index.ts delete mode 100644 client/src/app/search/index.ts rename client/src/app/{search => shared/shared-search}/advanced-search.model.ts (100%) create mode 100644 client/src/app/shared/shared-search/index.ts rename client/src/app/{search => shared/shared-search}/search.service.ts (90%) create mode 100644 client/src/app/shared/shared-search/shared-search.module.ts 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 9aa70288d..5db2887fa 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 @@ -3,6 +3,7 @@ import { Actor } from '@app/shared/shared-main' import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model' import { ProcessedVideoAbuse } from './video-abuse-list.component' +import { durationToString } from '@app/helpers' @Component({ selector: 'my-video-abuse-details', diff --git a/client/src/app/login/login-routing.module.ts b/client/src/app/+login/login-routing.module.ts similarity index 97% rename from client/src/app/login/login-routing.module.ts rename to client/src/app/+login/login-routing.module.ts index 22f59b4d9..aad55eac8 100644 --- a/client/src/app/login/login-routing.module.ts +++ b/client/src/app/+login/login-routing.module.ts @@ -6,7 +6,7 @@ import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.s const loginRoutes: Routes = [ { - path: 'login', + path: '', component: LoginComponent, canActivate: [ MetaGuard ], data: { diff --git a/client/src/app/login/login.component.html b/client/src/app/+login/login.component.html similarity index 100% rename from client/src/app/login/login.component.html rename to client/src/app/+login/login.component.html diff --git a/client/src/app/login/login.component.scss b/client/src/app/+login/login.component.scss similarity index 100% rename from client/src/app/login/login.component.scss rename to client/src/app/+login/login.component.scss diff --git a/client/src/app/login/login.component.ts b/client/src/app/+login/login.component.ts similarity index 100% rename from client/src/app/login/login.component.ts rename to client/src/app/+login/login.component.ts diff --git a/client/src/app/login/login.module.ts b/client/src/app/+login/login.module.ts similarity index 100% rename from client/src/app/login/login.module.ts rename to client/src/app/+login/login.module.ts diff --git a/client/src/app/reset-password/reset-password-routing.module.ts b/client/src/app/+reset-password/reset-password-routing.module.ts similarity index 95% rename from client/src/app/reset-password/reset-password-routing.module.ts rename to client/src/app/+reset-password/reset-password-routing.module.ts index d443b51d6..31bc08709 100644 --- a/client/src/app/reset-password/reset-password-routing.module.ts +++ b/client/src/app/+reset-password/reset-password-routing.module.ts @@ -5,7 +5,7 @@ import { ResetPasswordComponent } from './reset-password.component' const resetPasswordRoutes: Routes = [ { - path: 'reset-password', + path: '', component: ResetPasswordComponent, canActivate: [ MetaGuard ], data: { diff --git a/client/src/app/reset-password/reset-password.component.html b/client/src/app/+reset-password/reset-password.component.html similarity index 100% rename from client/src/app/reset-password/reset-password.component.html rename to client/src/app/+reset-password/reset-password.component.html diff --git a/client/src/app/reset-password/reset-password.component.scss b/client/src/app/+reset-password/reset-password.component.scss similarity index 100% rename from client/src/app/reset-password/reset-password.component.scss rename to client/src/app/+reset-password/reset-password.component.scss diff --git a/client/src/app/reset-password/reset-password.component.ts b/client/src/app/+reset-password/reset-password.component.ts similarity index 100% rename from client/src/app/reset-password/reset-password.component.ts rename to client/src/app/+reset-password/reset-password.component.ts diff --git a/client/src/app/reset-password/reset-password.module.ts b/client/src/app/+reset-password/reset-password.module.ts similarity index 100% rename from client/src/app/reset-password/reset-password.module.ts rename to client/src/app/+reset-password/reset-password.module.ts diff --git a/client/src/app/search/channel-lazy-load.resolver.ts b/client/src/app/+search/channel-lazy-load.resolver.ts similarity index 95% rename from client/src/app/search/channel-lazy-load.resolver.ts rename to client/src/app/+search/channel-lazy-load.resolver.ts index 5b6961e98..17a212829 100644 --- a/client/src/app/search/channel-lazy-load.resolver.ts +++ b/client/src/app/+search/channel-lazy-load.resolver.ts @@ -1,7 +1,7 @@ import { map } from 'rxjs/operators' import { Injectable } from '@angular/core' import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router' -import { SearchService } from './search.service' +import { SearchService } from '@app/shared/shared-search' @Injectable() export class ChannelLazyLoadResolver implements Resolve { diff --git a/client/src/app/search/search-filters.component.html b/client/src/app/+search/search-filters.component.html similarity index 100% rename from client/src/app/search/search-filters.component.html rename to client/src/app/+search/search-filters.component.html diff --git a/client/src/app/search/search-filters.component.scss b/client/src/app/+search/search-filters.component.scss similarity index 100% rename from client/src/app/search/search-filters.component.scss rename to client/src/app/+search/search-filters.component.scss diff --git a/client/src/app/search/search-filters.component.ts b/client/src/app/+search/search-filters.component.ts similarity index 99% rename from client/src/app/search/search-filters.component.ts rename to client/src/app/+search/search-filters.component.ts index 14a5d0484..fc1db3258 100644 --- a/client/src/app/search/search-filters.component.ts +++ b/client/src/app/+search/search-filters.component.ts @@ -1,8 +1,8 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { ValidatorFn } from '@angular/forms' import { ServerService } from '@app/core' -import { AdvancedSearch } from '@app/search/advanced-search.model' import { VideoValidatorsService } from '@app/shared/shared-forms' +import { AdvancedSearch } from '@app/shared/shared-search' import { I18n } from '@ngx-translate/i18n-polyfill' import { ServerConfig, VideoConstant } from '@shared/models' diff --git a/client/src/app/search/search-routing.module.ts b/client/src/app/+search/search-routing.module.ts similarity index 84% rename from client/src/app/search/search-routing.module.ts rename to client/src/app/+search/search-routing.module.ts index 9da900e9a..14a0d0a13 100644 --- a/client/src/app/search/search-routing.module.ts +++ b/client/src/app/+search/search-routing.module.ts @@ -1,13 +1,13 @@ import { NgModule } from '@angular/core' import { RouterModule, Routes } from '@angular/router' -import { SearchComponent } from '@app/search/search.component' import { MetaGuard } from '@ngx-meta/core' -import { VideoLazyLoadResolver } from './video-lazy-load.resolver' import { ChannelLazyLoadResolver } from './channel-lazy-load.resolver' +import { SearchComponent } from './search.component' +import { VideoLazyLoadResolver } from './video-lazy-load.resolver' const searchRoutes: Routes = [ { - path: 'search', + path: '', component: SearchComponent, canActivate: [ MetaGuard ], data: { @@ -17,7 +17,7 @@ const searchRoutes: Routes = [ } }, { - path: 'search/lazy-load-video', + path: 'lazy-load-video', component: SearchComponent, canActivate: [ MetaGuard ], resolve: { @@ -25,7 +25,7 @@ const searchRoutes: Routes = [ } }, { - path: 'search/lazy-load-channel', + path: 'lazy-load-channel', component: SearchComponent, canActivate: [ MetaGuard ], resolve: { diff --git a/client/src/app/search/search.component.html b/client/src/app/+search/search.component.html similarity index 100% rename from client/src/app/search/search.component.html rename to client/src/app/+search/search.component.html diff --git a/client/src/app/search/search.component.scss b/client/src/app/+search/search.component.scss similarity index 100% rename from client/src/app/search/search.component.scss rename to client/src/app/+search/search.component.scss diff --git a/client/src/app/search/search.component.ts b/client/src/app/+search/search.component.ts similarity index 98% rename from client/src/app/search/search.component.ts rename to client/src/app/+search/search.component.ts index 83b06e0ce..1ed54937b 100644 --- a/client/src/app/search/search.component.ts +++ b/client/src/app/+search/search.component.ts @@ -4,12 +4,11 @@ import { ActivatedRoute, Router } from '@angular/router' import { AuthService, ComponentPagination, HooksService, Notifier, ServerService, User, UserService } from '@app/core' import { immutableAssign } from '@app/helpers' import { Video, VideoChannel } from '@app/shared/shared-main' +import { AdvancedSearch, SearchService } from '@app/shared/shared-search' import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature' import { MetaService } from '@ngx-meta/core' import { I18n } from '@ngx-translate/i18n-polyfill' import { SearchTargetType, ServerConfig } from '@shared/models' -import { AdvancedSearch } from './advanced-search.model' -import { SearchService } from './search.service' @Component({ selector: 'my-search', diff --git a/client/src/app/search/search.module.ts b/client/src/app/+search/search.module.ts similarity index 85% rename from client/src/app/search/search.module.ts rename to client/src/app/+search/search.module.ts index 65c954de8..ee4f07ad1 100644 --- a/client/src/app/search/search.module.ts +++ b/client/src/app/+search/search.module.ts @@ -2,14 +2,14 @@ import { TagInputModule } from 'ngx-chips' import { NgModule } from '@angular/core' import { SharedFormModule } from '@app/shared/shared-forms' import { SharedMainModule } from '@app/shared/shared-main' +import { SharedSearchModule } from '@app/shared/shared-search' import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' +import { SearchService } from '../shared/shared-search/search.service' import { ChannelLazyLoadResolver } from './channel-lazy-load.resolver' -import { HighlightPipe } from './highlight.pipe' import { SearchFiltersComponent } from './search-filters.component' import { SearchRoutingModule } from './search-routing.module' import { SearchComponent } from './search.component' -import { SearchService } from './search.service' import { VideoLazyLoadResolver } from './video-lazy-load.resolver' @NgModule({ @@ -17,7 +17,9 @@ import { VideoLazyLoadResolver } from './video-lazy-load.resolver' TagInputModule, SearchRoutingModule, + SharedMainModule, + SharedSearchModule, SharedFormModule, SharedUserSubscriptionModule, SharedVideoMiniatureModule @@ -36,8 +38,7 @@ import { VideoLazyLoadResolver } from './video-lazy-load.resolver' providers: [ SearchService, VideoLazyLoadResolver, - ChannelLazyLoadResolver, - HighlightPipe + ChannelLazyLoadResolver ] }) export class SearchModule { } diff --git a/client/src/app/search/video-lazy-load.resolver.ts b/client/src/app/+search/video-lazy-load.resolver.ts similarity index 95% rename from client/src/app/search/video-lazy-load.resolver.ts rename to client/src/app/+search/video-lazy-load.resolver.ts index 8d846d367..e8b2b8c74 100644 --- a/client/src/app/search/video-lazy-load.resolver.ts +++ b/client/src/app/+search/video-lazy-load.resolver.ts @@ -1,7 +1,7 @@ import { map } from 'rxjs/operators' import { Injectable } from '@angular/core' import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router' -import { SearchService } from './search.service' +import { SearchService } from '@app/shared/shared-search' @Injectable() export class VideoLazyLoadResolver implements Resolve { diff --git a/client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts b/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts similarity index 100% rename from client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts rename to 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.html b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.html similarity index 100% rename from client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.html rename to client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.html diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.scss b/client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.scss similarity index 100% rename from client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.scss rename to client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.scss 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 similarity index 100% rename from client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts rename to client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html similarity index 100% rename from client/src/app/videos/+video-edit/shared/video-edit.component.html rename to client/src/app/+videos/+video-edit/shared/video-edit.component.html diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.scss b/client/src/app/+videos/+video-edit/shared/video-edit.component.scss similarity index 100% rename from client/src/app/videos/+video-edit/shared/video-edit.component.scss rename to client/src/app/+videos/+video-edit/shared/video-edit.component.scss 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 similarity index 100% rename from client/src/app/videos/+video-edit/shared/video-edit.component.ts rename to client/src/app/+videos/+video-edit/shared/video-edit.component.ts 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 similarity index 100% rename from client/src/app/videos/+video-edit/shared/video-edit.module.ts rename to client/src/app/+videos/+video-edit/shared/video-edit.module.ts diff --git a/client/src/app/videos/+video-edit/video-add-components/drag-drop.directive.ts b/client/src/app/+videos/+video-edit/video-add-components/drag-drop.directive.ts similarity index 100% rename from client/src/app/videos/+video-edit/video-add-components/drag-drop.directive.ts rename to client/src/app/+videos/+video-edit/video-add-components/drag-drop.directive.ts diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html similarity index 100% rename from client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.html rename to client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.scss b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.scss similarity index 100% rename from client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.scss rename to client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.scss 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 similarity index 97% rename from client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts rename to client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts index 5b453a1d9..538a187a8 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 @@ -4,7 +4,7 @@ import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@a import { scrollToTop } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' -import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' +import { VideoSend } from './video-send' import { LoadingBarService } from '@ngx-loading-bar/core' import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoPrivacy, VideoUpdate } from '@shared/models' diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.html similarity index 100% rename from client/src/app/videos/+video-edit/video-add-components/video-import-url.component.html rename to client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.html 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 similarity index 98% rename from client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts rename to client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts index d0bd1f54d..6508eef7e 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 @@ -5,7 +5,7 @@ import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@a import { getAbsoluteAPIUrl, scrollToTop } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' -import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' +import { VideoSend } from './video-send' import { LoadingBarService } from '@ngx-loading-bar/core' import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoPrivacy, VideoUpdate } from '@shared/models' diff --git a/client/src/app/videos/+video-edit/video-add-components/video-send.scss b/client/src/app/+videos/+video-edit/video-add-components/video-send.scss similarity index 100% rename from client/src/app/videos/+video-edit/video-add-components/video-send.scss rename to client/src/app/+videos/+video-edit/video-add-components/video-send.scss 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 similarity index 100% rename from client/src/app/videos/+video-edit/video-add-components/video-send.ts rename to client/src/app/+videos/+video-edit/video-add-components/video-send.ts diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html similarity index 100% rename from client/src/app/videos/+video-edit/video-add-components/video-upload.component.html rename to client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.scss b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.scss similarity index 100% rename from client/src/app/videos/+video-edit/video-add-components/video-upload.component.scss rename to client/src/app/+videos/+video-edit/video-add-components/video-upload.component.scss 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 similarity index 99% rename from client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts rename to client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index eb7ac32ae..e46ce6599 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 @@ -7,10 +7,10 @@ import { AuthService, CanComponentDeactivate, Notifier, ServerService, UserServi import { scrollToTop } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' -import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' import { LoadingBarService } from '@ngx-loading-bar/core' import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoPrivacy } from '@shared/models' +import { VideoSend } from './video-send' @Component({ 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 similarity index 100% rename from client/src/app/videos/+video-edit/video-add-routing.module.ts rename to client/src/app/+videos/+video-edit/video-add-routing.module.ts diff --git a/client/src/app/videos/+video-edit/video-add.component.html b/client/src/app/+videos/+video-edit/video-add.component.html similarity index 100% rename from client/src/app/videos/+video-edit/video-add.component.html rename to client/src/app/+videos/+video-edit/video-add.component.html diff --git a/client/src/app/videos/+video-edit/video-add.component.scss b/client/src/app/+videos/+video-edit/video-add.component.scss similarity index 100% rename from client/src/app/videos/+video-edit/video-add.component.scss rename to client/src/app/+videos/+video-edit/video-add.component.scss diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts similarity index 100% rename from client/src/app/videos/+video-edit/video-add.component.ts rename to client/src/app/+videos/+video-edit/video-add.component.ts diff --git a/client/src/app/videos/+video-edit/video-add.module.ts b/client/src/app/+videos/+video-edit/video-add.module.ts similarity index 100% rename from client/src/app/videos/+video-edit/video-add.module.ts rename to client/src/app/+videos/+video-edit/video-add.module.ts 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 similarity index 100% rename from client/src/app/videos/+video-edit/video-update-routing.module.ts rename to client/src/app/+videos/+video-edit/video-update-routing.module.ts diff --git a/client/src/app/videos/+video-edit/video-update.component.html b/client/src/app/+videos/+video-edit/video-update.component.html similarity index 100% rename from client/src/app/videos/+video-edit/video-update.component.html rename to client/src/app/+videos/+video-edit/video-update.component.html diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts similarity index 100% rename from client/src/app/videos/+video-edit/video-update.component.ts rename to client/src/app/+videos/+video-edit/video-update.component.ts diff --git a/client/src/app/videos/+video-edit/video-update.module.ts b/client/src/app/+videos/+video-edit/video-update.module.ts similarity index 86% rename from client/src/app/videos/+video-edit/video-update.module.ts rename to client/src/app/+videos/+video-edit/video-update.module.ts index 322c69629..99cd8bea1 100644 --- a/client/src/app/videos/+video-edit/video-update.module.ts +++ b/client/src/app/+videos/+video-edit/video-update.module.ts @@ -1,9 +1,9 @@ import { NgModule } from '@angular/core' import { CanDeactivateGuard } from '@app/core' -import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver' import { VideoEditModule } from './shared/video-edit.module' import { VideoUpdateRoutingModule } from './video-update-routing.module' import { VideoUpdateComponent } from './video-update.component' +import { VideoUpdateResolver } from './video-update.resolver' @NgModule({ imports: [ diff --git a/client/src/app/videos/+video-edit/video-update.resolver.ts b/client/src/app/+videos/+video-edit/video-update.resolver.ts similarity index 100% rename from client/src/app/videos/+video-edit/video-update.resolver.ts rename to client/src/app/+videos/+video-edit/video-update.resolver.ts diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.html b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.html similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment-add.component.html rename to client/src/app/+videos/+video-watch/comment/video-comment-add.component.html diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.scss b/client/src/app/+videos/+video-watch/comment/video-comment-add.component.scss similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment-add.component.scss rename to client/src/app/+videos/+video-watch/comment/video-comment-add.component.scss 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 similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment-add.component.ts rename to client/src/app/+videos/+video-watch/comment/video-comment-add.component.ts 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 similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts rename to client/src/app/+videos/+video-watch/comment/video-comment-thread-tree.model.ts diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.html b/client/src/app/+videos/+video-watch/comment/video-comment.component.html similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment.component.html rename to client/src/app/+videos/+video-watch/comment/video-comment.component.html diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.scss b/client/src/app/+videos/+video-watch/comment/video-comment.component.scss similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment.component.scss rename to client/src/app/+videos/+video-watch/comment/video-comment.component.scss 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 similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment.component.ts rename to client/src/app/+videos/+video-watch/comment/video-comment.component.ts 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 similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment.model.ts rename to client/src/app/+videos/+video-watch/comment/video-comment.model.ts 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 similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comment.service.ts rename to client/src/app/+videos/+video-watch/comment/video-comment.service.ts diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.html b/client/src/app/+videos/+video-watch/comment/video-comments.component.html similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comments.component.html rename to client/src/app/+videos/+video-watch/comment/video-comments.component.html diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.scss b/client/src/app/+videos/+video-watch/comment/video-comments.component.scss similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comments.component.scss rename to client/src/app/+videos/+video-watch/comment/video-comments.component.scss 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 similarity index 100% rename from client/src/app/videos/+video-watch/comment/video-comments.component.ts rename to client/src/app/+videos/+video-watch/comment/video-comments.component.ts diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.html b/client/src/app/+videos/+video-watch/modal/video-share.component.html similarity index 100% rename from client/src/app/videos/+video-watch/modal/video-share.component.html rename to client/src/app/+videos/+video-watch/modal/video-share.component.html diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.scss b/client/src/app/+videos/+video-watch/modal/video-share.component.scss similarity index 100% rename from client/src/app/videos/+video-watch/modal/video-share.component.scss rename to client/src/app/+videos/+video-watch/modal/video-share.component.scss 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 similarity index 100% rename from client/src/app/videos/+video-watch/modal/video-share.component.ts rename to client/src/app/+videos/+video-watch/modal/video-share.component.ts diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.html b/client/src/app/+videos/+video-watch/modal/video-support.component.html similarity index 100% rename from client/src/app/videos/+video-watch/modal/video-support.component.html rename to client/src/app/+videos/+video-watch/modal/video-support.component.html diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.scss b/client/src/app/+videos/+video-watch/modal/video-support.component.scss similarity index 100% rename from client/src/app/videos/+video-watch/modal/video-support.component.scss rename to client/src/app/+videos/+video-watch/modal/video-support.component.scss 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 similarity index 100% rename from client/src/app/videos/+video-watch/modal/video-support.component.ts rename to client/src/app/+videos/+video-watch/modal/video-support.component.ts diff --git a/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts b/client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts similarity index 95% rename from client/src/app/videos/recommendations/recent-videos-recommendation.service.ts rename to client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts index a376453bf..29fa268f4 100644 --- a/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts +++ b/client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts @@ -2,9 +2,8 @@ import { Observable, of } from 'rxjs' import { map, switchMap } from 'rxjs/operators' import { Injectable } from '@angular/core' import { ServerService, UserService } from '@app/core' -import { AdvancedSearch } from '@app/search/advanced-search.model' -import { SearchService } from '@app/search/search.service' import { Video, VideoService } from '@app/shared/shared-main' +import { AdvancedSearch, SearchService } from '@app/shared/shared-search' import { ServerConfig } from '@shared/models' import { RecommendationInfo } from './recommendation-info.model' import { RecommendationService } from './recommendations.service' diff --git a/client/src/app/videos/recommendations/recommendation-info.model.ts b/client/src/app/+videos/+video-watch/recommendations/recommendation-info.model.ts similarity index 100% rename from client/src/app/videos/recommendations/recommendation-info.model.ts rename to client/src/app/+videos/+video-watch/recommendations/recommendation-info.model.ts diff --git a/client/src/app/videos/recommendations/recommendations.module.ts b/client/src/app/+videos/+video-watch/recommendations/recommendations.module.ts similarity index 91% rename from client/src/app/videos/recommendations/recommendations.module.ts rename to client/src/app/+videos/+video-watch/recommendations/recommendations.module.ts index 03cc272ca..259afb196 100644 --- a/client/src/app/videos/recommendations/recommendations.module.ts +++ b/client/src/app/+videos/+video-watch/recommendations/recommendations.module.ts @@ -2,6 +2,7 @@ import { InputSwitchModule } from 'primeng/inputswitch' import { CommonModule } from '@angular/common' import { NgModule } from '@angular/core' import { SharedMainModule } from '@app/shared/shared-main' +import { SharedSearchModule } from '@app/shared/shared-search' import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist' import { RecentVideosRecommendationService } from './recent-videos-recommendation.service' @@ -14,6 +15,7 @@ import { RecommendedVideosStore } from './recommended-videos.store' InputSwitchModule, SharedMainModule, + SharedSearchModule, SharedVideoPlaylistModule, SharedVideoMiniatureModule ], diff --git a/client/src/app/videos/recommendations/recommendations.service.ts b/client/src/app/+videos/+video-watch/recommendations/recommendations.service.ts similarity index 100% rename from client/src/app/videos/recommendations/recommendations.service.ts rename to client/src/app/+videos/+video-watch/recommendations/recommendations.service.ts diff --git a/client/src/app/videos/recommendations/recommended-videos.component.html b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html similarity index 100% rename from client/src/app/videos/recommendations/recommended-videos.component.html rename to client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html diff --git a/client/src/app/videos/recommendations/recommended-videos.component.scss b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss similarity index 100% rename from client/src/app/videos/recommendations/recommended-videos.component.scss rename to client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.scss diff --git a/client/src/app/videos/recommendations/recommended-videos.component.ts b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts similarity index 100% rename from client/src/app/videos/recommendations/recommended-videos.component.ts rename to client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.ts diff --git a/client/src/app/videos/recommendations/recommended-videos.store.ts b/client/src/app/+videos/+video-watch/recommendations/recommended-videos.store.ts similarity index 100% rename from client/src/app/videos/recommendations/recommended-videos.store.ts rename to client/src/app/+videos/+video-watch/recommendations/recommended-videos.store.ts diff --git a/client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts b/client/src/app/+videos/+video-watch/timestamp-route-transformer.directive.ts similarity index 100% rename from client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts rename to client/src/app/+videos/+video-watch/timestamp-route-transformer.directive.ts diff --git a/client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts b/client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts similarity index 100% rename from client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts rename to client/src/app/+videos/+video-watch/video-duration-formatter.pipe.ts diff --git a/client/src/app/videos/+video-watch/video-watch-playlist.component.html b/client/src/app/+videos/+video-watch/video-watch-playlist.component.html similarity index 100% rename from client/src/app/videos/+video-watch/video-watch-playlist.component.html rename to client/src/app/+videos/+video-watch/video-watch-playlist.component.html diff --git a/client/src/app/videos/+video-watch/video-watch-playlist.component.scss b/client/src/app/+videos/+video-watch/video-watch-playlist.component.scss similarity index 100% rename from client/src/app/videos/+video-watch/video-watch-playlist.component.scss rename to client/src/app/+videos/+video-watch/video-watch-playlist.component.scss 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 similarity index 100% rename from client/src/app/videos/+video-watch/video-watch-playlist.component.ts rename to client/src/app/+videos/+video-watch/video-watch-playlist.component.ts 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 similarity index 100% rename from client/src/app/videos/+video-watch/video-watch-routing.module.ts rename to client/src/app/+videos/+video-watch/video-watch-routing.module.ts diff --git a/client/src/app/videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html similarity index 100% rename from client/src/app/videos/+video-watch/video-watch.component.html rename to client/src/app/+videos/+video-watch/video-watch.component.html diff --git a/client/src/app/videos/+video-watch/video-watch.component.scss b/client/src/app/+videos/+video-watch/video-watch.component.scss similarity index 100% rename from client/src/app/videos/+video-watch/video-watch.component.scss rename to client/src/app/+videos/+video-watch/video-watch.component.scss diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts similarity index 100% rename from client/src/app/videos/+video-watch/video-watch.component.ts rename to client/src/app/+videos/+video-watch/video-watch.component.ts diff --git a/client/src/app/videos/+video-watch/video-watch.module.ts b/client/src/app/+videos/+video-watch/video-watch.module.ts similarity index 96% rename from client/src/app/videos/+video-watch/video-watch.module.ts rename to client/src/app/+videos/+video-watch/video-watch.module.ts index a1c54f065..421170d81 100644 --- a/client/src/app/videos/+video-watch/video-watch.module.ts +++ b/client/src/app/+videos/+video-watch/video-watch.module.ts @@ -7,7 +7,7 @@ import { SharedModerationModule } from '@app/shared/shared-moderation' import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist' -import { RecommendationsModule } from '@app/videos/recommendations/recommendations.module' +import { RecommendationsModule } from './recommendations/recommendations.module' import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap' import { VideoCommentAddComponent } from './comment/video-comment-add.component' import { VideoCommentComponent } from './comment/video-comment.component' diff --git a/client/src/app/videos/index.ts b/client/src/app/+videos/index.ts similarity index 100% rename from client/src/app/videos/index.ts rename to client/src/app/+videos/index.ts diff --git a/client/src/app/videos/video-list/index.ts b/client/src/app/+videos/video-list/index.ts similarity index 100% rename from client/src/app/videos/video-list/index.ts rename to client/src/app/+videos/video-list/index.ts diff --git a/client/src/app/videos/video-list/overview/index.ts b/client/src/app/+videos/video-list/overview/index.ts similarity index 100% rename from client/src/app/videos/video-list/overview/index.ts rename to client/src/app/+videos/video-list/overview/index.ts diff --git a/client/src/app/videos/video-list/overview/overview.service.ts b/client/src/app/+videos/video-list/overview/overview.service.ts similarity index 100% rename from client/src/app/videos/video-list/overview/overview.service.ts rename to client/src/app/+videos/video-list/overview/overview.service.ts diff --git a/client/src/app/videos/video-list/overview/video-overview.component.html b/client/src/app/+videos/video-list/overview/video-overview.component.html similarity index 100% rename from client/src/app/videos/video-list/overview/video-overview.component.html rename to client/src/app/+videos/video-list/overview/video-overview.component.html diff --git a/client/src/app/videos/video-list/overview/video-overview.component.scss b/client/src/app/+videos/video-list/overview/video-overview.component.scss similarity index 100% rename from client/src/app/videos/video-list/overview/video-overview.component.scss rename to client/src/app/+videos/video-list/overview/video-overview.component.scss diff --git a/client/src/app/videos/video-list/overview/video-overview.component.ts b/client/src/app/+videos/video-list/overview/video-overview.component.ts similarity index 100% rename from client/src/app/videos/video-list/overview/video-overview.component.ts rename to client/src/app/+videos/video-list/overview/video-overview.component.ts diff --git a/client/src/app/videos/video-list/overview/videos-overview.model.ts b/client/src/app/+videos/video-list/overview/videos-overview.model.ts similarity index 100% rename from client/src/app/videos/video-list/overview/videos-overview.model.ts rename to client/src/app/+videos/video-list/overview/videos-overview.model.ts diff --git a/client/src/app/videos/video-list/video-local.component.ts b/client/src/app/+videos/video-list/video-local.component.ts similarity index 100% rename from client/src/app/videos/video-list/video-local.component.ts rename to client/src/app/+videos/video-list/video-local.component.ts 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 similarity index 100% rename from client/src/app/videos/video-list/video-most-liked.component.ts rename to client/src/app/+videos/video-list/video-most-liked.component.ts 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 similarity index 100% rename from client/src/app/videos/video-list/video-recently-added.component.ts rename to client/src/app/+videos/video-list/video-recently-added.component.ts diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/+videos/video-list/video-trending.component.ts similarity index 100% rename from client/src/app/videos/video-list/video-trending.component.ts rename to client/src/app/+videos/video-list/video-trending.component.ts 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 similarity index 100% rename from client/src/app/videos/video-list/video-user-subscriptions.component.ts rename to client/src/app/+videos/video-list/video-user-subscriptions.component.ts diff --git a/client/src/app/videos/videos-routing.module.ts b/client/src/app/+videos/videos-routing.module.ts similarity index 86% rename from client/src/app/videos/videos-routing.module.ts rename to client/src/app/+videos/videos-routing.module.ts index 16b65be63..e0e877fc6 100644 --- a/client/src/app/videos/videos-routing.module.ts +++ b/client/src/app/+videos/videos-routing.module.ts @@ -1,17 +1,17 @@ import { NgModule } from '@angular/core' import { RouterModule, Routes } from '@angular/router' -import { VideoLocalComponent } from '@app/videos/video-list/video-local.component' import { MetaGuard } from '@ngx-meta/core' +import { VideoOverviewComponent } from './video-list/overview/video-overview.component' +import { VideoLocalComponent } from './video-list/video-local.component' +import { VideoMostLikedComponent } from './video-list/video-most-liked.component' import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' import { VideoTrendingComponent } from './video-list/video-trending.component' -import { VideoMostLikedComponent } from './video-list/video-most-liked.component' -import { VideosComponent } from './videos.component' import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component' -import { VideoOverviewComponent } from './video-list/overview/video-overview.component' +import { VideosComponent } from './videos.component' const videosRoutes: Routes = [ { - path: 'videos', + path: '', component: VideosComponent, canActivateChild: [ MetaGuard ], children: [ @@ -91,7 +91,7 @@ const videosRoutes: Routes = [ }, { path: 'upload', - loadChildren: () => import('@app/videos/+video-edit/video-add.module').then(m => m.VideoAddModule), + loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule), data: { meta: { title: 'Upload a video' @@ -100,7 +100,7 @@ const videosRoutes: Routes = [ }, { path: 'update/:uuid', - loadChildren: () => import('@app/videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule), + loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule), data: { meta: { title: 'Edit a video' @@ -109,7 +109,7 @@ const videosRoutes: Routes = [ }, { path: 'watch', - loadChildren: () => import('@app/videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule), + loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule), data: { preload: 3000 } diff --git a/client/src/app/videos/videos.component.ts b/client/src/app/+videos/videos.component.ts similarity index 100% rename from client/src/app/videos/videos.component.ts rename to client/src/app/+videos/videos.component.ts diff --git a/client/src/app/videos/videos.module.ts b/client/src/app/+videos/videos.module.ts similarity index 94% rename from client/src/app/videos/videos.module.ts rename to client/src/app/+videos/videos.module.ts index 217e5bb50..1cf68bf83 100644 --- a/client/src/app/videos/videos.module.ts +++ b/client/src/app/+videos/videos.module.ts @@ -4,6 +4,7 @@ import { SharedGlobalIconModule } from '@app/shared/shared-icons' import { SharedMainModule } from '@app/shared/shared-main' import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' +import { OverviewService } from './video-list' import { VideoOverviewComponent } from './video-list/overview/video-overview.component' import { VideoLocalComponent } from './video-list/video-local.component' import { VideoMostLikedComponent } from './video-list/video-most-liked.component' @@ -39,6 +40,8 @@ import { VideosComponent } from './videos.component' VideosComponent ], - providers: [] + providers: [ + OverviewService + ] }) export class VideosModule { } diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index ceda41415..a39be17dc 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts @@ -4,6 +4,7 @@ import { AppComponent } from '@app/app.component' import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' import { MenuGuards } from '@app/core/routing/menu-guard.service' import { PreloadSelectedModulesList } from './core' +import { EmptyComponent } from './empty.component' const routes: Routes = [ { @@ -36,9 +37,25 @@ const routes: Routes = [ path: 'signup', loadChildren: () => import('./+signup/+register/register.module').then(m => m.RegisterModule) }, + { + path: 'reset-password', + loadChildren: () => import('./+reset-password/reset-password.module').then(m => m.ResetPasswordModule) + }, + { + path: 'login', + loadChildren: () => import('./+login/login.module').then(m => m.LoginModule) + }, + { + path: 'search', + loadChildren: () => import('./+search/search.module').then(m => m.SearchModule) + }, + { + path: 'videos', + loadChildren: () => import('./+videos/videos.module').then(m => m.VideosModule) + }, { path: '', - component: AppComponent // Avoid 404, app component will redirect dynamically + component: EmptyComponent // Avoid 404, app component will redirect dynamically }, { path: '**', diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 7fbc6463b..c6e9d7315 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -4,15 +4,13 @@ import { LOCALE_ID, NgModule, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular import { BrowserModule } from '@angular/platform-browser' import { ServerService } from '@app/core' import localeOc from '@app/helpers/locales/oc' -import { ResetPasswordModule } from '@app/reset-password' -import { SearchModule } from '@app/search' import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/models' import { AppRoutingModule } from './app-routing.module' import { AppComponent } from './app.component' import { CoreModule } from './core' import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' -import { LoginModule } from './login' +import { HighlightPipe } from './header/highlight.pipe' import { AvatarNotificationComponent, LanguageChooserComponent, MenuComponent } from './menu' import { ConfirmComponent } from './modal/confirm.component' import { CustomModalComponent } from './modal/custom-modal.component' @@ -24,7 +22,6 @@ import { SharedGlobalIconModule } from './shared/shared-icons' import { SharedInstanceModule } from './shared/shared-instance' import { SharedMainModule } from './shared/shared-main' import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings' -import { VideosModule } from './videos' registerLocaleData(localeOc, 'oc') @@ -41,6 +38,7 @@ registerLocaleData(localeOc, 'oc') HeaderComponent, SearchTypeaheadComponent, SuggestionComponent, + HighlightPipe, CustomModalComponent, WelcomeModalComponent, @@ -58,12 +56,6 @@ registerLocaleData(localeOc, 'oc') SharedGlobalIconModule, SharedInstanceModule, - LoginModule, - ResetPasswordModule, - SearchModule, - - VideosModule, - MetaModule.forRoot({ provide: MetaLoader, useFactory: (serverService: ServerService) => { diff --git a/client/src/app/empty.component.ts b/client/src/app/empty.component.ts new file mode 100644 index 000000000..5cde05a32 --- /dev/null +++ b/client/src/app/empty.component.ts @@ -0,0 +1,10 @@ + +import { Component } from '@angular/core' + +@Component({ + selector: 'my-empty', + template: '' +}) +export class EmptyComponent { + +} diff --git a/client/src/app/search/highlight.pipe.ts b/client/src/app/header/highlight.pipe.ts similarity index 100% rename from client/src/app/search/highlight.pipe.ts rename to client/src/app/header/highlight.pipe.ts diff --git a/client/src/app/login/index.ts b/client/src/app/login/index.ts deleted file mode 100644 index f1301d8b5..000000000 --- a/client/src/app/login/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './login-routing.module' -export * from './login.component' -export * from './login.module' diff --git a/client/src/app/reset-password/index.ts b/client/src/app/reset-password/index.ts deleted file mode 100644 index 438dc576a..000000000 --- a/client/src/app/reset-password/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './reset-password-routing.module' -export * from './reset-password.component' -export * from './reset-password.module' diff --git a/client/src/app/search/index.ts b/client/src/app/search/index.ts deleted file mode 100644 index 40f4e021f..000000000 --- a/client/src/app/search/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './search-routing.module' -export * from './search.component' -export * from './search.module' diff --git a/client/src/app/search/advanced-search.model.ts b/client/src/app/shared/shared-search/advanced-search.model.ts similarity index 100% rename from client/src/app/search/advanced-search.model.ts rename to client/src/app/shared/shared-search/advanced-search.model.ts diff --git a/client/src/app/shared/shared-search/index.ts b/client/src/app/shared/shared-search/index.ts new file mode 100644 index 000000000..f687f6767 --- /dev/null +++ b/client/src/app/shared/shared-search/index.ts @@ -0,0 +1,3 @@ +export * from './advanced-search.model' +export * from './search.service' +export * from './shared-search.module' diff --git a/client/src/app/search/search.service.ts b/client/src/app/shared/shared-search/search.service.ts similarity index 90% rename from client/src/app/search/search.service.ts rename to client/src/app/shared/shared-search/search.service.ts index 36342034f..96b954c99 100644 --- a/client/src/app/search/search.service.ts +++ b/client/src/app/shared/shared-search/search.service.ts @@ -4,11 +4,10 @@ import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core' import { peertubeLocalStorage } from '@app/helpers' -import { AdvancedSearch } from '@app/search/advanced-search.model' import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' -import { ResultList, Video as VideoServerModel, VideoChannel as VideoChannelServerModel } from '@shared/models' -import { SearchTargetType } from '@shared/models/search/search-target-query.model' -import { environment } from '../../environments/environment' +import { ResultList, SearchTargetType, Video as VideoServerModel, VideoChannel as VideoChannelServerModel } from '@shared/models' +import { environment } from '../../../environments/environment' +import { AdvancedSearch } from './advanced-search.model' @Injectable() export class SearchService { diff --git a/client/src/app/shared/shared-search/shared-search.module.ts b/client/src/app/shared/shared-search/shared-search.module.ts new file mode 100644 index 000000000..134300d88 --- /dev/null +++ b/client/src/app/shared/shared-search/shared-search.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core' +import { SharedMainModule } from '../shared-main' +import { SearchService } from './search.service' + +@NgModule({ + imports: [ + SharedMainModule + ], + + declarations: [ + ], + + exports: [ + ], + + providers: [ + SearchService + ] +}) +export class SharedSearchModule { } diff --git a/shared/models/videos/abuse/index.ts b/shared/models/videos/abuse/index.ts index bdeef1dad..f70bc736f 100644 --- a/shared/models/videos/abuse/index.ts +++ b/shared/models/videos/abuse/index.ts @@ -1,4 +1,5 @@ export * from './video-abuse-create.model' +export * from './video-abuse-reason.model' export * from './video-abuse-state.model' export * from './video-abuse-update.model' export * from './video-abuse-video-is.type'