scientist-softserv / iiif_print

A gem for Hyrax/Samvera for displaying PDF pages in a IIIF Compliant viewer
Apache License 2.0
4 stars 1 forks source link

[i387] - add default value to is_child property #237

Closed ShanaLMoore closed 1 year ago

ShanaLMoore commented 1 year ago

Story

This PR is to address the feedback from the following ticket. The user was still able to see the child works in the catalog and recent works section. To resolve this, we are setting the child work is_child attribute to be true on default.

Refs https://github.com/scientist-softserv/britishlibrary/issues/387

Expected Behavior Before Changes

ref: https://github.com/scientist-softserv/britishlibrary/issues/387#issuecomment-1542771258

image

Expected Behavior After Changes

As a result, you cannot see the child records while it's still processing. The user should and does not see child works in the following scenarios:

EMPTY CATALOG SEARCH :

image

RECENT WORKS SECTION:

image

VIEW RECENT ADDITIONS CATALOG PG:

image

Sidekiq

Notice is_child property is being set to true in the CreateWorkJob:

image

sample work: service-rbc-rbc0001-2015-2015gen56010-2015gen56010.pdf

Notes

ShanaLMoore commented 1 year ago

This makes a lot of sense, since we never want these to appear, and it should fix it for everyone!

I'm still curious if we know why the searches don't exclude the work types that are configured to be excluded? I thought that was the purpose of that config option. If it isn't then what does that configuration do?

The catalog search is fine, however the work index page is not because that code lives in UTK only. I started to bring it over to iiif_print but given the discussion we had in today's retro, maybe making a ticket for it to be picked up later is better? I can lay out the details of what needs to be done. @laritakr

ref: image

UTK's implementation: https://github.com/scientist-softserv/utk-hyku/blob/main/app/search_builders/hyrax/filter_by_type_decorator.rb

laritakr commented 1 year ago

The catalog search is fine, however the work index page is not because that code lives in UTK only.

We don't want to eliminate these from the dashboard views (that is the part that is only in UTK, correct?).

I thought the config option removed them from the catalog search and recent items searches, but perhaps I misunderstand that config?

Regardless, this is an ideal situation for these generated child works. I'm only concerned in case we ever DO want to eliminate a work type from the catalog search results, as we tried to do before this change.

ShanaLMoore commented 1 year ago

Ah ok. It's possible I misunderstood or am confused by all the hiding of work types across the various apps too 🙃 Yes, that feature was requested by UTK to hide Attachments. I created a ticket with the assumption that it should be hidden everywhere, like UTK's but i'll add a discuss label to it.

What you're saying makes sense because that's how it was implemented, to exclude the work types from catalog search. Ref the readme. Unfortunately the readme just says search and doesn't specify.

Perhaps this spec can offer us some clarity: https://github.com/scientist-softserv/iiif_print/blob/fd5b6678a620d32c97239aef01141190051277fd/spec/iiif_print/catalog_search_builder_spec.rb#L20-L59 I observed that this didn't behave that way for the recent works catalog search too. Maybe we can see if @kirkkwang remembers if it should.

kirkkwang commented 1 year ago

From what I understand, it doesn't remove from recent works, only the catalog search.

laritakr commented 1 year ago

I'm pretty sure I made a later change to remove it from recent works as well. I will search for that.