enju_biblio 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/items_controller.rb +0 -4
- data/app/controllers/manifestations_controller.rb +4 -10
- data/app/models/agent.rb +6 -6
- data/app/models/agent_import_file.rb +7 -7
- data/app/models/item.rb +0 -12
- data/app/models/manifestation.rb +0 -12
- data/app/models/resource_import_file.rb +15 -15
- data/app/views/agent_import_results/index.txt.ruby +5 -0
- data/app/views/agent_relationship_types/_form.html.erb +1 -1
- data/app/views/agent_types/_form.html.erb +1 -1
- data/app/views/carrier_types/_form.html.erb +1 -1
- data/app/views/create_types/_form.html.erb +1 -1
- data/app/views/form_of_works/_form.html.erb +1 -1
- data/app/views/frequencies/_form.html.erb +1 -1
- data/app/views/items/_form.html.erb +0 -10
- data/app/views/items/show.html.erb +0 -7
- data/app/views/licenses/_form.html.erb +1 -1
- data/app/views/manifestation_relationship_types/_form.html.erb +1 -1
- data/app/views/manifestations/_form.html.erb +0 -10
- data/app/views/manifestations/_show_detail_librarian.html.erb +0 -8
- data/app/views/medium_of_performances/_form.html.erb +1 -1
- data/app/views/produce_types/_form.html.erb +1 -1
- data/app/views/realize_types/_form.html.erb +1 -1
- data/app/views/resource_import_results/index.txt.ruby +5 -0
- data/app/views/series_statement_merges/_form.html.erb +1 -1
- data/db/migrate/20200322053443_add_default_custom_label_to_library_group.rb +6 -0
- data/db/migrate/20200322083313_create_custom_labels.rb +10 -0
- data/db/migrate/{20191219122214_create_custom_properties.rb → 20200322083458_create_custom_properties.rb} +1 -1
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/controllers/items_controller_spec.rb +0 -25
- data/spec/controllers/manifestations_controller_spec.rb +0 -25
- data/spec/dummy/db/schema.rb +13 -2
- data/spec/fixtures/library_groups.yml +31 -15
- data/spec/fixtures/resource_import_results.yml +2 -2
- data/spec/models/manifestation_spec.rb +0 -25
- data/spec/views/agent_import_results/index.html.erb_spec.rb +29 -0
- data/spec/views/agent_import_results/index.txt.ruby_spec.rb +20 -0
- data/spec/views/agent_import_results/show.html.erb_spec.rb +24 -0
- data/spec/views/manifestations/show.txt.ruby_spec.rb +1 -1
- data/spec/views/resource_import_results/index.txt.ruby_spec.rb +22 -0
- data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
- metadata +33 -32
- data/app/models/custom_property.rb +0 -17
- data/app/views/agent_import_results/index.txt.erb +0 -3
- data/app/views/items/_custom_property_fields.html.erb +0 -7
- data/app/views/manifestations/_custom_property_fields.html.erb +0 -7
- data/app/views/resource_import_results/index.txt.erb +0 -3
- data/spec/factories/custom_property.rb +0 -18
- data/spec/models/custom_property_spec.rb +0 -18
- data/spec/system/custom_properties_spec.rb +0 -84
@@ -1,17 +0,0 @@
|
|
1
|
-
class CustomProperty < ApplicationRecord
|
2
|
-
belongs_to :resource, polymorphic: true
|
3
|
-
validates :label, presence: true
|
4
|
-
end
|
5
|
-
|
6
|
-
# == Schema Information
|
7
|
-
#
|
8
|
-
# Table name: custom_properties
|
9
|
-
#
|
10
|
-
# id :integer not null, primary key
|
11
|
-
# resource_id :integer not null
|
12
|
-
# resource_type :string not null
|
13
|
-
# label :text not null
|
14
|
-
# value :text
|
15
|
-
# created_at :datetime not null
|
16
|
-
# updated_at :datetime not null
|
17
|
-
#
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<div class="nested-fields">
|
2
|
-
<%= f.label :label %>
|
3
|
-
<%= f.text_field :label, class: 'resource_custom_property_body' -%>
|
4
|
-
<%= f.label :value %>
|
5
|
-
<%= f.text_field :value, class: 'resource_custom_property_body' -%>
|
6
|
-
<%= link_to_remove_association t('page.remove'), f, data: {confirm: t('page.are_you_sure')} %><br />
|
7
|
-
</div>
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<div class="nested-fields">
|
2
|
-
<%= f.label :label %>
|
3
|
-
<%= f.text_field :label, class: 'resource_custom_property_body' -%>
|
4
|
-
<%= f.label :value %>
|
5
|
-
<%= f.text_field :value, class: 'resource_custom_property_body' -%>
|
6
|
-
<%= link_to_remove_association t('page.remove'), f, data: {confirm: t('page.are_you_sure')} %><br />
|
7
|
-
</div>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :custom_property do
|
3
|
-
sequence(:label){|n| "custom property #{n}"}
|
4
|
-
sequence(:value){|n| "カスタム項目 #{n}"}
|
5
|
-
end
|
6
|
-
|
7
|
-
factory :manifestation_custom_property, class: CustomProperty do
|
8
|
-
association :resource, factory: :manifestation
|
9
|
-
sequence(:label){|n| "custom property #{n}"}
|
10
|
-
sequence(:value){|n| "カスタム項目 #{n}"}
|
11
|
-
end
|
12
|
-
|
13
|
-
factory :item_custom_property, class: CustomProperty do
|
14
|
-
association :resource, factory: :item
|
15
|
-
sequence(:label){|n| "custom property #{n}"}
|
16
|
-
sequence(:value){|n| "カスタム項目 #{n}"}
|
17
|
-
end
|
18
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe CustomProperty, type: :model do
|
4
|
-
pending "add some examples to (or delete) #{__FILE__}"
|
5
|
-
end
|
6
|
-
|
7
|
-
# == Schema Information
|
8
|
-
#
|
9
|
-
# Table name: custom_properties
|
10
|
-
#
|
11
|
-
# id :integer not null, primary key
|
12
|
-
# resource_id :integer not null
|
13
|
-
# resource_type :string not null
|
14
|
-
# label :text not null
|
15
|
-
# value :text
|
16
|
-
# created_at :datetime not null
|
17
|
-
# updated_at :datetime not null
|
18
|
-
#
|
@@ -1,84 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
RSpec.describe 'CustomProperties', type: :system do
|
4
|
-
include Devise::Test::IntegrationHelpers
|
5
|
-
fixtures :all
|
6
|
-
|
7
|
-
describe 'Manifestation' do
|
8
|
-
before do
|
9
|
-
@manifestation = FactoryBot.create(:manifestation_custom_property).resource
|
10
|
-
CarrierType.find_by(name: 'volume').update(attachment: File.open("#{Rails.root.to_s}/../../app/assets/images/icons/book.png"))
|
11
|
-
end
|
12
|
-
|
13
|
-
describe 'When logged in as Librarian' do
|
14
|
-
before do
|
15
|
-
sign_in users(:librarian1)
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should show custom property' do
|
19
|
-
visit manifestation_path(@manifestation.id, locale: :ja)
|
20
|
-
expect(page).to have_content @manifestation.custom_properties.first.label
|
21
|
-
expect(page).to have_content @manifestation.custom_properties.first.value
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe 'When logged in as User' do
|
26
|
-
before do
|
27
|
-
sign_in users(:user1)
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'should not show custom property' do
|
31
|
-
visit manifestation_path(@manifestation.id, locale: :ja)
|
32
|
-
expect(page).not_to have_content @manifestation.custom_properties.first.label
|
33
|
-
expect(page).not_to have_content @manifestation.custom_properties.first.value
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe 'When not logged in' do
|
38
|
-
it 'should not show custom property' do
|
39
|
-
visit manifestation_path(@manifestation.id, locale: :ja)
|
40
|
-
expect(page).not_to have_content @manifestation.custom_properties.first.label
|
41
|
-
expect(page).not_to have_content @manifestation.custom_properties.first.value
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe 'Item' do
|
47
|
-
before do
|
48
|
-
@item = FactoryBot.create(:item_custom_property).resource
|
49
|
-
CarrierType.find_by(name: 'volume').update(attachment: File.open("#{Rails.root.to_s}/../../app/assets/images/icons/book.png"))
|
50
|
-
end
|
51
|
-
|
52
|
-
describe 'When logged in as Librarian' do
|
53
|
-
before do
|
54
|
-
sign_in users(:librarian1)
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'should show custom property' do
|
58
|
-
visit item_path(@item.id, locale: :ja)
|
59
|
-
expect(page).to have_content @item.custom_properties.first.label
|
60
|
-
expect(page).to have_content @item.custom_properties.first.value
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
describe 'When logged in as User' do
|
65
|
-
before do
|
66
|
-
sign_in users(:user1)
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'should not show custom property' do
|
70
|
-
visit item_path(@item.id, locale: :ja)
|
71
|
-
expect(page).not_to have_content @item.custom_properties.first.label
|
72
|
-
expect(page).not_to have_content @item.custom_properties.first.value
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
describe 'When not logged in' do
|
77
|
-
it 'should not show custom property' do
|
78
|
-
visit item_path(@item.id, locale: :ja)
|
79
|
-
expect(page).not_to have_content @item.custom_properties.first.label
|
80
|
-
expect(page).not_to have_content @item.custom_properties.first.value
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|