From fce83741bafcc8013d41bef9b50be5a14cd8c3c3 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Wed, 14 Feb 2024 15:01:30 -0800 Subject: [PATCH] default geonames_username to HYKU_GEONAMES_USERNAME Setting HYKU_GEONAMES_USERNAME doesn't work per the README's instruction without this change. The username is also configurable per tenant. This commit includes instructions to clarify such with the user. --- app/models/concerns/account_settings.rb | 4 ++-- config/locales/hyrax.en.yml | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/concerns/account_settings.rb b/app/models/concerns/account_settings.rb index 5cd2458c0..52ececc60 100644 --- a/app/models/concerns/account_settings.rb +++ b/app/models/concerns/account_settings.rb @@ -29,7 +29,7 @@ module AccountSettings setting :file_size_limit, type: 'string', default: 5.gigabytes.to_s setting :google_analytics_id, type: 'string' setting :google_scholarly_work_types, type: 'array', disabled: true - setting :geonames_username, type: 'string', default: '' + setting :geonames_username, type: 'string', default: ENV['HYKU_GEONAMES_USERNAME'] setting :gtm_id, type: 'string' setting :locale_name, type: 'string', disabled: true setting :monthly_email_list, type: 'array', disabled: true @@ -159,7 +159,7 @@ def reload_library_config config.contact_email = contact_email config.analytics = google_analytics_id.present? config.google_analytics_id = google_analytics_id if google_analytics_id.present? - config.geonames_username = geonames_username + config.geonames_username = geonames_username if geonames_username.present? config.uploader[:maxFileSize] = file_size_limit end diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml index 137ddfef0..c267fe11c 100644 --- a/config/locales/hyrax.en.yml +++ b/config/locales/hyrax.en.yml @@ -1102,7 +1102,8 @@ en: description: A brief overarching description that applies to all works collected in this set. For example, "Theses and supplementary files created by the School of Earth Sciences graduate students." title: A name to aid in identifying the Administrative Set and to distinguish it from other Administrative Sets in the repository. collection: - based_near: A place name related to the collection, such as its site of publication, or the city, state, or country the collection contents are about. Calls upon the GeoNames web service. + based_near: "A place name related to the work, such as its site of publication, or the city, state, or country the work contents are about. Calls upon the GeoNames web service. Please note, you must configure your geonames username in the account settings, or this field will have a loading error.
+
Steps to enable this field:
1. Create a free account on the Geonames web service page.
2. Go to your geonames account settings and select the option at the bottom to enable free services.
3. Go into your hyku account settings in the dashboard.
4. Enter your geonames username in the hyrax account settings.
5. You should now be able to see the list of locations in this dropdown." contributor: A person or group you want to recognize for playing a role in the creation of the collection, but not the primary role. creator: The person or group responsible for the collection. Usually this is the author of the content. Personal names should be entered with the last name first, e.g. "Smith, John.". date_created: The date on which the collection was created. @@ -1129,7 +1130,8 @@ en: share_applies_to_new_works: When new works are created directly in the collection, grant sharing users and groups permissions for the new work according to their collection roles. title: "" defaults: - based_near: A place name related to the work, such as its site of publication, or the city, state, or country the work contents are about. Calls upon the GeoNames web service. + based_near: "A place name related to the work, such as its site of publication, or the city, state, or country the work contents are about. Calls upon the GeoNames web service. Please note, you must configure your geonames username in the account settings, or this field will have a loading error.
+
Steps to enable this field:
1. Create a free account on the Geonames web service page.
2. Go to your geonames account settings and select the option at the bottom to enable free services.
3. Go into your hyku account settings in the dashboard.
4. Enter your geonames username in the hyrax account settings.
5. You should now be able to see the list of locations in this dropdown." contributor: A person or group you want to recognize for playing a role in the creation of the work, but not the primary role. creator: The person or group responsible for the work. Usually this is the author of the content. Personal names should be entered with the last name first, e.g. "Smith, John.". date_created: The date on which the work was created.