Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
PeerTube
Commits
be2df487
Verified
Commit
be2df487
authored
Jul 08, 2022
by
Chocobozzz
Browse files
Rename not fount page to error page
parent
553daacc
Changes
10
Hide whitespace changes
Inline
Side-by-side
client/src/app/+
page-not-found/page-not-found
-routing.module.ts
→
client/src/app/+
error-page/error-page
-routing.module.ts
View file @
be2df487
import
{
NgModule
}
from
'
@angular/core
'
import
{
RouterModule
,
Routes
}
from
'
@angular/router
'
import
{
PageNotFound
Component
}
from
'
./
page-not-found
.component
'
import
{
ErrorPage
Component
}
from
'
./
error-page
.component
'
import
{
MenuGuards
}
from
'
@app/core
'
const
pageNotFound
Routes
:
Routes
=
[
const
errorPage
Routes
:
Routes
=
[
{
path
:
''
,
component
:
PageNotFound
Component
,
component
:
ErrorPage
Component
,
canActivate
:
[
MenuGuards
.
close
(
true
)
],
canDeactivate
:
[
MenuGuards
.
open
(
true
)
],
data
:
{
...
...
@@ -18,7 +18,7 @@ const pageNotFoundRoutes: Routes = [
]
@
NgModule
({
imports
:
[
RouterModule
.
forChild
(
pageNotFound
Routes
)
],
imports
:
[
RouterModule
.
forChild
(
errorPage
Routes
)
],
exports
:
[
RouterModule
]
})
export
class
PageNotFound
RoutingModule
{}
export
class
ErrorPage
RoutingModule
{}
client/src/app/+
page-not-found/page-not-found
.component.html
→
client/src/app/+
error-page/error-page
.component.html
View file @
be2df487
...
...
@@ -31,7 +31,7 @@
<ng-container
*ngIf=
"type !== 'video'"
i18n
>
You might need to login to see the resource.
</ng-container>
</div>
<a
class=
"peertube-button-link orange-button mt-5"
i18n
routerLink=
"/login"
>
<a
class=
"peertube-button-
big-
link orange-button mt-5"
i18n
routerLink=
"/login"
>
Login
</a>
...
...
client/src/app/+
page-not-found/page-not-found
.component.scss
→
client/src/app/+
error-page/error-page
.component.scss
View file @
be2df487
...
...
@@ -35,18 +35,6 @@
width
:
400px
;
}
@media
screen
and
(
min-width
:
#{
breakpoint
(
lg
)
}
)
{
width
:
600px
;
}
@media
screen
and
(
min-width
:
#{
breakpoint
(
xl
)
}
)
{
width
:
700px
;
}
@media
screen
and
(
min-width
:
#{
breakpoint
(
xxl
)
}
)
{
width
:
800px
;
}
@media
screen
and
(
max-height
:
600px
)
{
padding-top
:
50px
;
...
...
client/src/app/+
page-not-found/page-not-found
.component.ts
→
client/src/app/+
error-page/error-page
.component.ts
View file @
be2df487
...
...
@@ -4,11 +4,11 @@ import { Router } from '@angular/router'
import
{
HttpStatusCode
}
from
'
@shared/models
'
@
Component
({
selector
:
'
my-
page-not-found
'
,
templateUrl
:
'
./
page-not-found
.component.html
'
,
styleUrls
:
[
'
./
page-not-found
.component.scss
'
]
selector
:
'
my-
error-page
'
,
templateUrl
:
'
./
error-page
.component.html
'
,
styleUrls
:
[
'
./
error-page
.component.scss
'
]
})
export
class
PageNotFound
Component
implements
OnInit
{
export
class
ErrorPage
Component
implements
OnInit
{
status
=
HttpStatusCode
.
NOT_FOUND_404
type
:
'
video
'
|
'
other
'
=
'
other
'
...
...
client/src/app/+
page-not-found/page-not-found
.module.ts
→
client/src/app/+
error-page/error-page
.module.ts
View file @
be2df487
import
{
CommonModule
}
from
'
@angular/common
'
import
{
NgModule
}
from
'
@angular/core
'
import
{
PageNotFound
RoutingModule
}
from
'
./
page-not-found
-routing.module
'
import
{
PageNotFound
Component
}
from
'
./
page-not-found
.component
'
import
{
ErrorPage
RoutingModule
}
from
'
./
error-page
-routing.module
'
import
{
ErrorPage
Component
}
from
'
./
error-page
.component
'
@
NgModule
({
imports
:
[
CommonModule
,
PageNotFound
RoutingModule
ErrorPage
RoutingModule
],
declarations
:
[
PageNotFound
Component
ErrorPage
Component
],
exports
:
[
PageNotFound
Component
ErrorPage
Component
],
providers
:
[]
})
export
class
PageNotFound
Module
{
}
export
class
ErrorPage
Module
{
}
client/src/app/app-routing.module.ts
View file @
be2df487
...
...
@@ -194,7 +194,7 @@ for (const locale of POSSIBLE_LOCALES) {
routes
.
push
({
path
:
'
**
'
,
loadChildren
:
()
=>
import
(
'
./+
page-not-found/page-not-found
.module
'
).
then
(
m
=>
m
.
PageNotFound
Module
)
loadChildren
:
()
=>
import
(
'
./+
error-page/error-page
.module
'
).
then
(
m
=>
m
.
ErrorPage
Module
)
})
@
NgModule
({
...
...
client/src/app/core/routing/redirect.service.ts
View file @
be2df487
...
...
@@ -46,7 +46,7 @@ export class RedirectService {
this
.
currentUrl
=
this
.
router
.
url
router
.
events
.
subscribe
(
event
=>
{
if
(
event
instanceof
NavigationEnd
||
event
instanceof
NavigationCancel
)
{
if
(
event
.
url
===
'
/404
'
)
return
if
(
[
'
/401
'
,
'
/404
'
].
includes
(
event
.
url
)
)
return
this
.
previousUrl
=
this
.
currentUrl
this
.
currentUrl
=
event
.
url
...
...
client/src/app/shared/shared-main/auth/auth-interceptor.service.ts
View file @
be2df487
...
...
@@ -62,7 +62,7 @@ export class AuthInterceptor implements HttpInterceptor {
}
private
handleNotAuthenticated
(
err
:
HttpErrorResponse
):
Observable
<
any
>
{
this
.
router
.
navigate
([
'
/40
4
'
],
{
state
:
{
obj
:
err
},
skipLocationChange
:
true
})
this
.
router
.
navigate
([
'
/40
1
'
],
{
state
:
{
obj
:
err
},
skipLocationChange
:
true
})
return
of
(
err
.
message
)
}
}
...
...
client/src/sass/class-helpers.scss
View file @
be2df487
...
...
@@ -27,10 +27,18 @@
@include
peertube-button
;
}
.peertube-button-big
{
@include
peertube-button-big
;
}
.peertube-button-link
{
@include
peertube-button-link
;
}
.peertube-button-big-link
{
@include
peertube-button-big-link
;
}
.orange-button
{
@include
orange-button
;
}
...
...
client/src/sass/include/_mixins.scss
View file @
be2df487
...
...
@@ -284,6 +284,13 @@
display
:
inline-block
;
}
@mixin
peertube-button-big-link
{
@include
disable-default-a-behaviour
;
@include
peertube-button-big
;
display
:
inline-block
;
}
@mixin
peertube-button-outline
{
@include
disable-default-a-behaviour
;
@include
peertube-button
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment