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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +58 -59
  3. data/Rakefile +25 -10
  4. data/app/assets/javascripts/geoblacklight_admin.js +1 -1
  5. data/app/assets/stylesheets/geoblacklight_admin/modules/_forms.scss +108 -0
  6. data/app/controllers/admin/documents_controller.rb +22 -13
  7. data/app/controllers/admin/search_controller.rb +2 -1
  8. data/app/controllers/admin/users_controller.rb +1 -1
  9. data/app/indexers/document_indexer.rb +1 -1
  10. data/app/jobs/export_job.rb +7 -5
  11. data/app/jobs/export_json_bulk_job.rb +95 -0
  12. data/app/jobs/export_json_job.rb +14 -12
  13. data/app/models/blacklight_api.rb +6 -6
  14. data/app/models/blacklight_api_facets.rb +7 -2
  15. data/app/models/blacklight_api_ids.rb +3 -4
  16. data/app/models/bulk_action.rb +1 -1
  17. data/app/views/admin/document_accesses/destroy_all.html.erb +1 -1
  18. data/app/views/admin/document_downloads/destroy_all.html.erb +1 -1
  19. data/app/views/admin/documents/_form_nav.html.erb +3 -1
  20. data/app/views/admin/documents/_json_file.jbuilder +14 -0
  21. data/app/views/admin/documents/_result_selected_options.html.erb +3 -1
  22. data/app/views/admin/documents/fetch.json_file.jbuilder +9 -0
  23. data/app/views/admin/documents/index.json_file.jbuilder +9 -0
  24. data/app/views/admin/elements/index.html.erb +1 -1
  25. data/app/views/admin/form_elements/index.html.erb +1 -1
  26. data/app/views/admin/shared/_navbar.html.erb +3 -3
  27. data/app/views/admin/shared/_toast.html.erb +1 -1
  28. data/app/views/admin/users/index.html.erb +1 -1
  29. data/config/locales/documents.en.yml +3 -0
  30. data/db/migrate/20230316183001_add_geoblacklight_admin_gem.rb +1 -0
  31. data/db/seeds.rb +0 -1
  32. data/db/seeds_elements.csv +56 -55
  33. data/db/seeds_elements.numbers +0 -0
  34. data/db/seeds_form_elements.csv +65 -64
  35. data/db/seeds_form_elements.numbers +0 -0
  36. data/lib/generators/geoblacklight_admin/config_generator.rb +31 -76
  37. data/lib/generators/geoblacklight_admin/install_generator.rb +1 -9
  38. data/lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json +12 -6
  39. data/lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb +315 -0
  40. data/lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb +2 -0
  41. data/lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb +15 -0
  42. data/lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb +2 -0
  43. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form.rb +178 -0
  44. data/lib/generators/geoblacklight_admin/templates/config/initializers/simple_form_bootstrap.rb +365 -0
  45. data/lib/generators/geoblacklight_admin/templates/config/settings.yml +74 -22
  46. data/lib/generators/geoblacklight_admin/templates/javascript/controllers/results_controller.js +10 -0
  47. data/lib/generators/geoblacklight_admin/templates/package.json +2 -0
  48. data/lib/generators/geoblacklight_admin/templates/solr/conf/schema.xml +3 -3
  49. data/lib/generators/geoblacklight_admin/views_generator.rb +2 -2
  50. data/lib/geoblacklight_admin/version.rb +1 -1
  51. data/lib/tasks/geoblacklight_admin.rake +6 -6
  52. metadata +24 -17
  53. data/lib/generators/geoblacklight_admin/example_docs_generator.rb +0 -18
  54. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/confirmations/new.html.erb +0 -0
  55. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/edit.html.erb +0 -0
  56. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/invitations/new.html.erb +0 -0
  57. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.html.erb +0 -0
  58. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/mailer/invitation_instructions.text.erb +0 -0
  59. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/edit.html.erb +0 -0
  60. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/passwords/new.html.erb +0 -0
  61. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/edit.html.erb +0 -0
  62. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/registrations/new.html.erb +0 -0
  63. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/sessions/new.html.erb +0 -0
  64. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/shared/_links.html.erb +0 -0
  65. /data/{app/views/admin → lib/generators/geoblacklight_admin/templates}/devise/unlocks/new.html.erb +0 -0
@@ -197,6 +197,16 @@ export default class extends Controller {
197
197
  }
198
198
  }
199
199
 
200
+ exportJsonFile() {
201
+ var scope = this.checkSelectionScope();
202
+ var el = document.querySelector('#result-selected-options');
203
+ if(scope === 'pageset') {
204
+ window.location = el.dataset.pageset + "&format=json_file"
205
+ } else {
206
+ window.location = el.dataset.resultset + "&format=json_file"
207
+ }
208
+ }
209
+
200
210
  exportJsonAardvark() {
201
211
  var scope = this.checkSelectionScope();
202
212
  var el = document.querySelector('#result-selected-options');
@@ -3,6 +3,8 @@
3
3
  "private": true,
4
4
  "dependencies": {
5
5
  "@babel/plugin-proposal-private-methods": "^7.18.6",
6
+ "@babel/plugin-proposal-private-property-in-object": "^7.20.0",
7
+ "@nathanvda/cocoon": "^1.2.14",
6
8
  "@rails/actioncable": "^6.0.0",
7
9
  "@rails/activestorage": "^6.0.0",
8
10
  "@rails/ujs": "^6.0.0",
@@ -18,9 +18,9 @@
18
18
  <dynamicField name="*_dtsi" type="pdate" stored="true" indexed="true" multiValued="false"/>
19
19
  <!-- END Kithe -->
20
20
 
21
- <!-- GEOMG -->
21
+ <!-- GBLADMIN -->
22
22
  <field name="geomg_id_s" type="string" stored="true" indexed="true" required="true"/>
23
- <!-- END GEOMG -->
23
+ <!-- END GBLADMIN -->
24
24
 
25
25
  <!-- GeoBlacklight -->
26
26
  <!-- Spatial Field Type: Represents the exent of the resource and powers map search functionality.
@@ -224,6 +224,6 @@
224
224
  <!-- for bbox value -->
225
225
  <copyField source="dcat_bbox" dest="solr_bboxtype"/>
226
226
 
227
- <!-- for GEOMG reporting -->
227
+ <!-- for GBLADMIN reporting -->
228
228
  <copyField source="date_created_dtsi" dest="date_created_drsim"/>
229
229
  </schema>
@@ -8,11 +8,11 @@ module GeoblacklightAdmin
8
8
 
9
9
  desc <<-DESCRIPTION
10
10
  This generator makes the following changes to your application:
11
- 1. Creates an app/views/catalog directory
11
+ 1. Creates an app/views/devise directory
12
12
  DESCRIPTION
13
13
 
14
14
  def create_views
15
- # @TODO
15
+ directory "devise", "app/views/devise", force: true
16
16
  end
17
17
  end
18
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GeoblacklightAdmin
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  task stats: :environment do
4
- Rake::Task["geomg:stats"].invoke
4
+ Rake::Task["gbl_admin:stats"].invoke
5
5
  end
6
6
 
7
7
  namespace :gbl_admin do
@@ -43,7 +43,7 @@ task ci: :environment do
43
43
  exit!(1) unless success
44
44
  end
45
45
 
46
- namespace :geomg do
46
+ namespace :gbl_admin do
47
47
  desc "Set everything to published state"
48
48
  task publish_all: :environment do
49
49
  Document.all.each do |doc|
@@ -68,7 +68,7 @@ namespace :geomg do
68
68
  CodeStatistics::TEST_TYPES << "Indexers Tests"
69
69
  end
70
70
 
71
- desc "Run Solr and GEOMG for development"
71
+ desc "Run Solr and GBLADMIN for development"
72
72
  task server: :environment do
73
73
  require "solr_wrapper"
74
74
 
@@ -80,7 +80,7 @@ namespace :geomg do
80
80
  puts "Solr running at http://localhost:8983/solr/blacklight-core/, ^C to exit"
81
81
  puts " "
82
82
  begin
83
- # Rake::Task['geomg:solr:restore'].invoke
83
+ # Rake::Task['gbl_admin:solr:restore'].invoke
84
84
  system "bundle exec rails s --binding=#{ENV.fetch("GEOMG_SERVER_BIND_INTERFACE",
85
85
  "0.0.0.0")} --port=#{ENV.fetch("GEOMG_SERVER_PORT",
86
86
  "3000")}"
@@ -103,7 +103,7 @@ namespace :geomg do
103
103
  puts "Solr running at http://localhost:8983/solr/#/blacklight-core/, ^C to exit"
104
104
  begin
105
105
  Rake::Task["db:fixtures:load"].invoke
106
- # Rake::Task["geomg:solr:reindex"].invoke
106
+ # Rake::Task["gbl_admin:solr:reindex"].invoke
107
107
  sleep
108
108
  rescue Interrupt
109
109
  puts "\nShutting down..."
@@ -111,7 +111,7 @@ namespace :geomg do
111
111
  end
112
112
  end
113
113
  else
114
- system("rake geomg:test RAILS_ENV=test")
114
+ system("rake gbl_admin:test RAILS_ENV=test")
115
115
  end
116
116
  end
117
117
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Larson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-15 00:00:00.000000000 Z
11
+ date: 2023-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_storage_validations
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 5.2.0
215
+ version: '5.2'
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 5.2.0
222
+ version: '5.2'
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: httparty
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -778,6 +778,7 @@ files:
778
778
  - app/jobs/bulk_action_run_document_job.rb
779
779
  - app/jobs/bulk_action_run_job.rb
780
780
  - app/jobs/export_job.rb
781
+ - app/jobs/export_json_bulk_job.rb
781
782
  - app/jobs/export_json_job.rb
782
783
  - app/jobs/import_document_job.rb
783
784
  - app/jobs/import_run_job.rb
@@ -854,18 +855,6 @@ files:
854
855
  - app/views/admin/bulk_actions/new.html.erb
855
856
  - app/views/admin/bulk_actions/show.html.erb
856
857
  - app/views/admin/bulk_actions/show.json.jbuilder
857
- - app/views/admin/devise/confirmations/new.html.erb
858
- - app/views/admin/devise/invitations/edit.html.erb
859
- - app/views/admin/devise/invitations/new.html.erb
860
- - app/views/admin/devise/mailer/invitation_instructions.html.erb
861
- - app/views/admin/devise/mailer/invitation_instructions.text.erb
862
- - app/views/admin/devise/passwords/edit.html.erb
863
- - app/views/admin/devise/passwords/new.html.erb
864
- - app/views/admin/devise/registrations/edit.html.erb
865
- - app/views/admin/devise/registrations/new.html.erb
866
- - app/views/admin/devise/sessions/new.html.erb
867
- - app/views/admin/devise/shared/_links.html.erb
868
- - app/views/admin/devise/unlocks/new.html.erb
869
858
  - app/views/admin/document_accesses/_document_access.json.jbuilder
870
859
  - app/views/admin/document_accesses/_form.html.erb
871
860
  - app/views/admin/document_accesses/destroy_all.html.erb
@@ -898,6 +887,7 @@ files:
898
887
  - app/views/admin/documents/_form_nav.html.erb
899
888
  - app/views/admin/documents/_json_aardvark.jbuilder
900
889
  - app/views/admin/documents/_json_btaa_aardvark.jbuilder
890
+ - app/views/admin/documents/_json_file.jbuilder
901
891
  - app/views/admin/documents/_json_gbl_v1.jbuilder
902
892
  - app/views/admin/documents/_result_facets.html.erb
903
893
  - app/views/admin/documents/_result_pagination.html.erb
@@ -910,10 +900,12 @@ files:
910
900
  - app/views/admin/documents/features/_multiple_download_links.html.erb
911
901
  - app/views/admin/documents/fetch.json_aardvark.jbuilder
912
902
  - app/views/admin/documents/fetch.json_btaa_aardvark.jbuilder
903
+ - app/views/admin/documents/fetch.json_file.jbuilder
913
904
  - app/views/admin/documents/fetch.json_gbl_v1.jbuilder
914
905
  - app/views/admin/documents/index.html.erb
915
906
  - app/views/admin/documents/index.json_aardvark.jbuilder
916
907
  - app/views/admin/documents/index.json_btaa_aardvark.jbuilder
908
+ - app/views/admin/documents/index.json_file.jbuilder
917
909
  - app/views/admin/documents/index.json_gbl_v1.jbuilder
918
910
  - app/views/admin/documents/show.json_aardvark.jbuilder
919
911
  - app/views/admin/documents/show.json_btaa_aardvark.jbuilder
@@ -995,7 +987,6 @@ files:
995
987
  - db/seeds_form_elements.numbers
996
988
  - db/structure.sql
997
989
  - lib/generators/geoblacklight_admin/config_generator.rb
998
- - lib/generators/geoblacklight_admin/example_docs_generator.rb
999
990
  - lib/generators/geoblacklight_admin/helpers_generator.rb
1000
991
  - lib/generators/geoblacklight_admin/install_generator.rb
1001
992
  - lib/generators/geoblacklight_admin/jobs_generator.rb
@@ -1004,11 +995,27 @@ files:
1004
995
  - lib/generators/geoblacklight_admin/templates/_user_util_links.html.erb
1005
996
  - lib/generators/geoblacklight_admin/templates/config/database.yml
1006
997
  - lib/generators/geoblacklight_admin/templates/config/geomg_aardvark_schema.json
998
+ - lib/generators/geoblacklight_admin/templates/config/initializers/devise.rb
1007
999
  - lib/generators/geoblacklight_admin/templates/config/initializers/geoblacklight_admin.rb
1008
1000
  - lib/generators/geoblacklight_admin/templates/config/initializers/kithe.rb
1001
+ - lib/generators/geoblacklight_admin/templates/config/initializers/mime_types.rb
1009
1002
  - lib/generators/geoblacklight_admin/templates/config/initializers/pagy.rb
1003
+ - lib/generators/geoblacklight_admin/templates/config/initializers/simple_form.rb
1004
+ - lib/generators/geoblacklight_admin/templates/config/initializers/simple_form_bootstrap.rb
1010
1005
  - lib/generators/geoblacklight_admin/templates/config/initializers/statesman.rb
1011
1006
  - lib/generators/geoblacklight_admin/templates/config/settings.yml
1007
+ - lib/generators/geoblacklight_admin/templates/devise/confirmations/new.html.erb
1008
+ - lib/generators/geoblacklight_admin/templates/devise/invitations/edit.html.erb
1009
+ - lib/generators/geoblacklight_admin/templates/devise/invitations/new.html.erb
1010
+ - lib/generators/geoblacklight_admin/templates/devise/mailer/invitation_instructions.html.erb
1011
+ - lib/generators/geoblacklight_admin/templates/devise/mailer/invitation_instructions.text.erb
1012
+ - lib/generators/geoblacklight_admin/templates/devise/passwords/edit.html.erb
1013
+ - lib/generators/geoblacklight_admin/templates/devise/passwords/new.html.erb
1014
+ - lib/generators/geoblacklight_admin/templates/devise/registrations/edit.html.erb
1015
+ - lib/generators/geoblacklight_admin/templates/devise/registrations/new.html.erb
1016
+ - lib/generators/geoblacklight_admin/templates/devise/sessions/new.html.erb
1017
+ - lib/generators/geoblacklight_admin/templates/devise/shared/_links.html.erb
1018
+ - lib/generators/geoblacklight_admin/templates/devise/unlocks/new.html.erb
1012
1019
  - lib/generators/geoblacklight_admin/templates/javascript/channels/consumer.js
1013
1020
  - lib/generators/geoblacklight_admin/templates/javascript/channels/export_channel.js
1014
1021
  - lib/generators/geoblacklight_admin/templates/javascript/channels/index.js
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rails/generators"
4
-
5
- module GeoblacklightAdmin
6
- class ExampleDocsGenerator < Rails::Generators::Base
7
- source_root File.expand_path("../../../spec/fixtures", __dir__)
8
-
9
- desc <<-DESCRIPTION
10
- This generator makes the following changes to your application:
11
- 1. Copies the dir of example solr doc files to host app/solr/geoblacklight/example_docs
12
- DESCRIPTION
13
-
14
- def create_services
15
- directory "files", "solr/geoblacklight/example_docs"
16
- end
17
- end
18
- end