diff --git a/app/parsers/bulkrax/csv_parser_decorator.rb b/app/parsers/bulkrax/csv_parser_decorator.rb index 9563eda..11c09bc 100644 --- a/app/parsers/bulkrax/csv_parser_decorator.rb +++ b/app/parsers/bulkrax/csv_parser_decorator.rb @@ -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? @@ -16,7 +17,7 @@ def valid_import? file_paths.is_a?(Array) rescue StandardError => e - status_info(e) + set_status_info(e) false end diff --git a/app/services/hyrax/analytics/ga4.rb b/app/services/hyrax/analytics/ga4.rb index 0ebd404..b9297bc 100644 --- a/app/services/hyrax/analytics/ga4.rb +++ b/app/services/hyrax/analytics/ga4.rb @@ -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'] - 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 @@ -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 diff --git a/config/initializers/bulkrax.rb b/config/initializers/bulkrax.rb index 6270a13..b078193 100644 --- a/config/initializers/bulkrax.rb +++ b/config/initializers/bulkrax.rb @@ -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: '\|' }, diff --git a/config/metadata/bulkrax_metadata.yaml b/config/metadata/bulkrax_metadata.yaml deleted file mode 100644 index 61d66e7..0000000 --- a/config/metadata/bulkrax_metadata.yaml +++ /dev/null @@ -1,14 +0,0 @@ -attributes: - bulkrax_identifier: - type: string - predicate: https://hykucommons.org/terms/bulkrax_identifier - multiple: false - index_keys: - # NOTE: For backwards compatibility, we specify `bulkrax_identifier_tesim` - # however if we want singular (which we do) and to have exact match - # (which we do) we don't want to use Text English Stored Indexed - # Multiple (e.g. _tesim suffix). Instead we want String Stored - # Index (e.g. _ssi). However, until we get all of our efforts - # coordinated; we'll continue to contend with this misalignment. - - "bulkrax_identifier_tesim" - - "bulkrax_identifier_ssi" diff --git a/hyrax-webapp b/hyrax-webapp index 673ddeb..715caac 160000 --- a/hyrax-webapp +++ b/hyrax-webapp @@ -1 +1 @@ -Subproject commit 673ddebb21e9a97f03851d6744d81c4fa928411d +Subproject commit 715caacbb7446102074e67587bfe966a4c6dcc70