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

Return date prep early #174

Merged
merged 2 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ This project bumps the version number for any changes (including documentation u

## [Unreleased] - i.e. pushed to main branch but not yet tagged as a release

## [5.0.6] - 2024-02-11
- Return date details responses early if there are errors, to avoid exceptions

## [5.0.5] - 2024-02-02
- For `date details` batch mode: add support for ingesting grouped fields at the same level as the structured date group. To find the group level of the structured date group, find the `date_field_group` value in the relevant CSV ingest template. If that field has a `REPEATING FIELD GROUP` value in the template, any other field values with the same `REPEATING FIELD GROUP` value can be ingested together.

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GIT
PATH
remote: .
specs:
collectionspace-mapper (5.0.5)
collectionspace-mapper (5.0.6)
activesupport (= 7.0.4.3)
chronic
collectionspace-client (~> 0.15.0)
Expand Down
13 changes: 10 additions & 3 deletions lib/collectionspace/mapper/date_details/data_prepper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def prep
if handler.grouped_handler
extract_grouped_data
grouped_prepped = handler.grouped_handler.prep(grouped_data)
unless grouped_prepped.errors.empty?
grouped_prepped.errors.each { |err| response.add_error(err) }
return response
end
end
split_data
transform_data
Expand All @@ -42,6 +46,8 @@ def prep
clean_transformed
readd_id
combine_data_fields
return response unless response.errors.empty?

merge_authority_data(auth_prepped) if authority_data
merge_grouped_data(grouped_prepped) if grouped_data
response
Expand Down Expand Up @@ -209,9 +215,10 @@ def merge_authority_data(auth_prepped)
def merge_grouped_data(grouped_prepped)
path = handler.target_path

response.combined_data[path].merge!(
grouped_prepped.combined_data[path]
)
response.combined_data[path].tap { |data| binding.pry unless data }
.merge!(
grouped_prepped.combined_data[path]
)
grouped_prepped.errors.each { |err| response.add_error(err) }
grouped_prepped.terms.each { |term| response.add_term(term) }
grouped_prepped.warnings.each do |warning|
Expand Down
2 changes: 1 addition & 1 deletion lib/collectionspace/mapper/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module CollectionSpace
module Mapper
VERSION = "5.0.5"
VERSION = "5.0.6"
end
end
Loading