hyrax 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +3 -0
  3. data/README.md +2 -2
  4. data/app/assets/stylesheets/hyrax/_proxy-rights.scss +7 -1
  5. data/app/presenters/hyrax/admin/users_presenter.rb +6 -0
  6. data/app/presenters/hyrax/collapsable_section_presenter.rb +1 -1
  7. data/app/views/_logo.html.erb +1 -1
  8. data/app/views/_user_util_links.html.erb +3 -3
  9. data/app/views/catalog/_search_form.html.erb +3 -1
  10. data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
  11. data/app/views/hyrax/admin/admin_sets/_show_actions.html.erb +3 -3
  12. data/app/views/hyrax/admin/admin_sets/edit.html.erb +1 -1
  13. data/app/views/hyrax/admin/admin_sets/index.html.erb +2 -2
  14. data/app/views/hyrax/admin/admin_sets/new.html.erb +1 -1
  15. data/app/views/hyrax/admin/admin_sets/show.html.erb +2 -2
  16. data/app/views/hyrax/admin/appearances/show.html.erb +1 -1
  17. data/app/views/hyrax/admin/collection_types/edit.html.erb +1 -1
  18. data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
  19. data/app/views/hyrax/admin/collection_types/new.html.erb +1 -1
  20. data/app/views/hyrax/admin/features/index.html.erb +1 -1
  21. data/app/views/hyrax/admin/users/index.html.erb +12 -8
  22. data/app/views/hyrax/admin/workflow_roles/index.html.erb +1 -1
  23. data/app/views/hyrax/base/_form_files.html.erb +6 -6
  24. data/app/views/hyrax/base/_show_actions.html.erb +13 -16
  25. data/app/views/hyrax/base/edit.html.erb +1 -1
  26. data/app/views/hyrax/collections/_list_works.html.erb +1 -1
  27. data/app/views/hyrax/collections/_media_display.html.erb +1 -1
  28. data/app/views/hyrax/content_blocks/edit.html.erb +1 -1
  29. data/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb +5 -3
  30. data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +6 -6
  31. data/app/views/hyrax/dashboard/collections/_list_works.html.erb +1 -1
  32. data/app/views/hyrax/dashboard/collections/_show_document_list_menu.html.erb +2 -2
  33. data/app/views/hyrax/dashboard/collections/_work_action_menu.html.erb +2 -2
  34. data/app/views/hyrax/dashboard/collections/edit.html.erb +1 -1
  35. data/app/views/hyrax/dashboard/collections/new.html.erb +1 -1
  36. data/app/views/hyrax/dashboard/collections/show.html.erb +1 -1
  37. data/app/views/hyrax/dashboard/profiles/_edit_primary.html.erb +2 -2
  38. data/app/views/hyrax/dashboard/profiles/edit.html.erb +1 -1
  39. data/app/views/hyrax/dashboard/profiles/show.html.erb +1 -1
  40. data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +5 -5
  41. data/app/views/hyrax/dashboard/sidebar/_configuration.html.erb +6 -6
  42. data/app/views/hyrax/dashboard/sidebar/_repository_content.html.erb +2 -2
  43. data/app/views/hyrax/dashboard/sidebar/_tasks.html.erb +4 -4
  44. data/app/views/hyrax/depositors/index.html.erb +1 -1
  45. data/app/views/hyrax/embargoes/index.html.erb +1 -1
  46. data/app/views/hyrax/file_sets/edit.html.erb +4 -4
  47. data/app/views/hyrax/homepage/index.html.erb +3 -3
  48. data/app/views/hyrax/my/_admin_set_action_menu.html.erb +4 -2
  49. data/app/views/hyrax/my/_collection_action_menu.html.erb +4 -3
  50. data/app/views/hyrax/my/_facet_layout.html.erb +1 -1
  51. data/app/views/hyrax/my/_facet_limit.html.erb +1 -1
  52. data/app/views/hyrax/my/_facet_pivot.html.erb +1 -1
  53. data/app/views/hyrax/my/_work_action_menu.html.erb +6 -4
  54. data/app/views/hyrax/my/collections/index.html.erb +1 -1
  55. data/app/views/hyrax/my/index.html.erb +1 -1
  56. data/app/views/hyrax/my/works/_list_works.html.erb +1 -1
  57. data/app/views/hyrax/my/works/index.html.erb +1 -1
  58. data/app/views/hyrax/pages/edit.html.erb +1 -1
  59. data/app/views/hyrax/transfers/index.html.erb +1 -1
  60. data/app/views/hyrax/transfers/new.html.erb +1 -1
  61. data/app/views/hyrax/users/_left_sidebar.html.erb +1 -1
  62. data/app/views/hyrax/users/_user_info.html.erb +9 -9
  63. data/app/views/hyrax/users/_vitals.html.erb +3 -3
  64. data/app/views/shared/_locale_picker.html.erb +2 -2
  65. data/config/locales/hyrax.de.yml +35 -0
  66. data/config/locales/hyrax.en.yml +29 -31
  67. data/config/locales/hyrax.es.yml +35 -0
  68. data/config/locales/hyrax.fr.yml +35 -0
  69. data/config/locales/hyrax.it.yml +35 -0
  70. data/config/locales/hyrax.pt-BR.yml +546 -511
  71. data/config/locales/hyrax.zh.yml +35 -0
  72. data/lib/hyrax/version.rb +1 -1
  73. data/spec/controllers/hyrax/homepage_controller_spec.rb +3 -2
  74. data/spec/factories/admin_sets.rb +1 -1
  75. data/spec/factories/admin_sets_lw.rb +7 -7
  76. data/spec/factories/api_items.rb +1 -1
  77. data/spec/factories/collection_branding_infos.rb +7 -7
  78. data/spec/factories/collection_type_participants.rb +2 -2
  79. data/spec/factories/collection_types.rb +28 -28
  80. data/spec/factories/collections.rb +14 -14
  81. data/spec/factories/collections_factory.rb +12 -12
  82. data/spec/factories/file_sets.rb +3 -3
  83. data/spec/factories/generic_works.rb +9 -9
  84. data/spec/factories/operations.rb +5 -5
  85. data/spec/factories/permission_template_accesses.rb +3 -3
  86. data/spec/factories/permission_templates.rb +10 -10
  87. data/spec/factories/single_use_links.rb +4 -4
  88. data/spec/factories/sipity_entities.rb +1 -1
  89. data/spec/factories/users.rb +4 -4
  90. data/spec/factories/workflow_actions.rb +1 -1
  91. data/spec/factories/workflow_states.rb +1 -1
  92. data/spec/features/batch_create_spec.rb +1 -1
  93. data/spec/features/create_work_spec.rb +3 -3
  94. data/spec/features/dashboard/collection_spec.rb +1 -1
  95. data/spec/forms/hyrax/forms/work_form_spec.rb +2 -2
  96. data/spec/forms/hyrax/generic_work_form_spec.rb +2 -2
  97. data/spec/presenters/hyrax/admin/users_presenter_spec.rb +16 -0
  98. data/spec/views/hyrax/admin/users/index.html.erb_spec.rb +32 -8
  99. data/spec/views/hyrax/base/edit.html.erb_spec.rb +1 -1
  100. data/template.rb +1 -1
  101. metadata +3 -3
@@ -1,21 +1,21 @@
1
1
  FactoryBot.define do
2
2
  factory :operation, class: Hyrax::Operation do
3
- operation_type "Test operation"
3
+ operation_type { "Test operation" }
4
4
 
5
5
  trait :failing do
6
- status Hyrax::Operation::FAILURE
6
+ status { Hyrax::Operation::FAILURE }
7
7
  end
8
8
 
9
9
  trait :pending do
10
- status Hyrax::Operation::PENDING
10
+ status { Hyrax::Operation::PENDING }
11
11
  end
12
12
 
13
13
  trait :successful do
14
- status Hyrax::Operation::SUCCESS
14
+ status { Hyrax::Operation::SUCCESS }
15
15
  end
16
16
 
17
17
  factory :batch_create_operation, class: Hyrax::BatchCreateOperation do
18
- operation_type "Batch Create"
18
+ operation_type { "Batch Create" }
19
19
  end
20
20
  end
21
21
  end
@@ -2,15 +2,15 @@ FactoryBot.define do
2
2
  factory :permission_template_access, class: Hyrax::PermissionTemplateAccess do
3
3
  permission_template
4
4
  trait :manage do
5
- access 'manage'
5
+ access { 'manage' }
6
6
  end
7
7
 
8
8
  trait :deposit do
9
- access 'deposit'
9
+ access { 'deposit' }
10
10
  end
11
11
 
12
12
  trait :view do
13
- access 'view'
13
+ access { 'view' }
14
14
  end
15
15
  end
16
16
  end
@@ -52,16 +52,16 @@ FactoryBot.define do
52
52
  end
53
53
 
54
54
  transient do
55
- with_admin_set false
56
- with_collection false
57
- with_workflows false
58
- with_active_workflow false
59
- manage_users nil
60
- manage_groups nil
61
- deposit_users nil
62
- deposit_groups nil
63
- view_users nil
64
- view_groups nil
55
+ with_admin_set { false }
56
+ with_collection { false }
57
+ with_workflows { false }
58
+ with_active_workflow { false }
59
+ manage_users { nil }
60
+ manage_groups { nil }
61
+ deposit_users { nil }
62
+ deposit_groups { nil }
63
+ view_users { nil }
64
+ view_groups { nil }
65
65
  end
66
66
  end
67
67
 
@@ -1,13 +1,13 @@
1
1
  FactoryBot.define do
2
2
  factory :single_use_link do
3
3
  factory :show_link do
4
- itemId 'fs-id'
5
- path '/concerns/generic_work/1234'
4
+ itemId { 'fs-id' }
5
+ path { '/concerns/generic_work/1234' }
6
6
  end
7
7
 
8
8
  factory :download_link do
9
- itemId 'fs-id'
10
- path '/downloads/1234'
9
+ itemId { 'fs-id' }
10
+ path { '/downloads/1234' }
11
11
  end
12
12
  end
13
13
  end
@@ -1,6 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :sipity_entity, class: Sipity::Entity do
3
- proxy_for_global_id 'gid://internal/Mock/1'
3
+ proxy_for_global_id { 'gid://internal/Mock/1' }
4
4
  workflow { workflow_state.workflow }
5
5
  workflow_state
6
6
  end
@@ -1,12 +1,12 @@
1
1
  FactoryBot.define do
2
2
  factory :user do
3
3
  sequence(:email) { |n| "user#{n}@example.com" }
4
- password 'password'
4
+ password { 'password' }
5
5
 
6
6
  transient do
7
7
  # Allow for custom groups when a user is instantiated.
8
8
  # @example create(:user, groups: 'avacado')
9
- groups []
9
+ groups { [] }
10
10
  end
11
11
 
12
12
  # TODO: Register the groups for the given user key such that we can remove the following from other specs:
@@ -22,7 +22,7 @@ FactoryBot.define do
22
22
  end
23
23
 
24
24
  factory :admin do
25
- groups ['admin']
25
+ groups { ['admin'] }
26
26
  end
27
27
 
28
28
  factory :user_with_mail do
@@ -46,7 +46,7 @@ FactoryBot.define do
46
46
  end
47
47
 
48
48
  trait :guest do
49
- guest true
49
+ guest { true }
50
50
  end
51
51
  end
52
52
 
@@ -1,6 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :workflow_action, class: Sipity::WorkflowAction do
3
3
  workflow
4
- name 'submit'
4
+ name { 'submit' }
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :workflow_state, class: Sipity::WorkflowState do
3
3
  workflow
4
- name 'initial'
4
+ name { 'initial' }
5
5
  end
6
6
  end
@@ -39,7 +39,7 @@ RSpec.describe 'Batch creation of works', type: :feature do
39
39
  it "allows on-behalf-of batch deposit", :js do
40
40
  click_link "Files" # switch tab
41
41
  expect(page).to have_content "Add files"
42
- within('button#addfiles') do
42
+ within('span#addfiles') do
43
43
  # two arbitrary files that aren't actually related, but should be
44
44
  # small enough to require minimal processessing.
45
45
  attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/small_file.txt", visible: false)
@@ -30,7 +30,7 @@ RSpec.describe 'Creating a new Work', :js, :workflow do
30
30
  click_link "Files" # switch tab
31
31
  expect(page).to have_content "Add files"
32
32
  expect(page).to have_content "Add folder"
33
- within('button#addfiles') do
33
+ within('span#addfiles') do
34
34
  attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false)
35
35
  attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/jp2_fits.xml", visible: false)
36
36
  end
@@ -71,7 +71,7 @@ RSpec.describe 'Creating a new Work', :js, :workflow do
71
71
  it "allows on-behalf-of deposit" do
72
72
  click_link "Files" # switch tab
73
73
  expect(page).to have_content "Add files"
74
- within('button#addfiles') do
74
+ within('span#addfiles') do
75
75
  attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false)
76
76
  attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/jp2_fits.xml", visible: false)
77
77
  end
@@ -113,7 +113,7 @@ RSpec.describe 'Creating a new Work', :js, :workflow do
113
113
 
114
114
  it 'updates the required file check status' do
115
115
  click_link "Files" # switch to the Files tab
116
- within('button#addfiles') do
116
+ within('span#addfiles') do
117
117
  attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false)
118
118
  end
119
119
  expect(page).to have_css('ul li#required-files.complete', text: 'Add files')
@@ -671,7 +671,7 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
671
671
 
672
672
  # add required file
673
673
  click_link "Files" # switch tab
674
- within('button#addfiles') do
674
+ within('span#addfiles') do
675
675
  attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/image.jp2", visible: false)
676
676
  end
677
677
  # set required metadata
@@ -106,7 +106,7 @@ RSpec.describe Hyrax::Forms::WorkForm do
106
106
  parent_id: '123',
107
107
  representative_id: '456',
108
108
  thumbnail_id: '789',
109
- keyword: ['derp'],
109
+ keyword: ['penguin'],
110
110
  source: ['related'],
111
111
  rights_statement: 'http://rightsstatements.org/vocab/InC-EDU/1.0/',
112
112
  license: ['http://creativecommons.org/licenses/by/3.0/us/']
@@ -121,7 +121,7 @@ RSpec.describe Hyrax::Forms::WorkForm do
121
121
  expect(subject['visibility']).to eq 'open'
122
122
  expect(subject['license']).to eq ['http://creativecommons.org/licenses/by/3.0/us/']
123
123
  expect(subject['rights_statement']).to eq 'http://rightsstatements.org/vocab/InC-EDU/1.0/'
124
- expect(subject['keyword']).to eq ['derp']
124
+ expect(subject['keyword']).to eq ['penguin']
125
125
  expect(subject['source']).to eq ['related']
126
126
  end
127
127
 
@@ -59,7 +59,7 @@ RSpec.describe Hyrax::GenericWorkForm do
59
59
  representative_id: '456',
60
60
  rendering_ids: [file_set.id],
61
61
  thumbnail_id: '789',
62
- keyword: ['derp'],
62
+ keyword: ['penguin'],
63
63
  license: ['http://creativecommons.org/licenses/by/3.0/us/'],
64
64
  member_of_collection_ids: ['123456', 'abcdef']
65
65
  )
@@ -72,7 +72,7 @@ RSpec.describe Hyrax::GenericWorkForm do
72
72
  expect(subject['description']).to be_empty
73
73
  expect(subject['visibility']).to eq 'open'
74
74
  expect(subject['license']).to eq ['http://creativecommons.org/licenses/by/3.0/us/']
75
- expect(subject['keyword']).to eq ['derp']
75
+ expect(subject['keyword']).to eq ['penguin']
76
76
  expect(subject['member_of_collection_ids']).to eq ['123456', 'abcdef']
77
77
  expect(subject['rendering_ids']).to eq [file_set.id]
78
78
  end
@@ -29,4 +29,20 @@ RSpec.describe Hyrax::Admin::UsersPresenter do
29
29
  end
30
30
  end
31
31
  end
32
+
33
+ describe 'show_last_access?' do
34
+ before do
35
+ allow(User).to receive(:devise_modules).and_return(modules)
36
+ end
37
+ subject { instance.show_last_access? }
38
+ context 'when devise trackable is installed' do
39
+ let(:modules) { [:trackable] }
40
+ it { is_expected.to be true }
41
+ end
42
+
43
+ context 'when devise trackable is not installed' do
44
+ let(:modules) { [:rememberable] }
45
+ it { is_expected.to be false }
46
+ end
47
+ end
32
48
  end
@@ -3,19 +3,43 @@ RSpec.describe 'hyrax/admin/users/index.html.erb', type: :view do
3
3
  let(:users) { [] }
4
4
 
5
5
  before do
6
- (1..4).each { |i| users << build(:user, display_name: "user#{i}", email: "email#{i}@example.com", last_sign_in_at: Time.zone.now - 15.minutes, created_at: Time.zone.now - 3.days) }
6
+ (1..4).each { |i| users << build(:user, display_name: "user#{i}", email: "email#{i}@example.com", created_at: Time.zone.now - 3.days) }
7
7
  allow(presenter).to receive(:users).and_return(users)
8
8
  assign(:presenter, presenter)
9
+ allow(presenter).to receive(:show_last_access?).and_return(show_last_access)
9
10
  end
10
11
 
11
- it "draws user list with all users" do
12
+ let(:page) do
12
13
  render
13
- page = Capybara::Node::Simple.new(rendered)
14
- expect(page).to have_content("Username")
15
- expect(page).to have_content("Roles")
16
- expect(page).to have_content("Last access")
17
- (1..4).each do |i|
18
- expect(page).to have_content("email#{i}@example.com")
14
+ Capybara::Node::Simple.new(rendered)
15
+ end
16
+
17
+ context 'when show_last_access? is true' do
18
+ let(:show_last_access) { true }
19
+ before do
20
+ allow(presenter).to receive(:last_accessed).and_return(Time.zone.now - 3.days)
21
+ end
22
+
23
+ it 'draws user list with all users' do
24
+ expect(page).to have_content("Username")
25
+ expect(page).to have_content("Roles")
26
+ expect(page).to have_content("Last access")
27
+ (1..4).each do |i|
28
+ expect(page).to have_content("email#{i}@example.com")
29
+ end
30
+ end
31
+ end
32
+
33
+ context 'when show_last_access? is false' do
34
+ let(:show_last_access) { false }
35
+
36
+ it 'draws user list with all users' do
37
+ expect(page).to have_content("Username")
38
+ expect(page).to have_content("Roles")
39
+ expect(page).not_to have_content("Last access")
40
+ (1..4).each do |i|
41
+ expect(page).to have_content("email#{i}@example.com")
42
+ end
19
43
  end
20
44
  end
21
45
  end
@@ -21,6 +21,6 @@ RSpec.describe 'hyrax/base/edit.html.erb', type: :view do
21
21
  expect(view).to receive(:provide).with(:page_title, 'A nice work // Generic Work [456] // Hyrax')
22
22
  expect(view).to receive(:provide).with(:page_header).and_yield
23
23
  render
24
- expect(rendered).to eq " <h1><span class=\"fa fa-edit\"></span>Edit Work</h1>\n\na form\n"
24
+ expect(rendered).to eq " <h1><span class=\"fa fa-edit\" aria-hidden=\"true\"></span>Edit Work</h1>\n\na form\n"
25
25
  end
26
26
  end
@@ -1,4 +1,4 @@
1
- gem 'hyrax', '2.2.0'
1
+ gem 'hyrax', '2.2.1'
2
2
  run 'bundle install'
3
3
  generate 'hyrax:install', '-f'
4
4
  rails_command 'db:migrate'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2018-08-15 00:00:00.000000000 Z
17
+ date: 2018-08-30 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -3005,7 +3005,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3005
3005
  version: '0'
3006
3006
  requirements: []
3007
3007
  rubyforge_project:
3008
- rubygems_version: 2.7.7
3008
+ rubygems_version: 2.6.13
3009
3009
  signing_key:
3010
3010
  specification_version: 4
3011
3011
  summary: Hyrax is a front-end based on the robust Samvera framework, providing a user