mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Redirecting to item edit page on the bitstream tab, instead of the item viewing page
This commit is contained in:
@@ -239,17 +239,17 @@ describe('EditBitstreamPageComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('when navigateToItemEditBitstreams is called, and the component has an itemId', () => {
|
describe('when navigateToItemEditBitstreams is called, and the component has an itemId', () => {
|
||||||
it('should redirect to the item edit path bitstream page', () => {
|
it('should redirect to the item edit page on the bitstreams tab with the itemId from the component', () => {
|
||||||
comp.itemId = 'some-uuid'
|
comp.itemId = 'some-uuid1'
|
||||||
|
comp.navigateToItemEditBitstreams();
|
||||||
|
expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditRoute('some-uuid1'), 'bitstreams']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
describe('when navigateToItemEditBitstreams is called, and the component does not have an itemId', () => {
|
||||||
|
it('should redirect to the item edit page on the bitstreams tab with the itemId from the bundle links ', () => {
|
||||||
|
comp.itemId = undefined;
|
||||||
comp.navigateToItemEditBitstreams();
|
comp.navigateToItemEditBitstreams();
|
||||||
expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditRoute('some-uuid'), 'bitstreams']);
|
expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditRoute('some-uuid'), 'bitstreams']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('when navigateToItemEditBitstreams is called, and the component does not have an itemId', () => {
|
|
||||||
it('should redirect to the item page', () => {
|
|
||||||
comp.itemId = undefined;
|
|
||||||
comp.navigateToItemEditBitstreams();
|
|
||||||
expect(routerStub.navigate).toHaveBeenCalledWith([getItemPageRoute('some-uuid')]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
@@ -507,7 +507,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
|||||||
this.bitstream.bundle.pipe(getFirstSucceededRemoteDataPayload(),
|
this.bitstream.bundle.pipe(getFirstSucceededRemoteDataPayload(),
|
||||||
mergeMap((bundle: Bundle) => bundle.item.pipe(getFirstSucceededRemoteDataPayload(), map((item: Item) => item.uuid))))
|
mergeMap((bundle: Bundle) => bundle.item.pipe(getFirstSucceededRemoteDataPayload(), map((item: Item) => item.uuid))))
|
||||||
.subscribe((item) => {
|
.subscribe((item) => {
|
||||||
this.router.navigate(([getItemPageRoute(item)]));
|
this.router.navigate(([getItemEditRoute(item), 'bitstreams']));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user