[ACA-1992] Keep favorite libraries navigation under same path (#1474)

* [ACA-1992] Keep favorite libraries navigation under same path

* Fix unit test
This commit is contained in:
davidcanonieto
2020-05-20 13:32:31 +01:00
committed by GitHub
parent 7ffecc546c
commit 51b461f859
5 changed files with 43 additions and 5 deletions

View File

@@ -144,7 +144,10 @@ describe('FavoriteLibrariesComponent', () => {
spyOn(router, 'navigate').and.stub();
component.navigateTo({ entry: { guid: 'guid' } } as any);
expect(router.navigate).toHaveBeenCalledWith(['libraries', 'libraryId']);
expect(router.navigate).toHaveBeenCalledWith([
'favorite/libraries',
'libraryId'
]);
});
});

View File

@@ -82,7 +82,9 @@ export class FavoriteLibrariesComponent extends PageComponent
navigateTo(node: SiteEntry) {
if (node && node.entry && node.entry.guid) {
this.store.dispatch(new NavigateLibraryAction(node.entry.guid));
this.store.dispatch(
new NavigateLibraryAction(node.entry.guid, 'favorite/libraries')
);
}
}