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 +4 -4
- data/README.md +2 -2
- data/app/assets/stylesheets/hyrax/_header.scss +0 -4
- data/app/assets/stylesheets/hyrax/_home-page.scss +1 -0
- data/app/jobs/attach_files_to_work_job.rb +3 -1
- data/app/views/hyrax/collections/show.html.erb +1 -1
- data/app/views/hyrax/users/_user.html.erb +1 -4
- data/config/locales/hyrax.de.yml +1 -0
- data/config/locales/hyrax.en.yml +1 -0
- data/config/locales/hyrax.es.yml +1 -0
- data/config/locales/hyrax.fr.yml +1 -0
- data/config/locales/hyrax.it.yml +1 -0
- data/config/locales/hyrax.pt-BR.yml +1 -0
- data/config/locales/hyrax.zh.yml +1 -0
- data/hyrax.gemspec +1 -1
- data/lib/generators/hyrax/riiif_generator.rb +1 -1
- data/lib/hyrax/version.rb +1 -1
- data/spec/jobs/attach_files_to_work_job_spec.rb +61 -53
- data/spec/spec_helper.rb +1 -1
- data/template.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 675c6cf986dd38320e1f9c76caa0e707bfdfd34b
|
4
|
+
data.tar.gz: 21487889ed825af87053b8ca78ad9a629f5ea0f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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:
|
@@ -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
|
73
|
+
<h2><%= t('hyrax.dashboard.collections.show.metadata_header') %></h2>
|
74
74
|
<%= render 'show_descriptions' %>
|
75
75
|
<% end %>
|
76
76
|
</div>
|
data/config/locales/hyrax.de.yml
CHANGED
@@ -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
|
data/config/locales/hyrax.en.yml
CHANGED
@@ -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
|
data/config/locales/hyrax.es.yml
CHANGED
@@ -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
|
data/config/locales/hyrax.fr.yml
CHANGED
@@ -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
|
data/config/locales/hyrax.it.yml
CHANGED
@@ -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
|
data/config/locales/hyrax.zh.yml
CHANGED
data/hyrax.gemspec
CHANGED
@@ -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.
|
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'
|
data/lib/hyrax/version.rb
CHANGED
@@ -1,71 +1,79 @@
|
|
1
1
|
RSpec.describe AttachFilesToWorkJob, perform_enqueued: [AttachFilesToWorkJob] do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
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
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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
|
data/spec/spec_helper.rb
CHANGED
@@ -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.
|
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
|
data/template.rb
CHANGED
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.
|
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-
|
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:
|
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:
|
732
|
+
version: 0.3.0
|
733
733
|
- !ruby/object:Gem::Dependency
|
734
734
|
name: database_cleaner
|
735
735
|
requirement: !ruby/object:Gem::Requirement
|