dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Fixed ItemSearchResultListElementComponent not fully themable

Open alexandrevryghem opened this issue 1 year ago • 4 comments

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 ItemListElementComponent to use the ListableObjectComponentLoaderComponent.
  • Created ItemListElementComponent#transformItemToItemSearchResult to convert an Item to an ItemSearchResult.

Guidance for how to test or review this PR:

  • Theme the ItemSearchResultListElementComponent in your theme (or use the custom theme, but don't forget to uncomment the theme in src/themes/eager-themes.module.ts)
  • Verify that with this PR the ItemSearchResultListElementComponent in 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.

alexandrevryghem avatar Nov 18 '23 10:11 alexandrevryghem

Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Feb 09 '24 21:02 github-actions[bot]

Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Mar 08 '24 15:03 github-actions[bot]

Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Mar 20 '24 14:03 github-actions[bot]

Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Apr 03 '24 19:04 github-actions[bot]

Hi @alexandrevryghem, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!

github-actions[bot] avatar Apr 15 '24 20:04 github-actions[bot]

@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 avatar Apr 30 '24 19:04 alexandrevryghem

@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)

tdonohue avatar May 01 '24 17:05 tdonohue

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

dspace-bot avatar May 03 '24 19:05 dspace-bot

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.

tdonohue avatar May 03 '24 19:05 tdonohue