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

After split, Show pages' items list includes the filesets of child works #817

Open
11 tasks
ShanaLMoore opened this issue Sep 19, 2024 · 5 comments
Open
11 tasks
Assignees
Labels
bug something isn't working M1 Milestone 1 reindex Valkyrie

Comments

@ShanaLMoore
Copy link
Contributor

ShanaLMoore commented Sep 19, 2024

Summary

Per Katharine,

I tested with my own 6 page PDF.

https://adl.s2.adventistdigitallibrary.org/concern/generic_works/538a6bcf-e2b7-429e-b15a-f19530a9a7d9?locale=en

BUGS:
The splitting worked, but we have double the number of child works showing in the items list. On Production we usually only see the child works with page numbers attached. However, on staging, there are a string of JPEGs in the item list.

All child works are showing in the UV, so the work is duplicated in the UV.

Acceptance Criteria

  • Feature parity with production
  • After split, the items section should only show the child works with page number attached.
  • After split, the parent work should not also show the child work's filesets in the items section.
  • No duplication in the UV

Screenshots or Video

STAGING

Image

PRODUCTION

Image

Testing Instructions

Ensure that feature flipper is set to universal viewer. Find a work with child works.

  • Universal viewer shows each page only once.
  • Universal viewer search works from either parent or child works.
  • Both child works and child work filesets will show in items list.

Select edit and save to reindex the parent work.

  • Only child works show in items list... child work's filesets no longer appear.

Create a new work with a PDF to split.

  • Universal viewer shows each page only once.
  • Universal viewer search works from either parent or child works.
  • Both child works and child work filesets show in items list.

Notes

related issue: samvera/hyrax#6767

@ShanaLMoore ShanaLMoore changed the title IiifSplit displays more than it should Split displays more than it should Sep 19, 2024
@ShanaLMoore ShanaLMoore added bug something isn't working Valkyrie M2 Milestone 2 M1 Milestone 1 and removed M2 Milestone 2 labels Sep 19, 2024
@ShanaLMoore ShanaLMoore changed the title Split displays more than it should After split, Show pages' items list includes the filesets of child works Sep 19, 2024
laritakr added a commit that referenced this issue Sep 19, 2024
Overrides logic related to media viewers to prioritize UV in all
cases, and fallback to PDFjs as much as possible, regardless of
feature flipper setting.

Refs
- samvera/hyku#2336
- #817

- Clean up views related to media viewers
- Better documentation of overrides
- Remove duplicated file set indexer decorator
@ShanaLMoore
Copy link
Contributor Author

ShanaLMoore commented Sep 20, 2024

Thoughts on an override to the indexers? Will it have negative consequences?

# hyku_indexing.rb and maybe pcdm indexer?
        solr_doc['member_ids_ssim'] = filter_member_ids(object.member_ids.map(&:to_s)) 
        solr_doc['file_set_ids_ssim'] = filter_fileset_ids(solr_doc['member_ids_ssim'])

private

  def filter_member_ids(member_ids)
    member_ids.reject do |id|
      member = Hyrax.query_service.find_by(id: Valkyrie::ID.new(id))
      member.is_a?(Hyrax::FileSet)
    end
  end

def filter_fileset_ids(member_ids)
  member_ids.select do |id|
    member = Hyrax.query_service.find_by(id: Valkyrie::ID.new(id))
    member.is_a?(Hyrax::FileSet)
  end
end


update 1: this didn't fully solve the problem. I still see the child filesets in the items section but I don't see them in the UV. I think it's because #list_of_item_ids_to_display also needs to filter them out for the view

Image

update 2:

# hyrax work_show_presenter.rb, ugly... but it works? 

# rejects Hyrax::FileSets unless it's a pdf. 

    def authorized_item_ids(filter_unreadable: Flipflop.hide_private_items?)
      @member_item_list_ids ||= begin
        ids = filter_unreadable ? ordered_ids.reject { |id| !current_ability.can?(:read, id) } : ordered_ids
        ids.reject do |id|
          member = Hyrax.query_service.find_by(id: id)
          if member.is_a?(Hyrax::FileSet)
            original_file = member.original_file
            original_file&.pdf? ? false : true
          else
            false
          end
        end
      end
    end

=> 🎉

Image

@ShanaLMoore
Copy link
Contributor Author

ShanaLMoore commented Sep 23, 2024

Per LaRita, koppie and dassie work as expected.

@laritakr
Copy link
Contributor

laritakr commented Sep 23, 2024

Appears to be due to IiifPrint's indexing that includes descendents for OCR purposes.

@laritakr laritakr added the blocked other work must be completed first label Sep 25, 2024
@laritakr laritakr removed the blocked other work must be completed first label Sep 26, 2024
laritakr added a commit that referenced this issue Sep 26, 2024
# Story

Refs
- #817

# Expected Behavior Before Changes

Universal viewer on parent work showed each page twice.

# Expected Behavior After Changes

Pages are no longer duplicated.

# Screenshots / Video

<details>
<summary></summary>

![Screenshot 2024-09-26 at 11 59
51 AM](https://github.com/user-attachments/assets/8aae255b-e308-45fb-b59b-72baa40ec62e)

</details>

# Notes
@laritakr
Copy link
Contributor

QA Results: ✅ Passed

Tested with work https://adl.s2.adventistdigitallibrary.org/concern/generic_works/9854b255-38ee-4cdd-95cf-004b9f8d324a?locale=en

Screenshots

UV does not duplicate pages

Image

Before a reindex, child work filesets are included in items

Image

After edit/save (to reindex) child work filesets are not included in items

Image

@KatharineV
Copy link
Collaborator

Working as expected when tested in ADL staging. Sample work: https://adl.s2.adventistdigitallibrary.org/concern/journal_articles/lake_union_herald_2023_05_18_19_how_shall_we_go?locale=en

Viewer shows the PDF once, and the items list has only page number child works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working M1 Milestone 1 reindex Valkyrie
Projects
Status: Deploy to Production
Development

No branches or pull requests

3 participants