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

Allow for multiple extents #1446

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Allow for multiple extents #1446

merged 1 commit into from
Dec 11, 2023

Conversation

marlo-longley
Copy link
Contributor

@marlo-longley marlo-longley commented Dec 7, 2023

I would love someone to verify that I interpreted the intent written in this ticket correctly:
Closes #989

I would also love feedback on whether we need to repeat this logic for both the _tesim and ssm fields.

Also, since there was no discussion on the ticket, I assume this is non-controversial and desired by the group.

@marlo-longley marlo-longley marked this pull request as ready for review December 7, 2023 16:19
@seanaery
Copy link
Contributor

seanaery commented Dec 7, 2023

@marlo-longley This is great progress and it moves this issue closer to fixed. A few thoughts...

Multiple extents

Here's what I'd expect the result to become, i.e., rather than a single-item array, the doc should have multiple extents and only the first should concatenate the values from within the same <physdesc>:

expect(result['extent_ssm']).to equal_array_ignoring_whitespace ['1.25 Linear Feet (1 volume)', '1 document case', '16 DVDRs']

We have a related issue to tackle in #997 where we should be showing a badge for each extent, i.e., multiple extents should be OK as long as we fix that other issue.

Removing and

With multiple values the and is coming from the default separator_options but can be overridden like has been done for several other fields in the catalog_controller.rb template. I.e.,

separator_options: {
      words_connector: '<br/>',
      two_words_connector: '<br/>',
      last_word_connector: '<br/>'
    }

Repeating for extent_tesim

In the traject config you can just copy the value that was captured for extent_ssm into extent_tesim without repeating the logic. I.e.,

to_field "extent_tesim" do |_record, accumulator, context|
  accumulator.concat context.output_hash["extent_ssm"] || []
end

Needed on components and collections alike

Since <extent> can be present in the top-level collection and in individual components, we'll need this tweak to also be present in ead2_component_config.rb; See: https://github.com/projectblacklight/arclight/blob/main/lib/arclight/traject/ead2_component_config.rb#L158-L159

@seanaery
Copy link
Contributor

seanaery commented Dec 7, 2023

I definitely welcome additional feedback from @mmmmcode , @gwiedeman and anyone else who can advise on the EAD nuances around extents in #989 :-)

@marlo-longley
Copy link
Contributor Author

Awesome thanks so much @seanaery !

@marlo-longley marlo-longley marked this pull request as draft December 7, 2023 22:34
@marlo-longley marlo-longley changed the title Change the logic for applying separators between multiple <physdesc> and nested <extent> elements Allow for multiple extents Dec 7, 2023
@marlo-longley
Copy link
Contributor Author

marlo-longley commented Dec 7, 2023

HI @seanaery -- I believe I addressed all your comments. I also added code to close #997, so now this PR addresses 2 issues. I would love feedback but here is what it's looking like:
Screenshot 2023-12-07 at 4 56 08 PM
Screenshot 2023-12-07 at 4 39 00 PM

The one question I had was about the failing test. I'm not sure if it's a requirement to use the extent field for this test as the size_accessor, and therefore whether it's a concern that this PR alters the data format.

extent_ssm: ['42GB'], # This field does not typically hold file size, but for test purposes..

@mmmmcode
Copy link

mmmmcode commented Dec 7, 2023

@seanaery @marlo-longley One thing I wonder about is the parentheses in the container summary text (extent altrender="carrier")- are those something we want to supply if they aren't present? Or is that something that should be addressed with local customizations?

@marlo-longley
Copy link
Contributor Author

@mmmmcode Thanks for taking a look! In these fixtures the words in parentheses are provided directly from the XML, as if a cataloger had entered it that way. So I wasn't thinking we should alter that. I want to make sure I'm understanding you, though!

@mmmmcode
Copy link

mmmmcode commented Dec 8, 2023 via email

@marlo-longley
Copy link
Contributor Author

marlo-longley commented Dec 8, 2023

Thanks for explaining @mmmmcode -- I could see this for sure but I'm thinking it is a change that is not directly related to allowing for multiple extents, or properly grouping extents, as the tickets lay out. If we want to change the formatting of text in extents, my take is that we should open a new ticket and discuss there, rather than lump new functionality into this particular PR.

@seanaery
Copy link
Contributor

seanaery commented Dec 8, 2023

@marlo-longley That all looks great to me and I agree about not trying to fold in parentheses formatting. As for the failing test, I'm unfamiliar with that downloads feature (we don't use it in our UI) but I wonder if you could just stub in a value there for a made-up accessor like document.finding_aid_size rather than tie it to the actual extent_ssm field and its accessor. https://github.com/projectblacklight/arclight/blob/main/spec/fixtures/config/downloads.yml#L19

@lfarrell lfarrell merged commit 41f14f8 into main Dec 11, 2023
4 checks passed
@lfarrell lfarrell deleted the remove-and branch December 11, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple extents always expressed as consecutive but sometimes concurrent
4 participants