geoblacklight_admin 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +58 -59
- data/Rakefile +25 -10
- data/app/assets/javascripts/geoblacklight_admin.js +1 -1
- data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +108 -0
- data/app/controllers/admin/documents_controller.rb +22 -13
- data/app/controllers/admin/search_controller.rb +2 -1
- data/app/controllers/admin/users_controller.rb +1 -1
- data/app/indexers/document_indexer.rb +1 -1
- data/app/jobs/export_job.rb +7 -5
- data/app/jobs/export_json_bulk_job.rb +95 -0
- data/app/jobs/export_json_job.rb +14 -12
- data/app/models/blacklight_api.rb +6 -6
- data/app/models/blacklight_api_facets.rb +7 -2
- data/app/models/blacklight_api_ids.rb +3 -4
- data/app/models/bulk_action.rb +1 -1
- data/app/views/admin/document_accesses/destroy_all.html.erb +1 -1
- data/app/views/admin/document_downloads/destroy_all.html.erb +1 -1
- data/app/views/admin/documents/_form_nav.html.erb +3 -1
- data/app/views/admin/documents/_json_file.jbuilder +14 -0
- data/app/views/admin/documents/_result_selected_options.html.erb +3 -1
- data/app/views/admin/documents/fetch.json_file.jbuilder +9 -0
- data/app/views/admin/documents/index.json_file.jbuilder +9 -0
- data/app/views/admin/elements/index.html.erb +1 -1
- data/app/views/admin/form_elements/index.html.erb +1 -1
- data/app/views/admin/shared/_navbar.html.erb +3 -3
- data/app/views/admin/shared/_toast.html.erb +1 -1
- data/app/views/admin/users/index.html.erb +1 -1
- data/config/locales/documents.en.yml +3 -0
- data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +1 -0
- data/db/seeds.rb +0 -1
- data/db/seeds_elements.csv +56 -55
- data/db/seeds_elements.numbers +0 -0
- data/db/seeds_form_elements.csv +65 -64
- data/db/seeds_form_elements.numbers +0 -0
- data/lib/generators/geoblacklight_admin/config_generator.rb +31 -76
- data/lib/generators/geoblacklight_admin/install_generator.rb +1 -9
- data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +12 -6
- data/lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb +315 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +2 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +15 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +2 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form.rb +178 -0
- data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form_bootstrap.rb +365 -0
- data/lib/generators/geoblacklight_admin/templates/config/settings.yml +74 -22
- data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +10 -0
- data/lib/generators/geoblacklight_admin/templates/package.json +2 -0
- data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +3 -3
- data/lib/generators/geoblacklight_admin/views_generator.rb +2 -2
- data/lib/geoblacklight_admin/version.rb +1 -1
- data/lib/tasks/geoblacklight_admin.rake +6 -6
- metadata +24 -17
- data/lib/generators/geoblacklight_admin/example_docs_generator.rb +0 -18
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/confirmations/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/edit.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.text.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/edit.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/edit.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/sessions/new.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/shared/_links.html.erb +0 -0
- /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/unlocks/new.html.erb +0 -0
@@ -8,51 +8,46 @@ module GeoblacklightAdmin
|
|
8
8
|
|
9
9
|
desc <<-DESCRIPTION
|
10
10
|
This generator makes the following changes to your application:
|
11
|
-
1. Copies GBL Admin initializer
|
12
|
-
|
13
|
-
3. Copies Pagy initializer file to host config
|
14
|
-
4. Copies Statesman initializer file to host config
|
15
|
-
5. Copies PG database.yml connection to host config
|
11
|
+
1. Copies GBL Admin initializer files to host config
|
12
|
+
5. Copies database.yml connection to host config
|
16
13
|
5. Copies settings.yml to host config
|
17
14
|
6. Copies .env.development and .env.test to host
|
18
15
|
6. Copies JSON Schema to host
|
19
16
|
7. Copies solr/* to host
|
20
17
|
8. Sets Routes
|
21
18
|
9. Sets Gems
|
22
|
-
10.Sets MimeTypes
|
23
19
|
11.Sets DB Seeds
|
24
20
|
11.Sets ActiveStorage
|
25
21
|
12.Sets Pagy Backend
|
26
22
|
|
27
23
|
DESCRIPTION
|
28
24
|
|
29
|
-
def
|
30
|
-
copy_file "config/initializers/geoblacklight_admin.rb", "config/initializers/geoblacklight_admin.rb"
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
copy_file "config/initializers/
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
copy_file "config/initializers/pagy.rb", "config/initializers/pagy.rb"
|
39
|
-
end
|
40
|
-
|
41
|
-
def create_statesman_initializer
|
42
|
-
copy_file "config/initializers/statesman.rb", "config/initializers/statesman.rb"
|
25
|
+
def create_gbl_admin_initializer_files
|
26
|
+
copy_file "config/initializers/geoblacklight_admin.rb", "config/initializers/geoblacklight_admin.rb", force: true
|
27
|
+
copy_file "config/initializers/devise.rb", "config/initializers/devise.rb", force: true
|
28
|
+
copy_file "config/initializers/kithe.rb", "config/initializers/kithe.rb", force: true
|
29
|
+
copy_file "config/initializers/mime_types.rb", "config/initializers/mime_types.rb", force: true
|
30
|
+
copy_file "config/initializers/pagy.rb", "config/initializers/pagy.rb", force: true
|
31
|
+
copy_file "config/initializers/simple_form.rb", "config/initializers/simple_form.rb", force: true
|
32
|
+
copy_file "config/initializers/simple_form_bootstrap.rb", "config/initializers/simple_form_bootstrap.rb", force: true
|
33
|
+
copy_file "config/initializers/statesman.rb", "config/initializers/statesman.rb", force: true
|
43
34
|
end
|
44
35
|
|
45
36
|
def create_database_yml
|
46
37
|
copy_file "config/database.yml", "config/database.yml", force: true
|
47
38
|
end
|
48
39
|
|
40
|
+
def create_dotenv
|
41
|
+
copy_file ".env.development.example", ".env.development"
|
42
|
+
copy_file ".env.development.example", ".env.test"
|
43
|
+
end
|
44
|
+
|
49
45
|
def create_settings_yml
|
50
46
|
copy_file "config/settings.yml", "config/settings.yml", force: true
|
51
47
|
end
|
52
48
|
|
53
|
-
def
|
54
|
-
copy_file ".
|
55
|
-
copy_file ".env.development.example", ".env.test"
|
49
|
+
def create_solr_yml
|
50
|
+
copy_file ".solr_wrapper.yml", ".solr_wrapper.yml", force: true
|
56
51
|
end
|
57
52
|
|
58
53
|
def copy_json_schema
|
@@ -63,12 +58,8 @@ module GeoblacklightAdmin
|
|
63
58
|
directory "solr", "solr", force: true
|
64
59
|
end
|
65
60
|
|
66
|
-
def create_solr_yml
|
67
|
-
copy_file ".solr_wrapper.yml", ".solr_wrapper.yml", force: true
|
68
|
-
end
|
69
|
-
|
70
61
|
def set_routes
|
71
|
-
gbl_admin_routes = <<-
|
62
|
+
gbl_admin_routes = <<-ROUTES
|
72
63
|
####################
|
73
64
|
# GBL‡ADMIN
|
74
65
|
|
@@ -129,7 +120,10 @@ module GeoblacklightAdmin
|
|
129
120
|
# Bookmarks
|
130
121
|
resources :bookmarks
|
131
122
|
delete "/bookmarks", to: "bookmarks#destroy", as: :bookmarks_destroy_by_fkeys
|
132
|
-
|
123
|
+
|
124
|
+
# Search controller
|
125
|
+
get "/search" => "search#index"
|
126
|
+
|
133
127
|
# AdvancedSearch controller
|
134
128
|
get '/advanced_search' => 'advanced_search#index', constraints: lambda { |req| req.format == :json }
|
135
129
|
get '/advanced_search/facets' => 'advanced_search#facets', constraints: lambda { |req| req.format == :json }
|
@@ -144,7 +138,7 @@ module GeoblacklightAdmin
|
|
144
138
|
# Documents
|
145
139
|
resources :documents do
|
146
140
|
get "versions"
|
147
|
-
|
141
|
+
|
148
142
|
# DocumentAccesses
|
149
143
|
resources :document_accesses, path: "access" do
|
150
144
|
collection do
|
@@ -155,7 +149,7 @@ module GeoblacklightAdmin
|
|
155
149
|
post "destroy_all"
|
156
150
|
end
|
157
151
|
end
|
158
|
-
|
152
|
+
|
159
153
|
# DocumentDownloads
|
160
154
|
resources :document_downloads, path: "downloads" do
|
161
155
|
collection do
|
@@ -166,7 +160,7 @@ module GeoblacklightAdmin
|
|
166
160
|
post "destroy_all"
|
167
161
|
end
|
168
162
|
end
|
169
|
-
|
163
|
+
|
170
164
|
# Document Assets
|
171
165
|
resources :document_assets, path: "assets" do
|
172
166
|
collection do
|
@@ -182,7 +176,7 @@ module GeoblacklightAdmin
|
|
182
176
|
get "fetch"
|
183
177
|
end
|
184
178
|
end
|
185
|
-
|
179
|
+
|
186
180
|
# Document Accesses
|
187
181
|
resources :document_accesses, path: "access" do
|
188
182
|
collection do
|
@@ -244,48 +238,9 @@ module GeoblacklightAdmin
|
|
244
238
|
inject_into_file "config/routes.rb", gbl_admin_routes, before: /^end/
|
245
239
|
end
|
246
240
|
|
247
|
-
def
|
248
|
-
|
249
|
-
|
250
|
-
# GBL‡ADMIN // @TODO: Why is this necessary? Shouldn't the engine dependencies get installed on their own?
|
251
|
-
gem 'active_storage_validations', '~> 1.0'
|
252
|
-
gem 'amazing_print'
|
253
|
-
gem 'blacklight_advanced_search'
|
254
|
-
# gem 'bootstrap', '~> 4.0' (upstream)
|
255
|
-
gem 'cocoon', '~> 1.2'
|
256
|
-
# gem 'devise', '~> 4.7' (upstream)
|
257
|
-
gem 'devise-bootstrap-views', '~> 1.0'
|
258
|
-
gem 'devise_invitable', '~> 2.0'
|
259
|
-
gem 'dotenv-rails'
|
260
|
-
gem 'haml', '~> 5.2'
|
261
|
-
gem 'httparty'
|
262
|
-
gem 'inline_svg'
|
263
|
-
# gem 'jquery-rails', '~> 4.4' (upstream)
|
264
|
-
gem 'kithe', '~> 2.0'
|
265
|
-
gem 'noticed'
|
266
|
-
gem 'pagy'
|
267
|
-
gem 'paper_trail'
|
268
|
-
gem 'qa', '~> 5.0'
|
269
|
-
gem 'ruby-progressbar'
|
270
|
-
gem 'simple_form', '~> 5.0'
|
271
|
-
gem 'statesman', '~> 7.1.0'
|
272
|
-
"
|
273
|
-
end
|
274
|
-
end
|
275
|
-
|
276
|
-
def set_mime_types
|
277
|
-
append_to_file "config/initializers/mime_types.rb" do
|
278
|
-
'
|
279
|
-
# GBL‡ADMIN
|
280
|
-
# Order is important. ActiveStorage needs :json to be last
|
281
|
-
Mime::Type.register "application/json", :json_aardvark
|
282
|
-
Mime::Type.register "application/json", :json_btaa_aardvark
|
283
|
-
Mime::Type.register "application/json", :json_gbl_v1
|
284
|
-
Mime::Type.register "application/json", :json
|
285
|
-
Mime::Type.register "text/csv", :csv_document_downloads
|
286
|
-
Mime::Type.register "text/csv", :csv_document_access_links
|
287
|
-
'
|
288
|
-
end
|
241
|
+
def set_development_mailer_host
|
242
|
+
mailer_host = "\n config.action_mailer.default_url_options = { :host => 'localhost:3000' }\n"
|
243
|
+
inject_into_file "config/environments/development.rb", mailer_host, after: "config.action_mailer.perform_caching = false"
|
289
244
|
end
|
290
245
|
|
291
246
|
def set_seeds
|
@@ -340,7 +295,7 @@ Mime::Type.register "text/csv", :csv_document_access_links
|
|
340
295
|
end
|
341
296
|
|
342
297
|
def add_catalog_controller_default_params
|
343
|
-
inject_into_file "app/controllers/catalog_controller.rb", after: "
|
298
|
+
inject_into_file "app/controllers/catalog_controller.rb", after: '"q.alt" => "*:*"' do
|
344
299
|
",\n 'fq' => ['b1g_publication_state_s:published']"
|
345
300
|
end
|
346
301
|
end
|
@@ -20,10 +20,6 @@ module GeoblacklightAdmin
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def generate_gbl_admin_example_docs
|
24
|
-
generate "geoblacklight_admin:example_docs"
|
25
|
-
end
|
26
|
-
|
27
23
|
def generate_gbl_admin_jobs
|
28
24
|
generate "geoblacklight_admin:jobs"
|
29
25
|
end
|
@@ -44,15 +40,11 @@ module GeoblacklightAdmin
|
|
44
40
|
generate "geoblacklight_admin:config"
|
45
41
|
end
|
46
42
|
|
47
|
-
def kithe_install
|
48
|
-
run "bundle exec rails generate simple_form:install --bootstrap"
|
49
|
-
end
|
50
|
-
|
51
43
|
def install_active_storage
|
52
44
|
run "bin/rails active_storage:install"
|
53
45
|
end
|
54
46
|
|
55
|
-
def
|
47
|
+
def install_yarn
|
56
48
|
run "yarn install"
|
57
49
|
end
|
58
50
|
end
|
@@ -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
|
-
"
|
137
|
-
"dct_rightsHolder_sm": {
|
143
|
+
"dct_rights_sm": {
|
138
144
|
"type": "array",
|
139
145
|
"items": {
|
140
146
|
"type": "string"
|
141
147
|
}
|
142
148
|
},
|
143
|
-
"
|
149
|
+
"dct_rightsHolder_sm": {
|
144
150
|
"type": "array",
|
145
151
|
"items": {
|
146
152
|
"type": "string"
|
147
153
|
}
|
148
154
|
},
|
149
|
-
"
|
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
|
@@ -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
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "pagy"
|
4
|
+
|
3
5
|
# Pagy initializer file (6.0.4)
|
4
6
|
# Customize only what you really need and notice that the core Pagy works also without any of the following lines.
|
5
7
|
# Should you just cherry pick part of this file, please maintain the require-order of the extras
|