Skip to content

Private/Withdrawn badges for items everywhere#972

Merged
tdonohue merged 4 commits intoDSpace:mainfrom
atmire:Private-withdrawn-badges-for-items-everywhere
Jan 4, 2021
Merged

Private/Withdrawn badges for items everywhere#972
tdonohue merged 4 commits intoDSpace:mainfrom
atmire:Private-withdrawn-badges-for-items-everywhere

Conversation

@Atmire-Kristof
Copy link
Copy Markdown
Contributor

References

This PR fixes #947

Description

This PR refactors the badges shown for withdrawn and private items on the administrative search to be shown on every listable component so that they're visible on other places as well (e.g. regular search, collection pages...)
It also adds an alert on top of simple and full item pages mentioning whether or not the item is private or withdrawn.

Instructions for Reviewers

Changes made:

  • Moved badges template to ListableObjectComponentLoaderComponent.
    -- This component will determine whether or not the badges should be displayed (ViewMode is set to a list and the object contains isDiscoverable and/or isWithdrawn properties)
    -- The badges template is passed on to the loaded list component, which knows how to deal with the content (e.g. a grid element will place the badge in the top-left corner of the thumbnail)
  • Added ItemAlertsComponent, displaying warning alerts for private and withdrawn items and rendered on top of simple and full item pages
  • Added/Modified test cases reflecting these changes

How to test:

  • Anonymous users should never see these badges or alerts, as they don't have the rights to view these items
  • Log in as an administrator and visit administrative search, regular search and collection pages and verify the badges are visible for private and withdrawn items. Also verify their position is on top of the element for lists and top-left within the thumbnails for grids.
  • Log in as an administrator and visit some of these item pages (simple & full) and verify an alert is displayed on top of the page mentioning the item being private or withdrawn.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • 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.

…-everywhere

Conflicts:
	src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts
	src/app/shared/shared.module.ts
@tdonohue tdonohue self-requested a review December 17, 2020 15:54
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Dec 17, 2020
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.

👍 Looks good. I've tested it as well and it works as described. I now see private/withdrawn label in normal browsing searching (when logged in as an Admin obviously). Additionally, there's now an alert on the item page for withdrawn/private items. Thanks @Atmire-Kristof !

@tdonohue tdonohue added this to the 7.0beta5 milestone Jan 4, 2021
@tdonohue tdonohue merged commit 8530357 into DSpace:main Jan 4, 2021
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Highlight withdrawn Items in collections

3 participants