blacklight-spotlight 3.4.1 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spotlight/version.rb +1 -1
- data/spec/factories/bulk_updates.rb +21 -0
- data/spec/factories/contact_emails.rb +8 -0
- data/spec/factories/contact_images.rb +8 -0
- data/spec/factories/contacts.rb +11 -0
- data/spec/factories/custom_fields.rb +9 -0
- data/spec/factories/custom_search_fields.rb +9 -0
- data/spec/factories/exhibit_thumbnails.rb +8 -0
- data/spec/factories/exhibits.rb +17 -0
- data/spec/factories/featured_images.rb +16 -0
- data/spec/factories/group.rb +17 -0
- data/spec/factories/job_trackers.rb +11 -0
- data/spec/factories/language.rb +8 -0
- data/spec/factories/main_navigation.rb +9 -0
- data/spec/factories/pages.rb +34 -0
- data/spec/factories/resources.rb +14 -0
- data/spec/factories/roles.rb +9 -0
- data/spec/factories/searches.rb +33 -0
- data/spec/factories/tags.rb +14 -0
- data/spec/factories/translation.rb +8 -0
- data/spec/factories/users.rb +50 -0
- metadata +21 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 343306a2d21bc872b86730fa7dd740c3209dea1ed39780ac6e7b71796b2c609d
|
4
|
+
data.tar.gz: f2d93939dc404c1f43477d37f44069b1e17ce4a1334377ec9a12da9d92411e54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcc3ecd39516bf763110820df9c205634af02b12829f1d69d76492f205614087db70b2d5e3ebf969d51333e42020639eeb88cb330475070d76cf971d3da91ad6
|
7
|
+
data.tar.gz: 36d94f02d287b05c3473d543c46993ed33fc27c3daf9f57a5500d2ad4fe585237148154c149cf0c258597317377690c1eefdbcc5c2debfc0cfa045e92b86c836
|
data/lib/spotlight/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :bulk_update, class: 'Spotlight::BulkUpdate' do
|
5
|
+
file { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'updated-bulk-update-template.csv'), __dir__)) }
|
6
|
+
|
7
|
+
exhibit
|
8
|
+
end
|
9
|
+
|
10
|
+
factory :bulk_update_no_cols, class: 'Spotlight::BulkUpdate' do
|
11
|
+
file { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'updated-bulk-update-template-no-cols.csv'), __dir__)) }
|
12
|
+
|
13
|
+
exhibit
|
14
|
+
end
|
15
|
+
|
16
|
+
factory :tagged_bulk_update, class: 'Spotlight::BulkUpdate' do
|
17
|
+
file { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'updated-bulk-update-template-w-tags.csv'), __dir__)) }
|
18
|
+
|
19
|
+
exhibit
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :contact_image, class: 'Spotlight::ContactImage' do
|
5
|
+
image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
|
6
|
+
iiif_tilesource { 'https://exhibits-stage.stanford.edu/images/78' }
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :exhibit_thumbnail, class: 'Spotlight::ExhibitThumbnail' do
|
5
|
+
image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
|
6
|
+
iiif_tilesource { 'https://exhibits-stage.stanford.edu/images/78' }
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :exhibit, class: 'Spotlight::Exhibit' do
|
5
|
+
sequence(:title) { |n| "Exhibit Title #{n}" }
|
6
|
+
published { true }
|
7
|
+
after(:build) { |exhibit| exhibit.searches << FactoryBot.build(:default_search, exhibit: exhibit) }
|
8
|
+
|
9
|
+
trait :with_thumbnail do
|
10
|
+
association :thumbnail, factory: :exhibit_thumbnail
|
11
|
+
end
|
12
|
+
end
|
13
|
+
factory :skinny_exhibit, class: 'Spotlight::Exhibit' do
|
14
|
+
sequence(:title) { |n| "Exhibit Title #{n}" }
|
15
|
+
published { true }
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :featured_image, class: 'Spotlight::FeaturedImage' do
|
5
|
+
image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
|
6
|
+
iiif_tilesource { 'https://exhibits-stage.stanford.edu/images/78' }
|
7
|
+
end
|
8
|
+
|
9
|
+
factory :temporary_image, class: 'Spotlight::TemporaryImage' do
|
10
|
+
image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
|
11
|
+
end
|
12
|
+
|
13
|
+
factory :masthead, class: 'Spotlight::Masthead' do
|
14
|
+
image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :group, class: 'Spotlight::Group' do
|
5
|
+
exhibit
|
6
|
+
|
7
|
+
factory :group_with_searches do
|
8
|
+
transient do
|
9
|
+
searches_count { 5 }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
after(:create) do |group, evaluator|
|
14
|
+
create_list(:search, evaluator.searches_count, groups: [group]) if evaluator.respond_to?(:searches_count)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :job_tracker, class: 'Spotlight::JobTracker' do
|
5
|
+
user
|
6
|
+
on factory: :exhibit
|
7
|
+
resource factory: :exhibit
|
8
|
+
created_at { Time.zone.parse('2017-01-05 23:00:00') }
|
9
|
+
updated_at { Time.zone.parse('2017-01-05 23:05:00') }
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :feature_page, class: 'Spotlight::FeaturePage' do
|
5
|
+
exhibit
|
6
|
+
sequence(:title) { |n| "FeaturePage#{n}" }
|
7
|
+
published { true }
|
8
|
+
content { '[]' }
|
9
|
+
end
|
10
|
+
factory :feature_page_static_title, class: 'Spotlight::FeaturePage' do
|
11
|
+
exhibit
|
12
|
+
title { 'FeaturePage' }
|
13
|
+
published { true }
|
14
|
+
content { '[]' }
|
15
|
+
end
|
16
|
+
factory :feature_subpage, parent: :feature_page do
|
17
|
+
transient do
|
18
|
+
exhibit
|
19
|
+
end
|
20
|
+
title { 'SubPage1' }
|
21
|
+
content { '[]' }
|
22
|
+
after(:build) { |subpage, evaluator| subpage.parent_page = FactoryBot.create(:feature_page, exhibit: evaluator.exhibit) }
|
23
|
+
end
|
24
|
+
factory :about_page, class: 'Spotlight::AboutPage' do
|
25
|
+
exhibit
|
26
|
+
sequence(:title) { |n| "AboutPage#{n}" }
|
27
|
+
content { '[]' }
|
28
|
+
published { true }
|
29
|
+
end
|
30
|
+
|
31
|
+
factory :home_page, class: 'Spotlight::HomePage' do
|
32
|
+
exhibit
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :resource, class: 'Spotlight::Resource' do
|
5
|
+
exhibit
|
6
|
+
type { 'Spotlight::Resource' }
|
7
|
+
url { 'some url' }
|
8
|
+
end
|
9
|
+
factory :uploaded_resource, class: 'Spotlight::Resources::Upload', parent: :resource do
|
10
|
+
type { 'Spotlight::Resources::Upload' }
|
11
|
+
association :upload, factory: :featured_image
|
12
|
+
# url { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :search, class: 'Spotlight::Search' do
|
5
|
+
exhibit
|
6
|
+
sequence(:title) { |n| "Exhibit Search #{n}" }
|
7
|
+
sequence(:slug) { |n| "Search#{n}" }
|
8
|
+
|
9
|
+
after(:build) { |search| search.thumbnail = FactoryBot.create(:featured_image) }
|
10
|
+
|
11
|
+
factory :search_with_groups do
|
12
|
+
transient do
|
13
|
+
groups_count { 2 }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
after(:create) do |search, evaluator|
|
18
|
+
create_list(:group, evaluator.groups_count, searches: [search]) if evaluator.respond_to?(:groups_count)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
factory :published_search, parent: :search do
|
23
|
+
published { true }
|
24
|
+
end
|
25
|
+
|
26
|
+
factory :default_search, class: 'Spotlight::Search' do
|
27
|
+
exhibit
|
28
|
+
title { 'All exhibit items' }
|
29
|
+
long_description { 'All items in this exhibit.' }
|
30
|
+
|
31
|
+
after(:build) { |search| search.thumbnail = FactoryBot.create(:featured_image) }
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :tag, class: 'ActsAsTaggableOn::Tag' do
|
5
|
+
sequence(:name) { |n| "tag#{n}" }
|
6
|
+
end
|
7
|
+
|
8
|
+
factory :tagging, class: 'ActsAsTaggableOn::Tagging' do
|
9
|
+
sequence(:tag) { |n| FactoryBot.create(:tag, name: "tagging#{n}") }
|
10
|
+
tagger { FactoryBot.create(:exhibit) }
|
11
|
+
taggable { FactoryBot.create(:exhibit) }
|
12
|
+
context { :tags }
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :user do
|
5
|
+
sequence(:email) { |n| "user#{n}@example.com" }
|
6
|
+
password { 'insecure' }
|
7
|
+
factory :site_admin do
|
8
|
+
after(:create) do |user, _evaluator|
|
9
|
+
user.roles.create role: 'admin', resource: Spotlight::Site.instance
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
factory :named_exhibit_roles do
|
14
|
+
transient do
|
15
|
+
exhibit { FactoryBot.create(:exhibit) }
|
16
|
+
role { nil }
|
17
|
+
end
|
18
|
+
|
19
|
+
after(:create) do |user, evaluator|
|
20
|
+
user.roles.create role: evaluator.role, resource: evaluator.exhibit if evaluator.role
|
21
|
+
end
|
22
|
+
|
23
|
+
factory :exhibit_admin do
|
24
|
+
transient do
|
25
|
+
role { 'admin' }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
factory :exhibit_curator do
|
30
|
+
transient do
|
31
|
+
role { 'curator' }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
trait :with_exhibit_role do
|
37
|
+
transient do
|
38
|
+
exhibit { FactoryBot.create(:exhibit) }
|
39
|
+
role { nil }
|
40
|
+
end
|
41
|
+
|
42
|
+
after(:create) do |user, evaluator|
|
43
|
+
user.roles.create role: evaluator.role, resource: evaluator.exhibit if evaluator.role
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
factory :exhibit_visitor do
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-spotlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
@@ -1573,6 +1573,26 @@ files:
|
|
1573
1573
|
- lib/spotlight/upload_field_config.rb
|
1574
1574
|
- lib/spotlight/version.rb
|
1575
1575
|
- lib/tasks/spotlight_tasks.rake
|
1576
|
+
- spec/factories/bulk_updates.rb
|
1577
|
+
- spec/factories/contact_emails.rb
|
1578
|
+
- spec/factories/contact_images.rb
|
1579
|
+
- spec/factories/contacts.rb
|
1580
|
+
- spec/factories/custom_fields.rb
|
1581
|
+
- spec/factories/custom_search_fields.rb
|
1582
|
+
- spec/factories/exhibit_thumbnails.rb
|
1583
|
+
- spec/factories/exhibits.rb
|
1584
|
+
- spec/factories/featured_images.rb
|
1585
|
+
- spec/factories/group.rb
|
1586
|
+
- spec/factories/job_trackers.rb
|
1587
|
+
- spec/factories/language.rb
|
1588
|
+
- spec/factories/main_navigation.rb
|
1589
|
+
- spec/factories/pages.rb
|
1590
|
+
- spec/factories/resources.rb
|
1591
|
+
- spec/factories/roles.rb
|
1592
|
+
- spec/factories/searches.rb
|
1593
|
+
- spec/factories/tags.rb
|
1594
|
+
- spec/factories/translation.rb
|
1595
|
+
- spec/factories/users.rb
|
1576
1596
|
- vendor/assets/images/sir-trevor-icons.svg
|
1577
1597
|
- vendor/assets/javascripts/Leaflet.Editable.js
|
1578
1598
|
- vendor/assets/javascripts/MutationObserver.js
|