-
Notifications
You must be signed in to change notification settings - Fork 1
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
Illustrative content #168
Illustrative content #168
Conversation
…cal_description model
…t and multiple dimensions
… from BF.illustrativeContent)
@@ -19,6 +19,8 @@ def value | |||
field_value[6..14] = '|||||||||' | |||
end | |||
field_value[15..17] = model.place | |||
# Book Illustrative Context | |||
field_value[18] = 'a' if model.book_illustrative_content.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor: ...descriptionSSSSS
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new test added for pre-exisitng code
@@ -52,6 +51,34 @@ | |||
include_examples 'mapper', described_class | |||
end | |||
|
|||
context 'with a single extent and multiple dimensions' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new test added for pre-existing code
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?