75939: Encode and lowercase entity type url

This commit is contained in:
Kristof De Langhe
2021-01-22 17:07:15 +01:00
parent 1d9d174f87
commit 694d45fd2c
2 changed files with 2 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ export function getItemEditRoute(item: Item) {
export function getEntityPageRoute(entityType: string, itemId: string) { export function getEntityPageRoute(entityType: string, itemId: string) {
if (isNotEmpty(entityType)) { if (isNotEmpty(entityType)) {
return new URLCombiner('/entities', entityType, itemId).toString(); return new URLCombiner('/entities', encodeURIComponent(entityType.toLowerCase()), itemId).toString();
} else { } else {
return new URLCombiner(getItemModuleRoute(), itemId).toString(); return new URLCombiner(getItemModuleRoute(), itemId).toString();
} }

View File

@@ -132,7 +132,7 @@ describe('DsoRedirectDataService', () => {
redir.subscribe(); redir.subscribe();
scheduler.schedule(() => redir); scheduler.schedule(() => redir);
scheduler.flush(); scheduler.flush();
expect(router.navigate).toHaveBeenCalledWith(['/entities/Publication/' + remoteData.payload.uuid]); expect(router.navigate).toHaveBeenCalledWith(['/entities/publication/' + remoteData.payload.uuid]);
}); });
it('should navigate to collections route', () => { it('should navigate to collections route', () => {