Skip to content

Unclickable title in search list fix#1061

Merged
tdonohue merged 3 commits intoDSpace:mainfrom
atmire:w2p-77472_unclickable-title-in-search-list
Mar 22, 2021
Merged

Unclickable title in search list fix#1061
tdonohue merged 3 commits intoDSpace:mainfrom
atmire:w2p-77472_unclickable-title-in-search-list

Conversation

@Raf-atmire
Copy link
Copy Markdown
Contributor

References

Description

This PR ensures that Items in the search lists will always have a clickable title.
This is done by altering the retrieval of the first occurrence of dc.title to the call to dsoNameService.getName(this.dso); This method will then provide us with the name of the DSO by calling dso.firstMetadataValue('dc.title') || dso.name || this.translateService.instant('dso.name.untitled'); and therefore, if a dc.title and a dso name don't exist, it'll return an "Untitled" String which is translatable

Instructions for Reviewers

List of changes in this PR:

  • Changed the retrieval of a dso's name in the search list from a dc.title metadata call to a more broad dsoNameService.getName call
  • Changed the dsoNameService.getName call to return an "Untitled" translatable String if a DSO doesn't have a title/name
  • Added tests for this behaviour

How to test this PR:

  • Setup this Angular branch with the api7.dspace.org as backend
  • Search for -dc.title:* in the search bar
  • Verify that Items are returned with an "Untitled" name instead of them being unclickable

Checklist

  • 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.
  • My PR passes TSLint validation using yarn run lint
  • My PR doesn't introduce circular dependencies
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new, third-party dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.

@lgtm-com
Copy link
Copy Markdown

lgtm-com Bot commented Mar 17, 2021

This pull request introduces 2 alerts when merging 91f11d6 into 1115c58 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@tdonohue tdonohue added this to the 7.0beta5 milestone Mar 17, 2021
@artlowel artlowel added bug e/4 Estimate in hours labels Mar 17, 2021
@tdonohue tdonohue self-requested a review March 18, 2021 15:26
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Mar 18, 2021
@LotteHofstede LotteHofstede force-pushed the w2p-77472_unclickable-title-in-search-list branch from b8deddf to c20a49e Compare March 18, 2021 16:58
@LotteHofstede LotteHofstede force-pushed the w2p-77472_unclickable-title-in-search-list branch from c20a49e to 3a0dc27 Compare March 18, 2021 17:02
Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks @Raf-atmire & @LotteHofstede ! I've tested & reviewed this. I've verified it works as described and fixes the problem.

@tdonohue tdonohue merged commit a9f553a into DSpace:main Mar 22, 2021
4science-it pushed a commit to 4Science/dspace-angular that referenced this pull request Nov 29, 2023
[CST-12624] updated the logic of the suggestion-targets feature.

Approved-by: Giuseppe Digilio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge bug e/4 Estimate in hours

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An item missing dc.title is not selectable in the user interface in certain contexts

4 participants