diff options
Diffstat (limited to 'client/src/app')
6 files changed, 40 insertions, 10 deletions
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 1b2820810..f048edec4 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -15,7 +15,7 @@ import { VideoDownloadComponent } from '@app/shared/shared-video-miniature' | |||
15 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' | 15 | import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' |
16 | import { MetaService } from '@ngx-meta/core' | 16 | import { MetaService } from '@ngx-meta/core' |
17 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' | 17 | import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' |
18 | import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models' | 18 | import { ServerConfig, ServerErrorCode, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models' |
19 | import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage' | 19 | import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage' |
20 | import { | 20 | import { |
21 | CustomizationOptions, | 21 | CustomizationOptions, |
@@ -361,7 +361,24 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
361 | ]) | 361 | ]) |
362 | .pipe( | 362 | .pipe( |
363 | // If 401, the video is private or blocked so redirect to 404 | 363 | // If 401, the video is private or blocked so redirect to 404 |
364 | catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 401, 403, 404 ])) | 364 | catchError(err => { |
365 | if (err.body.errorCode === ServerErrorCode.DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS && err.body.originUrl) { | ||
366 | const search = window.location.search | ||
367 | let originUrl = err.body.originUrl | ||
368 | if (search) originUrl += search | ||
369 | |||
370 | this.confirmService.confirm( | ||
371 | $localize`This video is not available on this instance. Do you want to be redirected on the origin instance: <a href="${originUrl}">${originUrl}</a>?`, | ||
372 | $localize`Redirection` | ||
373 | ).then(res => { | ||
374 | if (res === false) return this.restExtractor.redirectTo404IfNotFound(err, [ 400, 401, 403, 404 ]) | ||
375 | |||
376 | return window.location.href = originUrl | ||
377 | }) | ||
378 | } | ||
379 | |||
380 | return this.restExtractor.redirectTo404IfNotFound(err, [ 400, 401, 403, 404 ]) | ||
381 | }) | ||
365 | ) | 382 | ) |
366 | .subscribe(([ video, captionsResult ]) => { | 383 | .subscribe(([ video, captionsResult ]) => { |
367 | const queryParams = this.route.snapshot.queryParams | 384 | const queryParams = this.route.snapshot.queryParams |
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index a39be17dc..d3cdcefea 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' | 2 | import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' |
3 | import { AppComponent } from '@app/app.component' | ||
4 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' | 3 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' |
5 | import { MenuGuards } from '@app/core/routing/menu-guard.service' | 4 | import { MenuGuards } from '@app/core/routing/menu-guard.service' |
6 | import { PreloadSelectedModulesList } from './core' | 5 | import { PreloadSelectedModulesList } from './core' |
7 | import { EmptyComponent } from './empty.component' | 6 | import { EmptyComponent } from './empty.component' |
7 | import { POSSIBLE_LOCALES } from '@shared/core-utils/i18n' | ||
8 | 8 | ||
9 | const routes: Routes = [ | 9 | const routes: Routes = [ |
10 | { | 10 | { |
@@ -56,13 +56,22 @@ const routes: Routes = [ | |||
56 | { | 56 | { |
57 | path: '', | 57 | path: '', |
58 | component: EmptyComponent // Avoid 404, app component will redirect dynamically | 58 | component: EmptyComponent // Avoid 404, app component will redirect dynamically |
59 | }, | ||
60 | { | ||
61 | path: '**', | ||
62 | loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) | ||
63 | } | 59 | } |
64 | ] | 60 | ] |
65 | 61 | ||
62 | // Avoid 404 when changing language | ||
63 | for (const locale of POSSIBLE_LOCALES) { | ||
64 | routes.push({ | ||
65 | path: locale, | ||
66 | component: EmptyComponent | ||
67 | }) | ||
68 | } | ||
69 | |||
70 | routes.push({ | ||
71 | path: '**', | ||
72 | loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) | ||
73 | }) | ||
74 | |||
66 | @NgModule({ | 75 | @NgModule({ |
67 | imports: [ | 76 | imports: [ |
68 | RouterModule.forRoot(routes, { | 77 | RouterModule.forRoot(routes, { |
diff --git a/client/src/app/header/search-typeahead.component.scss b/client/src/app/header/search-typeahead.component.scss index 87e8b8c70..f8d68e986 100644 --- a/client/src/app/header/search-typeahead.component.scss +++ b/client/src/app/header/search-typeahead.component.scss | |||
@@ -28,7 +28,7 @@ | |||
28 | .jump-to-suggestions { | 28 | .jump-to-suggestions { |
29 | top: 100%; | 29 | top: 100%; |
30 | left: 0; | 30 | left: 0; |
31 | z-index: z(typeahead); | 31 | z-index: z('search-typeahead'); |
32 | width: 100%; | 32 | width: 100%; |
33 | } | 33 | } |
34 | 34 | ||
diff --git a/client/src/app/menu/menu.component.scss b/client/src/app/menu/menu.component.scss index 407d79725..975604055 100644 --- a/client/src/app/menu/menu.component.scss +++ b/client/src/app/menu/menu.component.scss | |||
@@ -241,6 +241,10 @@ menu { | |||
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | .dropdown { | ||
245 | z-index: #{z('menu') + 1} !important; | ||
246 | } | ||
247 | |||
244 | .dropdown-menu { | 248 | .dropdown-menu { |
245 | width: calc(100% + 40px); | 249 | width: calc(100% + 40px); |
246 | } | 250 | } |
diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts index cc933db0d..20be94d6e 100644 --- a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts +++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.ts | |||
@@ -363,7 +363,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV | |||
363 | label: $localize`Block video`, | 363 | label: $localize`Block video`, |
364 | isDisplayed: abuse => abuse.video && !abuse.video.deleted && !abuse.video.blacklisted, | 364 | isDisplayed: abuse => abuse.video && !abuse.video.deleted && !abuse.video.blacklisted, |
365 | handler: abuse => { | 365 | handler: abuse => { |
366 | this.videoBlocklistService.blockVideo(abuse.video.id, undefined, true) | 366 | this.videoBlocklistService.blockVideo(abuse.video.id, undefined, abuse.video.channel.isLocal) |
367 | .subscribe( | 367 | .subscribe( |
368 | () => { | 368 | () => { |
369 | this.notifier.success($localize`Video blocked.`) | 369 | this.notifier.success($localize`Video blocked.`) |
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html index 473fdc102..87ab68b87 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html +++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | <my-edit-button *ngIf="owned && touchScreenEditButton" [routerLink]="[ '/my-account', 'video-playlists', playlist.uuid ]"></my-edit-button> | 39 | <my-edit-button *ngIf="owned && touchScreenEditButton" [routerLink]="[ '/my-account', 'video-playlists', playlist.uuid ]"></my-edit-button> |
40 | 40 | ||
41 | <div *ngIf="owned" class="more" ngbDropdown #moreDropdown="ngbDropdown" placement="bottom auto" | 41 | <div *ngIf="owned" class="more" ngbDropdown #moreDropdown="ngbDropdown" placement="left auto" |
42 | (openChange)="onDropdownOpenChange()" autoClose="outside" | 42 | (openChange)="onDropdownOpenChange()" autoClose="outside" |
43 | > | 43 | > |
44 | <my-global-icon iconName="more-vertical" ngbDropdownToggle role="button" class="icon-more" (click)="$event.preventDefault()"></my-global-icon> | 44 | <my-global-icon iconName="more-vertical" ngbDropdownToggle role="button" class="icon-more" (click)="$event.preventDefault()"></my-global-icon> |