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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/spotlight/pages.js.erb +1 -1
- data/app/controllers/concerns/spotlight/controller.rb +0 -12
- data/app/helpers/spotlight/crop_helper.rb +1 -5
- data/app/models/concerns/spotlight/resources/open_graph.rb +1 -5
- data/app/models/concerns/spotlight/solr_document.rb +20 -23
- data/app/models/concerns/spotlight/solr_document/finder.rb +16 -0
- data/app/models/spotlight/blacklight_configuration.rb +5 -11
- data/app/models/spotlight/contact.rb +2 -2
- data/app/models/spotlight/custom_field.rb +1 -1
- data/app/models/spotlight/exhibit.rb +3 -3
- data/app/models/spotlight/feature_page.rb +2 -2
- data/app/models/spotlight/field_metadata.rb +12 -4
- data/app/models/spotlight/filter.rb +1 -8
- data/app/models/spotlight/lock.rb +1 -1
- data/app/models/spotlight/page.rb +3 -3
- data/app/models/spotlight/reindexing_log_entry.rb +1 -1
- data/app/models/spotlight/resource.rb +1 -1
- data/app/models/spotlight/resources/upload.rb +1 -1
- data/app/models/spotlight/role.rb +4 -11
- data/app/models/spotlight/search.rb +2 -2
- data/app/models/spotlight/site.rb +1 -1
- data/app/models/spotlight/solr_document_sidecar.rb +5 -1
- data/app/uploaders/spotlight/featured_image_uploader.rb +1 -1
- data/app/views/shared/_exhibit_navbar.html.erb +1 -1
- data/app/views/spotlight/catalog/_edit_default.html.erb +1 -1
- data/db/migrate/20131119213142_create_spotlight_pages.rb +1 -1
- data/db/migrate/20131120172811_create_spotlight_attachments.rb +1 -1
- data/db/migrate/20140128155151_create_exhibits.rb +1 -1
- data/db/migrate/20140128155152_create_roles.rb +1 -1
- data/db/migrate/20140130155151_create_spotlight_searches.rb +1 -1
- data/db/migrate/20140130215634_create_spotlight_blacklight_configurations.rb +1 -1
- data/db/migrate/20140206152809_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +1 -1
- data/db/migrate/20140206152810_add_missing_unique_indices.acts_as_taggable_on_engine.rb +1 -1
- data/db/migrate/20140211203403_create_spotlight_custom_fields.rb +1 -1
- data/db/migrate/20140211212626_create_spotlight_solr_document_sidecars.rb +1 -1
- data/db/migrate/20140218155151_create_contacts.rb +1 -1
- data/db/migrate/20140225180948_create_contact_emails.rb +1 -1
- data/db/migrate/20140228131207_create_resources.rb +1 -1
- data/db/migrate/20140401232956_change_featured_image_to_featured_image_id.rb +1 -1
- data/db/migrate/20140403180324_create_spotlight_main_navigations.rb +1 -1
- data/db/migrate/20141117111311_create_locks.rb +1 -1
- data/db/migrate/20141118233735_change_contact_details.rb +1 -1
- data/db/migrate/20141126231820_add_avatar_to_contacts.rb +1 -1
- data/db/migrate/20141205005902_add_layout_options_to_exhibit.rb +1 -1
- data/db/migrate/20150116161616_add_published_to_exhibit.rb +1 -1
- data/db/migrate/20150127173245_add_featured_image_to_exhibit.rb +1 -1
- data/db/migrate/20150217111511_add_polymorphic_document_to_sidecars.rb +1 -1
- data/db/migrate/20150304071512_add_spotlight_featured_images.rb +1 -1
- data/db/migrate/20150304111111_add_featured_image_to_spotlight_classes.rb +1 -1
- data/db/migrate/20150306202300_add_display_to_spotlight_main_navigations.rb +1 -1
- data/db/migrate/20150313175432_add_field_type_to_custom_fields.rb +1 -1
- data/db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +1 -1
- data/db/migrate/20150410180015_add_missing_taggable_index.acts_as_taggable_on_engine.rb +1 -1
- data/db/migrate/20150410180016_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +1 -1
- data/db/migrate/20150713160101_change_spotlight_searches_to_published.rb +1 -1
- data/db/migrate/20151016092343_remove_searchable_from_exhibit.rb +1 -1
- data/db/migrate/20151110082345_add_metadata_to_spotlight_resource.rb +1 -1
- data/db/migrate/20151117153210_change_spotlight_exhibit_published_default.rb +1 -1
- data/db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb +1 -1
- data/db/migrate/20151124105543_update_custom_field_names.rb +1 -1
- data/db/migrate/20151208085432_add_weight_to_exhibits.rb +1 -1
- data/db/migrate/20151210073829_create_spotlight_site.rb +1 -1
- data/db/migrate/20151211131415_add_site_to_spotlight_exhibits.rb +1 -1
- data/db/migrate/20151215141516_change_roles_to_support_polymorphic_associations.rb +1 -1
- data/db/migrate/20151215192845_add_index_status_to_resources.rb +1 -1
- data/db/migrate/20151217211019_create_spotlight_exhibit_filters.rb +1 -1
- data/db/migrate/20160329215014_add_readonly_to_custom_fields.rb +1 -1
- data/db/migrate/20160711121314_add_default_view_to_spotlight_searches.rb +1 -1
- data/db/migrate/20160714144125_add_iiif_urls_to_featured_image.rb +1 -1
- data/db/migrate/20160718194010_add_iiif_url_to_contact.rb +1 -1
- data/db/migrate/20160805143841_add_upload_id_to_resources.rb +1 -1
- data/db/migrate/20160815165432_add_resource_to_solr_document_sidecar.rb +1 -1
- data/db/migrate/20160816165432_add_index_status_to_solr_document_sidecar.rb +1 -1
- data/db/migrate/20160929180534_add_document_index_to_solr_document_sidecar.rb +1 -1
- data/db/migrate/20170105222939_create_spotlight_reindexing_log_entries.rb +1 -1
- data/db/migrate/20170204091234_add_theme_to_spotlight_exhibits.rb +1 -1
- data/db/migrate/20170803152134_migrate_tags_to_sidecars.rb +17 -0
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/spotlight/appearances_controller_spec.rb +4 -11
- data/spec/controllers/spotlight/catalog_controller_spec.rb +5 -3
- data/spec/controllers/spotlight/solr_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/tags_controller_spec.rb +1 -1
- data/spec/examples.txt +1133 -1135
- data/spec/features/add_custom_field_metadata_spec.rb +1 -1
- data/spec/features/add_iiif_manifest_spec.rb +1 -1
- data/spec/features/add_items_spec.rb +6 -2
- data/spec/features/autocomplete_typeahead_spec.rb +1 -0
- data/spec/features/exhibit_themes_spec.rb +1 -1
- data/spec/features/tags_admin_spec.rb +1 -1
- data/spec/jobs/spotlight/rename_sidecar_field_job_spec.rb +8 -2
- data/spec/models/solr_document_spec.rb +5 -5
- data/spec/models/spotlight/blacklight_configuration_spec.rb +3 -2
- data/spec/models/spotlight/contact_spec.rb +6 -0
- data/spec/models/spotlight/exhibit_spec.rb +0 -10
- data/spec/models/spotlight/field_metadata_spec.rb +4 -4
- data/spec/models/spotlight/reindexing_log_entry_spec.rb +1 -9
- data/spec/models/spotlight/resource_spec.rb +2 -0
- data/spec/models/spotlight/role_spec.rb +1 -1
- data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +3 -9
- data/spec/services/spotlight/solr_document_builder_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -6
- data/spec/support/helpers/controller_level_helpers.rb +0 -2
- data/spec/test_app_templates/fixture.css +0 -0
- data/spec/test_app_templates/fixture.png +0 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +14 -0
- data/spec/uploaders/spotlight/featured_image_uploader_spec.rb +2 -2
- data/spec/views/spotlight/searches/edit.html.erb_spec.rb +2 -0
- data/spec/views/spotlight/tags/index.html.erb_spec.rb +2 -2
- metadata +18 -29
- data/app/models/concerns/spotlight/ar_light.rb +0 -86
- data/app/models/concerns/spotlight/solr_document/active_model_concern.rb +0 -37
- 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
|