Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dataset feed to homepage #2167

Draft
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

luistoptal
Copy link
Collaborator

@luistoptal luistoptal commented Jan 4, 2025

Pull request for issue: #199

IMPORTANT: this is a follow up to PR #2078, I suggest reviewing #2078 and this PR in combination as this one includes refactor to the changes in #2078

  • Adds a dataset feed to the homepage
  • Refactors the news carousel as a resuable shared partial

image

How to test?

In home page http://gigadb.gigasciencejournal.com/ you should see a responsive carousel with datasets

How have functionalities been implemented?

  • the news feed from Homepage news items section rework #2078 was refactored to convert the carousel into a reusable partial protected/views/shared/_carousel_slider.php
  • In the SiteController a dataset search is performed and the search result passed to the view to be able to render a list of datasets as a carousel
  • The number of datasets on display is limited to 12, but more can be fetched
  • If more than 0 datasets are returned then render the dataset feed section protected/views/site/datasets_carousel.php

Any issues with implementation?

  • if the user changes the current carousel slide and then resizes the window, the carousel position is reset to slide 1. I think this is a fringe usecase so I did not handle it
  • The dropdown to select type from the original example is not implemented, I am not sure if it is useful. If this is an important feature, it could be added
  • Regarding the dataset data, I see a handful of utility methods to 'get' dataset data, e.g. protected/components/FormattedDatasetMainSection.php, in this PR I am directly accessing the dataset values but I do not know if I should use these utilities instead, for example, to get the dataset title i do:
$dataset['title']

But I think that it might be possible to alternatively do something like:

(...)
$mainSection = $assembly->getDatasetMainSection();
(...)
$mainSection->getHeadline()['title'];

Any changes to automated tests?

--

@luistoptal luistoptal changed the title New feature/199 homepage dataset carousel Add dataset feed to homepage Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant