blacklight-spotlight 0.34.1 → 1.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/spotlight/pages.js.erb +1 -1
  4. data/app/controllers/concerns/spotlight/controller.rb +0 -12
  5. data/app/helpers/spotlight/crop_helper.rb +1 -5
  6. data/app/models/concerns/spotlight/resources/open_graph.rb +1 -5
  7. data/app/models/concerns/spotlight/solr_document.rb +20 -23
  8. data/app/models/concerns/spotlight/solr_document/finder.rb +16 -0
  9. data/app/models/spotlight/blacklight_configuration.rb +5 -11
  10. data/app/models/spotlight/contact.rb +2 -2
  11. data/app/models/spotlight/custom_field.rb +1 -1
  12. data/app/models/spotlight/exhibit.rb +3 -3
  13. data/app/models/spotlight/feature_page.rb +2 -2
  14. data/app/models/spotlight/field_metadata.rb +12 -4
  15. data/app/models/spotlight/filter.rb +1 -8
  16. data/app/models/spotlight/lock.rb +1 -1
  17. data/app/models/spotlight/page.rb +3 -3
  18. data/app/models/spotlight/reindexing_log_entry.rb +1 -1
  19. data/app/models/spotlight/resource.rb +1 -1
  20. data/app/models/spotlight/resources/upload.rb +1 -1
  21. data/app/models/spotlight/role.rb +4 -11
  22. data/app/models/spotlight/search.rb +2 -2
  23. data/app/models/spotlight/site.rb +1 -1
  24. data/app/models/spotlight/solr_document_sidecar.rb +5 -1
  25. data/app/uploaders/spotlight/featured_image_uploader.rb +1 -1
  26. data/app/views/shared/_exhibit_navbar.html.erb +1 -1
  27. data/app/views/spotlight/catalog/_edit_default.html.erb +1 -1
  28. data/db/migrate/20131119213142_create_spotlight_pages.rb +1 -1
  29. data/db/migrate/20131120172811_create_spotlight_attachments.rb +1 -1
  30. data/db/migrate/20140128155151_create_exhibits.rb +1 -1
  31. data/db/migrate/20140128155152_create_roles.rb +1 -1
  32. data/db/migrate/20140130155151_create_spotlight_searches.rb +1 -1
  33. data/db/migrate/20140130215634_create_spotlight_blacklight_configurations.rb +1 -1
  34. data/db/migrate/20140206152809_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +1 -1
  35. data/db/migrate/20140206152810_add_missing_unique_indices.acts_as_taggable_on_engine.rb +1 -1
  36. data/db/migrate/20140211203403_create_spotlight_custom_fields.rb +1 -1
  37. data/db/migrate/20140211212626_create_spotlight_solr_document_sidecars.rb +1 -1
  38. data/db/migrate/20140218155151_create_contacts.rb +1 -1
  39. data/db/migrate/20140225180948_create_contact_emails.rb +1 -1
  40. data/db/migrate/20140228131207_create_resources.rb +1 -1
  41. data/db/migrate/20140401232956_change_featured_image_to_featured_image_id.rb +1 -1
  42. data/db/migrate/20140403180324_create_spotlight_main_navigations.rb +1 -1
  43. data/db/migrate/20141117111311_create_locks.rb +1 -1
  44. data/db/migrate/20141118233735_change_contact_details.rb +1 -1
  45. data/db/migrate/20141126231820_add_avatar_to_contacts.rb +1 -1
  46. data/db/migrate/20141205005902_add_layout_options_to_exhibit.rb +1 -1
  47. data/db/migrate/20150116161616_add_published_to_exhibit.rb +1 -1
  48. data/db/migrate/20150127173245_add_featured_image_to_exhibit.rb +1 -1
  49. data/db/migrate/20150217111511_add_polymorphic_document_to_sidecars.rb +1 -1
  50. data/db/migrate/20150304071512_add_spotlight_featured_images.rb +1 -1
  51. data/db/migrate/20150304111111_add_featured_image_to_spotlight_classes.rb +1 -1
  52. data/db/migrate/20150306202300_add_display_to_spotlight_main_navigations.rb +1 -1
  53. data/db/migrate/20150313175432_add_field_type_to_custom_fields.rb +1 -1
  54. data/db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +1 -1
  55. data/db/migrate/20150410180015_add_missing_taggable_index.acts_as_taggable_on_engine.rb +1 -1
  56. data/db/migrate/20150410180016_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +1 -1
  57. data/db/migrate/20150713160101_change_spotlight_searches_to_published.rb +1 -1
  58. data/db/migrate/20151016092343_remove_searchable_from_exhibit.rb +1 -1
  59. data/db/migrate/20151110082345_add_metadata_to_spotlight_resource.rb +1 -1
  60. data/db/migrate/20151117153210_change_spotlight_exhibit_published_default.rb +1 -1
  61. data/db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb +1 -1
  62. data/db/migrate/20151124105543_update_custom_field_names.rb +1 -1
  63. data/db/migrate/20151208085432_add_weight_to_exhibits.rb +1 -1
  64. data/db/migrate/20151210073829_create_spotlight_site.rb +1 -1
  65. data/db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb +1 -1
  66. data/db/migrate/20151215141516_change_roles_to_support_polymorphic_associations.rb +1 -1
  67. data/db/migrate/20151215192845_add_index_status_to_resources.rb +1 -1
  68. data/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb +1 -1
  69. data/db/migrate/20160329215014_add_readonly_to_custom_fields.rb +1 -1
  70. data/db/migrate/20160711121314_add_default_view_to_spotlight_searches.rb +1 -1
  71. data/db/migrate/20160714144125_add_iiif_urls_to_featured_image.rb +1 -1
  72. data/db/migrate/20160718194010_add_iiif_url_to_contact.rb +1 -1
  73. data/db/migrate/20160805143841_add_upload_id_to_resources.rb +1 -1
  74. data/db/migrate/20160815165432_add_resource_to_solr_document_sidecar.rb +1 -1
  75. data/db/migrate/20160816165432_add_index_status_to_solr_document_sidecar.rb +1 -1
  76. data/db/migrate/20160929180534_add_document_index_to_solr_document_sidecar.rb +1 -1
  77. data/db/migrate/20170105222939_create_spotlight_reindexing_log_entries.rb +1 -1
  78. data/db/migrate/20170204091234_add_theme_to_spotlight_exhibits.rb +1 -1
  79. data/db/migrate/20170803152134_migrate_tags_to_sidecars.rb +17 -0
  80. data/lib/spotlight/version.rb +1 -1
  81. data/spec/controllers/spotlight/appearances_controller_spec.rb +4 -11
  82. data/spec/controllers/spotlight/catalog_controller_spec.rb +5 -3
  83. data/spec/controllers/spotlight/solr_controller_spec.rb +1 -1
  84. data/spec/controllers/spotlight/tags_controller_spec.rb +1 -1
  85. data/spec/examples.txt +1133 -1135
  86. data/spec/features/add_custom_field_metadata_spec.rb +1 -1
  87. data/spec/features/add_iiif_manifest_spec.rb +1 -1
  88. data/spec/features/add_items_spec.rb +6 -2
  89. data/spec/features/autocomplete_typeahead_spec.rb +1 -0
  90. data/spec/features/exhibit_themes_spec.rb +1 -1
  91. data/spec/features/tags_admin_spec.rb +1 -1
  92. data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +8 -2
  93. data/spec/models/solr_document_spec.rb +5 -5
  94. data/spec/models/spotlight/blacklight_configuration_spec.rb +3 -2
  95. data/spec/models/spotlight/contact_spec.rb +6 -0
  96. data/spec/models/spotlight/exhibit_spec.rb +0 -10
  97. data/spec/models/spotlight/field_metadata_spec.rb +4 -4
  98. data/spec/models/spotlight/reindexing_log_entry_spec.rb +1 -9
  99. data/spec/models/spotlight/resource_spec.rb +2 -0
  100. data/spec/models/spotlight/role_spec.rb +1 -1
  101. data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +3 -9
  102. data/spec/services/spotlight/solr_document_builder_spec.rb +2 -2
  103. data/spec/spec_helper.rb +2 -6
  104. data/spec/support/helpers/controller_level_helpers.rb +0 -2
  105. data/spec/test_app_templates/fixture.css +0 -0
  106. data/spec/test_app_templates/fixture.png +0 -0
  107. data/spec/test_app_templates/lib/generators/test_app_generator.rb +14 -0
  108. data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +2 -2
  109. data/spec/views/spotlight/searches/edit.html.erb_spec.rb +2 -0
  110. data/spec/views/spotlight/tags/index.html.erb_spec.rb +2 -2
  111. metadata +18 -29
  112. data/app/models/concerns/spotlight/ar_light.rb +0 -86
  113. data/app/models/concerns/spotlight/solr_document/active_model_concern.rb +0 -37
  114. data/spec/support/backport_test_helpers.rb +0 -45
@@ -1,86 +0,0 @@
1
- module Spotlight
2
- ##
3
- # Stub ActiveRecord methods to allow non-ActiveRecord::Base objects to
4
- # participate in e.g. associations
5
- module ArLight
6
- extend ActiveSupport::Concern
7
- include ActiveRecord::ModelSchema
8
- include ActiveRecord::Inheritance
9
- include ActiveRecord::Associations
10
- include ActiveRecord::Reflection
11
- include ActiveModel::Dirty
12
-
13
- ##
14
- # Mock activerecord class-level methods
15
- module ClassMethods
16
- def has_attribute?(*_args)
17
- false
18
- end
19
-
20
- def columns_hash
21
- {}
22
- end
23
-
24
- def base_class
25
- self
26
- end
27
-
28
- # required for Rails >= 4.0.4
29
- def subclass_from_attributes?(_)
30
- false
31
- end
32
-
33
- def before_destroy(*_args); end
34
-
35
- def pluralize_table_names
36
- true
37
- end
38
-
39
- def add_autosave_association_callbacks(_arg); end
40
-
41
- # needed for Rails 4.1 + act_as_taggable
42
- def dangerous_attribute_method?(*_args)
43
- false
44
- end
45
-
46
- # needed for Rails 4.1 + act_as_taggable
47
- def generated_association_methods
48
- @generated_association_methods ||= begin
49
- mod = const_set(:GeneratedAssociationMethods, Module.new)
50
- include mod
51
- mod
52
- end
53
- end
54
-
55
- def validators_on(*_)
56
- []
57
- end
58
-
59
- def default_scopes
60
- []
61
- end
62
- end
63
-
64
- def initialize(source_doc = {}, solr_response = nil)
65
- @association_cache = {}
66
- super
67
- yield self if block_given?
68
- end
69
-
70
- # Returns true if +comparison_object+ is the same exact object, or +comparison_object+
71
- # is of the same type and +self+ has an ID and it is equal to +comparison_object.id+.
72
- #
73
- # Note that new records are different from any other record by definition, unless the
74
- # other record is the receiver itself. Besides, if you fetch existing records with
75
- # +select+ and leave the ID out, you're on your own, this predicate will return false.
76
- #
77
- # Note also that destroying a record preserves its ID in the model instance, so deleted
78
- # models are still comparable.
79
- def ==(other)
80
- super ||
81
- (other.instance_of?(self.class) &&
82
- id &&
83
- other.id == id)
84
- end
85
- end
86
- end
@@ -1,37 +0,0 @@
1
- module Spotlight
2
- module SolrDocument
3
- ##
4
- # ActiveModel stubs to make {::SolrDocument}s work as activemodel objects
5
- module ActiveModelConcern
6
- extend ActiveSupport::Concern
7
-
8
- included do
9
- include Spotlight::ArLight
10
- extend ActiveModel::Callbacks
11
- define_model_callbacks :save
12
- end
13
-
14
- def save
15
- run_callbacks :save do
16
- # no-op
17
- end
18
- end
19
-
20
- def to_key
21
- [id]
22
- end
23
-
24
- def persisted?
25
- true
26
- end
27
-
28
- def destroyed?
29
- false
30
- end
31
-
32
- def new_record?
33
- !persisted?
34
- end
35
- end
36
- end
37
- end
@@ -1,45 +0,0 @@
1
- # Backport the Rails 5 controller test methods to Rails 4
2
- module BackportTestHelpers
3
- def delete(*args)
4
- (action, rest) = *args
5
- rest ||= {}
6
-
7
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
8
-
9
- super(action, rest[:params])
10
- end
11
-
12
- def get(*args)
13
- (action, rest) = *args
14
- rest ||= {}
15
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
16
- super(action, rest[:params])
17
- end
18
-
19
- def post(*args)
20
- (action, rest) = *args
21
- rest ||= {}
22
- body = rest[:body]
23
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
24
-
25
- if body
26
- super(action, body, rest.except(:params).merge(rest[:params]))
27
- else
28
- super(action, rest[:params])
29
- end
30
- end
31
-
32
- def put(*args)
33
- (action, rest) = *args
34
- rest ||= {}
35
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
36
- super(action, rest[:params])
37
- end
38
-
39
- def patch(*args)
40
- (action, rest) = *args
41
- rest ||= {}
42
- @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr]
43
- super(action, rest[:params])
44
- end
45
- end