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

🐛 I91 fix importer issues #93

Merged
merged 5 commits into from
Jun 20, 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: 2 additions & 1 deletion app/parsers/bulkrax/csv_parser_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module CsvParserDecorator

def valid_import?
missing_fields_by_model = records.each_with_object({}) do |record, hash|
record.compact!
record.transform_keys!(&:downcase).transform_keys!(&:to_sym)
missing_fields = missing_fields_for(record)
hash[record[:model]] = missing_fields if missing_fields.present?
Expand All @@ -16,7 +17,7 @@ def valid_import?

file_paths.is_a?(Array)
rescue StandardError => e
status_info(e)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this method was deprecated in Bulkrax v6.0.0. Because of this, the imports would fail silently if there's an issue.

set_status_info(e)
false
end

Expand Down
20 changes: 10 additions & 10 deletions app/services/hyrax/analytics/ga4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def base64?(value)
def account_json_string
return @account_json_string if @account_json_string
@account_json_string = if @config['account_json']
base64?(@config['account_json']) ? Base64.decode64(@config['account_json']) : @config['account_json']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

rubocop fixes

else
File.read(@config['account_json_path'])
end
base64?(@config['account_json']) ? Base64.decode64(@config['account_json']) : @config['account_json']
else
File.read(@config['account_json_path'])
end
end

def account_info
Expand Down Expand Up @@ -176,31 +176,31 @@ def unique_visitors_for_id(id, date = default_date_range); end

def new_visitors(period = 'month', date = default_date_range)
start_date, end_date = date_period(period, date)
Visits.new(start_date: start_date, end_date: end_date).new_visits
Visits.new(start_date:, end_date:).new_visits
end

def new_visits_by_day(date = default_date_range, period = 'range')
start_date, end_date = date_period(period, date)
VisitsDaily.new(start_date: start_date, end_date: end_date).new_visits
VisitsDaily.new(start_date:, end_date:).new_visits
end

def returning_visitors(period = 'month', date = default_date_range)
start_date, end_date = date_period(period, date)
Visits.new(start_date: start_date, end_date: end_date).return_visits
Visits.new(start_date:, end_date:).return_visits
end

def returning_visits_by_day(date = default_date_range, period = 'range')
start_date, end_date = date_period(period, date)
VisitsDaily.new(start_date: start_date, end_date: end_date).return_visits
VisitsDaily.new(start_date:, end_date:).return_visits
end

def total_visitors(period = 'month', date = default_date_range)
start_date, end_date = date_period(period, date)
Visits.new(start_date: start_date, end_date: end_date).total_visits
Visits.new(start_date:, end_date:).total_visits
end

def page_statistics(start_date, object)
visits = VisitsDaily.new(start_date: start_date, end_date: Date.yesterday)
visits = VisitsDaily.new(start_date:, end_date: Date.yesterday)
visits.add_filter(dimension: 'contentId', values: [object.id.to_s])
visits.total_visits
end
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/bulkrax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
'audience' => { from: ['audience'], split: '\|' },
'based_near' => { from: ['location'], split: '\|' },
'bibliographic_citation' => { from: ['bibliographic_citation'], split: '\|', generated: true },
'bulkrax_identifier' => { from: ['source_identifier'], source_identifier: true, generated: true },
'bulkrax_identifier' => { from: ['source_identifier'], source_identifier: true, generated: true, search_field: 'bulkrax_identifier_tesim' },
'children' => { from: ['children'], split: /\s*[;|]\s*/, related_children_field_mapping: true },
'chronology_note' => { from: ['chronology_note'], split: '\|' },
'committee_member' => { from: ['committee_member'], split: '\|' },
Expand Down
14 changes: 0 additions & 14 deletions config/metadata/bulkrax_metadata.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion hyrax-webapp
Copy link
Contributor Author

Choose a reason for hiding this comment

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

updates bulkrax

Loading