diff options
Diffstat (limited to 'client/src')
28 files changed, 131 insertions, 93 deletions
diff --git a/client/src/app/+about/about-routing.module.ts b/client/src/app/+about/about-routing.module.ts index 96a737555..880bf4a39 100644 --- a/client/src/app/+about/about-routing.module.ts +++ b/client/src/app/+about/about-routing.module.ts | |||
@@ -1,17 +1,15 @@ | |||
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' | ||
4 | import { AboutComponent } from './about.component' | ||
5 | import { AboutInstanceComponent } from '@app/+about/about-instance/about-instance.component' | ||
6 | import { AboutPeertubeComponent } from '@app/+about/about-peertube/about-peertube.component' | ||
7 | import { AboutFollowsComponent } from '@app/+about/about-follows/about-follows.component' | 3 | import { AboutFollowsComponent } from '@app/+about/about-follows/about-follows.component' |
4 | import { AboutInstanceComponent } from '@app/+about/about-instance/about-instance.component' | ||
8 | import { AboutInstanceResolver } from '@app/+about/about-instance/about-instance.resolver' | 5 | import { AboutInstanceResolver } from '@app/+about/about-instance/about-instance.resolver' |
6 | import { AboutPeertubeComponent } from '@app/+about/about-peertube/about-peertube.component' | ||
7 | import { AboutComponent } from './about.component' | ||
9 | 8 | ||
10 | const aboutRoutes: Routes = [ | 9 | const aboutRoutes: Routes = [ |
11 | { | 10 | { |
12 | path: '', | 11 | path: '', |
13 | component: AboutComponent, | 12 | component: AboutComponent, |
14 | canActivateChild: [ MetaGuard ], | ||
15 | children: [ | 13 | children: [ |
16 | { | 14 | { |
17 | path: '', | 15 | path: '', |
diff --git a/client/src/app/+accounts/accounts-routing.module.ts b/client/src/app/+accounts/accounts-routing.module.ts index 3bf0f7185..2f3792a8d 100644 --- a/client/src/app/+accounts/accounts-routing.module.ts +++ b/client/src/app/+accounts/accounts-routing.module.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { AccountSearchComponent } from './account-search/account-search.component' | 3 | import { AccountSearchComponent } from './account-search/account-search.component' |
5 | import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' | 4 | import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' |
6 | import { AccountVideosComponent } from './account-videos/account-videos.component' | 5 | import { AccountVideosComponent } from './account-videos/account-videos.component' |
@@ -14,7 +13,6 @@ const accountsRoutes: Routes = [ | |||
14 | { | 13 | { |
15 | path: ':accountId', | 14 | path: ':accountId', |
16 | component: AccountsComponent, | 15 | component: AccountsComponent, |
17 | canActivateChild: [ MetaGuard ], | ||
18 | children: [ | 16 | children: [ |
19 | { | 17 | { |
20 | path: '', | 18 | path: '', |
diff --git a/client/src/app/+admin/admin-routing.module.ts b/client/src/app/+admin/admin-routing.module.ts index 986dae8eb..d029661d3 100644 --- a/client/src/app/+admin/admin-routing.module.ts +++ b/client/src/app/+admin/admin-routing.module.ts | |||
@@ -4,7 +4,6 @@ import { ConfigRoutes } from '@app/+admin/config' | |||
4 | import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes' | 4 | import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes' |
5 | import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes' | 5 | import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes' |
6 | import { SystemRoutes } from '@app/+admin/system' | 6 | import { SystemRoutes } from '@app/+admin/system' |
7 | import { MetaGuard } from '@ngx-meta/core' | ||
8 | import { AdminComponent } from './admin.component' | 7 | import { AdminComponent } from './admin.component' |
9 | import { FollowsRoutes } from './follows' | 8 | import { FollowsRoutes } from './follows' |
10 | import { UsersRoutes } from './users' | 9 | import { UsersRoutes } from './users' |
@@ -13,8 +12,6 @@ const adminRoutes: Routes = [ | |||
13 | { | 12 | { |
14 | path: '', | 13 | path: '', |
15 | component: AdminComponent, | 14 | component: AdminComponent, |
16 | canActivate: [ MetaGuard ], | ||
17 | canActivateChild: [ MetaGuard ], | ||
18 | children: [ | 15 | children: [ |
19 | { | 16 | { |
20 | path: '', | 17 | path: '', |
diff --git a/client/src/app/+home/home-routing.module.ts b/client/src/app/+home/home-routing.module.ts index 1eaee4449..a2085f191 100644 --- a/client/src/app/+home/home-routing.module.ts +++ b/client/src/app/+home/home-routing.module.ts | |||
@@ -1,13 +1,11 @@ | |||
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' | ||
4 | import { HomeComponent } from './home.component' | 3 | import { HomeComponent } from './home.component' |
5 | 4 | ||
6 | const homeRoutes: Routes = [ | 5 | const homeRoutes: Routes = [ |
7 | { | 6 | { |
8 | path: '', | 7 | path: '', |
9 | component: HomeComponent, | 8 | component: HomeComponent |
10 | canActivateChild: [ MetaGuard ] | ||
11 | } | 9 | } |
12 | ] | 10 | ] |
13 | 11 | ||
diff --git a/client/src/app/+login/login-routing.module.ts b/client/src/app/+login/login-routing.module.ts index 258ddc5c1..c5f0f23c2 100644 --- a/client/src/app/+login/login-routing.module.ts +++ b/client/src/app/+login/login-routing.module.ts | |||
@@ -1,14 +1,12 @@ | |||
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' | ||
4 | import { LoginComponent } from './login.component' | ||
5 | import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' | 3 | import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' |
4 | import { LoginComponent } from './login.component' | ||
6 | 5 | ||
7 | const loginRoutes: Routes = [ | 6 | const loginRoutes: Routes = [ |
8 | { | 7 | { |
9 | path: '', | 8 | path: '', |
10 | component: LoginComponent, | 9 | component: LoginComponent, |
11 | canActivate: [ MetaGuard ], | ||
12 | data: { | 10 | data: { |
13 | meta: { | 11 | meta: { |
14 | title: $localize`Login` | 12 | title: $localize`Login` |
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 e2f8660fb..ef39c1a36 100644 --- a/client/src/app/+my-account/my-account-routing.module.ts +++ b/client/src/app/+my-account/my-account-routing.module.ts | |||
@@ -1,20 +1,19 @@ | |||
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' | ||
4 | import { LoginGuard } from '../core' | 3 | import { LoginGuard } from '../core' |
5 | import { MyAccountAbusesListComponent } from './my-account-abuses/my-account-abuses-list.component' | 4 | import { MyAccountAbusesListComponent } from './my-account-abuses/my-account-abuses-list.component' |
5 | import { MyAccountApplicationsComponent } from './my-account-applications/my-account-applications.component' | ||
6 | import { MyAccountBlocklistComponent } from './my-account-blocklist/my-account-blocklist.component' | 6 | import { MyAccountBlocklistComponent } from './my-account-blocklist/my-account-blocklist.component' |
7 | import { MyAccountServerBlocklistComponent } from './my-account-blocklist/my-account-server-blocklist.component' | 7 | import { MyAccountServerBlocklistComponent } from './my-account-blocklist/my-account-server-blocklist.component' |
8 | import { MyAccountNotificationsComponent } from './my-account-notifications/my-account-notifications.component' | 8 | import { MyAccountNotificationsComponent } from './my-account-notifications/my-account-notifications.component' |
9 | import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' | 9 | import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' |
10 | import { MyAccountComponent } from './my-account.component' | 10 | import { MyAccountComponent } from './my-account.component' |
11 | import { MyAccountApplicationsComponent } from './my-account-applications/my-account-applications.component' | ||
12 | 11 | ||
13 | const myAccountRoutes: Routes = [ | 12 | const myAccountRoutes: Routes = [ |
14 | { | 13 | { |
15 | path: '', | 14 | path: '', |
16 | component: MyAccountComponent, | 15 | component: MyAccountComponent, |
17 | canActivateChild: [ MetaGuard, LoginGuard ], | 16 | canActivateChild: [ LoginGuard ], |
18 | children: [ | 17 | children: [ |
19 | { | 18 | { |
20 | path: '', | 19 | path: '', |
diff --git a/client/src/app/+my-library/my-library-routing.module.ts b/client/src/app/+my-library/my-library-routing.module.ts index d8e5aa562..76894bed8 100644 --- a/client/src/app/+my-library/my-library-routing.module.ts +++ b/client/src/app/+my-library/my-library-routing.module.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { LoginGuard } from '../core' | 3 | import { LoginGuard } from '../core' |
5 | import { MyHistoryComponent } from './my-history/my-history.component' | 4 | import { MyHistoryComponent } from './my-history/my-history.component' |
6 | import { MyLibraryComponent } from './my-library.component' | 5 | import { MyLibraryComponent } from './my-library.component' |
@@ -17,7 +16,7 @@ const myLibraryRoutes: Routes = [ | |||
17 | { | 16 | { |
18 | path: '', | 17 | path: '', |
19 | component: MyLibraryComponent, | 18 | component: MyLibraryComponent, |
20 | canActivateChild: [ MetaGuard, LoginGuard ], | 19 | canActivateChild: [ LoginGuard ], |
21 | children: [ | 20 | children: [ |
22 | { | 21 | { |
23 | path: '', | 22 | path: '', |
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 7f1ba2f68..3532cdbc1 100644 --- a/client/src/app/+reset-password/reset-password-routing.module.ts +++ b/client/src/app/+reset-password/reset-password-routing.module.ts | |||
@@ -1,16 +1,14 @@ | |||
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' | ||
4 | import { ResetPasswordComponent } from './reset-password.component' | 3 | import { ResetPasswordComponent } from './reset-password.component' |
5 | 4 | ||
6 | const resetPasswordRoutes: Routes = [ | 5 | const resetPasswordRoutes: Routes = [ |
7 | { | 6 | { |
8 | path: '', | 7 | path: '', |
9 | component: ResetPasswordComponent, | 8 | component: ResetPasswordComponent, |
10 | canActivate: [ MetaGuard ], | ||
11 | data: { | 9 | data: { |
12 | meta: { | 10 | meta: { |
13 | title: `Reset password` | 11 | title: $localize`Reset password` |
14 | } | 12 | } |
15 | } | 13 | } |
16 | } | 14 | } |
diff --git a/client/src/app/+search/search-routing.module.ts b/client/src/app/+search/search-routing.module.ts index e5d7d1ede..0d778af0d 100644 --- a/client/src/app/+search/search-routing.module.ts +++ b/client/src/app/+search/search-routing.module.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { ChannelLazyLoadResolver } from './channel-lazy-load.resolver' | 3 | import { ChannelLazyLoadResolver } from './channel-lazy-load.resolver' |
5 | import { SearchComponent } from './search.component' | 4 | import { SearchComponent } from './search.component' |
6 | import { VideoLazyLoadResolver } from './video-lazy-load.resolver' | 5 | import { VideoLazyLoadResolver } from './video-lazy-load.resolver' |
@@ -9,7 +8,6 @@ const searchRoutes: Routes = [ | |||
9 | { | 8 | { |
10 | path: '', | 9 | path: '', |
11 | component: SearchComponent, | 10 | component: SearchComponent, |
12 | canActivate: [ MetaGuard ], | ||
13 | data: { | 11 | data: { |
14 | meta: { | 12 | meta: { |
15 | title: $localize`Search` | 13 | title: $localize`Search` |
@@ -19,7 +17,6 @@ const searchRoutes: Routes = [ | |||
19 | { | 17 | { |
20 | path: 'lazy-load-video', | 18 | path: 'lazy-load-video', |
21 | component: SearchComponent, | 19 | component: SearchComponent, |
22 | canActivate: [ MetaGuard ], | ||
23 | resolve: { | 20 | resolve: { |
24 | data: VideoLazyLoadResolver | 21 | data: VideoLazyLoadResolver |
25 | } | 22 | } |
@@ -27,7 +24,6 @@ const searchRoutes: Routes = [ | |||
27 | { | 24 | { |
28 | path: 'lazy-load-channel', | 25 | path: 'lazy-load-channel', |
29 | component: SearchComponent, | 26 | component: SearchComponent, |
30 | canActivate: [ MetaGuard ], | ||
31 | resolve: { | 27 | resolve: { |
32 | data: ChannelLazyLoadResolver | 28 | data: ChannelLazyLoadResolver |
33 | } | 29 | } |
diff --git a/client/src/app/+search/search.component.ts b/client/src/app/+search/search.component.ts index ecede19a3..dcf654b7a 100644 --- a/client/src/app/+search/search.component.ts +++ b/client/src/app/+search/search.component.ts | |||
@@ -1,12 +1,11 @@ | |||
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, ComponentPagination, HooksService, Notifier, ServerService, User, UserService } from '@app/core' | 4 | import { AuthService, ComponentPagination, HooksService, MetaService, Notifier, ServerService, User, UserService } from '@app/core' |
5 | import { immutableAssign } from '@app/helpers' | 5 | import { immutableAssign } from '@app/helpers' |
6 | import { Video, VideoChannel } from '@app/shared/shared-main' | 6 | import { Video, VideoChannel } from '@app/shared/shared-main' |
7 | import { AdvancedSearch, SearchService } from '@app/shared/shared-search' | 7 | import { AdvancedSearch, SearchService } from '@app/shared/shared-search' |
8 | import { MiniatureDisplayOptions, VideoLinkType } from '@app/shared/shared-video-miniature' | 8 | import { MiniatureDisplayOptions, VideoLinkType } from '@app/shared/shared-video-miniature' |
9 | import { MetaService } from '@ngx-meta/core' | ||
10 | import { SearchTargetType, ServerConfig } from '@shared/models' | 9 | import { SearchTargetType, ServerConfig } from '@shared/models' |
11 | 10 | ||
12 | @Component({ | 11 | @Component({ |
@@ -238,7 +237,10 @@ export class SearchComponent implements OnInit, OnDestroy { | |||
238 | } | 237 | } |
239 | 238 | ||
240 | private updateTitle () { | 239 | private updateTitle () { |
241 | const suffix = this.currentSearch ? ' ' + this.currentSearch : '' | 240 | const suffix = this.currentSearch |
241 | ? ' ' + this.currentSearch | ||
242 | : '' | ||
243 | |||
242 | this.metaService.setTitle($localize`Search` + suffix) | 244 | this.metaService.setTitle($localize`Search` + suffix) |
243 | } | 245 | } |
244 | 246 | ||
diff --git a/client/src/app/+signup/+register/register-routing.module.ts b/client/src/app/+signup/+register/register-routing.module.ts index 61a2fa42d..dabe79fa5 100644 --- a/client/src/app/+signup/+register/register-routing.module.ts +++ b/client/src/app/+signup/+register/register-routing.module.ts | |||
@@ -1,14 +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 { ServerConfigResolver, UnloggedGuard } from '@app/core' | 3 | import { ServerConfigResolver, UnloggedGuard } from '@app/core' |
4 | import { MetaGuard } from '@ngx-meta/core' | ||
5 | import { RegisterComponent } from './register.component' | 4 | import { RegisterComponent } from './register.component' |
6 | 5 | ||
7 | const registerRoutes: Routes = [ | 6 | const registerRoutes: Routes = [ |
8 | { | 7 | { |
9 | path: '', | 8 | path: '', |
10 | component: RegisterComponent, | 9 | component: RegisterComponent, |
11 | canActivate: [ MetaGuard, UnloggedGuard ], | 10 | canActivate: [ UnloggedGuard ], |
12 | data: { | 11 | data: { |
13 | meta: { | 12 | meta: { |
14 | title: $localize`Register` | 13 | title: $localize`Register` |
diff --git a/client/src/app/+signup/+verify-account/verify-account-routing.module.ts b/client/src/app/+signup/+verify-account/verify-account-routing.module.ts index 67c80ae93..1bc636345 100644 --- a/client/src/app/+signup/+verify-account/verify-account-routing.module.ts +++ b/client/src/app/+signup/+verify-account/verify-account-routing.module.ts | |||
@@ -1,13 +1,11 @@ | |||
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' | ||
4 | import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component' | ||
5 | 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' |
4 | import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component' | ||
6 | 5 | ||
7 | const verifyAccountRoutes: Routes = [ | 6 | const verifyAccountRoutes: Routes = [ |
8 | { | 7 | { |
9 | path: '', | 8 | path: '', |
10 | canActivateChild: [ MetaGuard ], | ||
11 | children: [ | 9 | children: [ |
12 | { | 10 | { |
13 | path: 'email', | 11 | path: 'email', |
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 fcaad8934..4ee052873 100644 --- a/client/src/app/+video-channels/video-channels-routing.module.ts +++ b/client/src/app/+video-channels/video-channels-routing.module.ts | |||
@@ -1,6 +1,5 @@ | |||
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' | ||
4 | import { VideoChannelPlaylistsComponent } from './video-channel-playlists/video-channel-playlists.component' | 3 | import { VideoChannelPlaylistsComponent } from './video-channel-playlists/video-channel-playlists.component' |
5 | import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component' | 4 | import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component' |
6 | import { VideoChannelsComponent } from './video-channels.component' | 5 | import { VideoChannelsComponent } from './video-channels.component' |
@@ -9,7 +8,6 @@ const videoChannelsRoutes: Routes = [ | |||
9 | { | 8 | { |
10 | path: ':videoChannelName', | 9 | path: ':videoChannelName', |
11 | component: VideoChannelsComponent, | 10 | component: VideoChannelsComponent, |
12 | canActivateChild: [ MetaGuard ], | ||
13 | children: [ | 11 | children: [ |
14 | { | 12 | { |
15 | path: '', | 13 | path: '', |
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 9ff66bea0..3b9a5ab3a 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,14 +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 { CanDeactivateGuard, LoginGuard } from '@app/core' | 3 | import { CanDeactivateGuard, LoginGuard } from '@app/core' |
4 | import { MetaGuard } from '@ngx-meta/core' | ||
5 | import { VideoAddComponent } from './video-add.component' | 4 | import { VideoAddComponent } from './video-add.component' |
6 | 5 | ||
7 | const videoAddRoutes: Routes = [ | 6 | const videoAddRoutes: Routes = [ |
8 | { | 7 | { |
9 | path: '', | 8 | path: '', |
10 | component: VideoAddComponent, | 9 | component: VideoAddComponent, |
11 | canActivate: [ MetaGuard, LoginGuard ], | 10 | canActivate: [ LoginGuard ], |
12 | canDeactivate: [ CanDeactivateGuard ] | 11 | canDeactivate: [ CanDeactivateGuard ] |
13 | } | 12 | } |
14 | ] | 13 | ] |
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 a04351b05..ba9167dd0 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,7 +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 | import { CanDeactivateGuard, LoginGuard } from '@app/core' | 3 | import { CanDeactivateGuard, LoginGuard } from '@app/core' |
4 | import { MetaGuard } from '@ngx-meta/core' | ||
5 | import { VideoUpdateComponent } from './video-update.component' | 4 | import { VideoUpdateComponent } from './video-update.component' |
6 | import { VideoUpdateResolver } from './video-update.resolver' | 5 | import { VideoUpdateResolver } from './video-update.resolver' |
7 | 6 | ||
@@ -9,7 +8,7 @@ const videoUpdateRoutes: Routes = [ | |||
9 | { | 8 | { |
10 | path: '', | 9 | path: '', |
11 | component: VideoUpdateComponent, | 10 | component: VideoUpdateComponent, |
12 | canActivate: [ MetaGuard, LoginGuard ], | 11 | canActivate: [ LoginGuard ], |
13 | canDeactivate: [ CanDeactivateGuard ], | 12 | canDeactivate: [ CanDeactivateGuard ], |
14 | resolve: { | 13 | resolve: { |
15 | videoData: VideoUpdateResolver | 14 | videoData: VideoUpdateResolver |
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 d8fecb87d..cb77685c0 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,13 +1,11 @@ | |||
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' | ||
4 | import { VideoWatchComponent } from './video-watch.component' | 3 | import { VideoWatchComponent } from './video-watch.component' |
5 | 4 | ||
6 | const videoWatchRoutes: Routes = [ | 5 | const videoWatchRoutes: Routes = [ |
7 | { | 6 | { |
8 | path: 'playlist/:playlistId', | 7 | path: 'playlist/:playlistId', |
9 | component: VideoWatchComponent, | 8 | component: VideoWatchComponent |
10 | canActivate: [ MetaGuard ] | ||
11 | }, | 9 | }, |
12 | { | 10 | { |
13 | path: ':videoId/comments/:commentId', | 11 | path: ':videoId/comments/:commentId', |
@@ -15,8 +13,7 @@ const videoWatchRoutes: Routes = [ | |||
15 | }, | 13 | }, |
16 | { | 14 | { |
17 | path: ':videoId', | 15 | path: ':videoId', |
18 | component: VideoWatchComponent, | 16 | component: VideoWatchComponent |
19 | canActivate: [ MetaGuard ] | ||
20 | } | 17 | } |
21 | ] | 18 | ] |
22 | 19 | ||
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 77405d149..88c5cef52 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -9,6 +9,7 @@ import { | |||
9 | AuthUser, | 9 | AuthUser, |
10 | ConfirmService, | 10 | ConfirmService, |
11 | MarkdownService, | 11 | MarkdownService, |
12 | MetaService, | ||
12 | Notifier, | 13 | Notifier, |
13 | PeerTubeSocket, | 14 | PeerTubeSocket, |
14 | RestExtractor, | 15 | RestExtractor, |
@@ -25,7 +26,6 @@ import { SupportModalComponent } from '@app/shared/shared-support-modal' | |||
25 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' | 26 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' |
26 | import { VideoActionsDisplayType, VideoDownloadComponent } from '@app/shared/shared-video-miniature' | 27 | import { VideoActionsDisplayType, VideoDownloadComponent } from '@app/shared/shared-video-miniature' |
27 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' | 28 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
28 | import { MetaService } from '@ngx-meta/core' | ||
29 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' | 29 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' |
30 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | 30 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' |
31 | import { ServerConfig, ServerErrorCode, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models' | 31 | import { ServerConfig, ServerErrorCode, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models' |
diff --git a/client/src/app/+videos/videos-routing.module.ts b/client/src/app/+videos/videos-routing.module.ts index 16e3b9bb2..f9f476b18 100644 --- a/client/src/app/+videos/videos-routing.module.ts +++ b/client/src/app/+videos/videos-routing.module.ts | |||
@@ -1,7 +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 | import { LoginGuard } from '@app/core' | 3 | import { LoginGuard } from '@app/core' |
4 | import { MetaGuard } from '@ngx-meta/core' | ||
5 | import { VideoTrendingComponent } from './video-list' | 4 | import { VideoTrendingComponent } from './video-list' |
6 | import { VideoOverviewComponent } from './video-list/overview/video-overview.component' | 5 | import { VideoOverviewComponent } from './video-list/overview/video-overview.component' |
7 | import { VideoLocalComponent } from './video-list/video-local.component' | 6 | import { VideoLocalComponent } from './video-list/video-local.component' |
@@ -13,7 +12,6 @@ const videosRoutes: Routes = [ | |||
13 | { | 12 | { |
14 | path: '', | 13 | path: '', |
15 | component: VideosComponent, | 14 | component: VideosComponent, |
16 | canActivateChild: [ MetaGuard ], | ||
17 | children: [ | 15 | children: [ |
18 | { | 16 | { |
19 | path: 'overview', | 17 | path: 'overview', |
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index 57e485e8e..4e3cce590 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts | |||
@@ -3,7 +3,7 @@ import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' | |||
3 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' | 3 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' |
4 | import { MenuGuards } from '@app/core/routing/menu-guard.service' | 4 | import { MenuGuards } from '@app/core/routing/menu-guard.service' |
5 | import { POSSIBLE_LOCALES } from '@shared/core-utils/i18n' | 5 | import { POSSIBLE_LOCALES } from '@shared/core-utils/i18n' |
6 | import { PreloadSelectedModulesList } from './core' | 6 | import { MetaGuard, PreloadSelectedModulesList } from './core' |
7 | import { EmptyComponent } from './empty.component' | 7 | import { EmptyComponent } from './empty.component' |
8 | 8 | ||
9 | const routes: Routes = [ | 9 | const routes: Routes = [ |
@@ -11,7 +11,8 @@ const routes: Routes = [ | |||
11 | path: 'admin', | 11 | path: 'admin', |
12 | canActivate: [ MenuGuards.close() ], | 12 | canActivate: [ MenuGuards.close() ], |
13 | canDeactivate: [ MenuGuards.open() ], | 13 | canDeactivate: [ MenuGuards.open() ], |
14 | loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule) | 14 | loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule), |
15 | canActivateChild: [ MetaGuard ] | ||
15 | }, | 16 | }, |
16 | { | 17 | { |
17 | path: 'home', | 18 | path: 'home', |
@@ -19,51 +20,63 @@ const routes: Routes = [ | |||
19 | }, | 20 | }, |
20 | { | 21 | { |
21 | path: 'my-account', | 22 | path: 'my-account', |
22 | loadChildren: () => import('./+my-account/my-account.module').then(m => m.MyAccountModule) | 23 | loadChildren: () => import('./+my-account/my-account.module').then(m => m.MyAccountModule), |
24 | canActivateChild: [ MetaGuard ] | ||
23 | }, | 25 | }, |
24 | { | 26 | { |
25 | path: 'my-library', | 27 | path: 'my-library', |
26 | loadChildren: () => import('./+my-library/my-library.module').then(m => m.MyLibraryModule) | 28 | loadChildren: () => import('./+my-library/my-library.module').then(m => m.MyLibraryModule), |
29 | canActivateChild: [ MetaGuard ] | ||
27 | }, | 30 | }, |
28 | { | 31 | { |
29 | path: 'verify-account', | 32 | path: 'verify-account', |
30 | loadChildren: () => import('./+signup/+verify-account/verify-account.module').then(m => m.VerifyAccountModule) | 33 | loadChildren: () => import('./+signup/+verify-account/verify-account.module').then(m => m.VerifyAccountModule), |
34 | canActivateChild: [ MetaGuard ] | ||
31 | }, | 35 | }, |
32 | { | 36 | { |
33 | path: 'accounts', | 37 | path: 'accounts', |
34 | loadChildren: () => import('./+accounts/accounts.module').then(m => m.AccountsModule) | 38 | loadChildren: () => import('./+accounts/accounts.module').then(m => m.AccountsModule), |
39 | canActivateChild: [ MetaGuard ] | ||
35 | }, | 40 | }, |
36 | { | 41 | { |
37 | path: 'video-channels', | 42 | path: 'video-channels', |
38 | loadChildren: () => import('./+video-channels/video-channels.module').then(m => m.VideoChannelsModule) | 43 | loadChildren: () => import('./+video-channels/video-channels.module').then(m => m.VideoChannelsModule), |
44 | canActivateChild: [ MetaGuard ] | ||
39 | }, | 45 | }, |
40 | { | 46 | { |
41 | path: 'about', | 47 | path: 'about', |
42 | loadChildren: () => import('./+about/about.module').then(m => m.AboutModule) | 48 | loadChildren: () => import('./+about/about.module').then(m => m.AboutModule), |
49 | canActivateChild: [ MetaGuard ] | ||
43 | }, | 50 | }, |
44 | { | 51 | { |
45 | path: 'signup', | 52 | path: 'signup', |
46 | loadChildren: () => import('./+signup/+register/register.module').then(m => m.RegisterModule) | 53 | loadChildren: () => import('./+signup/+register/register.module').then(m => m.RegisterModule), |
54 | canActivateChild: [ MetaGuard ] | ||
47 | }, | 55 | }, |
48 | { | 56 | { |
49 | path: 'reset-password', | 57 | path: 'reset-password', |
50 | loadChildren: () => import('./+reset-password/reset-password.module').then(m => m.ResetPasswordModule) | 58 | loadChildren: () => import('./+reset-password/reset-password.module').then(m => m.ResetPasswordModule), |
59 | canActivateChild: [ MetaGuard ] | ||
51 | }, | 60 | }, |
52 | { | 61 | { |
53 | path: 'login', | 62 | path: 'login', |
54 | loadChildren: () => import('./+login/login.module').then(m => m.LoginModule) | 63 | loadChildren: () => import('./+login/login.module').then(m => m.LoginModule), |
64 | canActivateChild: [ MetaGuard ] | ||
55 | }, | 65 | }, |
56 | { | 66 | { |
57 | path: 'search', | 67 | path: 'search', |
58 | loadChildren: () => import('./+search/search.module').then(m => m.SearchModule) | 68 | loadChildren: () => import('./+search/search.module').then(m => m.SearchModule), |
69 | canActivateChild: [ MetaGuard ] | ||
59 | }, | 70 | }, |
60 | { | 71 | { |
61 | path: 'videos', | 72 | path: 'videos', |
62 | loadChildren: () => import('./+videos/videos.module').then(m => m.VideosModule) | 73 | loadChildren: () => import('./+videos/videos.module').then(m => m.VideosModule), |
74 | canActivateChild: [ MetaGuard ] | ||
63 | }, | 75 | }, |
64 | { | 76 | { |
65 | path: 'remote-interaction', | 77 | path: 'remote-interaction', |
66 | loadChildren: () => import('./+remote-interaction/remote-interaction.module').then(m => m.RemoteInteractionModule) | 78 | loadChildren: () => import('./+remote-interaction/remote-interaction.module').then(m => m.RemoteInteractionModule), |
79 | canActivateChild: [ MetaGuard ] | ||
67 | }, | 80 | }, |
68 | { | 81 | { |
69 | path: 'video-playlists/watch', | 82 | path: 'video-playlists/watch', |
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 3cec6d739..9f46d49a2 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts | |||
@@ -4,9 +4,7 @@ import { APP_BASE_HREF, registerLocaleData } from '@angular/common' | |||
4 | import { NgModule } from '@angular/core' | 4 | import { NgModule } from '@angular/core' |
5 | import { BrowserModule } from '@angular/platform-browser' | 5 | import { BrowserModule } from '@angular/platform-browser' |
6 | import { ServiceWorkerModule } from '@angular/service-worker' | 6 | import { ServiceWorkerModule } from '@angular/service-worker' |
7 | import { ServerService } from '@app/core' | ||
8 | import localeOc from '@app/helpers/locales/oc' | 7 | import localeOc from '@app/helpers/locales/oc' |
9 | import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' | ||
10 | import { AppRoutingModule } from './app-routing.module' | 8 | import { AppRoutingModule } from './app-routing.module' |
11 | import { AppComponent } from './app.component' | 9 | import { AppComponent } from './app.component' |
12 | import { CoreModule } from './core' | 10 | import { CoreModule } from './core' |
@@ -19,12 +17,12 @@ import { CustomModalComponent } from './modal/custom-modal.component' | |||
19 | import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component' | 17 | import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component' |
20 | import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component' | 18 | import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component' |
21 | import { WelcomeModalComponent } from './modal/welcome-modal.component' | 19 | import { WelcomeModalComponent } from './modal/welcome-modal.component' |
20 | import { SharedActorImageModule } from './shared/shared-actor-image/shared-actor-image.module' | ||
22 | import { SharedFormModule } from './shared/shared-forms' | 21 | import { SharedFormModule } from './shared/shared-forms' |
23 | import { SharedGlobalIconModule } from './shared/shared-icons' | 22 | import { SharedGlobalIconModule } from './shared/shared-icons' |
24 | import { SharedInstanceModule } from './shared/shared-instance' | 23 | import { SharedInstanceModule } from './shared/shared-instance' |
25 | import { SharedMainModule } from './shared/shared-main' | 24 | import { SharedMainModule } from './shared/shared-main' |
26 | import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings' | 25 | import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings' |
27 | import { SharedActorImageModule } from './shared/shared-actor-image/shared-actor-image.module' | ||
28 | 26 | ||
29 | registerLocaleData(localeOc, 'oc') | 27 | registerLocaleData(localeOc, 'oc') |
30 | 28 | ||
@@ -62,22 +60,6 @@ registerLocaleData(localeOc, 'oc') | |||
62 | SharedInstanceModule, | 60 | SharedInstanceModule, |
63 | SharedActorImageModule, | 61 | SharedActorImageModule, |
64 | 62 | ||
65 | MetaModule.forRoot({ | ||
66 | provide: MetaLoader, | ||
67 | useFactory: (serverService: ServerService) => { | ||
68 | return new MetaStaticLoader({ | ||
69 | pageTitlePositioning: PageTitlePositioning.PrependPageTitle, | ||
70 | pageTitleSeparator: ' - ', | ||
71 | get applicationName () { return serverService.getTmpConfig().instance.name }, | ||
72 | defaults: { | ||
73 | get title () { return serverService.getTmpConfig().instance.name }, | ||
74 | get description () { return serverService.getTmpConfig().instance.shortDescription } | ||
75 | } | ||
76 | }) | ||
77 | }, | ||
78 | deps: [ ServerService ] | ||
79 | }), | ||
80 | |||
81 | AppRoutingModule // Put it after all the module because it has the 404 route | 63 | AppRoutingModule // Put it after all the module because it has the 404 route |
82 | ], | 64 | ], |
83 | 65 | ||
diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts index 3152a7003..de3274544 100644 --- a/client/src/app/core/core.module.ts +++ b/client/src/app/core/core.module.ts | |||
@@ -14,7 +14,7 @@ import { throwIfAlreadyLoaded } from './module-import-guard' | |||
14 | import { Notifier } from './notification' | 14 | import { Notifier } from './notification' |
15 | import { HtmlRendererService, LinkifierService, MarkdownService } from './renderer' | 15 | import { HtmlRendererService, LinkifierService, MarkdownService } from './renderer' |
16 | import { RestExtractor, RestService } from './rest' | 16 | import { RestExtractor, RestService } from './rest' |
17 | import { LoginGuard, RedirectService, UnloggedGuard, UserRightGuard } from './routing' | 17 | import { LoginGuard, MetaGuard, MetaService, RedirectService, UnloggedGuard, UserRightGuard } from './routing' |
18 | import { CanDeactivateGuard } from './routing/can-deactivate-guard.service' | 18 | import { CanDeactivateGuard } from './routing/can-deactivate-guard.service' |
19 | import { ServerConfigResolver } from './routing/server-config-resolver.service' | 19 | import { ServerConfigResolver } from './routing/server-config-resolver.service' |
20 | import { ScopedTokensService } from './scoped-tokens' | 20 | import { ScopedTokensService } from './scoped-tokens' |
@@ -77,7 +77,10 @@ import { LocalStorageService, ScreenService, SessionStorageService } from './wra | |||
77 | MessageService, | 77 | MessageService, |
78 | PeerTubeSocket, | 78 | PeerTubeSocket, |
79 | ServerConfigResolver, | 79 | ServerConfigResolver, |
80 | CanDeactivateGuard | 80 | CanDeactivateGuard, |
81 | |||
82 | MetaService, | ||
83 | MetaGuard | ||
81 | ] | 84 | ] |
82 | }) | 85 | }) |
83 | export class CoreModule { | 86 | export class CoreModule { |
diff --git a/client/src/app/core/routing/index.ts b/client/src/app/core/routing/index.ts index 239c27caf..4314ea475 100644 --- a/client/src/app/core/routing/index.ts +++ b/client/src/app/core/routing/index.ts | |||
@@ -3,6 +3,8 @@ export * from './custom-reuse-strategy' | |||
3 | export * from './disable-for-reuse-hook' | 3 | export * from './disable-for-reuse-hook' |
4 | export * from './login-guard.service' | 4 | export * from './login-guard.service' |
5 | export * from './menu-guard.service' | 5 | export * from './menu-guard.service' |
6 | export * from './meta-guard.service' | ||
7 | export * from './meta.service' | ||
6 | export * from './preload-selected-modules-list' | 8 | export * from './preload-selected-modules-list' |
7 | export * from './redirect.service' | 9 | export * from './redirect.service' |
8 | export * from './server-config-resolver.service' | 10 | export * from './server-config-resolver.service' |
diff --git a/client/src/app/core/routing/meta-guard.service.ts b/client/src/app/core/routing/meta-guard.service.ts new file mode 100644 index 000000000..bedb3450e --- /dev/null +++ b/client/src/app/core/routing/meta-guard.service.ts | |||
@@ -0,0 +1,23 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router' | ||
3 | import { MetaService } from './meta.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class MetaGuard implements CanActivate, CanActivateChild { | ||
7 | |||
8 | constructor (private meta: MetaService) { } | ||
9 | |||
10 | canActivate (route: ActivatedRouteSnapshot): boolean { | ||
11 | const metaSettings = route.data?.meta | ||
12 | |||
13 | if (metaSettings) { | ||
14 | this.meta.update(metaSettings) | ||
15 | } | ||
16 | |||
17 | return true | ||
18 | } | ||
19 | |||
20 | canActivateChild (route: ActivatedRouteSnapshot): boolean { | ||
21 | return this.canActivate(route) | ||
22 | } | ||
23 | } | ||
diff --git a/client/src/app/core/routing/meta.service.ts b/client/src/app/core/routing/meta.service.ts new file mode 100644 index 000000000..a5ac778dc --- /dev/null +++ b/client/src/app/core/routing/meta.service.ts | |||
@@ -0,0 +1,40 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Meta, Title } from '@angular/platform-browser' | ||
3 | import { HTMLServerConfig } from '@shared/models/server' | ||
4 | import { ServerService } from '../server' | ||
5 | |||
6 | export interface MetaSettings { | ||
7 | title?: string | ||
8 | } | ||
9 | |||
10 | @Injectable() | ||
11 | export class MetaService { | ||
12 | private config: HTMLServerConfig | ||
13 | |||
14 | constructor ( | ||
15 | private titleService: Title, | ||
16 | private meta: Meta, | ||
17 | private server: ServerService | ||
18 | ) { | ||
19 | this.config = this.server.getTmpConfig() | ||
20 | this.server.getConfig() | ||
21 | .subscribe(config => this.config = config) | ||
22 | } | ||
23 | |||
24 | setTitle (subTitle?: string) { | ||
25 | let title = '' | ||
26 | if (subTitle) title += `${subTitle} - ` | ||
27 | |||
28 | title += this.config.instance.name | ||
29 | |||
30 | this.titleService.setTitle(title) | ||
31 | } | ||
32 | |||
33 | setTag (name: string, value: string) { | ||
34 | this.meta.addTag({ name, content: value }) | ||
35 | } | ||
36 | |||
37 | update (meta: MetaSettings) { | ||
38 | this.setTitle(meta.title) | ||
39 | } | ||
40 | } | ||
diff --git a/client/src/app/shared/shared-main/plugins/plugin-placeholder.component.scss b/client/src/app/shared/shared-main/plugins/plugin-placeholder.component.scss new file mode 100644 index 000000000..4e37c5e61 --- /dev/null +++ b/client/src/app/shared/shared-main/plugins/plugin-placeholder.component.scss | |||
@@ -0,0 +1,3 @@ | |||
1 | div { | ||
2 | height: 100%; | ||
3 | } | ||
diff --git a/client/src/app/shared/shared-main/plugins/plugin-placeholder.component.ts b/client/src/app/shared/shared-main/plugins/plugin-placeholder.component.ts index 4d5381e8d..858eff9ba 100644 --- a/client/src/app/shared/shared-main/plugins/plugin-placeholder.component.ts +++ b/client/src/app/shared/shared-main/plugins/plugin-placeholder.component.ts | |||
@@ -4,7 +4,7 @@ import { PluginElementPlaceholder } from '@shared/models' | |||
4 | @Component({ | 4 | @Component({ |
5 | selector: 'my-plugin-placeholder', | 5 | selector: 'my-plugin-placeholder', |
6 | template: '<div [id]="getId()"></div>', | 6 | template: '<div [id]="getId()"></div>', |
7 | styles: [ 'div { height: 100%; }' ] | 7 | styleUrls: [ './plugin-placeholder.component.scss' ] |
8 | }) | 8 | }) |
9 | 9 | ||
10 | export class PluginPlaceholderComponent { | 10 | export class PluginPlaceholderComponent { |
diff --git a/client/src/polyfills.ts b/client/src/polyfills.ts index 7c051413f..d862de8d8 100644 --- a/client/src/polyfills.ts +++ b/client/src/polyfills.ts | |||
@@ -58,7 +58,7 @@ import 'core-js/es/object' | |||
58 | * Zone JS is required by default for Angular itself. | 58 | * Zone JS is required by default for Angular itself. |
59 | */ | 59 | */ |
60 | // tslint:disable | 60 | // tslint:disable |
61 | import 'zone.js/dist/zone' // Included with Angular CLI. | 61 | import 'zone.js' // Included with Angular CLI. |
62 | 62 | ||
63 | /*************************************************************************************************** | 63 | /*************************************************************************************************** |
64 | * APPLICATION IMPORTS | 64 | * APPLICATION IMPORTS |
diff --git a/client/src/root-helpers/peertube-web-storage.ts b/client/src/root-helpers/peertube-web-storage.ts index f29845443..d4cad8a20 100644 --- a/client/src/root-helpers/peertube-web-storage.ts +++ b/client/src/root-helpers/peertube-web-storage.ts | |||
@@ -4,17 +4,19 @@ const valuesMap = new Map() | |||
4 | 4 | ||
5 | function proxify (instance: MemoryStorage) { | 5 | function proxify (instance: MemoryStorage) { |
6 | return new Proxy(instance, { | 6 | return new Proxy(instance, { |
7 | set: function (obj, prop: string | number, value) { | 7 | set: function (obj, prop: string | symbol, value) { |
8 | if (MemoryStorage.prototype.hasOwnProperty(prop)) { | 8 | if (MemoryStorage.prototype.hasOwnProperty(prop)) { |
9 | instance[prop] = value | 9 | // FIXME: symbol typing issue https://github.com/microsoft/TypeScript/issues/1863 |
10 | instance[prop as any] = value | ||
10 | } else { | 11 | } else { |
11 | instance.setItem(prop, value) | 12 | instance.setItem(prop, value) |
12 | } | 13 | } |
13 | return true | 14 | return true |
14 | }, | 15 | }, |
15 | get: function (target, name: string | number) { | 16 | get: function (target, name: string | symbol | number) { |
16 | if (MemoryStorage.prototype.hasOwnProperty(name)) { | 17 | if (MemoryStorage.prototype.hasOwnProperty(name)) { |
17 | return instance[name] | 18 | // FIXME: symbol typing issue https://github.com/microsoft/TypeScript/issues/1863 |
19 | return instance[name as any] | ||
18 | } | 20 | } |
19 | if (valuesMap.has(name)) { | 21 | if (valuesMap.has(name)) { |
20 | return instance.getItem(name) | 22 | return instance.getItem(name) |
@@ -23,9 +25,8 @@ function proxify (instance: MemoryStorage) { | |||
23 | }) | 25 | }) |
24 | } | 26 | } |
25 | 27 | ||
26 | class MemoryStorage { | 28 | class MemoryStorage implements Storage { |
27 | [key: string]: any | 29 | [key: string]: any |
28 | [index: number]: string | ||
29 | 30 | ||
30 | getItem (key: any) { | 31 | getItem (key: any) { |
31 | const stringKey = String(key) | 32 | const stringKey = String(key) |