hyrax 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d34c51d077dddcd6a5932d22a633104906b17e30
4
- data.tar.gz: f61e880d0705b2863c0edf50e0066b8cf4df41c3
3
+ metadata.gz: 675c6cf986dd38320e1f9c76caa0e707bfdfd34b
4
+ data.tar.gz: 21487889ed825af87053b8ca78ad9a629f5ea0f1
5
5
  SHA512:
6
- metadata.gz: bcda312829b2581af6d701b0a57cc11e99d26e12c4405fc5f8ecb814328cdc94a5ed74cb5deb0583b995b8ffd64127f806c4b7fb64a37372610ddf2d0e477d44
7
- data.tar.gz: 70e85336f1286e3749f22f8cd4ee8d3607a4f06bc9dda48429cf37f53041b7d9012ddb1628bc97ae1de8d17622019e6f20d37f66bd920adb272fe1996a96954c
6
+ metadata.gz: 2cc13e4c761febbcc6d71a5f2169695d8723878198458bb6c024de8e92820e8f83cbd2dd18def0bd4fdc848d2b3efd56854f1d93afb758c80044c0fe19c53580
7
+ data.tar.gz: 38ef4eca1f3c896f65bae3df9923a1d40888cc458d1bf1431858ac41c71474a2b250044cf4f33a227d7f512c45224a2f91bd5d16ea2367af7f55ad9147691b06
data/README.md CHANGED
@@ -64,7 +64,7 @@ The Samvera community is here to help. Please see our [support guide](./.github/
64
64
  # Getting started
65
65
 
66
66
  This document contains instructions specific to setting up an app with __Hyrax
67
- v2.4.0__. If you are looking for instructions on installing a different
67
+ v2.4.1__. If you are looking for instructions on installing a different
68
68
  version, be sure to select the appropriate branch or tag from the drop-down
69
69
  menu above.
70
70
 
@@ -163,7 +163,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
163
163
  Generate a new Rails application using the template.
164
164
 
165
165
  ```
166
- rails _5.1.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.4.0/template.rb
166
+ rails _5.1.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.4.1/template.rb
167
167
  ```
168
168
 
169
169
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
@@ -17,10 +17,6 @@ header > .navbar {
17
17
 
18
18
  .searchbar-right {
19
19
  margin-right: 0;
20
-
21
- label {
22
- color: #ffffff;
23
- }
24
20
  }
25
21
 
26
22
  // We need these ancestor selectors to override Bootstrap and push
@@ -40,6 +40,7 @@
40
40
 
41
41
  .navbar {
42
42
  background-color: $navbar-transparent-bg;
43
+ color: #fff;
43
44
  margin-bottom: 0;
44
45
 
45
46
  .navbar-nav {
@@ -11,12 +11,14 @@ class AttachFilesToWorkJob < Hyrax::ApplicationJob
11
11
  work_permissions = work.permissions.map(&:to_hash)
12
12
  metadata = visibility_attributes(work_attributes)
13
13
  uploaded_files.each do |uploaded_file|
14
+ next if uploaded_file.file_set_uri.present?
15
+
14
16
  actor = Hyrax::Actors::FileSetActor.new(FileSet.create, user)
17
+ uploaded_file.update(file_set_uri: actor.file_set.uri)
15
18
  actor.file_set.permissions_attributes = work_permissions
16
19
  actor.create_metadata(metadata)
17
20
  actor.create_content(uploaded_file)
18
21
  actor.attach_to_work(work)
19
- uploaded_file.update(file_set_uri: actor.file_set.uri)
20
22
  end
21
23
  end
22
24
 
@@ -70,7 +70,7 @@
70
70
  </div>
71
71
  <div class="col-md-4 hyc-metadata">
72
72
  <% unless has_collection_search_parameters? %>
73
- <h2>Collection Details</h2>
73
+ <h2><%= t('hyrax.dashboard.collections.show.metadata_header') %></h2>
74
74
  <%= render 'show_descriptions' %>
75
75
  <% end %>
76
76
  </div>
@@ -2,10 +2,7 @@
2
2
  <div class="panel-heading">
3
3
  <%= image_tag user.avatar.url(:thumb), width: 100 if user.avatar.present? %>
4
4
  <h3>
5
- <% if user.name != user.user_key %>
6
- <%= user.name %><br />
7
- <% end %>
8
- <%= user.user_key %>
5
+ <%= user.name %>
9
6
  </h3>
10
7
  </div>
11
8
 
@@ -654,6 +654,7 @@ de:
654
654
  show:
655
655
  header: Sammlung
656
656
  item_count: Arbeiten
657
+ metadata_header: Details zur Sammlung
657
658
  parent_collection_header: Übergeordnete Sammlungen
658
659
  public_view_label: Öffentliche Sicht der Sammlung
659
660
  search_results: Suchergebnisse innerhalb dieser Sammlung
@@ -653,6 +653,7 @@ en:
653
653
  show:
654
654
  header: Collection
655
655
  item_count: Works
656
+ metadata_header: Collection Details
656
657
  parent_collection_header: Parent Collections
657
658
  public_view_label: Public view of Collection
658
659
  search_results: Search Results within this Collection
@@ -652,6 +652,7 @@ es:
652
652
  show:
653
653
  header: Colección
654
654
  item_count: Trabajos
655
+ metadata_header: Detalles de la colección
655
656
  parent_collection_header: Colecciones de padres
656
657
  public_view_label: Vista pública de la colección
657
658
  search_results: Resultados de búsqueda dentro de esta colección
@@ -653,6 +653,7 @@ fr:
653
653
  show:
654
654
  header: Collection
655
655
  item_count: Travaux
656
+ metadata_header: Détails de la collection
656
657
  parent_collection_header: Collections de parents
657
658
  public_view_label: Vue publique de la collection
658
659
  search_results: Résultats de la recherche dans cette collection
@@ -652,6 +652,7 @@ it:
652
652
  show:
653
653
  header: Collezione
654
654
  item_count: Lavori
655
+ metadata_header: Dettagli della collezione
655
656
  parent_collection_header: Collezioni principali
656
657
  public_view_label: Visione pubblica della collezione
657
658
  search_results: Risultati della ricerca all'interno di questa raccolta
@@ -647,6 +647,7 @@ pt-BR:
647
647
  show:
648
648
  header: Coleção
649
649
  item_count: Obras
650
+ metadata_header: Detalhes da coleção
650
651
  parent_collection_header: Coleções mães
651
652
  public_view_label: Vista pública da Coleção
652
653
  search_results: Resultados da pesquisa dentro desta coleção
@@ -650,6 +650,7 @@ zh:
650
650
  show:
651
651
  header: 采集
652
652
  item_count: 作品
653
+ metadata_header: 收集细节
653
654
  parent_collection_header: 家长集合
654
655
  public_view_label: 公众对收藏的看法
655
656
  search_results: 搜索此集合中的结果
@@ -82,7 +82,7 @@ SUMMARY
82
82
 
83
83
  # temporary pin to 2.17 due to failures caused in 2.18.0
84
84
  spec.add_development_dependency "capybara", '~> 2.4', '< 2.18.0'
85
- spec.add_development_dependency 'capybara-maleficent', '~> 0.2'
85
+ spec.add_development_dependency 'capybara-maleficent', '~> 0.3.0'
86
86
  spec.add_development_dependency 'database_cleaner', '~> 1.3'
87
87
  spec.add_development_dependency 'engine_cart', '~> 2.0'
88
88
  spec.add_development_dependency "equivalent-xml", '~> 0.5'
@@ -16,7 +16,7 @@ class Hyrax::RiiifGenerator < Rails::Generators::Base
16
16
  end
17
17
 
18
18
  def add_to_gemfile
19
- gem 'riiif', '~> 1.1'
19
+ gem 'riiif', '~> 2.0'
20
20
 
21
21
  Bundler.with_clean_env do
22
22
  run "bundle install"
@@ -1,3 +1,3 @@
1
1
  module Hyrax
2
- VERSION = '2.4.0'.freeze
2
+ VERSION = '2.4.1'.freeze
3
3
  end
@@ -1,71 +1,79 @@
1
1
  RSpec.describe AttachFilesToWorkJob, perform_enqueued: [AttachFilesToWorkJob] do
2
- context "happy path" do
3
- let(:file1) { File.open(fixture_path + '/world.png') }
4
- let(:file2) { File.open(fixture_path + '/image.jp2') }
5
- let(:uploaded_file1) { build(:uploaded_file, file: file1) }
6
- let(:uploaded_file2) { build(:uploaded_file, file: file2) }
7
- let(:generic_work) { create(:public_generic_work) }
8
- let(:user) { create(:user) }
2
+ let(:file1) { File.open(fixture_path + '/world.png') }
3
+ let(:file2) { File.open(fixture_path + '/image.jp2') }
4
+ let(:uploaded_file1) { build(:uploaded_file, file: file1) }
5
+ let(:uploaded_file2) { build(:uploaded_file, file: file2) }
6
+ let(:generic_work) { create(:public_generic_work) }
7
+ let(:user) { create(:user) }
9
8
 
10
- shared_examples 'a file attacher', perform_enqueued: [AttachFilesToWorkJob, IngestJob] do
11
- it 'attaches files, copies visibility and permissions and updates the uploaded files' do
12
- expect(CharacterizeJob).to receive(:perform_later).twice
13
- described_class.perform_now(generic_work, [uploaded_file1, uploaded_file2])
14
- generic_work.reload
15
- expect(generic_work.file_sets.count).to eq 2
16
- expect(generic_work.file_sets.map(&:visibility)).to all(eq 'open')
17
- expect(uploaded_file1.reload.file_set_uri).not_to be_nil
18
- expect(ImportUrlJob).not_to have_been_enqueued
19
- end
9
+ shared_examples 'a file attacher', perform_enqueued: [AttachFilesToWorkJob, IngestJob] do
10
+ it 'attaches files, copies visibility and permissions and updates the uploaded files' do
11
+ expect(CharacterizeJob).to receive(:perform_later).twice
12
+ described_class.perform_now(generic_work, [uploaded_file1, uploaded_file2])
13
+ generic_work.reload
14
+ expect(generic_work.file_sets.count).to eq 2
15
+ expect(generic_work.file_sets.map(&:visibility)).to all(eq 'open')
16
+ expect(uploaded_file1.reload.file_set_uri).not_to be_nil
17
+ expect(ImportUrlJob).not_to have_been_enqueued
20
18
  end
19
+ end
21
20
 
22
- context "with uploaded files on the filesystem" do
23
- before do
24
- generic_work.permissions.build(name: 'userz@bbb.ddd', type: 'person', access: 'edit')
25
- generic_work.save
21
+ context "with uploaded files on the filesystem" do
22
+ before do
23
+ generic_work.permissions.build(name: 'userz@bbb.ddd', type: 'person', access: 'edit')
24
+ generic_work.save
25
+ end
26
+ it_behaves_like 'a file attacher' do
27
+ it 'records the depositor(s) in edit_users' do
28
+ expect(generic_work.file_sets.map(&:edit_users)).to all(match_array([generic_work.depositor, 'userz@bbb.ddd']))
26
29
  end
27
- it_behaves_like 'a file attacher' do
28
- it 'records the depositor(s) in edit_users' do
29
- expect(generic_work.file_sets.map(&:edit_users)).to all(match_array([generic_work.depositor, 'userz@bbb.ddd']))
30
+
31
+ describe 'with existing files' do
32
+ let(:file_set) { create(:file_set) }
33
+ let(:uploaded_file1) { build(:uploaded_file, file: file1, file_set_uri: 'http://example.com/file_set') }
34
+
35
+ it 'skips files that already have a FileSet' do
36
+ expect { described_class.perform_now(generic_work, [uploaded_file1, uploaded_file2]) }
37
+ .to change { generic_work.file_sets.count }.to eq 1
30
38
  end
31
39
  end
32
40
  end
41
+ end
33
42
 
34
- context "with uploaded files at remote URLs" do
35
- let(:url1) { 'https://example.com/my/img.png' }
36
- let(:url2) { URI('https://example.com/other/img.png') }
37
- let(:fog_file1) { double(CarrierWave::Storage::Abstract, url: url1) }
38
- let(:fog_file2) { double(CarrierWave::Storage::Abstract, url: url2) }
39
-
40
- before do
41
- allow(uploaded_file1.file).to receive(:file).and_return(fog_file1)
42
- allow(uploaded_file2.file).to receive(:file).and_return(fog_file2)
43
- end
43
+ context "with uploaded files at remote URLs" do
44
+ let(:url1) { 'https://example.com/my/img.png' }
45
+ let(:url2) { URI('https://example.com/other/img.png') }
46
+ let(:fog_file1) { double(CarrierWave::Storage::Abstract, url: url1) }
47
+ let(:fog_file2) { double(CarrierWave::Storage::Abstract, url: url2) }
44
48
 
45
- it_behaves_like 'a file attacher'
49
+ before do
50
+ allow(uploaded_file1.file).to receive(:file).and_return(fog_file1)
51
+ allow(uploaded_file2.file).to receive(:file).and_return(fog_file2)
46
52
  end
47
53
 
48
- context "deposited on behalf of another user" do
49
- before do
50
- generic_work.on_behalf_of = user.user_key
51
- generic_work.save
52
- end
53
- it_behaves_like 'a file attacher' do
54
- it 'records the depositor(s) in edit_users' do
55
- expect(generic_work.file_sets.map(&:edit_users)).to all(match_array([user.user_key]))
56
- end
54
+ it_behaves_like 'a file attacher'
55
+ end
56
+
57
+ context "deposited on behalf of another user" do
58
+ before do
59
+ generic_work.on_behalf_of = user.user_key
60
+ generic_work.save
61
+ end
62
+ it_behaves_like 'a file attacher' do
63
+ it 'records the depositor(s) in edit_users' do
64
+ expect(generic_work.file_sets.map(&:edit_users)).to all(match_array([user.user_key]))
57
65
  end
58
66
  end
67
+ end
59
68
 
60
- context "deposited as 'Yourself' selected in on behalf of list" do
61
- before do
62
- generic_work.on_behalf_of = ''
63
- generic_work.save
64
- end
65
- it_behaves_like 'a file attacher' do
66
- it 'records the depositor(s) in edit_users' do
67
- expect(generic_work.file_sets.map(&:edit_users)).to all(match_array([generic_work.depositor]))
68
- end
69
+ context "deposited as 'Yourself' selected in on behalf of list" do
70
+ before do
71
+ generic_work.on_behalf_of = ''
72
+ generic_work.save
73
+ end
74
+ it_behaves_like 'a file attacher' do
75
+ it 'records the depositor(s) in edit_users' do
76
+ expect(generic_work.file_sets.map(&:edit_users)).to all(match_array([generic_work.depositor]))
69
77
  end
70
78
  end
71
79
  end
@@ -49,7 +49,7 @@ unless ENV['SKIP_MALEFICENT']
49
49
  # Wrap Capybara matchers with sleep intervals to reduce fragility of specs.
50
50
  require 'capybara/maleficent/spindle'
51
51
 
52
- Capybara::Maleficent.config do |c|
52
+ Capybara::Maleficent.configure do |c|
53
53
  # Quieting down maleficent's logging
54
54
  logger = Logger.new(STDOUT)
55
55
  logger.level = Logger::INFO
@@ -1,4 +1,4 @@
1
- gem 'hyrax', '2.4.0'
1
+ gem 'hyrax', '2.4.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.4.0
4
+ version: 2.4.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-11-06 00:00:00.000000000 Z
17
+ date: 2018-11-16 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -722,14 +722,14 @@ dependencies:
722
722
  requirements:
723
723
  - - "~>"
724
724
  - !ruby/object:Gem::Version
725
- version: '0.2'
725
+ version: 0.3.0
726
726
  type: :development
727
727
  prerelease: false
728
728
  version_requirements: !ruby/object:Gem::Requirement
729
729
  requirements:
730
730
  - - "~>"
731
731
  - !ruby/object:Gem::Version
732
- version: '0.2'
732
+ version: 0.3.0
733
733
  - !ruby/object:Gem::Dependency
734
734
  name: database_cleaner
735
735
  requirement: !ruby/object:Gem::Requirement