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

Fix link to user's works on dashboard #6373

Merged
merged 2 commits into from
Oct 20, 2023
Merged

Fix link to user's works on dashboard #6373

merged 2 commits into from
Oct 20, 2023

Conversation

abelemlih
Copy link
Contributor

Fixes

Fixes #6359

Summary

When Valkyrie is used, the generic type in Solr is stored in field generic_type_si, instead of generic_type_sim for apps that are not using Valkyrie. This causes the application to generate the wrong link to a user's works on the dashboard.

Guidance for testing, such as acceptance criteria or new user interface behaviors:

  1. Navigate to the home page (no need to be logged in at all)
  2. Click on the "Recently Uploaded" tab
  3. Click on a depositor's name
  4. Click on "Works created" link
  5. 0 works returned in search results

Type of change (for release notes)

  • notes-bugfix Bug Fixes

Detailed Description

To generate the link to a user's works on the dashboard, the application previously added facet params for two fields: depositor_ssim and generic_type_sim. The application relied on the method search_state_with_facets, which is a generic method from the HyraxHelperBehavior that generates the facet params to be used in the link. This method is no longer useful for this particular case, since it assumes all facet fields are multivalued, while generic_type_si is not for Valkyrie apps.

In this PR, I avoided adding custom logic for this method, and added a new method in the DashboardHelperBehavior instead. The new method I added, #link_to_works, generates the correct link for a user's works whether Valkyrie is used or not.

Changes proposed in this pull request:

  • Remove the use of link_to_field from the HyraxHelperBehavior to link to a user's works
  • Add a new method, #link_to_works, to the DashboardHelperBehavior that checks whether Valkyrie is used and generates the correct link. For Valyrie applications, the method uses generic_type_si for the facet params, and generic_type_sim for the other use cases.
  • Add specs to spec/helpers/hyrax/dashboard_helper_behavior_spec.rb to verify that the new method generates the correct link for both uses cases

@samvera/hyrax-code-reviewers

@dlpierce dlpierce merged commit 9061589 into main Oct 20, 2023
4 checks passed
@dlpierce dlpierce deleted the abel-6359 branch October 20, 2023 14:09
@dlpierce dlpierce added the notes-bugfix Release Notes: Fixed a bug label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-bugfix Release Notes: Fixed a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to view list of works created by particular user
2 participants