Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

🎁 Add persistent highlighting to UV #471

Merged
merged 1 commit into from
Jun 23, 2023
Merged

Conversation

kirkkwang
Copy link
Contributor

Story

This commit will add the feature of persisting the search from the catalog to the UV. This will make it better for the user so they don't have to search the same term again.

Ref:

Expected Behavior Before Changes

A catalog search did not persist from the catalog to the UV.

Expected Behavior After Changes

A catalog search now persists to from the catalog to the UV.

Screenshots / Video

adl-470

Notes

In the Screen cap, my UV reloads, for some reason it's only happening when I record my screen.

Comment on lines 10 to 14
return unless @work.is_a? FileSet
return @work if @work.is_a? FileSet

filesets = @work.members.select { |m| m.is_a? FileSet }
filesets.empty? ? nil : filesets[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

if we're doing an empty return if @work is anything other than a file set....then we're returning @work if it is a file set....how do we get to lines 13-14?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! This was left over from the old Newspaper gem logic, as I'm looking at it now, I'm not sure why it would have worked since if @work comes in as something that is NOT a FileSet, then we'd get a type mismatch error like we're seeing. If it came in as a string then we find it's FileSet and if it does come in as a FileSet then it just returns it. So I'm not sure why you would call #members on a FileSet to look for more FileSets. 🤔

https://github.com/scientist-softserv/iiif_print/blob/8fdf56e151b5adb7e6aab1cd29d39b74554ed48a/lib/iiif_print/data/fileset_helper.rb#L13-L22

Copy link
Contributor

Choose a reason for hiding this comment

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

in the code you linked above, we would get to the code on your lines 13-14 in the instance that @work was a Work model.

however, in the code changes you have right now, you are returning from the method if @work is a Work model. so the code on 13-14 doesn't apply. if the intention is to get the file sets on a work, then I think line 10 needs to be removed.

in that case, we return the FileSet if that was passed in, or we find the FileSet if a Work was passed in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes the intention is the get the FileSet, i have the IIIF Print PR you looked at that addresses this at a higher level so actually i'm going to close this one and update IIIF Print instead, thanks for taking a look!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, going to keep this PR opened and push another commit to update IIIF Print, might as well keep it in one instead of splitting it into two

@kirkkwang
Copy link
Contributor Author

closing this PR in favor of this change in IIIF Print notch8/iiif_print#253

next step is to update IIIF Print in this repo

@kirkkwang kirkkwang closed this Jun 23, 2023
@kirkkwang kirkkwang reopened this Jun 23, 2023
@kirkkwang
Copy link
Contributor Author

On second thought I can just use this same PR since it's all filled out and add a different commit

This commit will add the feature of persisting the search from the
catalog to the UV.  This will make it better for the user so they don't
have to search the same term again.  This will also update IIIF Print to
the latest revision.

Ref:
  - https://github.com/scientist-softserv/adventist-dl/issues/470
@kirkkwang kirkkwang force-pushed the i470-persistent-highlighting branch from d447dd8 to d9658e8 Compare June 23, 2023 17:33
@kirkkwang kirkkwang requested a review from alishaevn June 23, 2023 18:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants