Skip to content

Commit 70b456d

Browse files
authored
Merge pull request DSpace#1493 from DSpace/revert-1407-DSC-287-Show-an-error-page-if-the-REST-API-is-not-available
Revert "Show an error page if the rest api is not available"
2 parents 001ba43 + e61de06 commit 70b456d

13 files changed

Lines changed: 15 additions & 234 deletions

src/app/app-routing-paths.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ export function getPageNotFoundRoute() {
8989
return `/${PAGE_NOT_FOUND_PATH}`;
9090
}
9191

92-
export const INTERNAL_SERVER_ERROR = '500';
93-
94-
export function getPageInternalServerErrorRoute() {
95-
return `/${INTERNAL_SERVER_ERROR}`;
96-
}
97-
9892
export const INFO_MODULE_PATH = 'info';
9993
export function getInfoModulePath() {
10094
return `/${INFO_MODULE_PATH}`;

src/app/app-routing.module.ts

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ import {
1111
FORBIDDEN_PATH,
1212
FORGOT_PASSWORD_PATH,
1313
INFO_MODULE_PATH,
14-
INTERNAL_SERVER_ERROR,
15-
LEGACY_BITSTREAM_MODULE_PATH,
1614
PROFILE_MODULE_PATH,
1715
REGISTER_PATH,
18-
REQUEST_COPY_MODULE_PATH,
1916
WORKFLOW_ITEM_MODULE_PATH,
17+
LEGACY_BITSTREAM_MODULE_PATH, REQUEST_COPY_MODULE_PATH,
2018
} from './app-routing-paths';
2119
import { COLLECTION_MODULE_PATH } from './collection-page/collection-page-routing-paths';
2220
import { COMMUNITY_MODULE_PATH } from './community-page/community-page-routing-paths';
@@ -28,25 +26,14 @@ import { SiteRegisterGuard } from './core/data/feature-authorization/feature-aut
2826
import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.component';
2927
import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component';
3028
import { GroupAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
31-
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
32-
import { ServerCheckGuard } from './core/server-check/server-check.guard';
3329

3430
@NgModule({
3531
imports: [
36-
RouterModule.forRoot([
37-
{ path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent },
38-
{
39-
path: '',
40-
canActivate: [AuthBlockingGuard],
41-
canActivateChild: [ServerCheckGuard],
32+
RouterModule.forRoot([{
33+
path: '', canActivate: [AuthBlockingGuard],
4234
children: [
4335
{ path: '', redirectTo: '/home', pathMatch: 'full' },
44-
{
45-
path: 'reload/:rnd',
46-
component: ThemedPageNotFoundComponent,
47-
pathMatch: 'full',
48-
canActivate: [ReloadGuard]
49-
},
36+
{ path: 'reload/:rnd', component: ThemedPageNotFoundComponent, pathMatch: 'full', canActivate: [ReloadGuard] },
5037
{
5138
path: 'home',
5239
loadChildren: () => import('./home-page/home-page.module')
@@ -102,8 +89,7 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
10289
.then((m) => m.ItemPageModule),
10390
canActivate: [EndUserAgreementCurrentUserGuard]
10491
},
105-
{
106-
path: 'entities/:entity-type',
92+
{ path: 'entities/:entity-type',
10793
loadChildren: () => import('./item-page/item-page.module')
10894
.then((m) => m.ItemPageModule),
10995
canActivate: [EndUserAgreementCurrentUserGuard]
@@ -147,12 +133,12 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
147133
{
148134
path: 'login',
149135
loadChildren: () => import('./login-page/login-page.module')
150-
.then((m) => m.LoginPageModule)
136+
.then((m) => m.LoginPageModule),
151137
},
152138
{
153139
path: 'logout',
154140
loadChildren: () => import('./logout-page/logout-page.module')
155-
.then((m) => m.LogoutPageModule)
141+
.then((m) => m.LogoutPageModule),
156142
},
157143
{
158144
path: 'submit',
@@ -192,7 +178,7 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
192178
},
193179
{
194180
path: INFO_MODULE_PATH,
195-
loadChildren: () => import('./info/info.module').then((m) => m.InfoModule)
181+
loadChildren: () => import('./info/info.module').then((m) => m.InfoModule),
196182
},
197183
{
198184
path: REQUEST_COPY_MODULE_PATH,
@@ -206,18 +192,17 @@ import { ServerCheckGuard } from './core/server-check/server-check.guard';
206192
{
207193
path: 'statistics',
208194
loadChildren: () => import('./statistics-page/statistics-page-routing.module')
209-
.then((m) => m.StatisticsPageRoutingModule)
195+
.then((m) => m.StatisticsPageRoutingModule),
210196
},
211197
{
212198
path: ACCESS_CONTROL_MODULE_PATH,
213199
loadChildren: () => import('./access-control/access-control.module').then((m) => m.AccessControlModule),
214200
canActivate: [GroupAdministratorGuard],
215201
},
216202
{ path: '**', pathMatch: 'full', component: ThemedPageNotFoundComponent },
217-
]
218-
}
219-
], {
220-
onSameUrlNavigation: 'reload',
203+
]}
204+
],{
205+
onSameUrlNavigation: 'reload',
221206
})
222207
],
223208
exports: [RouterModule],

src/app/app.module.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ import { ThemedFooterComponent } from './footer/themed-footer.component';
5454
import { ThemedBreadcrumbsComponent } from './breadcrumbs/themed-breadcrumbs.component';
5555
import { ThemedHeaderNavbarWrapperComponent } from './header-nav-wrapper/themed-header-navbar-wrapper.component';
5656
import { IdleModalComponent } from './shared/idle-modal/idle-modal.component';
57-
import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component';
58-
import { PageInternalServerErrorComponent } from './page-internal-server-error/page-internal-server-error.component';
5957

6058
import { AppConfig, APP_CONFIG } from '../config/app-config.interface';
6159

@@ -183,9 +181,7 @@ const DECLARATIONS = [
183181
ThemedBreadcrumbsComponent,
184182
ForbiddenComponent,
185183
ThemedForbiddenComponent,
186-
IdleModalComponent,
187-
ThemedPageInternalServerErrorComponent,
188-
PageInternalServerErrorComponent
184+
IdleModalComponent
189185
];
190186

191187
const EXPORTS = [

src/app/core/data/root-data.service.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,5 @@ export class RootDataService {
106106
findAllByHref(href: string | Observable<string>, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<Root>[]): Observable<RemoteData<PaginatedList<Root>>> {
107107
return this.dataService.findAllByHref(href, findListOptions, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
108108
}
109-
110-
/**
111-
* Set to sale the root endpoint cache hit
112-
*/
113-
invalidateRootCache() {
114-
this.requestService.setStaleByHrefSubstring('server/api');
115-
}
116109
}
117110
/* tslint:enable:max-classes-per-file */

src/app/core/server-check/server-check.guard.spec.ts

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/app/core/server-check/server-check.guard.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/app/core/services/server-response.service.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,4 @@ export class ServerResponseService {
3131
setNotFound(message = 'Not found'): this {
3232
return this.setStatus(404, message);
3333
}
34-
35-
setInternalServerError(message = 'Internal Server Error'): this {
36-
return this.setStatus(500, message);
37-
}
3834
}

src/app/page-internal-server-error/page-internal-server-error.component.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/app/page-internal-server-error/page-internal-server-error.component.scss

Whitespace-only changes.

src/app/page-internal-server-error/page-internal-server-error.component.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)