mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
74053: remove fdescribe + use consts for routing paths
This commit is contained in:
@@ -61,6 +61,12 @@ export function getUnauthorizedRoute() {
|
||||
return `/${UNAUTHORIZED_PATH}`;
|
||||
}
|
||||
|
||||
export const PAGE_NOT_FOUND_PATH = '404';
|
||||
|
||||
export function getPageNotFoundRoute() {
|
||||
return `/${PAGE_NOT_FOUND_PATH}`;
|
||||
}
|
||||
|
||||
export const INFO_MODULE_PATH = 'info';
|
||||
export function getInfoModulePath() {
|
||||
return `/${INFO_MODULE_PATH}`;
|
||||
|
@@ -24,7 +24,7 @@ import {
|
||||
createSuccessfulRemoteDataObject
|
||||
} from '../../shared/remote-data.utils';
|
||||
|
||||
fdescribe('Core Module - RxJS Operators', () => {
|
||||
describe('Core Module - RxJS Operators', () => {
|
||||
let scheduler: TestScheduler;
|
||||
let requestService: RequestService;
|
||||
const testRequestHref = 'https://rest.api/';
|
||||
|
@@ -13,7 +13,7 @@ import { MetadataField } from '../metadata/metadata-field.model';
|
||||
import { MetadataSchema } from '../metadata/metadata-schema.model';
|
||||
import { BrowseDefinition } from './browse-definition.model';
|
||||
import { DSpaceObject } from './dspace-object.model';
|
||||
import { getUnauthorizedRoute } from '../../app-routing-paths';
|
||||
import { getPageNotFoundRoute, getUnauthorizedRoute } from '../../app-routing-paths';
|
||||
import { getEndUserAgreementPath } from '../../info/info-routing-paths';
|
||||
|
||||
/**
|
||||
@@ -181,9 +181,9 @@ export const redirectOn404Or401 = (router: Router) =>
|
||||
tap((rd: RemoteData<T>) => {
|
||||
if (rd.hasFailed) {
|
||||
if (rd.error.statusCode === 404) {
|
||||
router.navigateByUrl('/404', {skipLocationChange: true});
|
||||
router.navigateByUrl(`/${getPageNotFoundRoute()}`, {skipLocationChange: true});
|
||||
} else if (rd.error.statusCode === 401) {
|
||||
router.navigateByUrl('/401', {skipLocationChange: true});
|
||||
router.navigateByUrl(`/${getUnauthorizedRoute()}`, {skipLocationChange: true});
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
Reference in New Issue
Block a user