hyrax 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +3 -0
- data/README.md +2 -2
- data/app/assets/stylesheets/hyrax/_proxy-rights.scss +7 -1
- data/app/presenters/hyrax/admin/users_presenter.rb +6 -0
- data/app/presenters/hyrax/collapsable_section_presenter.rb +1 -1
- data/app/views/_logo.html.erb +1 -1
- data/app/views/_user_util_links.html.erb +3 -3
- data/app/views/catalog/_search_form.html.erb +3 -1
- data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_show_actions.html.erb +3 -3
- data/app/views/hyrax/admin/admin_sets/edit.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/index.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/new.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/show.html.erb +2 -2
- data/app/views/hyrax/admin/appearances/show.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/edit.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/new.html.erb +1 -1
- data/app/views/hyrax/admin/features/index.html.erb +1 -1
- data/app/views/hyrax/admin/users/index.html.erb +12 -8
- data/app/views/hyrax/admin/workflow_roles/index.html.erb +1 -1
- data/app/views/hyrax/base/_form_files.html.erb +6 -6
- data/app/views/hyrax/base/_show_actions.html.erb +13 -16
- data/app/views/hyrax/base/edit.html.erb +1 -1
- data/app/views/hyrax/collections/_list_works.html.erb +1 -1
- data/app/views/hyrax/collections/_media_display.html.erb +1 -1
- data/app/views/hyrax/content_blocks/edit.html.erb +1 -1
- data/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb +5 -3
- data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +6 -6
- data/app/views/hyrax/dashboard/collections/_list_works.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_document_list_menu.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_work_action_menu.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/edit.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/new.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/show.html.erb +1 -1
- data/app/views/hyrax/dashboard/profiles/_edit_primary.html.erb +2 -2
- data/app/views/hyrax/dashboard/profiles/edit.html.erb +1 -1
- data/app/views/hyrax/dashboard/profiles/show.html.erb +1 -1
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +5 -5
- data/app/views/hyrax/dashboard/sidebar/_configuration.html.erb +6 -6
- data/app/views/hyrax/dashboard/sidebar/_repository_content.html.erb +2 -2
- data/app/views/hyrax/dashboard/sidebar/_tasks.html.erb +4 -4
- data/app/views/hyrax/depositors/index.html.erb +1 -1
- data/app/views/hyrax/embargoes/index.html.erb +1 -1
- data/app/views/hyrax/file_sets/edit.html.erb +4 -4
- data/app/views/hyrax/homepage/index.html.erb +3 -3
- data/app/views/hyrax/my/_admin_set_action_menu.html.erb +4 -2
- data/app/views/hyrax/my/_collection_action_menu.html.erb +4 -3
- data/app/views/hyrax/my/_facet_layout.html.erb +1 -1
- data/app/views/hyrax/my/_facet_limit.html.erb +1 -1
- data/app/views/hyrax/my/_facet_pivot.html.erb +1 -1
- data/app/views/hyrax/my/_work_action_menu.html.erb +6 -4
- data/app/views/hyrax/my/collections/index.html.erb +1 -1
- data/app/views/hyrax/my/index.html.erb +1 -1
- data/app/views/hyrax/my/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/my/works/index.html.erb +1 -1
- data/app/views/hyrax/pages/edit.html.erb +1 -1
- data/app/views/hyrax/transfers/index.html.erb +1 -1
- data/app/views/hyrax/transfers/new.html.erb +1 -1
- data/app/views/hyrax/users/_left_sidebar.html.erb +1 -1
- data/app/views/hyrax/users/_user_info.html.erb +9 -9
- data/app/views/hyrax/users/_vitals.html.erb +3 -3
- data/app/views/shared/_locale_picker.html.erb +2 -2
- data/config/locales/hyrax.de.yml +35 -0
- data/config/locales/hyrax.en.yml +29 -31
- data/config/locales/hyrax.es.yml +35 -0
- data/config/locales/hyrax.fr.yml +35 -0
- data/config/locales/hyrax.it.yml +35 -0
- data/config/locales/hyrax.pt-BR.yml +546 -511
- data/config/locales/hyrax.zh.yml +35 -0
- data/lib/hyrax/version.rb +1 -1
- data/spec/controllers/hyrax/homepage_controller_spec.rb +3 -2
- data/spec/factories/admin_sets.rb +1 -1
- data/spec/factories/admin_sets_lw.rb +7 -7
- data/spec/factories/api_items.rb +1 -1
- data/spec/factories/collection_branding_infos.rb +7 -7
- data/spec/factories/collection_type_participants.rb +2 -2
- data/spec/factories/collection_types.rb +28 -28
- data/spec/factories/collections.rb +14 -14
- data/spec/factories/collections_factory.rb +12 -12
- data/spec/factories/file_sets.rb +3 -3
- data/spec/factories/generic_works.rb +9 -9
- data/spec/factories/operations.rb +5 -5
- data/spec/factories/permission_template_accesses.rb +3 -3
- data/spec/factories/permission_templates.rb +10 -10
- data/spec/factories/single_use_links.rb +4 -4
- data/spec/factories/sipity_entities.rb +1 -1
- data/spec/factories/users.rb +4 -4
- data/spec/factories/workflow_actions.rb +1 -1
- data/spec/factories/workflow_states.rb +1 -1
- data/spec/features/batch_create_spec.rb +1 -1
- data/spec/features/create_work_spec.rb +3 -3
- data/spec/features/dashboard/collection_spec.rb +1 -1
- data/spec/forms/hyrax/forms/work_form_spec.rb +2 -2
- data/spec/forms/hyrax/generic_work_form_spec.rb +2 -2
- data/spec/presenters/hyrax/admin/users_presenter_spec.rb +16 -0
- data/spec/views/hyrax/admin/users/index.html.erb_spec.rb +32 -8
- data/spec/views/hyrax/base/edit.html.erb_spec.rb +1 -1
- data/template.rb +1 -1
- metadata +3 -3
data/config/locales/hyrax.zh.yml
CHANGED
@@ -418,6 +418,10 @@ zh:
|
|
418
418
|
header: 关联
|
419
419
|
relationships_parent_row:
|
420
420
|
label: '属于 %{type}:'
|
421
|
+
share_with:
|
422
|
+
definition_heading: 许可定义
|
423
|
+
definitions_html: "<strong>查看/下载:</strong>可以从%{application_name}中访问此文件(内容和元数据)。 <br /> <strong>编辑:</strong>可以<strong>编辑</strong>此文件(包括内容和元数据)。您只能将此权限授予%{institution_name}用户和/或组。"
|
424
|
+
share_with_html: 您可以为特定用户和/或组授予对文件的“查看/下载”或“编辑”访问权限。输入有效的%{account_name},一次选择一个,选择该用户的访问级别,然后单击+添加。
|
421
425
|
show:
|
422
426
|
last_modified: 最新修改
|
423
427
|
social_media:
|
@@ -840,8 +844,39 @@ zh:
|
|
840
844
|
header: 选择一个动作
|
841
845
|
versions: 版本
|
842
846
|
versions_title: 显示以前的版本
|
847
|
+
edit:
|
848
|
+
descriptions: 说明
|
849
|
+
header: 编辑%{file_set}
|
850
|
+
permissions: 权限
|
851
|
+
versions: 版本
|
852
|
+
form:
|
853
|
+
attach_to: 附加到%{parent}
|
854
|
+
cancel: 取消
|
855
|
+
save: 保存
|
856
|
+
title: 标题
|
843
857
|
groups_description:
|
844
858
|
description_html: 标有"选择一个群"的下拉框内是您所属的一组用户管理群的清单。您可以选择一个特定的群,指定对%{application_name}中文件的访问级别,类似于添加用户访问级别。
|
859
|
+
permission:
|
860
|
+
save: 保存
|
861
|
+
permission_form:
|
862
|
+
applied_to: "(适用于刚刚上传的所有文件)"
|
863
|
+
depositor: 储户
|
864
|
+
enter: 输入%{account_label}(一次一个)
|
865
|
+
header: 权限
|
866
|
+
optional: "(可选的)"
|
867
|
+
save_note_html: 在页面底部按“保存”按钮之前, <strong>不会</strong>保存权限。
|
868
|
+
select_group: 选择一个组
|
869
|
+
share_with: 与某人分享
|
870
|
+
table_title_access: 访问权限
|
871
|
+
table_title_user: 人/组
|
872
|
+
user_search: 搜索用户
|
873
|
+
versioning:
|
874
|
+
current: 当前版本
|
875
|
+
header: 版本
|
876
|
+
restore: 恢复以前的版本
|
877
|
+
restore_from: 还原自
|
878
|
+
save: 保存修订
|
879
|
+
upload: 上传新版本
|
845
880
|
help:
|
846
881
|
header: 用户支持
|
847
882
|
override_text: 用 app/views/static/help.html.erb 取代此文件。
|
data/lib/hyrax/version.rb
CHANGED
@@ -52,7 +52,7 @@ RSpec.describe Hyrax::HomepageController, type: :controller do
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
context "with a document not created this second" do
|
55
|
+
context "with a document not created this second", clean_repo: true do
|
56
56
|
before do
|
57
57
|
gw3 = GenericWork.new(title: ['Test 3 Document'], read_groups: ['public'])
|
58
58
|
gw3.apply_depositor_metadata('mjg36')
|
@@ -60,7 +60,8 @@ RSpec.describe Hyrax::HomepageController, type: :controller do
|
|
60
60
|
old_to_solr = gw3.method(:to_solr)
|
61
61
|
allow(gw3).to receive(:to_solr) do
|
62
62
|
old_to_solr.call.merge(
|
63
|
-
Solrizer.solr_name('system_create', :stored_sortable, type: :date) => 1.day.ago.iso8601
|
63
|
+
Solrizer.solr_name('system_create', :stored_sortable, type: :date) => 1.day.ago.iso8601,
|
64
|
+
Solrizer.solr_name('date_uploaded', :stored_sortable, type: :date) => 1.day.ago.iso8601
|
64
65
|
)
|
65
66
|
end
|
66
67
|
gw3.save
|
@@ -58,8 +58,8 @@ FactoryBot.define do
|
|
58
58
|
transient do
|
59
59
|
user { create(:user) }
|
60
60
|
|
61
|
-
with_permission_template false
|
62
|
-
with_solr_document false
|
61
|
+
with_permission_template { false }
|
62
|
+
with_solr_document { false }
|
63
63
|
end
|
64
64
|
sequence(:title) { |n| ["Collection Title #{n}"] }
|
65
65
|
|
@@ -87,10 +87,10 @@ FactoryBot.define do
|
|
87
87
|
manage_groups: [::Ability.admin_group_name]
|
88
88
|
}
|
89
89
|
end
|
90
|
-
with_solr_document true
|
90
|
+
with_solr_document { true }
|
91
91
|
end
|
92
|
-
id AdminSet::DEFAULT_ID
|
93
|
-
title AdminSet::DEFAULT_TITLE
|
92
|
+
id { AdminSet::DEFAULT_ID }
|
93
|
+
title { AdminSet::DEFAULT_TITLE }
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -99,8 +99,8 @@ FactoryBot.define do
|
|
99
99
|
# Do not use with create because the save will cause the solr grants to be created.
|
100
100
|
transient do
|
101
101
|
user { create(:user) }
|
102
|
-
with_permission_template true
|
103
|
-
with_solr_document true
|
102
|
+
with_permission_template { true }
|
103
|
+
with_solr_document { true }
|
104
104
|
end
|
105
105
|
|
106
106
|
sequence(:title) { |n| ["No Solr Grant Admin Set Title #{n}"] }
|
data/spec/factories/api_items.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :collection_branding_info do
|
3
|
-
collection_id "1"
|
4
|
-
role "banner"
|
5
|
-
local_path "/fake/path/to/banner.png"
|
6
|
-
alt_text "This is the banner"
|
7
|
-
target_url "http://example.com/"
|
8
|
-
height ""
|
9
|
-
width ""
|
3
|
+
collection_id { "1" }
|
4
|
+
role { "banner" }
|
5
|
+
local_path { "/fake/path/to/banner.png" }
|
6
|
+
alt_text { "This is the banner" }
|
7
|
+
target_url { "http://example.com/" }
|
8
|
+
height { "" }
|
9
|
+
width { "" }
|
10
10
|
end
|
11
11
|
end
|
@@ -2,7 +2,7 @@ FactoryBot.define do
|
|
2
2
|
factory :collection_type_participant, class: Hyrax::CollectionTypeParticipant do
|
3
3
|
association :hyrax_collection_type, factory: :collection_type
|
4
4
|
sequence(:agent_id) { |n| "user#{n}@example.com" }
|
5
|
-
agent_type 'user'
|
6
|
-
access Hyrax::CollectionTypeParticipant::MANAGE_ACCESS
|
5
|
+
agent_type { 'user' }
|
6
|
+
access { Hyrax::CollectionTypeParticipant::MANAGE_ACCESS }
|
7
7
|
end
|
8
8
|
end
|
@@ -3,22 +3,22 @@ FactoryBot.define do
|
|
3
3
|
sequence(:title) { |n| "Collection Type #{n}" }
|
4
4
|
sequence(:machine_id) { |n| "title_#{n}" }
|
5
5
|
|
6
|
-
description 'Collection type with all options'
|
7
|
-
nestable true
|
8
|
-
discoverable true
|
9
|
-
sharable true
|
10
|
-
brandable true
|
11
|
-
share_applies_to_new_works true
|
12
|
-
allow_multiple_membership true
|
13
|
-
require_membership false
|
14
|
-
assigns_workflow false
|
15
|
-
assigns_visibility false
|
6
|
+
description { 'Collection type with all options' }
|
7
|
+
nestable { true }
|
8
|
+
discoverable { true }
|
9
|
+
sharable { true }
|
10
|
+
brandable { true }
|
11
|
+
share_applies_to_new_works { true }
|
12
|
+
allow_multiple_membership { true }
|
13
|
+
require_membership { false }
|
14
|
+
assigns_workflow { false }
|
15
|
+
assigns_visibility { false }
|
16
16
|
|
17
17
|
transient do
|
18
|
-
creator_user nil
|
19
|
-
creator_group nil
|
20
|
-
manager_user nil
|
21
|
-
manager_group nil
|
18
|
+
creator_user { nil }
|
19
|
+
creator_group { nil }
|
20
|
+
manager_user { nil }
|
21
|
+
manager_group { nil }
|
22
22
|
end
|
23
23
|
|
24
24
|
after(:create) do |collection_type, evaluator|
|
@@ -56,50 +56,50 @@ FactoryBot.define do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
trait :nestable do
|
59
|
-
nestable true
|
59
|
+
nestable { true }
|
60
60
|
end
|
61
61
|
|
62
62
|
trait :not_nestable do
|
63
|
-
nestable false
|
63
|
+
nestable { false }
|
64
64
|
end
|
65
65
|
|
66
66
|
trait :discoverable do
|
67
|
-
discoverable true
|
67
|
+
discoverable { true }
|
68
68
|
end
|
69
69
|
|
70
70
|
trait :not_discoverable do
|
71
|
-
discoverable false
|
71
|
+
discoverable { false }
|
72
72
|
end
|
73
73
|
|
74
74
|
trait :brandable do
|
75
|
-
brandable true
|
75
|
+
brandable { true }
|
76
76
|
end
|
77
77
|
|
78
78
|
trait :not_brandable do
|
79
|
-
brandable false
|
79
|
+
brandable { false }
|
80
80
|
end
|
81
81
|
|
82
82
|
trait :sharable do
|
83
|
-
sharable true
|
84
|
-
share_applies_to_new_works true
|
83
|
+
sharable { true }
|
84
|
+
share_applies_to_new_works { true }
|
85
85
|
end
|
86
86
|
|
87
87
|
trait :sharable_no_work_permissions do
|
88
|
-
sharable true
|
89
|
-
share_applies_to_new_works false
|
88
|
+
sharable { true }
|
89
|
+
share_applies_to_new_works { false }
|
90
90
|
end
|
91
91
|
|
92
92
|
trait :not_sharable do
|
93
|
-
sharable false
|
94
|
-
share_applies_to_new_works false
|
93
|
+
sharable { false }
|
94
|
+
share_applies_to_new_works { false }
|
95
95
|
end
|
96
96
|
|
97
97
|
trait :allow_multiple_membership do
|
98
|
-
allow_multiple_membership true
|
98
|
+
allow_multiple_membership { true }
|
99
99
|
end
|
100
100
|
|
101
101
|
trait :not_allow_multiple_membership do
|
102
|
-
allow_multiple_membership false
|
102
|
+
allow_multiple_membership { false }
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
@@ -102,10 +102,10 @@ FactoryBot.define do
|
|
102
102
|
transient do
|
103
103
|
user { create(:user) }
|
104
104
|
|
105
|
-
collection_type_settings nil
|
106
|
-
with_permission_template false
|
107
|
-
with_nesting_attributes nil
|
108
|
-
with_solr_document false
|
105
|
+
collection_type_settings { nil }
|
106
|
+
with_permission_template { false }
|
107
|
+
with_nesting_attributes { nil }
|
108
|
+
with_solr_document { false }
|
109
109
|
end
|
110
110
|
sequence(:title) { |n| ["Collection Title #{n}"] }
|
111
111
|
|
@@ -130,32 +130,32 @@ FactoryBot.define do
|
|
130
130
|
factory :public_collection_lw, traits: [:public_lw]
|
131
131
|
|
132
132
|
factory :private_collection_lw do
|
133
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
133
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
134
134
|
end
|
135
135
|
|
136
136
|
factory :institution_collection_lw do
|
137
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
137
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED }
|
138
138
|
end
|
139
139
|
|
140
140
|
factory :named_collection_lw do
|
141
|
-
title ['collection title']
|
142
|
-
description ['collection description']
|
141
|
+
title { ['collection title'] }
|
142
|
+
description { ['collection description'] }
|
143
143
|
end
|
144
144
|
|
145
145
|
trait :public_lw do
|
146
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
146
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
147
147
|
end
|
148
148
|
|
149
149
|
trait :private_lw do
|
150
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
150
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
151
151
|
end
|
152
152
|
|
153
153
|
trait :institution_lw do
|
154
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
154
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED }
|
155
155
|
end
|
156
156
|
|
157
157
|
trait :public_lw do
|
158
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
158
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
159
159
|
end
|
160
160
|
end
|
161
161
|
|
@@ -179,8 +179,8 @@ FactoryBot.define do
|
|
179
179
|
# col.save(validate: false)
|
180
180
|
transient do
|
181
181
|
user { create(:user) }
|
182
|
-
with_permission_template false
|
183
|
-
do_save false
|
182
|
+
with_permission_template { false }
|
183
|
+
do_save { false }
|
184
184
|
end
|
185
185
|
|
186
186
|
sequence(:title) { |n| ["Typeless Collection Title #{n}"] }
|
@@ -20,10 +20,10 @@ FactoryBot.define do
|
|
20
20
|
transient do
|
21
21
|
user { create(:user) }
|
22
22
|
# allow defaulting to default user collection
|
23
|
-
collection_type_settings nil
|
24
|
-
with_permission_template false
|
25
|
-
create_access false
|
26
|
-
with_nesting_attributes nil
|
23
|
+
collection_type_settings { nil }
|
24
|
+
with_permission_template { false }
|
25
|
+
create_access { false }
|
26
|
+
with_nesting_attributes { nil }
|
27
27
|
end
|
28
28
|
sequence(:title) { |n| ["Collection Title #{n}"] }
|
29
29
|
|
@@ -66,20 +66,20 @@ FactoryBot.define do
|
|
66
66
|
factory :public_collection, traits: [:public]
|
67
67
|
|
68
68
|
trait :public do
|
69
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
69
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
70
70
|
end
|
71
71
|
|
72
72
|
factory :private_collection do
|
73
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
73
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
74
74
|
end
|
75
75
|
|
76
76
|
factory :institution_collection do
|
77
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
|
77
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED }
|
78
78
|
end
|
79
79
|
|
80
80
|
factory :named_collection do
|
81
|
-
title ['collection title']
|
82
|
-
description ['collection description']
|
81
|
+
title { ['collection title'] }
|
82
|
+
description { ['collection description'] }
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
@@ -103,9 +103,9 @@ FactoryBot.define do
|
|
103
103
|
# col.save(validate: false)
|
104
104
|
transient do
|
105
105
|
user { create(:user) }
|
106
|
-
with_permission_template false
|
107
|
-
create_access false
|
108
|
-
do_save false
|
106
|
+
with_permission_template { false }
|
107
|
+
create_access { false }
|
108
|
+
do_save { false }
|
109
109
|
end
|
110
110
|
|
111
111
|
sequence(:title) { |n| ["Typeless Collection Title #{n}"] }
|
data/spec/factories/file_sets.rb
CHANGED
@@ -2,7 +2,7 @@ FactoryBot.define do
|
|
2
2
|
factory :file_set do
|
3
3
|
transient do
|
4
4
|
user { create(:user) }
|
5
|
-
content nil
|
5
|
+
content { nil }
|
6
6
|
end
|
7
7
|
after(:build) do |fs, evaluator|
|
8
8
|
fs.apply_depositor_metadata evaluator.user.user_key
|
@@ -13,11 +13,11 @@ FactoryBot.define do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
trait :public do
|
16
|
-
read_groups ["public"]
|
16
|
+
read_groups { ["public"] }
|
17
17
|
end
|
18
18
|
|
19
19
|
trait :registered do
|
20
|
-
read_groups ["registered"]
|
20
|
+
read_groups { ["registered"] }
|
21
21
|
end
|
22
22
|
|
23
23
|
factory :file_with_work do
|
@@ -3,7 +3,7 @@ FactoryBot.define do
|
|
3
3
|
transient do
|
4
4
|
user { create(:user) }
|
5
5
|
# Set to true (or a hash) if you want to create an admin set
|
6
|
-
with_admin_set false
|
6
|
+
with_admin_set { false }
|
7
7
|
end
|
8
8
|
|
9
9
|
# It is reasonable to assume that a work has an admin set; However, we don't want to
|
@@ -22,8 +22,8 @@ FactoryBot.define do
|
|
22
22
|
work.save! if work.member_of_collections.present?
|
23
23
|
end
|
24
24
|
|
25
|
-
title ["Test title"]
|
26
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
25
|
+
title { ["Test title"] }
|
26
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
27
27
|
|
28
28
|
after(:build) do |work, evaluator|
|
29
29
|
work.apply_depositor_metadata(evaluator.user.user_key)
|
@@ -32,15 +32,15 @@ FactoryBot.define do
|
|
32
32
|
factory :public_generic_work, aliases: [:public_work], traits: [:public]
|
33
33
|
|
34
34
|
trait :public do
|
35
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
|
35
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
36
36
|
end
|
37
37
|
|
38
38
|
factory :private_work do
|
39
|
-
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
|
39
|
+
visibility { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
40
40
|
end
|
41
41
|
|
42
42
|
factory :registered_generic_work do
|
43
|
-
read_groups ["registered"]
|
43
|
+
read_groups { ["registered"] }
|
44
44
|
end
|
45
45
|
|
46
46
|
factory :work_with_one_file do
|
@@ -100,7 +100,7 @@ FactoryBot.define do
|
|
100
100
|
# let(:work) { create(:embargoed_work, with_embargo_attributes: embargo_attributes) }
|
101
101
|
|
102
102
|
transient do
|
103
|
-
with_embargo_attributes false
|
103
|
+
with_embargo_attributes { false }
|
104
104
|
embargo_date { Date.tomorrow.to_s }
|
105
105
|
current_state { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
106
106
|
future_state { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
@@ -147,7 +147,7 @@ FactoryBot.define do
|
|
147
147
|
# let(:work) { create(:leased_work, with_lease_attributes: lease_attributes) }
|
148
148
|
|
149
149
|
transient do
|
150
|
-
with_lease_attributes false
|
150
|
+
with_lease_attributes { false }
|
151
151
|
lease_date { Date.tomorrow.to_s }
|
152
152
|
current_state { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
153
153
|
future_state { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
@@ -184,7 +184,7 @@ FactoryBot.define do
|
|
184
184
|
|
185
185
|
# Doesn't set up any edit_users
|
186
186
|
factory :work_without_access, class: GenericWork do
|
187
|
-
title ['Test title']
|
187
|
+
title { ['Test title'] }
|
188
188
|
depositor { create(:user).user_key }
|
189
189
|
end
|
190
190
|
end
|