dspace-angular
dspace-angular copied to clipboard
Fixed ItemSearchResultListElementComponent not fully themable
References
- Fixes #2511
Description
The ItemListElementComponent previously used the ItemSearchResultListElementComponent selector directly in its HTML, instead of using the ListableObjectComponentLoaderComponent. Because of this the base theme is always used instead of the correct one.
Instructions for Reviewers
List of changes in this PR:
- Updated
ItemListElementComponentto use theListableObjectComponentLoaderComponent. - Created
ItemListElementComponent#transformItemToItemSearchResultto convert anItemto anItemSearchResult.
Guidance for how to test or review this PR:
- Theme the
ItemSearchResultListElementComponentin your theme (or use thecustomtheme, but don't forget to uncomment the theme insrc/themes/eager-themes.module.ts) - Verify that with this PR the
ItemSearchResultListElementComponentin the browse by pages is now also correctly themed
Checklist
- [x] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
- [x] My PR passes ESLint validation using
yarn lint - [x] My PR doesn't introduce circular dependencies (verified via
yarn check-circ-deps) - [x] My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
- [x] My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
- [x] If my PR includes new libraries/dependencies (in
package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation. - [x] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
- [x] If my PR fixes an issue ticket, I've linked them together.
Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!
Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!
Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!
Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!
Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!
@tdonohue: I merged the latest main branch and the error was automatically fixed, so this was probably because of a recent change on main
@alexandrevryghem : This appears to be failing specs at this time. Once that's resolved, I can retest. Here's the error:
FAILED TESTS:
ItemListElementComponent
when the publication is rendered
✖ should contain a PublicationListElementComponent
Chrome Headless 124.0.6367.60 (Linux x86_64)
TypeError: Cannot read properties of undefined (reading 'getRenderTypes')
at ListableObjectComponentLoaderComponent.getComponent (src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts:131:51)
at ListableObjectComponentLoaderComponent.instantiateComponent (src/app/shared/abstract-component-loader/abstract-component-loader.component.ts:112:51)
at ListableObjectComponentLoaderComponent.instantiateComponent (src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts:114:11)
at ListableObjectComponentLoaderComponent.call [as ngOnInit] (src/app/shared/abstract-component-loader/abstract-component-loader.component.ts:83:10)
at callHookInternal (node_modules/@angular/core/fesm2022/core.mjs:5136:14)
at callHook (node_modules/@angular/core/fesm2022/core.mjs:5163:13)
at callHooks (node_modules/@angular/core/fesm2022/core.mjs:5118:17)
at executeInitAndCheckHooks (node_modules/@angular/core/fesm2022/core.mjs:5068:9)
at refreshView (node_modules/@angular/core/fesm2022/core.mjs:12806:21)
at detectChangesInView$1 (node_modules/@angular/core/fesm2022/core.mjs:13015:9)
Backport failed for dspace-7_x, because it was unable to cherry-pick the commit(s).
Please cherry-pick the changes locally and resolve any conflicts.
git fetch origin dspace-7_x
git worktree add -d .worktree/backport-2651-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-2651-to-dspace-7_x
git switch --create backport-2651-to-dspace-7_x
git cherry-pick -x d00fc5d9d300ae85cdb3ae82271650d04d48d774 04cf1419eaaa440e94927687bc54154f0dcd6aa5 da320b5fbc52fdc2facc67a55cbd129ed423545e
It looks like the port to 7.x failed. If we want to port this to 7.x, that'd need to be in a separate PR. That said, I'm OK with this also just being an 8.0 change.