Skip to content

Illustrative content#168

Merged
justinlittman merged 8 commits intomainfrom
illustrative-content
Dec 9, 2021
Merged

Illustrative content#168
justinlittman merged 8 commits intomainfrom
illustrative-content

Conversation

@ndushay
Copy link
Copy Markdown
Contributor

@ndushay ndushay commented Dec 9, 2021

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?

end
field_value[15..17] = model.place
# Book Illustrative Context
field_value[18] = 'a' if model.book_illustrative_content.present?
Copy link
Copy Markdown
Contributor Author

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|
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor Author

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
Copy link
Copy Markdown
Contributor Author

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

include_examples 'mapper', described_class
end

context 'with a single extent and multiple dimensions' do
Copy link
Copy Markdown
Contributor Author

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

@justinlittman justinlittman merged commit 997881f into main Dec 9, 2021
@justinlittman justinlittman deleted the illustrative-content branch December 9, 2021 12:11
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.

Map bf:illustrativeContent to MARC

2 participants