geoblacklight_admin 0.0.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -36
  3. data/Rakefile +47 -14
  4. data/app/assets/javascripts/geoblacklight_admin.js +2 -1
  5. data/app/assets/stylesheets/geoblacklight_admin/_core.scss +5 -0
  6. data/app/assets/stylesheets/geoblacklight_admin/modules/_chosen.scss +425 -0
  7. data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +108 -0
  8. data/app/controllers/admin/admin_controller.rb +4 -2
  9. data/app/controllers/admin/advanced_search_controller.rb +123 -103
  10. data/app/controllers/admin/api_controller.rb +123 -108
  11. data/app/controllers/admin/bookmarks_controller.rb +4 -4
  12. data/app/controllers/admin/bulk_actions_controller.rb +9 -4
  13. data/app/controllers/admin/concerns/upload_util.rb +2 -0
  14. data/app/controllers/admin/document_accesses_controller.rb +10 -4
  15. data/app/controllers/admin/document_assets_controller.rb +14 -11
  16. data/app/controllers/admin/document_downloads_controller.rb +12 -10
  17. data/app/controllers/admin/documents_controller.rb +32 -15
  18. data/app/controllers/admin/elements_controller.rb +6 -5
  19. data/app/controllers/admin/form_elements_controller.rb +4 -4
  20. data/app/controllers/admin/ids_controller.rb +107 -87
  21. data/app/controllers/admin/import_documents_controller.rb +1 -1
  22. data/app/controllers/admin/imports_controller.rb +7 -3
  23. data/app/controllers/admin/mappings_controller.rb +6 -4
  24. data/app/controllers/admin/notifications_controller.rb +1 -1
  25. data/app/controllers/admin/search_controller.rb +3 -2
  26. data/app/controllers/admin/users_controller.rb +2 -2
  27. data/app/helpers/form_input_helper.rb +4 -4
  28. data/app/helpers/geoblacklight_admin_helper.rb +1 -1
  29. data/app/indexers/document_indexer.rb +1 -1
  30. data/app/jobs/export_job.rb +9 -6
  31. data/app/jobs/export_json_bulk_job.rb +95 -0
  32. data/app/jobs/export_json_job.rb +14 -12
  33. data/app/models/admin/bookmark.rb +18 -0
  34. data/app/models/api_search_builder.rb +3 -1
  35. data/app/models/blacklight_api.rb +6 -6
  36. data/app/models/blacklight_api_facets.rb +7 -2
  37. data/app/models/blacklight_api_ids.rb +3 -4
  38. data/app/models/bulk_action.rb +1 -1
  39. data/app/models/document/bbox_validator.rb +9 -5
  40. data/app/models/document/date_range_validator.rb +13 -10
  41. data/app/models/document/geom_validator.rb +4 -2
  42. data/app/models/document.rb +15 -7
  43. data/app/models/element.rb +9 -7
  44. data/app/models/form_control.rb +2 -0
  45. data/app/models/form_element.rb +2 -0
  46. data/app/models/form_feature.rb +2 -0
  47. data/app/models/form_group.rb +2 -0
  48. data/app/models/form_header.rb +2 -0
  49. data/app/models/geoblacklight_admin/schema.rb +5 -2
  50. data/app/models/geoblacklight_admin.rb +2 -0
  51. data/app/models/import/csv_duplicates_validator.rb +2 -1
  52. data/app/models/import/csv_header_validator.rb +2 -1
  53. data/app/models/import.rb +4 -7
  54. data/app/models/user.rb +1 -1
  55. data/app/services/export_csv_service.rb +5 -1
  56. data/app/views/admin/advanced_search/facets.json.jbuilder +9 -8
  57. data/app/views/admin/advanced_search/index.json.jbuilder +8 -7
  58. data/app/views/admin/api/_field.json.jbuilder +1 -1
  59. data/app/views/admin/api/fetch.json.jbuilder +8 -7
  60. data/app/views/admin/api/index.json.jbuilder +8 -7
  61. data/app/views/admin/bookmarks/index.html.erb +2 -2
  62. data/app/views/admin/bulk_actions/index.html.erb +3 -3
  63. data/app/views/admin/bulk_actions/show.html.erb +1 -1
  64. data/app/views/admin/document_accesses/_form.html.erb +1 -1
  65. data/app/views/admin/document_accesses/destroy_all.html.erb +3 -3
  66. data/app/views/admin/document_accesses/edit.html.erb +1 -1
  67. data/app/views/admin/document_accesses/import.html.erb +2 -2
  68. data/app/views/admin/document_accesses/index.html.erb +9 -9
  69. data/app/views/admin/document_accesses/new.html.erb +1 -1
  70. data/app/views/admin/document_downloads/_form.html.erb +1 -1
  71. data/app/views/admin/document_downloads/destroy_all.html.erb +2 -2
  72. data/app/views/admin/document_downloads/edit.html.erb +2 -3
  73. data/app/views/admin/document_downloads/import.html.erb +1 -1
  74. data/app/views/admin/document_downloads/index.html.erb +9 -9
  75. data/app/views/admin/document_downloads/new.html.erb +1 -1
  76. data/app/views/admin/document_downloads/show.html.erb +2 -2
  77. data/app/views/admin/documents/_document_bookmark.html.erb +1 -1
  78. data/app/views/admin/documents/_form_nav.html.erb +3 -1
  79. data/app/views/admin/documents/_json_btaa_aardvark.jbuilder +1 -3
  80. data/app/views/admin/documents/_json_file.jbuilder +14 -0
  81. data/app/views/admin/documents/_result_selected_options.html.erb +3 -1
  82. data/app/views/admin/documents/edit.html.erb +1 -1
  83. data/app/views/admin/documents/features/_multiple_download_links.html.erb +2 -2
  84. data/app/views/admin/documents/fetch.json_file.jbuilder +9 -0
  85. data/app/views/admin/documents/index.html.erb +2 -4
  86. data/app/views/admin/documents/index.json_file.jbuilder +9 -0
  87. data/app/views/admin/documents/versions.html.erb +1 -1
  88. data/app/views/admin/elements/_element.json.jbuilder +4 -1
  89. data/app/views/admin/elements/_form.html.erb +1 -1
  90. data/app/views/admin/elements/edit.html.erb +2 -2
  91. data/app/views/admin/elements/index.html.erb +4 -4
  92. data/app/views/admin/elements/index.json.jbuilder +2 -0
  93. data/app/views/admin/elements/new.html.erb +1 -1
  94. data/app/views/admin/elements/show.html.erb +6 -6
  95. data/app/views/admin/elements/show.json.jbuilder +2 -0
  96. data/app/views/admin/form_elements/_form.html.erb +1 -1
  97. data/app/views/admin/form_elements/_form_element.json.jbuilder +2 -0
  98. data/app/views/admin/form_elements/edit.html.erb +2 -2
  99. data/app/views/admin/form_elements/index.html.erb +2 -2
  100. data/app/views/admin/form_elements/index.json.jbuilder +2 -0
  101. data/app/views/admin/form_elements/new.html.erb +1 -1
  102. data/app/views/admin/form_elements/show.html.erb +2 -2
  103. data/app/views/admin/form_elements/show.json.jbuilder +2 -0
  104. data/app/views/admin/ids/fetch.json.jbuilder +8 -7
  105. data/app/views/admin/ids/index.json.jbuilder +3 -2
  106. data/app/views/admin/import_documents/show.html.haml +1 -1
  107. data/app/views/admin/imports/_import.json.jbuilder +2 -1
  108. data/app/views/admin/imports/_show_failed_tab.html.erb +2 -2
  109. data/app/views/admin/imports/_show_success_tab.html.erb +1 -1
  110. data/app/views/admin/imports/edit.html.erb +3 -3
  111. data/app/views/admin/imports/index.html.erb +3 -3
  112. data/app/views/admin/layouts/application.html.erb +4 -4
  113. data/app/views/admin/mappings/_form.html.erb +1 -1
  114. data/app/views/admin/mappings/_mapping.json.jbuilder +2 -1
  115. data/app/views/admin/mappings/edit.html.erb +2 -2
  116. data/app/views/admin/mappings/new.html.erb +1 -1
  117. data/app/views/admin/mappings/show.html.erb +2 -2
  118. data/app/views/admin/notifications/index.html.erb +3 -3
  119. data/app/views/admin/search/index.html.erb +2 -2
  120. data/app/views/admin/shared/_navbar.html.erb +11 -6
  121. data/app/views/admin/shared/_toast.html.erb +1 -1
  122. data/app/views/admin/users/index.html.erb +1 -1
  123. data/app/views/catalog/_show_gbl_admin.html.erb +3 -0
  124. data/config/locales/documents.en.yml +3 -0
  125. data/config/routes.rb +37 -33
  126. data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +409 -0
  127. data/db/seeds.rb +7 -6
  128. data/db/seeds_elements.csv +56 -55
  129. data/db/seeds_elements.numbers +0 -0
  130. data/db/seeds_form_elements.csv +65 -64
  131. data/db/seeds_form_elements.numbers +0 -0
  132. data/lib/generators/geoblacklight_admin/config_generator.rb +61 -94
  133. data/lib/generators/geoblacklight_admin/install_generator.rb +3 -12
  134. data/lib/generators/geoblacklight_admin/jobs_generator.rb +3 -2
  135. data/lib/generators/geoblacklight_admin/models_generator.rb +0 -1
  136. data/lib/generators/geoblacklight_admin/templates/_show_sidebar.html.erb +19 -0
  137. data/lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb +1 -1
  138. data/lib/generators/geoblacklight_admin/templates/config/database.yml +9 -5
  139. data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +12 -6
  140. data/lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb +315 -0
  141. data/lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb +1 -2
  142. data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +2 -0
  143. data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +15 -0
  144. data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +152 -68
  145. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form.rb +178 -0
  146. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form_bootstrap.rb +365 -0
  147. data/lib/generators/geoblacklight_admin/templates/config/settings.yml +293 -0
  148. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +10 -0
  149. data/lib/generators/geoblacklight_admin/templates/package.json +3 -0
  150. data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +3 -3
  151. data/lib/generators/geoblacklight_admin/views_generator.rb +2 -3
  152. data/lib/geoblacklight_admin/engine.rb +5 -6
  153. data/lib/geoblacklight_admin/version.rb +1 -1
  154. data/lib/geoblacklight_admin.rb +1 -1
  155. data/lib/tasks/geoblacklight_admin.rake +15 -11
  156. metadata +101 -63
  157. data/.editorconfig +0 -18
  158. data/.gitignore +0 -75
  159. data/.standard.yml +0 -4
  160. data/Gemfile +0 -59
  161. data/LICENSE +0 -21
  162. data/app/assets/images/.keep +0 -0
  163. data/app/controllers/admin/concerns/.keep +0 -0
  164. data/app/models/bookmark.rb +0 -17
  165. data/app/models/concerns/.keep +0 -0
  166. data/db/migrate/20230316183001_add_geoblacklight_admin.rb +0 -399
  167. data/geoblacklight_admin.gemspec +0 -67
  168. data/lib/generators/geoblacklight_admin/example_docs_generator.rb +0 -18
  169. data/lib/generators/geoblacklight_admin/templates/.env.development.example +0 -28
  170. data/lib/generators/geoblacklight_admin/templates/.solr_wrapper.yml +0 -7
  171. data/lib/generators/geoblacklight_admin/templates/solr/snapshots/.keep +0 -0
  172. data/lib/tasks/.keep +0 -0
  173. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -35
  174. data/template.rb +0 -16
  175. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/confirmations/new.html.erb +0 -0
  176. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/edit.html.erb +0 -0
  177. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/new.html.erb +0 -0
  178. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.html.erb +0 -0
  179. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.text.erb +0 -0
  180. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/edit.html.erb +0 -0
  181. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/new.html.erb +0 -0
  182. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/edit.html.erb +0 -0
  183. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/new.html.erb +0 -0
  184. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/sessions/new.html.erb +0 -0
  185. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/shared/_links.html.erb +0 -0
  186. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/unlocks/new.html.erb +0 -0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "rails/generators"
2
4
 
3
5
  module GeoblacklightAdmin
@@ -6,9 +8,6 @@ module GeoblacklightAdmin
6
8
 
7
9
  desc "Install GeoblacklightAdmin"
8
10
 
9
- def add_settings_vars
10
- end
11
-
12
11
  def bundle_install
13
12
  Bundler.with_unbundled_env do
14
13
  run "bundle install"
@@ -21,10 +20,6 @@ module GeoblacklightAdmin
21
20
  end
22
21
  end
23
22
 
24
- def generate_gbl_admin_example_docs
25
- generate "geoblacklight_admin:example_docs"
26
- end
27
-
28
23
  def generate_gbl_admin_jobs
29
24
  generate "geoblacklight_admin:jobs"
30
25
  end
@@ -45,15 +40,11 @@ module GeoblacklightAdmin
45
40
  generate "geoblacklight_admin:config"
46
41
  end
47
42
 
48
- def kithe_install
49
- run "bundle exec rails generate simple_form:install --bootstrap"
50
- end
51
-
52
43
  def install_active_storage
53
44
  run "bin/rails active_storage:install"
54
45
  end
55
46
 
56
- def yarn_install
47
+ def install_yarn
57
48
  run "yarn install"
58
49
  end
59
50
  end
@@ -2,7 +2,8 @@
2
2
 
3
3
  require "rails/generators"
4
4
 
5
- module GeoblacklightAdmin class JobsGenerator < Rails::Generators::Base
5
+ module GeoblacklightAdmin
6
+ class JobsGenerator < Rails::Generators::Base
6
7
  source_root File.expand_path("templates", __dir__)
7
8
 
8
9
  desc <<-DESCRIPTION
@@ -11,7 +12,7 @@ module GeoblacklightAdmin class JobsGenerator < Rails::Generators::Base
11
12
  DESCRIPTION
12
13
 
13
14
  def config_development_jobs_queue_adapter
14
- job_config = <<-"JOBS"
15
+ job_config = <<-JOBS
15
16
  config.active_job.queue_adapter = :inline
16
17
  JOBS
17
18
 
@@ -18,6 +18,5 @@ module GeoblacklightAdmin
18
18
  def copy_migrations
19
19
  rake "geoblacklight_admin:install:migrations"
20
20
  end
21
-
22
21
  end
23
22
  end
@@ -0,0 +1,19 @@
1
+ <div class="gbl-admin">
2
+ <%= render :partial => "show_gbl_admin" %>
3
+ </div>
4
+
5
+ <%= render :partial => 'show_tools', locals: { document: @document } %>
6
+
7
+ <div class="sidebar-buttons">
8
+ <%= render :partial => "show_web_services" %>
9
+ <%= render :partial => "show_downloads" %>
10
+ </div>
11
+
12
+ <% unless @document.more_like_this.empty? %>
13
+ <div class="card">
14
+ <div class="card-header">More Like This</div>
15
+ <div class="card-body">
16
+ <%= render :collection => @document.more_like_this, :partial => 'show_more_like_this', :as => :document %>
17
+ </div>
18
+ </div>
19
+ <% end %>
@@ -8,7 +8,7 @@
8
8
 
9
9
  <% if current_user.admin? %>
10
10
  <li class="nav-item">
11
- <%= link_to "GBL Admin", admin_documents_path, {class: 'nav-link'} %>
11
+ <%= link_to "GBLAdmin", admin_documents_path, {class: 'nav-link'} %>
12
12
  </li>
13
13
  <% end %>
14
14
 
@@ -1,18 +1,22 @@
1
1
  default: &default
2
2
  adapter: postgresql
3
3
  encoding: unicode
4
- host: <%= ENV['GBL_ADMIN_DB_HOST'] || '127.0.0.1' %>
5
- port: <%= ENV['GBL_ADMIN_DB_PORT'] || '5432' %>
6
- database: <%= ENV['GBL_ADMIN_DB_DATABASE'] || 'geoblacklight_development' %>
7
- username: <%= ENV['GBL_ADMIN_DB_USER'] %>
8
- password: <%= ENV['GBL_ADMIN_DB_PASSWORD'] %>
4
+ host: <%= ENV['POSTGRES_HOST'] || '127.0.0.1' %>
5
+ port: <%= ENV['POSTGRES_PORT'] || '5432' %>
6
+ username: <%= ENV['POSTGRES_USER'] || 'postgres' %>
7
+ password: <%= ENV['POSTGRES_PASSWORD'] || 'postgres' %>
9
8
  pool: 5
10
9
 
11
10
  test:
11
+ database: <%= ENV['POSTGRES_DB'] || 'geoblacklight_test' %>
12
12
  <<: *default
13
13
 
14
+
14
15
  development:
16
+ database: <%= ENV['POSTGRES_DB'] || 'geoblacklight_development' %>
15
17
  <<: *default
16
18
 
19
+
17
20
  production:
21
+ database: <%= ENV['POSTGRES_DB'] || 'geoblacklight_production' %>
18
22
  <<: *default
@@ -21,6 +21,12 @@
21
21
  "type": "string"
22
22
  }
23
23
  },
24
+ "gbl_displayNote_sm": {
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string"
28
+ }
29
+ },
24
30
  "dct_creator_sm": {
25
31
  "type": "array",
26
32
  "items": {
@@ -91,6 +97,7 @@
91
97
  },
92
98
  "locn_geometry": { "type": "string" },
93
99
  "dcat_centroid_ss": { "type": "string" },
100
+ "gbl_georeferenced_b": { "type": "boolean" },
94
101
  "dct_relation_sm": {
95
102
  "type": "array",
96
103
  "items": {
@@ -133,34 +140,34 @@
133
140
  "type": "string"
134
141
  }
135
142
  },
136
- "dct_accessRights_s": { "type": "string" },
137
- "dct_rightsHolder_sm": {
143
+ "dct_rights_sm": {
138
144
  "type": "array",
139
145
  "items": {
140
146
  "type": "string"
141
147
  }
142
148
  },
143
- "dct_license_sm": {
149
+ "dct_rightsHolder_sm": {
144
150
  "type": "array",
145
151
  "items": {
146
152
  "type": "string"
147
153
  }
148
154
  },
149
- "dct_rights_sm": {
155
+ "dct_license_sm": {
150
156
  "type": "array",
151
157
  "items": {
152
158
  "type": "string"
153
159
  }
154
160
  },
161
+ "dct_accessRights_s": { "type": "string" },
155
162
  "dct_format_s": { "type": "string" },
156
163
  "gbl_fileSize_s": { "type": "string" },
157
- "gbl_wxsIdentifier_s": { "type": "string" },
158
164
  "dct_references_s": {
159
165
  "type": "array",
160
166
  "items": {
161
167
  "type": "object"
162
168
  }
163
169
  },
170
+ "gbl_wxsIdentifier_s": { "type": "string" },
164
171
  "id": { "type": "string" },
165
172
  "geomg_id_s": { "type": "string" },
166
173
  "dct_identifier_sm": {
@@ -175,7 +182,6 @@
175
182
  },
176
183
  "gbl_mdVersion_s": { "type": "string" },
177
184
  "gbl_suppressed_b": { "type": "boolean" },
178
- "gbl_georeferenced_b": { "type": "boolean" },
179
185
  "b1g_image_ss": { "type": "string" },
180
186
  "b1g_geonames_sm": {
181
187
  "type": "array",
@@ -0,0 +1,315 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "devise_invitable"
4
+
5
+ # Assuming you have not yet modified this file, each configuration option below
6
+ # is set to its default value. Note that some are commented out while others
7
+ # are not: uncommented lines are intended to protect your configuration from
8
+ # breaking changes in upgrades (i.e., in the event that future versions of
9
+ # Devise change the default values for those options).
10
+ #
11
+ # Use this hook to configure devise mailer, warden hooks and so forth.
12
+ # Many of these configuration options can be set straight in your model.
13
+ Devise.setup do |config|
14
+ # The secret key used by Devise. Devise uses this key to generate
15
+ # random tokens. Changing this key will render invalid all existing
16
+ # confirmation, reset password and unlock tokens in the database.
17
+ # Devise will use the `secret_key_base` as its `secret_key`
18
+ # by default. You can change it below and use your own secret key.
19
+ # config.secret_key = '38e18fee79edc84245f53caeceb29a05b1e48af0dfa906b0818db912b7c64b4f25a4e1ba8c513639635dde0e83c78ddc9f43b7197f3e66b043e15751c45e04c3'
20
+
21
+ # ==> Controller configuration
22
+ # Configure the parent class to the devise controllers.
23
+ # config.parent_controller = 'DeviseController'
24
+
25
+ # ==> Mailer Configuration
26
+ # Configure the e-mail address which will be shown in Devise::Mailer,
27
+ # note that it will be overwritten if you use your own mailer class
28
+ # with default "from" parameter.
29
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
30
+
31
+ # Configure the class responsible to send e-mails.
32
+ # config.mailer = 'Devise::Mailer'
33
+
34
+ # Configure the parent class responsible to send e-mails.
35
+ # config.parent_mailer = 'ActionMailer::Base'
36
+
37
+ # ==> ORM configuration
38
+ # Load and configure the ORM. Supports :active_record (default) and
39
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
40
+ # available as additional gems.
41
+ require "devise/orm/active_record"
42
+
43
+ # ==> Configuration for any authentication mechanism
44
+ # Configure which keys are used when authenticating a user. The default is
45
+ # just :email. You can configure it to use [:username, :subdomain], so for
46
+ # authenticating a user, both parameters are required. Remember that those
47
+ # parameters are used only when authenticating and not when retrieving from
48
+ # session. If you need permissions, you should implement that in a before filter.
49
+ # You can also supply a hash where the value is a boolean determining whether
50
+ # or not authentication should be aborted when the value is not present.
51
+ # config.authentication_keys = [:email]
52
+
53
+ # Configure parameters from the request object used for authentication. Each entry
54
+ # given should be a request method and it will automatically be passed to the
55
+ # find_for_authentication method and considered in your model lookup. For instance,
56
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
57
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
58
+ # config.request_keys = []
59
+
60
+ # Configure which authentication keys should be case-insensitive.
61
+ # These keys will be downcased upon creating or modifying a user and when used
62
+ # to authenticate or find a user. Default is :email.
63
+ config.case_insensitive_keys = [:email]
64
+
65
+ # Configure which authentication keys should have whitespace stripped.
66
+ # These keys will have whitespace before and after removed upon creating or
67
+ # modifying a user and when used to authenticate or find a user. Default is :email.
68
+ config.strip_whitespace_keys = [:email]
69
+
70
+ # Tell if authentication through request.params is enabled. True by default.
71
+ # It can be set to an array that will enable params authentication only for the
72
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
73
+ # enable it only for database (email + password) authentication.
74
+ # config.params_authenticatable = true
75
+
76
+ # Tell if authentication through HTTP Auth is enabled. False by default.
77
+ # It can be set to an array that will enable http authentication only for the
78
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
79
+ # enable it only for database authentication.
80
+ # For API-only applications to support authentication "out-of-the-box", you will likely want to
81
+ # enable this with :database unless you are using a custom strategy.
82
+ # The supported strategies are:
83
+ # :database = Support basic authentication with authentication key + password
84
+ # config.http_authenticatable = false
85
+
86
+ # If 401 status code should be returned for AJAX requests. True by default.
87
+ # config.http_authenticatable_on_xhr = true
88
+
89
+ # The realm used in Http Basic Authentication. 'Application' by default.
90
+ # config.http_authentication_realm = 'Application'
91
+
92
+ # It will change confirmation, password recovery and other workflows
93
+ # to behave the same regardless if the e-mail provided was right or wrong.
94
+ # Does not affect registerable.
95
+ # config.paranoid = true
96
+
97
+ # By default Devise will store the user in session. You can skip storage for
98
+ # particular strategies by setting this option.
99
+ # Notice that if you are skipping storage for all authentication paths, you
100
+ # may want to disable generating routes to Devise's sessions controller by
101
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
102
+ config.skip_session_storage = [:http_auth]
103
+
104
+ # By default, Devise cleans up the CSRF token on authentication to
105
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
106
+ # requests for sign in and sign up, you need to get a new CSRF token
107
+ # from the server. You can disable this option at your own risk.
108
+ # config.clean_up_csrf_token_on_authentication = true
109
+
110
+ # When false, Devise will not attempt to reload routes on eager load.
111
+ # This can reduce the time taken to boot the app but if your application
112
+ # requires the Devise mappings to be loaded during boot time the application
113
+ # won't boot properly.
114
+ # config.reload_routes = true
115
+
116
+ # ==> Configuration for :database_authenticatable
117
+ # For bcrypt, this is the cost for hashing the password and defaults to 12. If
118
+ # using other algorithms, it sets how many times you want the password to be hashed.
119
+ # The number of stretches used for generating the hashed password are stored
120
+ # with the hashed password. This allows you to change the stretches without
121
+ # invalidating existing passwords.
122
+ #
123
+ # Limiting the stretches to just one in testing will increase the performance of
124
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
125
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
126
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
127
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
128
+ config.stretches = Rails.env.test? ? 1 : 12
129
+
130
+ # Set up a pepper to generate the hashed password.
131
+ # config.pepper = '6e8adaeab8e4b438c27c55c1a8b0b4bd7a40135c758b8ad7144e5bbc9becdd0b2d53a04bad40ec46a8dde4b958766ae9f6faf4ebb28e17240c33507e06e19870'
132
+
133
+ # Send a notification to the original email when the user's email is changed.
134
+ # config.send_email_changed_notification = false
135
+
136
+ # Send a notification email when the user's password is changed.
137
+ # config.send_password_change_notification = false
138
+
139
+ # ==> Configuration for :confirmable
140
+ # A period that the user is allowed to access the website even without
141
+ # confirming their account. For instance, if set to 2.days, the user will be
142
+ # able to access the website for two days without confirming their account,
143
+ # access will be blocked just in the third day.
144
+ # You can also set it to nil, which will allow the user to access the website
145
+ # without confirming their account.
146
+ # Default is 0.days, meaning the user cannot access the website without
147
+ # confirming their account.
148
+ # config.allow_unconfirmed_access_for = 2.days
149
+
150
+ # A period that the user is allowed to confirm their account before their
151
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
152
+ # their account within 3 days after the mail was sent, but on the fourth day
153
+ # their account can't be confirmed with the token any more.
154
+ # Default is nil, meaning there is no restriction on how long a user can take
155
+ # before confirming their account.
156
+ # config.confirm_within = 3.days
157
+
158
+ # If true, requires any email changes to be confirmed (exactly the same way as
159
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
160
+ # db field (see migrations). Until confirmed, new email is stored in
161
+ # unconfirmed_email column, and copied to email column on successful confirmation.
162
+ config.reconfirmable = true
163
+
164
+ # Defines which key will be used when confirming an account
165
+ # config.confirmation_keys = [:email]
166
+
167
+ # ==> Configuration for :rememberable
168
+ # The time the user will be remembered without asking for credentials again.
169
+ # config.remember_for = 2.weeks
170
+
171
+ # Invalidates all the remember me tokens when the user signs out.
172
+ config.expire_all_remember_me_on_sign_out = true
173
+
174
+ # If true, extends the user's remember period when remembered via cookie.
175
+ # config.extend_remember_period = false
176
+
177
+ # Options to be passed to the created cookie. For instance, you can set
178
+ # secure: true in order to force SSL only cookies.
179
+ # config.rememberable_options = {}
180
+
181
+ # ==> Configuration for :validatable
182
+ # Range for password length.
183
+ config.password_length = 6..128
184
+
185
+ # Email regex used to validate email formats. It simply asserts that
186
+ # one (and only one) @ exists in the given string. This is mainly
187
+ # to give user feedback and not to assert the e-mail validity.
188
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
189
+
190
+ # ==> Configuration for :timeoutable
191
+ # The time you want to timeout the user session without activity. After this
192
+ # time the user will be asked for credentials again. Default is 30 minutes.
193
+ # config.timeout_in = 30.minutes
194
+
195
+ # ==> Configuration for :lockable
196
+ # Defines which strategy will be used to lock an account.
197
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
198
+ # :none = No lock strategy. You should handle locking by yourself.
199
+ # config.lock_strategy = :failed_attempts
200
+
201
+ # Defines which key will be used when locking and unlocking an account
202
+ # config.unlock_keys = [:email]
203
+
204
+ # Defines which strategy will be used to unlock an account.
205
+ # :email = Sends an unlock link to the user email
206
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
207
+ # :both = Enables both strategies
208
+ # :none = No unlock strategy. You should handle unlocking by yourself.
209
+ # config.unlock_strategy = :both
210
+
211
+ # Number of authentication tries before locking an account if lock_strategy
212
+ # is failed attempts.
213
+ # config.maximum_attempts = 20
214
+
215
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
216
+ # config.unlock_in = 1.hour
217
+
218
+ # Warn on the last attempt before the account is locked.
219
+ # config.last_attempt_warning = true
220
+
221
+ # ==> Configuration for :recoverable
222
+ #
223
+ # Defines which key will be used when recovering the password for an account
224
+ # config.reset_password_keys = [:email]
225
+
226
+ # Time interval you can reset your password with a reset password key.
227
+ # Don't put a too small interval or your users won't have the time to
228
+ # change their passwords.
229
+ config.reset_password_within = 6.hours
230
+
231
+ # When set to false, does not sign a user in automatically after their password is
232
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
233
+ # config.sign_in_after_reset_password = true
234
+
235
+ # ==> Configuration for :encryptable
236
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
237
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
238
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
239
+ # for default behavior) and :restful_authentication_sha1 (then you should set
240
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
241
+ #
242
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
243
+ # config.encryptor = :sha512
244
+
245
+ # ==> Scopes configuration
246
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
247
+ # "users/sessions/new". It's turned off by default because it's slower if you
248
+ # are using only default views.
249
+ # config.scoped_views = false
250
+
251
+ # Configure the default scope given to Warden. By default it's the first
252
+ # devise role declared in your routes (usually :user).
253
+ # config.default_scope = :user
254
+
255
+ # Set this configuration to false if you want /users/sign_out to sign out
256
+ # only the current scope. By default, Devise signs out all scopes.
257
+ # config.sign_out_all_scopes = true
258
+
259
+ # ==> Navigation configuration
260
+ # Lists the formats that should be treated as navigational. Formats like
261
+ # :html should redirect to the sign in page when the user does not have
262
+ # access, but formats like :xml or :json, should return 401.
263
+ #
264
+ # If you have any extra navigational formats, like :iphone or :mobile, you
265
+ # should add them to the navigational formats lists.
266
+ #
267
+ # The "*/*" below is required to match Internet Explorer requests.
268
+ # config.navigational_formats = ['*/*', :html, :turbo_stream]
269
+
270
+ # The default HTTP method used to sign out a resource. Default is :delete.
271
+ config.sign_out_via = :delete
272
+
273
+ # ==> OmniAuth
274
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
275
+ # up on your models and hooks.
276
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
277
+
278
+ # ==> Warden configuration
279
+ # If you want to use other strategies, that are not supported by Devise, or
280
+ # change the failure app, you can configure them inside the config.warden block.
281
+ #
282
+ # config.warden do |manager|
283
+ # manager.intercept_401 = false
284
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
285
+ # end
286
+
287
+ # ==> Mountable engine configurations
288
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
289
+ # is mountable, there are some extra configurations to be taken into account.
290
+ # The following options are available, assuming the engine is mounted as:
291
+ #
292
+ # mount MyEngine, at: '/my_engine'
293
+ #
294
+ # The router that invoked `devise_for`, in the example above, would be:
295
+ # config.router_name = :my_engine
296
+ #
297
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
298
+ # so you need to do it manually. For the users scope, it would be:
299
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
300
+
301
+ # ==> Hotwire/Turbo configuration
302
+ # When using Devise with Hotwire/Turbo, the http status for error responses
303
+ # and some redirects must match the following. The default in Devise for existing
304
+ # apps is `200 OK` and `302 Found respectively`, but new apps are generated with
305
+ # these new defaults that match Hotwire/Turbo behavior.
306
+ # Note: These might become the new default in future versions of Devise.
307
+ config.responder.error_status = :unprocessable_entity
308
+ config.responder.redirect_status = :see_other
309
+
310
+ # ==> Configuration for :registerable
311
+
312
+ # When set to false, does not sign a user in automatically after their password is
313
+ # changed. Defaults to true, so a user is signed in automatically after changing a password.
314
+ # config.sign_in_after_change_password = true
315
+ end
@@ -13,8 +13,7 @@ GEOMG_SCHEMA = HashWithIndifferentAccess.new(
13
13
  # GEOMG_SCHEMA_TIMESTAMP
14
14
  # This constant hold the Time of the last changes to the Element table.
15
15
  # If the timestamp changes, the rails server and sidekiq will need to be restarted.
16
- if File.exist?(Rails.root.join("tmp/schema_timestamp.txt").to_s)
17
- else
16
+ unless File.exist?(Rails.root.join("tmp/schema_timestamp.txt").to_s)
18
17
  File.write(Rails.root.join("tmp/schema_timestamp.txt").to_s, Time.now.to_s)
19
18
  end
20
19
  GEOMG_SCHEMA_TIMESTAMP = File.read(Rails.root.join("tmp/schema_timestamp.txt").to_s)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "kithe"
4
+
3
5
  traject_logger = ActiveSupport::Logger.new("#{Rails.root}/log/traject.log")
4
6
 
5
7
  Kithe.indexable_settings.solr_url = ENV["SOLR_URL"]
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+
6
+ # GBL‡ADMIN
7
+ ## Order is important. ActiveStorage needs :json to be last
8
+ Mime::Type.register "application/json", :json_aardvark
9
+ Mime::Type.register "application/json", :json_btaa_aardvark
10
+ Mime::Type.register "application/json", :json_file
11
+ Mime::Type.register "application/json", :json_gbl_v1
12
+ Mime::Type.register "application/json", :json
13
+
14
+ Mime::Type.register "text/csv", :csv_document_downloads
15
+ Mime::Type.register "text/csv", :csv_document_access_links