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
@@ -5,7 +5,7 @@ module Spotlight
|
|
5
5
|
has_many :exhibits, -> { ordered_by_weight }
|
6
6
|
has_many :roles, as: :resource
|
7
7
|
|
8
|
-
belongs_to :masthead, dependent: :destroy
|
8
|
+
belongs_to :masthead, dependent: :destroy, optional: true
|
9
9
|
|
10
10
|
accepts_nested_attributes_for :masthead, update_only: true
|
11
11
|
accepts_nested_attributes_for :exhibits
|
@@ -2,8 +2,12 @@ module Spotlight
|
|
2
2
|
##
|
3
3
|
# Exhibit-specific metadata for indexed documents
|
4
4
|
class SolrDocumentSidecar < ActiveRecord::Base
|
5
|
+
extend ActsAsTaggableOn::Taggable
|
6
|
+
|
7
|
+
acts_as_taggable
|
8
|
+
|
5
9
|
belongs_to :exhibit, required: true
|
6
|
-
belongs_to :resource
|
10
|
+
belongs_to :resource, optional: true
|
7
11
|
belongs_to :document, required: true, polymorphic: true
|
8
12
|
serialize :data, Hash
|
9
13
|
serialize :index_status, Hash
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<ul class="nav navbar-nav">
|
8
|
-
<li class="<%= "active" if current_page?(current_exhibit) %>"><%= link_to t(:'spotlight.curation.nav.home'), current_exhibit %></li>
|
8
|
+
<li class="<%= "active" if current_page?([spotlight, current_exhibit]) %>"><%= link_to t(:'spotlight.curation.nav.home'), [spotlight, current_exhibit] %></li>
|
9
9
|
<% current_exhibit.main_navigations.displayable.each do |navigation| %>
|
10
10
|
<%= render partial: "shared/#{navigation.nav_type}_navbar", locals: { navigation: navigation } %>
|
11
11
|
<% end %>
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
<% if can? :tag, current_exhibit %>
|
39
39
|
<div class="edit-tags">
|
40
|
-
<%= f.text_field :exhibit_tag_list, value: f.object.tags_from(current_exhibit).to_s, 'data-autocomplete_url' => exhibit_tags_path(current_exhibit, format: 'json') %>
|
40
|
+
<%= f.text_field :exhibit_tag_list, value: f.object.sidecar(current_exhibit).tags_from(current_exhibit).to_s, 'data-autocomplete_url' => exhibit_tags_path(current_exhibit, format: 'json') %>
|
41
41
|
</div>
|
42
42
|
<% end %>
|
43
43
|
<div class="form-actions">
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class ChangeFeaturedImageToFeaturedImageId < ActiveRecord::Migration
|
1
|
+
class ChangeFeaturedImageToFeaturedImageId < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
remove_column :spotlight_searches, :featured_image, :string
|
4
4
|
add_column :spotlight_searches, :featured_item_id, :string
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AddPolymorphicDocumentToSidecars < ActiveRecord::Migration
|
1
|
+
class AddPolymorphicDocumentToSidecars < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
add_column :spotlight_solr_document_sidecars, :document_id, :string
|
4
4
|
add_column :spotlight_solr_document_sidecars, :document_type, :string
|
data/db/migrate/20150410180014_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# This migration comes from acts_as_taggable_on_engine (originally 3)
|
2
|
-
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
|
2
|
+
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]
|
3
3
|
def self.up
|
4
4
|
add_column :tags, :taggings_count, :integer, default: 0
|
5
5
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# This migration comes from acts_as_taggable_on_engine (originally 4)
|
2
|
-
class AddMissingTaggableIndex < ActiveRecord::Migration
|
2
|
+
class AddMissingTaggableIndex < ActiveRecord::Migration[4.2]
|
3
3
|
def self.up
|
4
4
|
add_index :taggings, [:taggable_id, :taggable_type, :context]
|
5
5
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# This migration comes from acts_as_taggable_on_engine (originally 5)
|
2
2
|
# This migration is added to circumvent issue #623 and have special characters
|
3
3
|
# work properly
|
4
|
-
class ChangeCollationForTagNames < ActiveRecord::Migration
|
4
|
+
class ChangeCollationForTagNames < ActiveRecord::Migration[4.2]
|
5
5
|
def up
|
6
6
|
if ActsAsTaggableOn::Utils.using_mysql?
|
7
7
|
execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class ChangeRolesToSupportPolymorphicAssociations < ActiveRecord::Migration
|
1
|
+
class ChangeRolesToSupportPolymorphicAssociations < ActiveRecord::Migration[4.2]
|
2
2
|
def up
|
3
3
|
add_column :spotlight_roles, :resource_id, :integer
|
4
4
|
add_column :spotlight_roles, :resource_type, :string
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AddResourceToSolrDocumentSidecar < ActiveRecord::Migration
|
1
|
+
class AddResourceToSolrDocumentSidecar < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
add_column :spotlight_solr_document_sidecars, :resource_id, :integer
|
4
4
|
add_column :spotlight_solr_document_sidecars, :resource_type, :string
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AddDocumentIndexToSolrDocumentSidecar < ActiveRecord::Migration
|
1
|
+
class AddDocumentIndexToSolrDocumentSidecar < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
add_index :spotlight_solr_document_sidecars, [:exhibit_id, :document_type, :document_id], name: 'spotlight_solr_document_sidecars_exhibit_document'
|
4
4
|
add_index :spotlight_solr_document_sidecars, [:document_type, :document_id], name: 'spotlight_solr_document_sidecars_solr_document'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class MigrateTagsToSidecars < ActiveRecord::Migration[5.0]
|
2
|
+
def up
|
3
|
+
Spotlight::SolrDocumentSidecar.reset_column_information
|
4
|
+
ActsAsTaggableOn::Tagging.reset_column_information
|
5
|
+
|
6
|
+
ActsAsTaggableOn::Tagging.where(taggable_type: 'SolrDocument', tagger_type: 'Spotlight::Exhibit').find_each do |e|
|
7
|
+
sidecar = Spotlight::SolrDocumentSidecar.find_or_create_by(document_id: e.taggable_id, document_type: 'SolrDocument', exhibit_id: e.tagger_id)
|
8
|
+
e.update(taggable: sidecar)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def down
|
13
|
+
ActsAsTaggableOn::Tagging.where(taggable_type: 'Spotlight::SolrDocumentSidecar').find_each do |e|
|
14
|
+
e.update(taggable: e.taggable.document)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/spotlight/version.rb
CHANGED
@@ -60,17 +60,10 @@ describe Spotlight::AppearancesController, type: :controller do
|
|
60
60
|
}
|
61
61
|
end
|
62
62
|
let(:main_navigation_attributes) do
|
63
|
-
|
64
|
-
{
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
else
|
69
|
-
[
|
70
|
-
{ id: first_nav.id, label: 'Some Label', weight: 500 },
|
71
|
-
{ id: last_nav.id, display: false }
|
72
|
-
]
|
73
|
-
end
|
63
|
+
{
|
64
|
+
0 => { id: first_nav.id, label: 'Some Label', weight: 500 },
|
65
|
+
1 => { id: last_nav.id, display: false }
|
66
|
+
}
|
74
67
|
end
|
75
68
|
it 'updates the navigation' do
|
76
69
|
patch :update, params: submitted
|