From 9549183db75c2ad10665ee59799ab73e5647b7fd Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Mon, 17 Jun 2024 18:04:25 -0700 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=9B=20replace=20deprecated=20metho?= =?UTF-8?q?d=20and=20strip=20out=20nils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit status_info was deprecated in Bulkrax v6.0.0. It has been updated to set_status_info. We were also receiving an error because of nil values, so record.compact! is needed. --- app/parsers/bulkrax/csv_parser_decorator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 6958dfdefd7633ac01b2928dfe41306d8f40ad11 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Tue, 18 Jun 2024 15:43:59 -0700 Subject: [PATCH 2/4] :broom: remove bulkrax_metadata.yml and update mapping In this commit we remove bulkrax_metadata.yml since there's nothing custom about it; it will inherit settings from Hyku instead. Additionally we add a search_field key to the bulkrax.rb, for the bulkrax_identifier mapping. --- config/initializers/bulkrax.rb | 2 +- config/metadata/bulkrax_metadata.yaml | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 config/metadata/bulkrax_metadata.yaml 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" From b0a900b5b794c82d62b3aa4d2e423f9db2fa5427 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Wed, 19 Jun 2024 08:14:09 -0700 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=92=84rubocop=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/hyrax/analytics/ga4.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 From 79a44cc3fb3f3555b2c2e37d8da15ba5d24607b5 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Wed, 19 Jun 2024 09:00:26 -0700 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A7=B9=20Updates=20submodule=20for=20?= =?UTF-8?q?bulkrax=20and=20iiif=5Fprint=20bug=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyrax-webapp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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