hyrax 5.0.1 → 5.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +7 -176
- data/.dassie/.env +8 -3
- data/.dassie/Gemfile +13 -2
- data/.dassie/app/controllers/hyrax/generic_work_resources_controller.rb +17 -0
- data/.dassie/app/controllers/hyrax/generic_works_controller.rb +7 -1
- data/.dassie/app/forms/generic_work_resource_form.rb +20 -0
- data/.dassie/app/indexers/generic_work_resource_indexer.rb +16 -0
- data/.dassie/app/models/admin_set_resource.rb +9 -0
- data/.dassie/app/models/collection_resource.rb +2 -0
- data/.dassie/app/models/file_set.rb +2 -0
- data/.dassie/app/models/generic_work_resource.rb +10 -0
- data/.dassie/app/views/hyrax/generic_work_resources/_generic_work_resource.html.erb +2 -0
- data/.dassie/config/analytics.yml +6 -1
- data/.dassie/config/application.rb +24 -0
- data/.dassie/config/initializers/hyrax.rb +13 -3
- data/.dassie/config/initializers/wings.rb +109 -0
- data/.dassie/config/metadata/generic_work_resource.yaml +22 -0
- data/.dassie/config/valkyrie_index.yml +4 -10
- data/.dassie/db/migrate/20240506070809_valkyrie_id_to_string.rb +5 -0
- data/.dassie/db/schema.rb +2 -2
- data/.dassie/spec/indexers/generic_work_resource_indexer_spec.rb +13 -0
- data/.dassie/spec/models/generic_work_resource_spec.rb +12 -0
- data/.dassie/spec/views/generic_work_resources/_generic_work_resource.html.erb_spec.rb +7 -0
- data/.dockerignore +6 -4
- data/.github/release.yml +3 -0
- data/.github/workflows/lint-build-test.yml +130 -0
- data/.github/workflows/test-results.yml +40 -0
- data/.koppie/.env +7 -5
- data/.koppie/Gemfile +12 -1
- data/.koppie/config/analytics.yml +6 -1
- data/.koppie/config/environments/test.rb +2 -0
- data/.koppie/config/initializers/1_valkyrie.rb +6 -2
- data/.koppie/config/solr.yml +1 -1
- data/.regen +1 -1
- data/.rubocop.yml +5 -0
- data/Dockerfile +16 -36
- data/Gemfile +2 -0
- data/app/assets/javascripts/hydra-editor/field_manager.es6 +187 -0
- data/app/assets/javascripts/hyrax/analytics_events.js +48 -24
- data/app/assets/javascripts/hyrax/collapse.js +4 -4
- data/app/assets/javascripts/hyrax/file_manager/save_manager.es6 +2 -0
- data/app/assets/javascripts/hyrax/search.js +2 -3
- data/app/assets/javascripts/hyrax/select_work_type.es6 +3 -1
- data/app/assets/javascripts/hyrax/uploader.js +20 -18
- data/app/assets/javascripts/hyrax.js +1 -0
- data/app/assets/stylesheets/_bootstrap-default-overrides.scss +4 -0
- data/app/assets/stylesheets/hyrax/_card.scss +4 -0
- data/app/assets/stylesheets/hyrax/_catalog.scss +21 -0
- data/app/assets/stylesheets/hyrax/_collections.scss +1 -1
- data/app/assets/stylesheets/hyrax/_facets.scss +15 -3
- data/app/assets/stylesheets/hyrax/_featured.scss +4 -0
- data/app/assets/stylesheets/hyrax/_form.scss +4 -0
- data/app/assets/stylesheets/hyrax/_forms.scss +2 -1
- data/app/assets/stylesheets/hyrax/_nestable.scss +9 -8
- data/app/assets/stylesheets/hyrax/_select_work_type.scss +12 -0
- data/app/assets/stylesheets/hyrax/_styles.scss +4 -0
- data/app/assets/stylesheets/hyrax/_work-show.scss +3 -0
- data/app/controllers/concerns/hyrax/singular_subresource_controller.rb +7 -2
- data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +11 -2
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +9 -2
- data/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +2 -2
- data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +7 -8
- data/app/controllers/hyrax/dashboard/collections_controller.rb +2 -1
- data/app/controllers/hyrax/downloads_controller.rb +24 -3
- data/app/controllers/hyrax/file_sets_controller.rb +32 -6
- data/app/controllers/hyrax/my/works_controller.rb +20 -0
- data/app/controllers/hyrax/stats_controller.rb +1 -1
- data/app/controllers/hyrax/uploads_controller.rb +28 -2
- data/app/forms/hyrax/forms/admin/appearance.rb +1 -1
- data/app/forms/hyrax/forms/admin/collection_type_form.rb +1 -7
- data/app/forms/hyrax/forms/pcdm_collection_form.rb +9 -0
- data/app/forms/hyrax/forms/work_embargo_form.rb +6 -0
- data/app/forms/hyrax/forms/work_lease_form.rb +6 -0
- data/app/indexers/concerns/hyrax/location_indexer.rb +2 -2
- data/app/indexers/hyrax/indexers/file_set_indexer.rb +4 -0
- data/app/indexers/hyrax/indexers/resource_indexer.rb +1 -0
- data/app/indexers/hyrax/valkyrie_indexer.rb +3 -5
- data/app/jobs/migrate_files_to_valkyrie_job.rb +109 -0
- data/app/jobs/migrate_resources_job.rb +34 -0
- data/app/jobs/valkyrie_create_derivatives_job.rb +2 -1
- data/app/models/admin_set.rb +1 -0
- data/app/models/concerns/hyrax/ar_resource.rb +104 -0
- data/app/models/concerns/hyrax/solr_document/ordered_members.rb +2 -1
- data/app/models/concerns/hyrax/solr_document_behavior.rb +13 -2
- data/app/models/concerns/hyrax/valkyrie_lazy_migration.rb +82 -0
- data/app/models/file_download_stat.rb +1 -1
- data/app/models/file_view_stat.rb +1 -1
- data/app/models/hyrax/collection_type.rb +12 -4
- data/app/models/hyrax/file_metadata.rb +19 -0
- data/app/models/hyrax/file_set.rb +25 -0
- data/app/models/hyrax/model_registry.rb +2 -3
- data/app/models/hyrax/resource.rb +5 -0
- data/app/models/hyrax/statistic.rb +12 -37
- data/app/presenters/hyrax/file_set_presenter.rb +2 -1
- data/app/presenters/hyrax/file_usage.rb +3 -3
- data/app/presenters/hyrax/iiif_manifest_presenter.rb +2 -1
- data/app/presenters/hyrax/member_presenter_factory.rb +7 -1
- data/app/presenters/hyrax/menu_presenter.rb +1 -1
- data/app/presenters/hyrax/stats_usage_presenter.rb +2 -1
- data/app/presenters/hyrax/work_show_presenter.rb +13 -17
- data/app/presenters/hyrax/work_usage.rb +5 -2
- data/app/search_builders/hyrax/expired_embargo_search_builder.rb +7 -1
- data/app/search_builders/hyrax/expired_lease_search_builder.rb +7 -1
- data/app/search_builders/hyrax/filter_by_type.rb +1 -3
- data/app/search_builders/hyrax/valkyrie_abstract_type_relation.rb +7 -2
- data/app/services/hyrax/access_control_list.rb +1 -1
- data/app/services/hyrax/admin_set_create_service.rb +16 -5
- data/app/services/hyrax/admin_set_service.rb +2 -1
- data/app/services/hyrax/analytics/ga4/base.rb +96 -0
- data/app/services/hyrax/analytics/ga4/events.rb +25 -0
- data/app/services/hyrax/analytics/ga4/events_daily.rb +36 -0
- data/app/services/hyrax/analytics/ga4/visits.rb +33 -0
- data/app/services/hyrax/analytics/ga4/visits_daily.rb +24 -0
- data/app/services/hyrax/analytics/ga4.rb +204 -0
- data/app/services/hyrax/analytics/google.rb +16 -2
- data/app/services/hyrax/analytics/matomo.rb +16 -3
- data/app/services/hyrax/analytics/results.rb +6 -0
- data/app/services/hyrax/custom_queries/find_access_control.rb +1 -1
- data/app/services/hyrax/custom_queries/find_by_date_range.rb +6 -23
- data/app/services/hyrax/custom_queries/find_collections_by_type.rb +2 -2
- data/app/services/hyrax/custom_queries/find_count_by.rb +3 -31
- data/app/services/hyrax/custom_queries/find_file_metadata.rb +2 -2
- data/app/services/hyrax/custom_queries/find_models_by_access.rb +5 -27
- data/app/services/hyrax/embargo_manager.rb +2 -1
- data/app/services/hyrax/listeners/file_listener.rb +2 -2
- data/app/services/hyrax/lock_manager.rb +6 -6
- data/app/services/hyrax/lockable.rb +4 -3
- data/app/services/hyrax/simple_schema_loader.rb +1 -1
- data/app/services/hyrax/solr_service.rb +22 -8
- data/app/services/hyrax/statistics/query_service.rb +1 -1
- data/app/services/hyrax/statistics/works/over_time.rb +1 -1
- data/app/services/hyrax/thumbnail_path_service.rb +2 -0
- data/app/services/hyrax/user_stat_importer.rb +5 -5
- data/app/services/hyrax/valkyrie_upload.rb +9 -7
- data/app/services/hyrax/versioning_service.rb +10 -2
- data/app/services/hyrax/work_query_service.rb +2 -2
- data/app/services/migrate_resource_service.rb +55 -0
- data/app/views/_controls.html.erb +5 -5
- data/app/views/_masthead.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +9 -16
- data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
- data/app/views/catalog/_thumbnail_list_default.html.erb +2 -2
- data/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +4 -4
- data/app/views/hyrax/admin/analytics/work_reports/index.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/_form.html.erb +4 -4
- data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
- data/app/views/hyrax/admin/features/index.html.erb +1 -1
- data/app/views/hyrax/base/_file_manager_actions.html.erb +1 -1
- data/app/views/hyrax/base/_file_manager_member.html.erb +7 -4
- data/app/views/hyrax/base/_file_manager_thumbnail.html.erb +1 -1
- data/app/views/hyrax/base/_form_files.html.erb +1 -1
- data/app/views/hyrax/base/_form_member_of_collections.html.erb +4 -0
- data/app/views/hyrax/base/_show_actions.html.erb +7 -8
- data/app/views/hyrax/base/_work_button_row.html.erb +1 -1
- data/app/views/hyrax/batch_select/_add_button.html.erb +1 -1
- data/app/views/hyrax/content_blocks/_form.html.erb +3 -3
- data/app/views/hyrax/dashboard/_sidebar.html.erb +1 -1
- data/app/views/hyrax/dashboard/_user_activity.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_form_share.html.erb +6 -4
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +1 -1
- data/app/views/hyrax/dashboard/show_admin.html.erb +18 -19
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +1 -1
- data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +7 -7
- data/app/views/hyrax/file_sets/_actions.html.erb +9 -1
- data/app/views/hyrax/file_sets/_permission_form.html.erb +4 -2
- data/app/views/hyrax/file_sets/_show_actions.html.erb +1 -1
- data/app/views/hyrax/homepage/_featured.html.erb +1 -1
- data/app/views/hyrax/homepage/_recent_document.html.erb +2 -2
- data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +6 -6
- data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
- data/app/views/hyrax/my/collections/_tabs.html.erb +1 -1
- data/app/views/hyrax/pages/_form.html.erb +8 -8
- data/app/views/hyrax/transfers/_received.html.erb +1 -1
- data/app/views/hyrax/uploads/create.json.jbuilder +2 -2
- data/app/views/hyrax/users/_activity_log.html.erb +15 -9
- data/app/views/hyrax/users/_user_row.html.erb +6 -3
- data/app/views/hyrax/users/_vitals.html.erb +3 -2
- data/app/views/layouts/_head_tag_content.html.erb +2 -0
- data/app/views/shared/_appearance_styles.html.erb +5 -1
- data/app/views/shared/_ga4.html.erb +11 -0
- data/app/views/shared/_select_work_type_modal.html.erb +10 -1
- data/bin/db-migrate-seed.sh +3 -3
- data/bin/dev-entrypoint.sh +7 -2
- data/bin/{db-wait.sh → service-wait.sh} +1 -1
- data/bin/worker-entrypoint.sh +8 -0
- data/chart/hyrax/templates/deployment-worker.yaml +2 -2
- data/config/locales/hyrax.en.yml +4 -2
- data/config/metadata/basic_metadata.yaml +20 -0
- data/config/metadata/hyrax_internal_metadata.yaml +1 -1
- data/docker-compose-dassie.yml +167 -0
- data/docker-compose-koppie.yml +21 -36
- data/docker-compose-sirenia.yml +50 -44
- data/docker-compose.yml +2 -183
- data/documentation/developing-your-hyrax-based-app.md +2 -2
- data/hyrax.gemspec +5 -4
- data/lib/freyja/custom_query_container.rb +5 -0
- data/lib/freyja/metadata_adapter.rb +32 -0
- data/lib/freyja/persister.rb +42 -0
- data/lib/freyja/query_service.rb +20 -0
- data/lib/freyja/resource_factory.rb +8 -0
- data/lib/freyja.rb +14 -0
- data/lib/frigg/custom_query_container.rb +5 -0
- data/lib/frigg/metadata_adapter.rb +22 -0
- data/lib/frigg/persister.rb +33 -0
- data/lib/frigg/query_service.rb +15 -0
- data/lib/frigg.rb +13 -0
- data/lib/generators/hyrax/install_generator.rb +5 -0
- data/lib/generators/hyrax/templates/config/analytics.yml +6 -1
- data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +6 -2
- data/lib/generators/hyrax/templates/config/valkyrie_index.yml +1 -1
- data/lib/goddess/custom_query_container.rb +71 -0
- data/lib/goddess/metadata.rb +13 -0
- data/lib/goddess/query.rb +176 -0
- data/lib/hyrax/configuration.rb +83 -0
- data/lib/hyrax/engine.rb +2 -0
- data/lib/hyrax/form_fields.rb +1 -3
- data/lib/hyrax/name.rb +5 -0
- data/lib/hyrax/rubocop/custom_cops.rb +30 -0
- data/lib/hyrax/specs/capybara.rb +10 -6
- data/lib/hyrax/specs/shared_specs/factories/admin_sets.rb +2 -0
- data/lib/hyrax/specs/shared_specs/factories/hyrax_embargo.rb +4 -0
- data/lib/hyrax/specs/shared_specs/factories/hyrax_lease.rb +4 -0
- data/lib/hyrax/specs/shared_specs/factories/hyrax_work.rb +16 -2
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +1 -1
- data/lib/hyrax/transactions/admin_set_destroy.rb +2 -1
- data/lib/hyrax/transactions/collection_destroy.rb +2 -1
- data/lib/hyrax/transactions/container.rb +9 -0
- data/lib/hyrax/transactions/steps/add_file_sets.rb +2 -1
- data/lib/hyrax/transactions/steps/delete_permission_template.rb +30 -0
- data/lib/hyrax/transactions/steps/delete_resource.rb +1 -1
- data/lib/hyrax/transactions/steps/save_collection_logo.rb +2 -1
- data/lib/hyrax/valkyrie_can_can_adapter.rb +8 -1
- data/lib/hyrax/version.rb +1 -1
- data/lib/wings/active_fedora_converter.rb +13 -5
- data/lib/wings/converter_value_mapper.rb +1 -0
- data/lib/wings/services/custom_queries/find_collections_by_type.rb +2 -1
- data/lib/wings/services/custom_queries/find_file_metadata.rb +2 -2
- data/lib/wings/setup.rb +12 -3
- data/lib/wings/transformer_value_mapper.rb +5 -1
- data/lib/wings/valkyrie/persister.rb +3 -1
- data/template.rb +1 -1
- metadata +77 -19
- data/.koppie/scripts/db-migrate-seed.sh +0 -9
- data/.koppie/scripts/entrypoint.sh +0 -10
@@ -4,39 +4,53 @@ class TrackingTags {
|
|
4
4
|
}
|
5
5
|
|
6
6
|
analytics() {
|
7
|
-
|
7
|
+
switch(this.provider) {
|
8
|
+
case "matomo":
|
8
9
|
return _paq;
|
9
|
-
|
10
|
-
|
10
|
+
case "ga4":
|
11
|
+
return dataLayer;
|
12
|
+
default:
|
11
13
|
return _gaq;
|
12
14
|
}
|
13
15
|
}
|
14
16
|
|
15
17
|
pageView() {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
switch(this.provider) {
|
19
|
+
case "matomo":
|
20
|
+
return 'trackPageView';
|
21
|
+
case "ga4":
|
22
|
+
return 'event';
|
23
|
+
default:
|
24
|
+
return '_trackPageview';
|
20
25
|
}
|
21
26
|
}
|
22
27
|
|
23
28
|
trackEvent() {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
29
|
+
switch(this.provider) {
|
30
|
+
case "matomo":
|
31
|
+
return 'trackEvent';
|
32
|
+
case "ga4":
|
33
|
+
return 'event';
|
34
|
+
default:
|
35
|
+
return '_trackEvent';
|
28
36
|
}
|
29
37
|
}
|
30
38
|
}
|
31
39
|
|
32
|
-
function trackPageView() {
|
33
|
-
|
40
|
+
function trackPageView(provider) {
|
41
|
+
if(provider !== 'ga4'){
|
42
|
+
window.trackingTags.analytics().push([window.trackingTags.pageView()]);
|
43
|
+
}
|
34
44
|
}
|
35
45
|
|
36
|
-
function trackAnalyticsEvents() {
|
46
|
+
function trackAnalyticsEvents(provider) {
|
37
47
|
$('span.analytics-event').each(function(){
|
38
48
|
var eventSpan = $(this)
|
39
|
-
|
49
|
+
if(provider !== 'ga4') {
|
50
|
+
window.trackingTags.analytics().push([window.trackingTags.trackEvent(), eventSpan.data('category'), eventSpan.data('action'), eventSpan.data('name')]);
|
51
|
+
} else {
|
52
|
+
gtag('event', eventSpan.data('action'), { 'content_type': eventSpan.data('category'), 'content_id': eventSpan.data('name')})
|
53
|
+
}
|
40
54
|
})
|
41
55
|
}
|
42
56
|
|
@@ -46,8 +60,8 @@ function setupTracking() {
|
|
46
60
|
return;
|
47
61
|
}
|
48
62
|
window.trackingTags = new TrackingTags(provider)
|
49
|
-
trackPageView()
|
50
|
-
trackAnalyticsEvents()
|
63
|
+
trackPageView(provider)
|
64
|
+
trackAnalyticsEvents(provider)
|
51
65
|
}
|
52
66
|
|
53
67
|
if (typeof Turbolinks !== 'undefined') {
|
@@ -55,7 +69,7 @@ if (typeof Turbolinks !== 'undefined') {
|
|
55
69
|
setupTracking()
|
56
70
|
})
|
57
71
|
} else {
|
58
|
-
$(document).
|
72
|
+
$(document).ready(function() {
|
59
73
|
setupTracking()
|
60
74
|
})
|
61
75
|
}
|
@@ -66,10 +80,20 @@ $(document).on('click', '#file_download', function(e) {
|
|
66
80
|
return;
|
67
81
|
}
|
68
82
|
window.trackingTags = new TrackingTags(provider)
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set-in-
|
73
|
-
|
74
|
-
|
83
|
+
|
84
|
+
if(provider !== 'ga4') {
|
85
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set', 'file-set-download', $(this).data('label')]);
|
86
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set-in-work', 'file-set-in-work-download', $(this).data('work-id')]);
|
87
|
+
$(this).data('collection-ids').forEach(function (collection) {
|
88
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set-in-collection', 'file-set-in-collection-download', collection]);
|
89
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'work-in-collection', 'work-in-collection-download', collection]);
|
90
|
+
});
|
91
|
+
} else {
|
92
|
+
gtag('event', 'file-set-download', { 'content_type': 'file-set', 'content_id': $(this).data('label')})
|
93
|
+
gtag('event', 'file-set-in-work-download', { 'content_type': 'file-set-in-work', 'content_id': $(this).data('work-id')})
|
94
|
+
$(this).data('collection-ids').forEach(function (collection) {
|
95
|
+
gtag('event', 'file-set-in-collection-download', { 'content_type': 'file-set-in-collection', 'content_id': collection })
|
96
|
+
gtag('event', 'work-in-collection-download', { 'content_type': 'work-in-collection', 'content_id': collection })
|
97
|
+
});
|
98
|
+
}
|
75
99
|
});
|
@@ -40,10 +40,10 @@ function getStatusActivity(){
|
|
40
40
|
}
|
41
41
|
else if(isCollapsed){
|
42
42
|
resultDiv.classList.remove("in");
|
43
|
-
resultDiv.setAttribute("aria-expanded", "false");
|
43
|
+
// resultDiv.setAttribute("aria-expanded", "false");
|
44
44
|
}else{
|
45
45
|
resultDiv.classList.add("in");
|
46
|
-
resultDiv.setAttribute("aria-expanded", "true");
|
46
|
+
// resultDiv.setAttribute("aria-expanded", "true");
|
47
47
|
}
|
48
48
|
}
|
49
49
|
|
@@ -55,10 +55,10 @@ function getStatusSettings(){
|
|
55
55
|
}
|
56
56
|
else if(isCollapsed){
|
57
57
|
resultDiv.classList.remove("in");
|
58
|
-
resultDiv.setAttribute("aria-expanded", "false");
|
58
|
+
// resultDiv.setAttribute("aria-expanded", "false");
|
59
59
|
}else{
|
60
60
|
resultDiv.classList.add("in");
|
61
|
-
resultDiv.setAttribute("aria-expanded", "true");
|
61
|
+
// resultDiv.setAttribute("aria-expanded", "true");
|
62
62
|
}
|
63
63
|
}
|
64
64
|
|
@@ -26,8 +26,10 @@ export default class SaveManager {
|
|
26
26
|
check_button() {
|
27
27
|
if (this.is_changed) {
|
28
28
|
this.save_button.removeClass("disabled")
|
29
|
+
this.save_button.attr("aria-disabled", "false")
|
29
30
|
} else {
|
30
31
|
this.save_button.addClass("disabled")
|
32
|
+
this.save_button.attr("aria-disabled", "true")
|
31
33
|
}
|
32
34
|
}
|
33
35
|
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
this.init = function() {
|
6
6
|
this.$label = this.$element.find('[data-search-element="label"]');
|
7
|
+
this.$visibleLabel = this.$element.find('.dropdown-toggle').find('span[aria-hidden="true"]');
|
7
8
|
this.$items = this.$element.find('[data-search-option]');
|
8
9
|
this.setDefault();
|
9
10
|
}
|
@@ -12,7 +13,6 @@
|
|
12
13
|
this.attachEvents();
|
13
14
|
}
|
14
15
|
|
15
|
-
|
16
16
|
Hyrax.Search.prototype = {
|
17
17
|
attachEvents: function() {
|
18
18
|
|
@@ -43,6 +43,7 @@
|
|
43
43
|
|
44
44
|
setLabel: function(label) {
|
45
45
|
this.$label.html(label);
|
46
|
+
this.$visibleLabel.html(label);
|
46
47
|
}
|
47
48
|
|
48
49
|
}
|
@@ -58,8 +59,6 @@
|
|
58
59
|
|
59
60
|
})(jQuery);
|
60
61
|
|
61
|
-
|
62
62
|
Blacklight.onLoad(function() {
|
63
63
|
$('#search-form-header').search();
|
64
64
|
});
|
65
|
-
|
@@ -39,6 +39,8 @@ export default class SelectWorkType {
|
|
39
39
|
// for a single work. So, given the value of 'this.type', return the appropriate
|
40
40
|
// path.
|
41
41
|
destination() {
|
42
|
-
|
42
|
+
let admin_set_id = this.form.find('select').val()
|
43
|
+
let url = this.form.find('input[type="radio"]:checked').data(this.type)
|
44
|
+
return url + "&admin_set_id=" + admin_set_id
|
43
45
|
}
|
44
46
|
}
|
@@ -10,7 +10,6 @@
|
|
10
10
|
* https://github.com/blueimp/jQuery-File-Upload
|
11
11
|
*
|
12
12
|
* Copyright 2010, Sebastian Tschan
|
13
|
-
* https://blueimp.net
|
14
13
|
*
|
15
14
|
* Licensed under the MIT license:
|
16
15
|
* http://www.opensource.org/licenses/MIT
|
@@ -21,45 +20,48 @@
|
|
21
20
|
|
22
21
|
$.fn.extend({
|
23
22
|
hyraxUploader: function( options ) {
|
24
|
-
// Initialize our jQuery File Upload widget.
|
25
23
|
this.fileupload($.extend({
|
26
|
-
|
27
|
-
// acceptFileTypes: /(\.|\/)(png|mov|jpe?g|pdf)$/i, // not a strong check, just a regex on the filename
|
28
|
-
// limitMultiFileUploadSize: 500000000, // bytes
|
24
|
+
maxChunkSize: 10000000, // 10 MB chunk size
|
29
25
|
autoUpload: true,
|
30
26
|
url: '/uploads/',
|
31
27
|
type: 'POST',
|
32
|
-
dropZone: $(this).find('.dropzone')
|
28
|
+
dropZone: $(this).find('.dropzone'),
|
29
|
+
add: function (e, data) {
|
30
|
+
var that = this;
|
31
|
+
$.post('/uploads/', { files: [data.files[0].name] }, function (result) {
|
32
|
+
data.formData = {id: result.files[0].id};
|
33
|
+
$.blueimp.fileupload.prototype.options.add.call(that, e, data);
|
34
|
+
});
|
35
|
+
}
|
33
36
|
}, Hyrax.config.uploader, options))
|
34
37
|
.on('fileuploadadded', function (e, data) {
|
35
38
|
$(e.currentTarget).find('button.cancel').removeAttr("hidden");
|
36
39
|
});
|
37
|
-
|
38
40
|
$(document).on('dragover', function(e) {
|
39
41
|
var dropZone = $('.dropzone'),
|
40
42
|
timeout = window.dropZoneTimeout;
|
41
43
|
if (!timeout) {
|
42
|
-
|
44
|
+
dropZone.addClass('in');
|
43
45
|
} else {
|
44
|
-
|
46
|
+
clearTimeout(timeout);
|
45
47
|
}
|
46
48
|
var found = false,
|
47
49
|
node = e.target;
|
48
50
|
do {
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
if (node === dropZone[0]) {
|
52
|
+
found = true;
|
53
|
+
break;
|
54
|
+
}
|
55
|
+
node = node.parentNode;
|
54
56
|
} while (node !== null);
|
55
57
|
if (found) {
|
56
|
-
|
58
|
+
dropZone.addClass('hover');
|
57
59
|
} else {
|
58
|
-
|
60
|
+
dropZone.removeClass('hover');
|
59
61
|
}
|
60
62
|
window.dropZoneTimeout = setTimeout(function () {
|
61
|
-
|
62
|
-
|
63
|
+
window.dropZoneTimeout = null;
|
64
|
+
dropZone.removeClass('in hover');
|
63
65
|
}, 100);
|
64
66
|
});
|
65
67
|
}
|
@@ -90,6 +90,7 @@
|
|
90
90
|
//= require hyrax/collapse
|
91
91
|
//= require hyrax/skip_to_content
|
92
92
|
//= require hyrax/reports-buttons
|
93
|
+
//= require hydra-editor/field_manager
|
93
94
|
|
94
95
|
// this needs to be after batch_select so that the form ids get setup correctly
|
95
96
|
//= require hyrax/batch_edit
|
@@ -18,6 +18,10 @@ $warning: #565653 !default;
|
|
18
18
|
// * Darkens the text for disabled pagination buttons on every page.
|
19
19
|
$breadcrumb-active-color: #4c4c4c;
|
20
20
|
$pagination-disabled-color: #4c4c4c;
|
21
|
+
$blue: #0056B3 !default;
|
22
|
+
// Adjusts link text to show as underlined and then not underlined on hover
|
23
|
+
$link-decoration: underline !default;
|
24
|
+
$link-hover-decoration: none !default;
|
21
25
|
|
22
26
|
// Date picker on safari placeholder text was misaligned
|
23
27
|
@media screen {
|
@@ -23,6 +23,16 @@
|
|
23
23
|
}
|
24
24
|
}
|
25
25
|
|
26
|
+
.search-results-title-row {
|
27
|
+
.badge {
|
28
|
+
margin-bottom: 6px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.search-result-title {
|
32
|
+
margin-right: 16px;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
26
36
|
.collection-icon-search {
|
27
37
|
padding-bottom: 20px;
|
28
38
|
}
|
@@ -91,3 +101,14 @@
|
|
91
101
|
display: inline-block;
|
92
102
|
}
|
93
103
|
}
|
104
|
+
|
105
|
+
@media (max-width: 1199px) {
|
106
|
+
.sort-pagination {
|
107
|
+
display: block !important;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
#search-results .search-result-wrapper .metadata a,
|
112
|
+
#documents .document-metadata a {
|
113
|
+
word-break: break-all;
|
114
|
+
}
|
@@ -1,9 +1,21 @@
|
|
1
1
|
#facet-panel-collapse {
|
2
|
-
display: inline-block !important;
|
2
|
+
display: inline-block !important;
|
3
3
|
width: 100%;
|
4
4
|
}
|
5
5
|
|
6
|
-
.
|
6
|
+
.facet-field-heading button.collapsed::after {
|
7
|
+
transition: transform 0.25s ease;
|
8
|
+
}
|
9
|
+
|
10
|
+
.facet-field-heading button::after {
|
11
|
+
transition: transform 0.25s ease;
|
12
|
+
}
|
13
|
+
|
14
|
+
.collapsing {
|
15
|
+
transition: height 0.25s ease;
|
16
|
+
}
|
17
|
+
|
18
|
+
.facets-header > .navbar-toggler {
|
7
19
|
display: none;
|
8
20
|
}
|
9
21
|
|
@@ -43,4 +55,4 @@ ul.facet-values.list-unstyled {
|
|
43
55
|
content: "\f105";
|
44
56
|
font-family: "FontAwesome";
|
45
57
|
padding-left: 0.5rem;
|
46
|
-
}
|
58
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
legend small {
|
2
2
|
margin-left: 0.5em;
|
3
|
-
color: #
|
3
|
+
color: #595959;
|
4
4
|
font-size: 15px;
|
5
5
|
}
|
6
6
|
|
@@ -40,6 +40,7 @@ legend small {
|
|
40
40
|
|
41
41
|
.select2-container .select2-choice > .select2-chosen {
|
42
42
|
max-width: 26em;
|
43
|
+
overflow: auto;
|
43
44
|
}
|
44
45
|
|
45
46
|
form {
|
@@ -47,12 +47,12 @@ tr.dd-item {
|
|
47
47
|
|
48
48
|
.dd-placeholder,
|
49
49
|
.dd-empty { margin: 5px 0; padding: 0; min-height: 30px; border: 1px dashed #b6bcbf; box-sizing: border-box; -moz-box-sizing: border-box; }
|
50
|
-
.dd-empty { border: 1px dashed #bbb; min-height: 100px;
|
51
|
-
background-image: -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
50
|
+
.dd-empty { border: 1px dashed #bbb; min-height: 100px;
|
51
|
+
background-image: -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
52
52
|
-webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
53
|
-
background-image: -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
53
|
+
background-image: -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
54
54
|
-moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
55
|
-
background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
55
|
+
background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
56
56
|
linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
57
57
|
background-size: 60px 60px;
|
58
58
|
background-position: 0 0, 30px 30px;
|
@@ -82,7 +82,7 @@ tr.dd-item {
|
|
82
82
|
background: #fafafa;
|
83
83
|
background: -webkit-linear-gradient(top, #fafafa 0%, #eee 100%);
|
84
84
|
background: -moz-linear-gradient(top, #fafafa 0%, #eee 100%);
|
85
|
-
background: linear-gradient(
|
85
|
+
background: linear-gradient(to bottom, #fafafa 0%, #eee 100%);
|
86
86
|
-webkit-border-radius: 3px;
|
87
87
|
border-radius: 3px;
|
88
88
|
box-sizing: border-box; -moz-box-sizing: border-box;
|
@@ -95,15 +95,16 @@ tr.dd-item {
|
|
95
95
|
|
96
96
|
.dd3-item > button { margin-left: 30px; }
|
97
97
|
|
98
|
-
.dd3-handle {
|
98
|
+
.dd3-handle {
|
99
99
|
position: absolute; margin: 0; left: 0; top: 0; cursor: pointer; width: 30px;
|
100
100
|
text-indent: 100px;
|
101
101
|
white-space: nowrap; overflow: hidden;
|
102
102
|
border: 1px solid #aaa;
|
103
103
|
background: #ddd;
|
104
104
|
background: -webkit-linear-gradient(top, #ddd 0%, #bbb 100%);
|
105
|
-
background:
|
106
|
-
background:
|
105
|
+
background: -moz-linear-gradient(top, #ddd 0%, #bbb 100%);
|
106
|
+
background: -o-linear-gradient(to bottom, #ddd 0%, #bbb 100%);
|
107
|
+
background: linear-gradient(to bottom, #ddd 0%, #bbb 100%);
|
107
108
|
border-top-right-radius: 0;
|
108
109
|
border-bottom-right-radius: 0;
|
109
110
|
}
|
@@ -6,12 +6,17 @@ module Hyrax
|
|
6
6
|
|
7
7
|
included do
|
8
8
|
before_action :find_work, only: :work
|
9
|
+
before_action :find_file_set, only: :file
|
9
10
|
load_and_authorize_resource :work, only: :work
|
10
|
-
load_and_authorize_resource :file,
|
11
|
+
load_and_authorize_resource :file, only: :file
|
11
12
|
end
|
12
13
|
|
13
14
|
def find_work
|
14
|
-
@work = Hyrax
|
15
|
+
@work = Hyrax.query_service.find_by(id: params[:id])
|
16
|
+
end
|
17
|
+
|
18
|
+
def find_file_set
|
19
|
+
@file = Hyrax.query_service.find_by(id: params[:id])
|
15
20
|
end
|
16
21
|
end
|
17
22
|
end
|
@@ -11,10 +11,19 @@ module Hyrax
|
|
11
11
|
|
12
12
|
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
13
13
|
def send_file_contents_valkyrie(file_set)
|
14
|
-
|
15
|
-
|
14
|
+
# TODO: Refactor for goddess adapter usage
|
15
|
+
# This determines if we're dealing with active fedora or not. If we are,
|
16
|
+
# fallback to the original implementation.
|
16
17
|
mime_type = params[:mime_type]
|
17
18
|
file_metadata = find_file_metadata(file_set: file_set, use: use, mime_type: mime_type)
|
19
|
+
begin
|
20
|
+
::Valkyrie::StorageAdapter.adapter_for(id: file_metadata.file_identifier)
|
21
|
+
rescue Valkyrie::StorageAdapter::AdapterNotFoundError
|
22
|
+
return show_active_fedora
|
23
|
+
end
|
24
|
+
|
25
|
+
response.headers["Accept-Ranges"] = "bytes"
|
26
|
+
self.status = 200
|
18
27
|
return unless stale?(last_modified: file_metadata.updated_at, template: false)
|
19
28
|
|
20
29
|
file = Valkyrie::StorageAdapter.find_by(id: file_metadata.file_identifier)
|
@@ -58,7 +58,7 @@ module Hyrax
|
|
58
58
|
@admin_set_options = available_admin_sets
|
59
59
|
# TODO: move these lines to the work form builder in Hyrax
|
60
60
|
curation_concern.depositor = current_user.user_key
|
61
|
-
curation_concern.admin_set_id = admin_set_id_for_new
|
61
|
+
curation_concern.admin_set_id = params[:admin_set_id] || admin_set_id_for_new
|
62
62
|
build_form
|
63
63
|
end
|
64
64
|
|
@@ -263,6 +263,8 @@ module Hyrax
|
|
263
263
|
|
264
264
|
def contextual_path(presenter, parent_presenter)
|
265
265
|
::Hyrax::ContextualPath.new(presenter, parent_presenter).show
|
266
|
+
rescue NoMethodError
|
267
|
+
''
|
266
268
|
end
|
267
269
|
|
268
270
|
##
|
@@ -385,7 +387,12 @@ module Hyrax
|
|
385
387
|
|
386
388
|
def format_error_messages(errors)
|
387
389
|
# the error may already be a string
|
388
|
-
errors.respond_to?(:messages)
|
390
|
+
return errors unless errors.respond_to?(:messages)
|
391
|
+
|
392
|
+
errors.messages.map do |field, messages|
|
393
|
+
field_name = field.to_s.humanize
|
394
|
+
messages.map { |message| "#{field_name} #{message.sub(/^./, &:downcase)}" }
|
395
|
+
end.flatten.join("\n")
|
389
396
|
end
|
390
397
|
|
391
398
|
def after_create_error(errors, original_input_params_for_form = nil)
|
@@ -5,7 +5,7 @@ module Hyrax
|
|
5
5
|
class CollectionReportsController < AnalyticsController
|
6
6
|
include Hyrax::BreadcrumbsForCollectionAnalytics
|
7
7
|
def index
|
8
|
-
return unless Hyrax.config.
|
8
|
+
return unless Hyrax.config.analytics_reporting?
|
9
9
|
|
10
10
|
@pageviews = Hyrax::Analytics.daily_events('collection-page-view')
|
11
11
|
@work_page_views = Hyrax::Analytics.daily_events('work-in-collection-view')
|
@@ -21,7 +21,7 @@ module Hyrax
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def show
|
24
|
-
return unless Hyrax.config.
|
24
|
+
return unless Hyrax.config.analytics_reporting?
|
25
25
|
@document = ::SolrDocument.find(params[:id])
|
26
26
|
@pageviews = Hyrax::Analytics.daily_events_for_id(@document.id, 'collection-page-view')
|
27
27
|
@work_page_views = Hyrax::Analytics.daily_events_for_id(@document.id, 'work-in-collection-view')
|
@@ -4,9 +4,10 @@ module Hyrax
|
|
4
4
|
module Analytics
|
5
5
|
class WorkReportsController < AnalyticsController
|
6
6
|
include Hyrax::BreadcrumbsForWorksAnalytics
|
7
|
+
before_action :authenticate_user!
|
7
8
|
|
8
9
|
def index
|
9
|
-
return unless Hyrax.config.
|
10
|
+
return unless Hyrax.config.analytics_reporting?
|
10
11
|
|
11
12
|
@accessible_works ||= accessible_works
|
12
13
|
@accessible_file_sets ||= accessible_file_sets
|
@@ -14,10 +15,7 @@ module Hyrax
|
|
14
15
|
@top_works = paginate(top_works_list, rows: 10)
|
15
16
|
@top_file_set_downloads = paginate(top_files_list, rows: 10)
|
16
17
|
|
17
|
-
if current_user.ability.admin?
|
18
|
-
@pageviews = Hyrax::Analytics.daily_events('work-view')
|
19
|
-
@downloads = Hyrax::Analytics.daily_events('file-set-download')
|
20
|
-
end
|
18
|
+
@pageviews = Hyrax::Analytics.daily_events('work-view'), @downloads = Hyrax::Analytics.daily_events('file-set-download') if current_user.ability.admin?
|
21
19
|
|
22
20
|
respond_to do |format|
|
23
21
|
format.html
|
@@ -39,7 +37,7 @@ module Hyrax
|
|
39
37
|
private
|
40
38
|
|
41
39
|
def accessible_works
|
42
|
-
models = Hyrax.
|
40
|
+
models = Hyrax::ModelRegistry.work_rdf_representations.map { |m| "\"#{m}\"" }
|
43
41
|
if current_user.ability.admin?
|
44
42
|
Hyrax::SolrService.query("has_model_ssim:(#{models.join(' OR ')})",
|
45
43
|
fl: 'title_tesim, id, member_of_collections',
|
@@ -54,15 +52,16 @@ module Hyrax
|
|
54
52
|
end
|
55
53
|
|
56
54
|
def accessible_file_sets
|
55
|
+
file_set_model_clause = "has_model_ssim:\"#{Hyrax::ModelRegistry.file_set_rdf_representations.join('" OR "')}\""
|
57
56
|
if current_user.ability.admin?
|
58
57
|
Hyrax::SolrService.query(
|
59
|
-
|
58
|
+
file_set_model_clause,
|
60
59
|
fl: 'title_tesim, id',
|
61
60
|
rows: 50_000
|
62
61
|
)
|
63
62
|
else
|
64
63
|
Hyrax::SolrService.query(
|
65
|
-
"edit_access_person_ssim:#{current_user} AND
|
64
|
+
"edit_access_person_ssim:#{current_user} AND #{file_set_model_clause}",
|
66
65
|
fl: 'title_tesim, id',
|
67
66
|
rows: 50_000
|
68
67
|
)
|
@@ -231,7 +231,8 @@ module Hyrax
|
|
231
231
|
banner_unchanged_indicator: params["banner_unchanged"] },
|
232
232
|
'collection_resource.save_collection_logo' => { update_logo_file_ids: params["logo_files"],
|
233
233
|
alttext_values: params["alttext"],
|
234
|
-
linkurl_values: params["linkurl"]
|
234
|
+
linkurl_values: params["linkurl"],
|
235
|
+
logo_unchanged_indicator: false }
|
235
236
|
)
|
236
237
|
.call(form)
|
237
238
|
@collection = result.value_or { return after_update_errors(result.failure.first) }
|