Files
dspace-angular/src/app/app-routing-paths.ts
Kristof De Langhe a0759098ea Merge branch 'w2p-72699_Hard-redirect-after-log-in' into w2p-72541_User-agreement-and-Privacy-statement
Conflicts:
	src/app/+collection-page/collection-page-routing.module.ts
	src/app/+community-page/community-page-routing.module.ts
	src/app/+item-page/item-page-routing.module.ts
	src/app/+workflowitems-edit-page/workflowitems-edit-page-routing.module.ts
	src/app/app-routing.module.ts
	src/app/core/shared/operators.ts
2020-09-03 16:06:59 +02:00

68 lines
1.8 KiB
TypeScript

import { DSpaceObject } from './core/shared/dspace-object.model';
import { Community } from './core/shared/community.model';
import { Collection } from './core/shared/collection.model';
import { Item } from './core/shared/item.model';
import { getCommunityPageRoute } from './+community-page/community-page-routing-paths';
import { getCollectionPageRoute } from './+collection-page/collection-page-routing-paths';
import { getItemPageRoute } from './+item-page/item-page-routing-paths';
export const BITSTREAM_MODULE_PATH = 'bitstreams';
export function getBitstreamModuleRoute() {
return `/${BITSTREAM_MODULE_PATH}`;
}
export const ADMIN_MODULE_PATH = 'admin';
export function getAdminModuleRoute() {
return `/${ADMIN_MODULE_PATH}`;
}
export const PROFILE_MODULE_PATH = 'profile';
export function getProfileModuleRoute() {
return `/${PROFILE_MODULE_PATH}`;
}
export const REGISTER_PATH = 'register';
export function getRegisterRoute() {
return `/${REGISTER_PATH}`;
}
export const FORGOT_PASSWORD_PATH = 'forgot';
export function getForgotPasswordRoute() {
return `/${FORGOT_PASSWORD_PATH}`;
}
export const WORKFLOW_ITEM_MODULE_PATH = 'workflowitems';
export function getWorkflowItemModuleRoute() {
return `/${WORKFLOW_ITEM_MODULE_PATH}`;
}
export function getDSORoute(dso: DSpaceObject): string {
switch ((dso as any).type) {
case Community.type.value:
return getCommunityPageRoute(dso.uuid);
case Collection.type.value:
return getCollectionPageRoute(dso.uuid);
case Item.type.value:
return getItemPageRoute(dso.uuid);
}
}
export const UNAUTHORIZED_PATH = 'unauthorized';
export function getUnauthorizedRoute() {
return `/${UNAUTHORIZED_PATH}`;
}
export const INFO_MODULE_PATH = 'info';
export function getInfoModulePath() {
return `/${INFO_MODULE_PATH}`;
}