mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
CST-5309 changes for error page component
This commit is contained in:

committed by
Luca Giamminonni

parent
43f4ff7cde
commit
a9fcdce960
@@ -107,6 +107,8 @@ export function getPageInternalServerErrorRoute() {
|
|||||||
return `/${INTERNAL_SERVER_ERROR}`;
|
return `/${INTERNAL_SERVER_ERROR}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ERROR_PAGE = 'error'
|
||||||
|
|
||||||
export const INFO_MODULE_PATH = 'info';
|
export const INFO_MODULE_PATH = 'info';
|
||||||
export function getInfoModulePath() {
|
export function getInfoModulePath() {
|
||||||
return `/${INFO_MODULE_PATH}`;
|
return `/${INFO_MODULE_PATH}`;
|
||||||
|
@@ -8,6 +8,7 @@ import {
|
|||||||
ACCESS_CONTROL_MODULE_PATH,
|
ACCESS_CONTROL_MODULE_PATH,
|
||||||
ADMIN_MODULE_PATH,
|
ADMIN_MODULE_PATH,
|
||||||
BITSTREAM_MODULE_PATH,
|
BITSTREAM_MODULE_PATH,
|
||||||
|
ERROR_PAGE,
|
||||||
FORBIDDEN_PATH,
|
FORBIDDEN_PATH,
|
||||||
FORGOT_PASSWORD_PATH,
|
FORGOT_PASSWORD_PATH,
|
||||||
INFO_MODULE_PATH,
|
INFO_MODULE_PATH,
|
||||||
@@ -31,11 +32,13 @@ import { GroupAdministratorGuard } from './core/data/feature-authorization/featu
|
|||||||
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
|
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
|
||||||
import { ServerCheckGuard } from './core/server-check/server-check.guard';
|
import { ServerCheckGuard } from './core/server-check/server-check.guard';
|
||||||
import { MenuResolver } from './menu.resolver';
|
import { MenuResolver } from './menu.resolver';
|
||||||
|
import { ThemedPageErrorComponent } from './page-error/themed-page-error.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forRoot([
|
RouterModule.forRoot([
|
||||||
{ path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent },
|
{ path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent },
|
||||||
|
{ path: ERROR_PAGE , component: ThemedPageErrorComponent },
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
canActivate: [AuthBlockingGuard],
|
canActivate: [AuthBlockingGuard],
|
||||||
|
10
src/app/page-error/page-error.component.html
Normal file
10
src/app/page-error/page-error.component.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<div class="page-internal-server-error container">
|
||||||
|
<h1>{{status}}</h1>
|
||||||
|
<h2><small>{{"error-page.description." + status | translate}}</small></h2>
|
||||||
|
<br/>
|
||||||
|
<p>{{"error-page." + code | translate}}</p>
|
||||||
|
<br/>
|
||||||
|
<p class="text-center">
|
||||||
|
<a href="/home" class="btn btn-primary">{{ status + ".link.home-page" | translate}}</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
0
src/app/page-error/page-error.component.scss
Normal file
0
src/app/page-error/page-error.component.scss
Normal file
27
src/app/page-error/page-error.component.ts
Normal file
27
src/app/page-error/page-error.component.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This component representing the `PageError` DSpace page.
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-page-error',
|
||||||
|
styleUrls: ['./page-error.component.scss'],
|
||||||
|
templateUrl: './page-error.component.html',
|
||||||
|
changeDetection: ChangeDetectionStrategy.Default
|
||||||
|
})
|
||||||
|
export class PageErrorComponent {
|
||||||
|
status: number;
|
||||||
|
code: string;
|
||||||
|
/**
|
||||||
|
* Initialize instance variables
|
||||||
|
*
|
||||||
|
* @param {ActivatedRoute} activatedRoute
|
||||||
|
*/
|
||||||
|
constructor(private activatedRoute: ActivatedRoute) {
|
||||||
|
this.activatedRoute.queryParams.subscribe((params) => {
|
||||||
|
this.status = params['status'];
|
||||||
|
this.code = params['code'];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
26
src/app/page-error/themed-page-error.component.ts
Normal file
26
src/app/page-error/themed-page-error.component.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ThemedComponent } from '../shared/theme-support/themed.component';
|
||||||
|
import { PageErrorComponent } from './page-error.component';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Themed wrapper for PageErrorComponent
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-search-page',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../shared/theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedPageErrorComponent extends ThemedComponent<PageErrorComponent> {
|
||||||
|
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'PageErrorComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../themes/${themeName}/app/page-error/page-error.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import(`src/app/page-error/page-error.component`);
|
||||||
|
}
|
||||||
|
}
|
@@ -40,6 +40,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
PageInternalServerErrorComponent
|
PageInternalServerErrorComponent
|
||||||
} from './page-internal-server-error/page-internal-server-error.component';
|
} from './page-internal-server-error/page-internal-server-error.component';
|
||||||
|
import { ThemedPageErrorComponent } from './page-error/themed-page-error.component';
|
||||||
|
import { PageErrorComponent } from './page-error/page-error.component';
|
||||||
|
|
||||||
const IMPORTS = [
|
const IMPORTS = [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
@@ -74,7 +76,9 @@ const DECLARATIONS = [
|
|||||||
ThemedForbiddenComponent,
|
ThemedForbiddenComponent,
|
||||||
IdleModalComponent,
|
IdleModalComponent,
|
||||||
ThemedPageInternalServerErrorComponent,
|
ThemedPageInternalServerErrorComponent,
|
||||||
PageInternalServerErrorComponent
|
PageInternalServerErrorComponent,
|
||||||
|
ThemedPageErrorComponent,
|
||||||
|
PageErrorComponent
|
||||||
];
|
];
|
||||||
|
|
||||||
const EXPORTS = [
|
const EXPORTS = [
|
||||||
|
@@ -27,6 +27,16 @@
|
|||||||
|
|
||||||
"404.page-not-found": "page not found",
|
"404.page-not-found": "page not found",
|
||||||
|
|
||||||
|
"error-page.description.401": "unauthorized",
|
||||||
|
|
||||||
|
"error-page.description.403": "forbidden",
|
||||||
|
|
||||||
|
"error-page.description.500": "Service Unavailable",
|
||||||
|
|
||||||
|
"error-page.description.404": "page not found",
|
||||||
|
|
||||||
|
"error-page.orcid.generic-error": "An error occurred during login via ORCID. Make sure you have shared your ORCID account email address with DSpace. If the error persists, contact the administrator",
|
||||||
|
|
||||||
"access-status.embargo.listelement.badge": "Embargo",
|
"access-status.embargo.listelement.badge": "Embargo",
|
||||||
|
|
||||||
"access-status.metadata.only.listelement.badge": "Metadata only",
|
"access-status.metadata.only.listelement.badge": "Metadata only",
|
||||||
|
Reference in New Issue
Block a user