hyrax 2.0.0.beta4 → 2.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_fixme.yml +0 -1
- data/.travis.yml +4 -3
- data/README.md +3 -3
- data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +22 -0
- data/app/actors/hyrax/actors/file_set_actor.rb +4 -0
- data/app/actors/hyrax/actors/transfer_request_actor.rb +23 -0
- data/app/assets/javascripts/hyrax/autocomplete/default.es6 +2 -1
- data/app/assets/stylesheets/hyrax/_file_manager.scss +3 -0
- data/app/controllers/hyrax/dashboard/collections_controller.rb +0 -1
- data/app/controllers/hyrax/my_controller.rb +1 -1
- data/app/forms/hyrax/forms/work_form.rb +5 -4
- data/app/helpers/hyrax/content_block_helper_behavior.rb +2 -2
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +0 -7
- data/app/indexers/hyrax/indexes_workflow.rb +1 -1
- data/app/models/admin_set.rb +1 -1
- data/app/models/concerns/hyrax/basic_metadata.rb +1 -1
- data/app/models/concerns/hyrax/in_admin_set.rb +1 -1
- data/app/models/concerns/hyrax/proxy_deposit.rb +0 -8
- data/app/models/concerns/hyrax/solr_document_behavior.rb +0 -11
- data/app/models/concerns/hyrax/user.rb +3 -3
- data/app/models/hyrax/orcid_validator.rb +6 -1
- data/app/services/hyrax/admin_set_create_service.rb +0 -1
- data/app/services/hyrax/default_middleware_stack.rb +1 -0
- data/app/services/hyrax/statistics/depositors/summary.rb +5 -1
- data/app/services/hyrax/statistics/over_time.rb +5 -1
- data/app/services/hyrax/statistics/query_service.rb +55 -0
- data/app/services/hyrax/statistics/works/count.rb +1 -1
- data/app/services/hyrax/workflow/status_list_service.rb +1 -1
- data/app/views/hyrax/base/_form.html.erb +2 -1
- data/app/views/hyrax/base/_form_files.html.erb +0 -2
- data/app/views/hyrax/base/_form_progress.html.erb +1 -1
- data/app/views/hyrax/base/_form_visibility_error.html.erb +3 -0
- data/app/views/hyrax/base/_show_actions.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_actions.html.erb +1 -1
- data/app/views/hyrax/dashboard/profiles/_edit_primary.html.erb +4 -1
- data/app/views/hyrax/dashboard/show_user.html.erb +3 -1
- data/app/views/hyrax/file_sets/_show_actions.html.erb +1 -1
- data/app/views/hyrax/homepage/_recent_document.html.erb +1 -1
- data/config/locales/hyrax.de.yml +9 -8
- data/hyrax.gemspec +2 -2
- data/lib/generators/hyrax/config_generator.rb +14 -16
- data/lib/generators/hyrax/templates/config/{hyrax.rb → initializers/hyrax.rb} +21 -0
- data/lib/generators/hyrax/templates/config/{mini_magick.rb → initializers/mini_magick.rb} +0 -0
- data/lib/generators/hyrax/templates/config/{redis_config.rb → initializers/redis_config.rb} +0 -0
- data/lib/hyrax.rb +2 -1
- data/lib/hyrax/configuration.rb +17 -10
- data/lib/hyrax/controlled_vocabularies.rb +9 -0
- data/{app/controlled_vocabularies → lib}/hyrax/controlled_vocabularies/location.rb +0 -0
- data/lib/hyrax/version.rb +1 -1
- data/spec/actors/hyrax/actors/create_with_remote_files_actor_spec.rb +36 -0
- data/spec/actors/hyrax/actors/file_set_actor_spec.rb +5 -1
- data/spec/actors/hyrax/actors/transfer_request_actor_spec.rb +43 -0
- data/spec/controllers/hyrax/admin/admin_sets_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/api/items_controller_spec.rb +4 -4
- data/spec/controllers/hyrax/batch_edits_controller_spec.rb +3 -6
- data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +87 -68
- data/spec/controllers/hyrax/dashboard/profiles_controller_spec.rb +5 -5
- data/spec/controllers/hyrax/file_sets_controller_spec.rb +7 -19
- data/spec/controllers/hyrax/fixity_checks_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/generic_works_controller_spec.rb +1 -3
- data/spec/controllers/hyrax/single_use_links_viewer_controller_spec.rb +2 -4
- data/spec/factories/admin_sets.rb +0 -4
- data/spec/forms/hyrax/forms/work_form_spec.rb +41 -0
- data/spec/helpers/hyrax/content_block_helper_spec.rb +6 -0
- data/spec/helpers/hyrax_helper_spec.rb +0 -13
- data/spec/indexers/hyrax/generic_work_indexer_spec.rb +4 -1
- data/spec/javascripts/autocomplete_spec.js.coffee +39 -4
- data/spec/jobs/fixity_check_job_spec.rb +1 -2
- data/spec/lib/hyrax/configuration_spec.rb +4 -2
- data/spec/models/admin_set_spec.rb +0 -24
- data/spec/models/collection_spec.rb +0 -13
- data/spec/models/file_set_spec.rb +0 -17
- data/spec/models/generic_work_spec.rb +0 -11
- data/spec/models/solr_document_spec.rb +0 -32
- data/spec/models/user_spec.rb +20 -5
- data/spec/presenters/hyrax/file_usage_spec.rb +3 -7
- data/spec/services/hyrax/admin_set_create_service_spec.rb +2 -2
- data/spec/services/hyrax/admin_set_service_spec.rb +2 -2
- data/spec/services/hyrax/change_content_depositor_service_spec.rb +2 -6
- data/spec/services/hyrax/collections_service_spec.rb +1 -1
- data/spec/services/hyrax/default_middleware_stack_spec.rb +1 -0
- data/spec/services/hyrax/import_url_failure_service_spec.rb +1 -3
- data/spec/services/hyrax/persist_directly_contained_output_file_service_spec.rb +2 -1
- data/spec/services/hyrax/repository_fixity_check_service_spec.rb +1 -3
- data/spec/services/hyrax/{query_service_spec.rb → statistics/query_service_spec.rb} +5 -3
- data/spec/services/hyrax/versioning_service_spec.rb +2 -5
- data/spec/services/hyrax/work_query_service_spec.rb +1 -1
- data/spec/services/hyrax/workflow/status_list_service_spec.rb +7 -2
- data/spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb +1 -4
- data/spec/views/hyrax/base/_form.html.erb_spec.rb +4 -11
- data/spec/views/hyrax/base/_form_progress.html.erb_spec.rb +14 -0
- data/spec/views/hyrax/collections/_show_document_list_row.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/dashboard/collections/_show_document_list_row.html.erb_spec.rb +1 -3
- data/spec/views/hyrax/dashboard/profiles/edit.html.erb_spec.rb +24 -0
- data/spec/views/hyrax/dashboard/show_user_spec.rb +24 -0
- data/template.rb +1 -1
- metadata +18 -13
- data/app/services/hyrax/query_service.rb +0 -53
@@ -1,9 +1,7 @@
|
|
1
1
|
RSpec.describe Hyrax::RepositoryFixityCheckService do
|
2
|
-
let(:user) { FactoryGirl.create(:user) }
|
3
2
|
let!(:file) do
|
4
|
-
|
3
|
+
create(:file_set).tap do |file|
|
5
4
|
file.add_file(File.open(fixture_path + '/world.png'), path: 'content', original_name: 'world.png')
|
6
|
-
file.apply_depositor_metadata(user)
|
7
5
|
end
|
8
6
|
end
|
9
7
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
RSpec.describe Hyrax::QueryService, :clean_repo do
|
1
|
+
RSpec.describe Hyrax::Statistics::QueryService, :clean_repo do
|
2
2
|
let(:service) { described_class.new }
|
3
3
|
|
4
4
|
describe "#count" do
|
@@ -54,8 +54,9 @@ RSpec.describe Hyrax::QueryService, :clean_repo do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
context "when file is registered" do
|
57
|
-
it { is_expected.to eq [work] }
|
58
57
|
let(:read_groups) { ["registered"] }
|
58
|
+
|
59
|
+
it { is_expected.to eq [work] }
|
59
60
|
end
|
60
61
|
end
|
61
62
|
|
@@ -77,8 +78,9 @@ RSpec.describe Hyrax::QueryService, :clean_repo do
|
|
77
78
|
end
|
78
79
|
|
79
80
|
context "when file is registered" do
|
80
|
-
it { is_expected.to eq [] }
|
81
81
|
let(:read_groups) { ["registered"] }
|
82
|
+
|
83
|
+
it { is_expected.to eq [] }
|
82
84
|
end
|
83
85
|
end
|
84
86
|
|
@@ -1,10 +1,7 @@
|
|
1
1
|
RSpec.describe Hyrax::VersioningService do
|
2
2
|
describe '#latest_version_of' do
|
3
|
-
let(:
|
4
|
-
|
5
|
-
f.apply_depositor_metadata('mjg36')
|
6
|
-
end
|
7
|
-
end
|
3
|
+
let(:user) { build(:user) }
|
4
|
+
let(:file) { create(:file_set) }
|
8
5
|
|
9
6
|
before do
|
10
7
|
# Add the original_file (this service creates a version after saving when you call it with versioning: true)
|
@@ -45,7 +45,7 @@ module Hyrax
|
|
45
45
|
context 'when the work is not deleted' do
|
46
46
|
# NOTE: This is testing the full behavior of finding
|
47
47
|
let!(:work_query_service) { described_class.new(id: work.id) }
|
48
|
-
let!(:work) {
|
48
|
+
let!(:work) { create(:generic_work, title: ["Test work"]) }
|
49
49
|
|
50
50
|
it 'will retrieve the SOLR document and use the #to_s method of that' do
|
51
51
|
expect(subject).to eq(work.title.first)
|
@@ -7,7 +7,7 @@ RSpec.describe Hyrax::Workflow::StatusListService do
|
|
7
7
|
let(:document) do
|
8
8
|
{ id: '33333',
|
9
9
|
has_model_ssim: ['GenericWork'],
|
10
|
-
actionable_workflow_roles_ssim: ["generic_work-approving", "generic_work-rejecting"],
|
10
|
+
actionable_workflow_roles_ssim: ["foobar-generic_work-approving", "foobar-generic_work-rejecting"],
|
11
11
|
workflow_state_name_ssim: ["initial"],
|
12
12
|
title_tesim: ['Hey dood!'] }
|
13
13
|
end
|
@@ -25,9 +25,14 @@ RSpec.describe Hyrax::Workflow::StatusListService do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
context "when user has roles" do
|
28
|
+
let(:template) { double('template', admin_set_id: 'foobar') }
|
29
|
+
let(:workflow) do
|
30
|
+
instance_double(Sipity::Workflow, name: 'generic_work', permission_template: template)
|
31
|
+
end
|
32
|
+
|
28
33
|
before do
|
29
34
|
allow(Hyrax::Workflow::PermissionQuery).to receive(:scope_processing_workflow_roles_for_user_and_workflow).and_return(workflow_roles)
|
30
|
-
allow(Sipity::Workflow).to receive(:all).and_return([
|
35
|
+
allow(Sipity::Workflow).to receive(:all).and_return([workflow])
|
31
36
|
end
|
32
37
|
|
33
38
|
it "returns status rows" do
|
@@ -1,11 +1,8 @@
|
|
1
|
-
|
2
1
|
RSpec.describe 'hyrax/admin/admin_sets/_show_document_list_row.html.erb', type: :view do
|
3
2
|
let(:user) { create(:user, groups: 'admin') }
|
4
3
|
|
5
4
|
let(:work) do
|
6
|
-
|
7
|
-
gw.apply_depositor_metadata(user)
|
8
|
-
end
|
5
|
+
create(:work, user: user, creator: ["ggm"], title: ['One Hundred Years of Solitude'])
|
9
6
|
end
|
10
7
|
|
11
8
|
before do
|
@@ -74,17 +74,8 @@ RSpec.describe 'hyrax/base/_form.html.erb', type: :view do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
describe 'uploading a folder' do
|
77
|
-
|
78
|
-
|
79
|
-
it 'renders the add folder button' do
|
80
|
-
expect(page).to have_content('Add folder...')
|
81
|
-
end
|
82
|
-
end
|
83
|
-
context 'with a non-Chrome browser' do
|
84
|
-
before { allow(view).to receive(:browser_supports_directory_upload?) { false } }
|
85
|
-
it 'does not render the add folder button' do
|
86
|
-
expect(page).not_to have_content('Add folder...')
|
87
|
-
end
|
77
|
+
it 'renders the add folder button' do
|
78
|
+
expect(page).to have_content('Add folder...')
|
88
79
|
end
|
89
80
|
end
|
90
81
|
end
|
@@ -95,6 +86,7 @@ RSpec.describe 'hyrax/base/_form.html.erb', type: :view do
|
|
95
86
|
before do
|
96
87
|
# Add an error to the work
|
97
88
|
work.errors.add :base, 'broken'
|
89
|
+
work.errors.add :visibility, 'visibility_error'
|
98
90
|
allow(form).to receive(:select_files).and_return([])
|
99
91
|
end
|
100
92
|
|
@@ -106,6 +98,7 @@ RSpec.describe 'hyrax/base/_form.html.erb', type: :view do
|
|
106
98
|
|
107
99
|
# It diplays form errors
|
108
100
|
expect(page).to have_content("broken")
|
101
|
+
expect(page).to have_content("visibility_error")
|
109
102
|
end
|
110
103
|
end
|
111
104
|
end
|
@@ -26,13 +26,27 @@ RSpec.describe 'hyrax/base/_form_progress.html.erb', type: :view do
|
|
26
26
|
let(:proxies) { [stub_model(User, email: 'bob@example.com')] }
|
27
27
|
|
28
28
|
before do
|
29
|
+
allow(Flipflop).to receive(:proxy_deposit?).and_return(true)
|
29
30
|
allow(user).to receive(:can_make_deposits_for).and_return(proxies)
|
30
31
|
end
|
32
|
+
|
31
33
|
it "shows options for proxy" do
|
32
34
|
expect(page).to have_content 'On behalf of'
|
33
35
|
expect(page).to have_selector("select#generic_work_on_behalf_of option[value=\"\"]", text: 'Yourself')
|
34
36
|
expect(page).to have_selector("select#generic_work_on_behalf_of option[value=\"bob@example.com\"]")
|
35
37
|
end
|
38
|
+
|
39
|
+
context 'when feature disabled' do
|
40
|
+
before do
|
41
|
+
allow(Flipflop).to receive(:proxy_deposit?).and_return(false)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "does not show options for proxy" do
|
45
|
+
expect(page).not_to have_content 'On behalf of'
|
46
|
+
expect(page).not_to have_selector("select#generic_work_on_behalf_of option[value=\"\"]", text: 'Yourself')
|
47
|
+
expect(page).not_to have_selector("select#generic_work_on_behalf_of option[value=\"bob@example.com\"]")
|
48
|
+
end
|
49
|
+
end
|
36
50
|
end
|
37
51
|
|
38
52
|
context "without options for proxy" do
|
@@ -2,9 +2,7 @@ RSpec.describe 'hyrax/collections/_show_document_list_row.html.erb', type: :view
|
|
2
2
|
let(:user) { create(:user) }
|
3
3
|
|
4
4
|
let(:work) do
|
5
|
-
|
6
|
-
gw.apply_depositor_metadata(user)
|
7
|
-
end
|
5
|
+
create(:work, user: user, creator: ["ggm"], title: ['One Hundred Years of Solitude'])
|
8
6
|
end
|
9
7
|
|
10
8
|
let(:collection) { mock_model(Collection, title: 'My awesome collection', members: [work]) }
|
@@ -2,9 +2,7 @@ RSpec.describe 'hyrax/dashboard/collections/_show_document_list_row.html.erb', t
|
|
2
2
|
let(:user) { create(:user) }
|
3
3
|
|
4
4
|
let(:work) do
|
5
|
-
|
6
|
-
gw.apply_depositor_metadata(user)
|
7
|
-
end
|
5
|
+
create(:work, user: user, creator: ["ggm"], title: ['One Hundred Years of Solitude'])
|
8
6
|
end
|
9
7
|
|
10
8
|
let(:collection) { mock_model(Collection, title: 'My awesome collection', members: [work]) }
|
@@ -13,6 +13,30 @@ RSpec.describe 'hyrax/dashboard/profiles/edit.html.erb', type: :view do
|
|
13
13
|
expect(rendered).to match(/ORCID Profile/)
|
14
14
|
end
|
15
15
|
|
16
|
+
describe 'proxy deposit' do
|
17
|
+
context 'when enabled' do
|
18
|
+
before do
|
19
|
+
allow(Flipflop).to receive(:proxy_deposit?).and_return(true)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'renders proxy partial' do
|
23
|
+
render
|
24
|
+
expect(rendered).to match(/Authorize Proxies/)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'when disabled' do
|
29
|
+
before do
|
30
|
+
allow(Flipflop).to receive(:proxy_deposit?).and_return(false)
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'does not render proxy partial' do
|
34
|
+
render
|
35
|
+
expect(rendered).not_to match(/Authorize Proxies/)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
16
40
|
context "with trophy" do
|
17
41
|
let(:solr_document) { SolrDocument.new(id: 'abc123', has_model_ssim: 'GenericWork', title_tesim: ['Title']) }
|
18
42
|
let(:page) { Capybara::Node::Simple.new(rendered) }
|
@@ -31,4 +31,28 @@ RSpec.describe "hyrax/dashboard/show_user.html.erb", type: :view do
|
|
31
31
|
expect(rendered).to have_content "sent transfers"
|
32
32
|
expect(rendered).to have_content "received transfers"
|
33
33
|
end
|
34
|
+
|
35
|
+
describe 'proxy deposit' do
|
36
|
+
context 'when enabled' do
|
37
|
+
before do
|
38
|
+
allow(Flipflop).to receive(:proxy_deposit?).and_return(true)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'renders proxy partial' do
|
42
|
+
render
|
43
|
+
expect(rendered).to match(/Authorize Proxies/)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
context 'when disabled' do
|
48
|
+
before do
|
49
|
+
allow(Flipflop).to receive(:proxy_deposit?).and_return(false)
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'does not render proxy partial' do
|
53
|
+
render
|
54
|
+
expect(rendered).not_to match(/Authorize Proxies/)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
34
58
|
end
|
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.0.0.
|
4
|
+
version: 2.0.0.beta5
|
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: 2017-
|
17
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: rails
|
@@ -358,14 +358,14 @@ dependencies:
|
|
358
358
|
requirements:
|
359
359
|
- - "~>"
|
360
360
|
- !ruby/object:Gem::Version
|
361
|
-
version: '
|
361
|
+
version: '2.0'
|
362
362
|
type: :runtime
|
363
363
|
prerelease: false
|
364
364
|
version_requirements: !ruby/object:Gem::Requirement
|
365
365
|
requirements:
|
366
366
|
- - "~>"
|
367
367
|
- !ruby/object:Gem::Version
|
368
|
-
version: '
|
368
|
+
version: '2.0'
|
369
369
|
- !ruby/object:Gem::Dependency
|
370
370
|
name: flipflop
|
371
371
|
requirement: !ruby/object:Gem::Requirement
|
@@ -628,14 +628,14 @@ dependencies:
|
|
628
628
|
requirements:
|
629
629
|
- - "~>"
|
630
630
|
- !ruby/object:Gem::Version
|
631
|
-
version: '1.
|
631
|
+
version: '1.2'
|
632
632
|
type: :development
|
633
633
|
prerelease: false
|
634
634
|
version_requirements: !ruby/object:Gem::Requirement
|
635
635
|
requirements:
|
636
636
|
- - "~>"
|
637
637
|
- !ruby/object:Gem::Version
|
638
|
-
version: '1.
|
638
|
+
version: '1.2'
|
639
639
|
- !ruby/object:Gem::Dependency
|
640
640
|
name: mida
|
641
641
|
requirement: !ruby/object:Gem::Requirement
|
@@ -983,6 +983,7 @@ files:
|
|
983
983
|
- app/actors/hyrax/actors/optimistic_lock_validator.rb
|
984
984
|
- app/actors/hyrax/actors/terminator.rb
|
985
985
|
- app/actors/hyrax/actors/transactional_request.rb
|
986
|
+
- app/actors/hyrax/actors/transfer_request_actor.rb
|
986
987
|
- app/assets/images/audio.png
|
987
988
|
- app/assets/images/collection.png
|
988
989
|
- app/assets/images/default.png
|
@@ -1111,7 +1112,6 @@ files:
|
|
1111
1112
|
- app/channels/hyrax/application_cable/connection.rb
|
1112
1113
|
- app/channels/hyrax/notifications_channel.rb
|
1113
1114
|
- app/connections/hyrax/clean_connection.rb
|
1114
|
-
- app/controlled_vocabularies/hyrax/controlled_vocabularies/location.rb
|
1115
1115
|
- app/controllers/concerns/hyrax/admin/stats_behavior.rb
|
1116
1116
|
- app/controllers/concerns/hyrax/admin/users_controller_behavior.rb
|
1117
1117
|
- app/controllers/concerns/hyrax/api.rb
|
@@ -1485,7 +1485,6 @@ files:
|
|
1485
1485
|
- app/services/hyrax/persist_derivatives.rb
|
1486
1486
|
- app/services/hyrax/persist_directly_contained_output_file_service.rb
|
1487
1487
|
- app/services/hyrax/qa_select_service.rb
|
1488
|
-
- app/services/hyrax/query_service.rb
|
1489
1488
|
- app/services/hyrax/quick_classification_query.rb
|
1490
1489
|
- app/services/hyrax/repository_fixity_check_service.rb
|
1491
1490
|
- app/services/hyrax/resource_types_service.rb
|
@@ -1495,6 +1494,7 @@ files:
|
|
1495
1494
|
- app/services/hyrax/statistics/depositors/summary.rb
|
1496
1495
|
- app/services/hyrax/statistics/file_sets/by_format.rb
|
1497
1496
|
- app/services/hyrax/statistics/over_time.rb
|
1497
|
+
- app/services/hyrax/statistics/query_service.rb
|
1498
1498
|
- app/services/hyrax/statistics/system_stats.rb
|
1499
1499
|
- app/services/hyrax/statistics/term_query.rb
|
1500
1500
|
- app/services/hyrax/statistics/users/over_time.rb
|
@@ -1624,6 +1624,7 @@ files:
|
|
1624
1624
|
- app/views/hyrax/base/_form_share.html.erb
|
1625
1625
|
- app/views/hyrax/base/_form_thumbnail.html.erb
|
1626
1626
|
- app/views/hyrax/base/_form_visibility_component.html.erb
|
1627
|
+
- app/views/hyrax/base/_form_visibility_error.html.erb
|
1627
1628
|
- app/views/hyrax/base/_guts4form.html.erb
|
1628
1629
|
- app/views/hyrax/base/_items.html.erb
|
1629
1630
|
- app/views/hyrax/base/_member.html.erb
|
@@ -1964,7 +1965,9 @@ files:
|
|
1964
1965
|
- lib/generators/hyrax/templates/config/authorities/resource_types.yml
|
1965
1966
|
- lib/generators/hyrax/templates/config/authorities/rights_statements.yml
|
1966
1967
|
- lib/generators/hyrax/templates/config/clamav.rb
|
1967
|
-
- lib/generators/hyrax/templates/config/hyrax.rb
|
1968
|
+
- lib/generators/hyrax/templates/config/initializers/hyrax.rb
|
1969
|
+
- lib/generators/hyrax/templates/config/initializers/mini_magick.rb
|
1970
|
+
- lib/generators/hyrax/templates/config/initializers/redis_config.rb
|
1968
1971
|
- lib/generators/hyrax/templates/config/initializers/simple_form.rb
|
1969
1972
|
- lib/generators/hyrax/templates/config/initializers/simple_form_bootstrap.rb
|
1970
1973
|
- lib/generators/hyrax/templates/config/locales/hyrax.de.yml
|
@@ -1975,9 +1978,7 @@ files:
|
|
1975
1978
|
- lib/generators/hyrax/templates/config/locales/hyrax.pt-BR.yml
|
1976
1979
|
- lib/generators/hyrax/templates/config/locales/hyrax.zh.yml
|
1977
1980
|
- lib/generators/hyrax/templates/config/mime_types.rb
|
1978
|
-
- lib/generators/hyrax/templates/config/mini_magick.rb
|
1979
1981
|
- lib/generators/hyrax/templates/config/redis.yml
|
1980
|
-
- lib/generators/hyrax/templates/config/redis_config.rb
|
1981
1982
|
- lib/generators/hyrax/templates/config/tinymce.yml
|
1982
1983
|
- lib/generators/hyrax/templates/config/zotero.yml
|
1983
1984
|
- lib/generators/hyrax/templates/db/seeds.rb
|
@@ -2019,6 +2020,8 @@ files:
|
|
2019
2020
|
- lib/hyrax/callbacks.rb
|
2020
2021
|
- lib/hyrax/callbacks/registry.rb
|
2021
2022
|
- lib/hyrax/configuration.rb
|
2023
|
+
- lib/hyrax/controlled_vocabularies.rb
|
2024
|
+
- lib/hyrax/controlled_vocabularies/location.rb
|
2022
2025
|
- lib/hyrax/controlled_vocabulary/importer/downloader.rb
|
2023
2026
|
- lib/hyrax/controlled_vocabulary/importer/language.rb
|
2024
2027
|
- lib/hyrax/controller_resource.rb
|
@@ -2096,6 +2099,7 @@ files:
|
|
2096
2099
|
- spec/actors/hyrax/actors/model_actor_spec.rb
|
2097
2100
|
- spec/actors/hyrax/actors/optimistic_lock_validator_spec.rb
|
2098
2101
|
- spec/actors/hyrax/actors/transactional_request_spec.rb
|
2102
|
+
- spec/actors/hyrax/actors/transfer_request_actor_spec.rb
|
2099
2103
|
- spec/authorities/qa/authorities/find_works_spec.rb
|
2100
2104
|
- spec/channels/hyrax/application_cable/channel_spec.rb
|
2101
2105
|
- spec/channels/hyrax/application_cable/connection_spec.rb
|
@@ -2489,7 +2493,6 @@ files:
|
|
2489
2493
|
- spec/services/hyrax/persist_derivatives_spec.rb
|
2490
2494
|
- spec/services/hyrax/persist_directly_contained_output_file_service_spec.rb
|
2491
2495
|
- spec/services/hyrax/qa_select_service_spec.rb
|
2492
|
-
- spec/services/hyrax/query_service_spec.rb
|
2493
2496
|
- spec/services/hyrax/quick_classification_query_spec.rb
|
2494
2497
|
- spec/services/hyrax/repository_fixity_check_service_spec.rb
|
2495
2498
|
- spec/services/hyrax/resource_types_service_spec.rb
|
@@ -2497,6 +2500,7 @@ files:
|
|
2497
2500
|
- spec/services/hyrax/statistics/collections/over_time_spec.rb
|
2498
2501
|
- spec/services/hyrax/statistics/depositors/summary_spec.rb
|
2499
2502
|
- spec/services/hyrax/statistics/file_sets/by_format_spec.rb
|
2503
|
+
- spec/services/hyrax/statistics/query_service_spec.rb
|
2500
2504
|
- spec/services/hyrax/statistics/system_stats_spec.rb
|
2501
2505
|
- spec/services/hyrax/statistics/users/over_time_spec.rb
|
2502
2506
|
- spec/services/hyrax/statistics/works/by_depositor_spec.rb
|
@@ -2730,6 +2734,7 @@ test_files:
|
|
2730
2734
|
- spec/actors/hyrax/actors/model_actor_spec.rb
|
2731
2735
|
- spec/actors/hyrax/actors/optimistic_lock_validator_spec.rb
|
2732
2736
|
- spec/actors/hyrax/actors/transactional_request_spec.rb
|
2737
|
+
- spec/actors/hyrax/actors/transfer_request_actor_spec.rb
|
2733
2738
|
- spec/authorities/qa/authorities/find_works_spec.rb
|
2734
2739
|
- spec/channels/hyrax/application_cable/channel_spec.rb
|
2735
2740
|
- spec/channels/hyrax/application_cable/connection_spec.rb
|
@@ -3123,7 +3128,6 @@ test_files:
|
|
3123
3128
|
- spec/services/hyrax/persist_derivatives_spec.rb
|
3124
3129
|
- spec/services/hyrax/persist_directly_contained_output_file_service_spec.rb
|
3125
3130
|
- spec/services/hyrax/qa_select_service_spec.rb
|
3126
|
-
- spec/services/hyrax/query_service_spec.rb
|
3127
3131
|
- spec/services/hyrax/quick_classification_query_spec.rb
|
3128
3132
|
- spec/services/hyrax/repository_fixity_check_service_spec.rb
|
3129
3133
|
- spec/services/hyrax/resource_types_service_spec.rb
|
@@ -3131,6 +3135,7 @@ test_files:
|
|
3131
3135
|
- spec/services/hyrax/statistics/collections/over_time_spec.rb
|
3132
3136
|
- spec/services/hyrax/statistics/depositors/summary_spec.rb
|
3133
3137
|
- spec/services/hyrax/statistics/file_sets/by_format_spec.rb
|
3138
|
+
- spec/services/hyrax/statistics/query_service_spec.rb
|
3134
3139
|
- spec/services/hyrax/statistics/system_stats_spec.rb
|
3135
3140
|
- spec/services/hyrax/statistics/users/over_time_spec.rb
|
3136
3141
|
- spec/services/hyrax/statistics/works/by_depositor_spec.rb
|
@@ -1,53 +0,0 @@
|
|
1
|
-
module Hyrax
|
2
|
-
class QueryService
|
3
|
-
# query to find works created during the time range
|
4
|
-
# @param [DateTime] start_datetime starting date time for range query
|
5
|
-
# @param [DateTime] end_datetime ending date time for range query
|
6
|
-
def find_by_date_created(start_datetime, end_datetime = nil)
|
7
|
-
return [] if start_datetime.blank? # no date just return nothing
|
8
|
-
relation.where(build_date_query(start_datetime, end_datetime))
|
9
|
-
end
|
10
|
-
|
11
|
-
def find_registered_in_date_range(start_datetime, end_datetime = nil)
|
12
|
-
find_by_date_created(start_datetime, end_datetime).merge(where_registered)
|
13
|
-
end
|
14
|
-
|
15
|
-
def find_public_in_date_range(start_datetime, end_datetime = nil)
|
16
|
-
find_by_date_created(start_datetime, end_datetime).merge(where_public)
|
17
|
-
end
|
18
|
-
|
19
|
-
def where_public
|
20
|
-
where_access_is 'public'
|
21
|
-
end
|
22
|
-
|
23
|
-
def where_registered
|
24
|
-
where_access_is 'registered'
|
25
|
-
end
|
26
|
-
|
27
|
-
def build_date_query(start_datetime, end_datetime)
|
28
|
-
start_date_str = start_datetime.utc.strftime(date_format)
|
29
|
-
end_date_str = if end_datetime.blank?
|
30
|
-
"*"
|
31
|
-
else
|
32
|
-
end_datetime.utc.strftime(date_format)
|
33
|
-
end
|
34
|
-
"system_create_dtsi:[#{start_date_str} TO #{end_date_str}]"
|
35
|
-
end
|
36
|
-
|
37
|
-
delegate :count, to: :relation
|
38
|
-
|
39
|
-
def relation
|
40
|
-
Hyrax::WorkRelation.new
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
def where_access_is(access_level)
|
46
|
-
relation.where Hydra.config.permissions.read.group => access_level
|
47
|
-
end
|
48
|
-
|
49
|
-
def date_format
|
50
|
-
"%Y-%m-%dT%H:%M:%SZ"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|