Fix browse-by pages sending unnecessary request to author index#5382
Conversation
nathanmlf
left a comment
There was a problem hiding this comment.
Hey @oscar-escire! Tested it on my side and everything seems to be working as expected. Great job!
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @oscar-escire ! This looks good to me and works based on my testing.
I think this impacts all recent major releases, so I'm flagging this for automatic backport. At a minimum, it'd be good to backport to 9.x if possible.
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-7_x
git worktree add -d .worktree/backport-5382-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-5382-to-dspace-7_x
git switch --create backport-5382-to-dspace-7_x
git cherry-pick -x 11ed6485a898815f97755f2ec05ab39b16338559 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-8_x
git worktree add -d .worktree/backport-5382-to-dspace-8_x origin/dspace-8_x
cd .worktree/backport-5382-to-dspace-8_x
git switch --create backport-5382-to-dspace-8_x
git cherry-pick -x 11ed6485a898815f97755f2ec05ab39b16338559 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-9_x
git worktree add -d .worktree/backport-5382-to-dspace-9_x origin/dspace-9_x
cd .worktree/backport-5382-to-dspace-9_x
git switch --create backport-5382-to-dspace-9_x
git cherry-pick -x 11ed6485a898815f97755f2ec05ab39b16338559 |
|
@oscar-escire : Unfortunately, this was unable to be auto-backported. If you are interested in seeing this also in 9.x, 8.x or 7.6.x, please create a backport PR against one (or more) of those branches. Otherwise, this fix will only be available in 10.0 |
|
@tdonohue: Sure, as soon as I have the PRs ready for each version, I'll send them over |
References
Description
Removes hardcoded default initialization to 'author' browse index that caused unnecessary failed requests when visiting browse-by pages on systems where the 'author' index is disabled.
Before this PR:
BrowseByMetadataComponentinitialized with a hardcoded request to 'author' browse index/api/discover/browses/author/entries(unnecessary and would fail if disabled)/api/discover/browses/title/entries)After this PR:
browseEntries$remains undefined until properly initializedInstructions for Reviewers
Expected behavior:
List of changes in this PR:
BrowseByMetadataComponent- the component now waits for route parameters before initializing browse requestsBrowseByDateComponent.ngOnInit()to properly use browse ID from route parameters instead of relying on parent's defaultBrowseByTitleComponent.ngOnInit()to properly use browse ID from route parameters instead of relying on parent's defaultBrowseByDateComponenttest spy to expect 'dateissued' instead of 'author'loading$properly initialized to show loading indicator while waiting for route parametersChecklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.