Skip to content

Displaying Recent Submissions on the homepage#1801

Merged
tdonohue merged 4 commits intoDSpace:mainfrom
GauravD2t:main
Sep 15, 2022
Merged

Displaying Recent Submissions on the homepage#1801
tdonohue merged 4 commits intoDSpace:mainfrom
GauravD2t:main

Conversation

@GauravD2t
Copy link
Copy Markdown
Contributor

References

#667

Description

Displaying Recent Submissions on the Repository's homepage with option of configuring number of items required to be displayed.

Instructions for Reviewers

Update the "rpp" variable in the config.example.yml with the item count that needs to be displayed in the Recent Submission section.
If you do not want to display any item under the Recent Submission section, keep the "rpp" count = 0.
Restart the server for the change to take effect, and no need to re-build the application.
Home page will show the Recent Submission section below the community list with the latest items submitted.
Upon clicking the Load more button, users will be redirected to the search results page, and items will list in descending order based on the submission date.
If there is no item submitted in the repository or rpp = 0, then Recent Submission should not appear.

Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.

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.

@tdonohue tdonohue added component: Discovery related to discovery search or browse system new feature labels Aug 31, 2022
@tdonohue
Copy link
Copy Markdown
Member

@GauravD2t : Thanks for recreating this! I'll add it to the 7.4 review board.

@artlowel and @MarieVerdonck : Adding you as potential reviews since you both helped review #1632, and this is an updated replacement for that PR.

Copy link
Copy Markdown
Contributor

@MarieVerdonck MarieVerdonck 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 to me :)

Also tested can override default config in config.(dev/prod).yml; e.g.

homePage:
  recentSubmissionsRpp: 20
  recentSubmissionsSortField: 'dc.date.issued'

@tdonohue tdonohue self-requested a review September 8, 2022 15:01
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.

@GauravD2t : Overall, this works and the code looks good. However, I found a bug & I have a minor request.

  1. First, I discovered there's no way to turn this feature off (e.g. if you don't want to display recent submissions on the homepage). I was expecting that if I set recentSubmissionsRpp: 0 in my config.*.yml then no recent submissions should be displayed. However, that doesn't work, instead I see the first 20 recent submissions (which is likely the default page size).
  2. Second, I have some minor recommendations for changing the configuration structure slightly to align with PR #1803 (which adds a different homePage configuration)

Comment thread config/config.example.yml Outdated
# The number of item showing in recent submission components
recentSubmissionsRpp: 5
# Sort record of recent submission
recentSubmissionsSortField: 'dc.date.accessioned'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have another pull request #1803 which is adding the same sort of "homePage" configuration, and ideally we'd like these two PRs to have configurations that look similar.

Could we restructure this configuration to look like this?

homePage:
  recentSubmissions:
    pageSize: 5
    sortField: 'dc.date.accessioned'

This would allow both this PRs to use the same "homePage" section of the configuration and work similarly. I also think this will be easier for users to understand, as the "Rpp" meaning is not clear.

@tdonohue tdonohue self-requested a review September 14, 2022 20:07
@artlowel artlowel removed their request for review September 15, 2022 09:41
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 @GauravD2t ! This looks great to me now, and I can hide the section by setting pageSize: 0. As this is now at +2, it's ready to merge for 7.4

@tdonohue tdonohue added this to the 7.4 milestone Sep 15, 2022
@tdonohue tdonohue merged commit bb31e1d into DSpace:main Sep 15, 2022
Comment thread src/config/homepage-config.interface.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: Discovery related to discovery search or browse system new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Recently Added Items" doesn't exist on homepage

4 participants