Illustrative content#168
Merged
justinlittman merged 8 commits intomainfrom Dec 9, 2021
Merged
Conversation
…cal_description model
…t and multiple dimensions
… from BF.illustrativeContent)
ndushay
commented
Dec 9, 2021
| end | ||
| field_value[15..17] = model.place | ||
| # Book Illustrative Context | ||
| field_value[18] = 'a' if model.book_illustrative_content.present? |
Contributor
Author
There was a problem hiding this comment.
the ticket said to default this to 'a'
| if illustrative_content_uri | ||
| other_physical_details = LiteralOrRemoteResolver.resolve_label(term: illustrative_content_uri, item: item) | ||
| end | ||
| extent_physical_descriptions = extent_terms.sort.map do |extent_term| |
Contributor
Author
There was a problem hiding this comment.
refactor: ...descriptionSSSSS
Comment on lines
+37
to
+43
| dimensions = item.instance.query.path_all_literal([BF.dimensions]).sort | ||
| if extent_physical_descriptions.length == 1 && dimensions.length == 1 | ||
| return [extent_physical_descriptions.first.merge(dimensions: dimensions)] | ||
| end | ||
|
|
||
| extent_physical_description + [dimensions] | ||
| extent_physical_descriptions << { dimensions: dimensions } if dimensions.present? | ||
| extent_physical_descriptions |
Contributor
Author
There was a problem hiding this comment.
refactor: :dimensions is an attribute of PhysicalDescription class; the existing code was confusing to follow. Tests for more cases around multiple dimensions and multiple physical_decriptions were also added.
| '300 $a extent1 $a extent2 $c dimension1 $c dimension2 $3 materials_specified1', | ||
| '300 $3 materials_specified2' | ||
| ] | ||
| context 'with single extents and dimensions in multiple physical descriptions' do |
Contributor
Author
There was a problem hiding this comment.
new test added for pre-exisitng code
| include_examples 'mapper', described_class | ||
| end | ||
|
|
||
| context 'with a single extent and multiple dimensions' do |
Contributor
Author
There was a problem hiding this comment.
new test added for pre-existing code
justinlittman
approved these changes
Dec 9, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why was this change made?
FIxes #158 (Map bf:illustrativeContent to MARC 300b and to MARC 008/18)
There is some refactoring bundled in.
How was this change tested?
unit tests
Which documentation and/or configurations were updated?