hyrax 3.2.0 → 3.4.1
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 +3 -6
- data/.dassie/.env +1 -1
- data/.dassie/Gemfile +7 -3
- data/.dassie/app/models/user.rb +0 -2
- data/.dassie/config/analytics.yml +12 -5
- data/.dassie/config/environments/development.rb +2 -0
- data/.dassie/config/initializers/hyrax.rb +13 -1
- data/.dassie/db/migrate/20210921150120_enable_uuid_extension.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150121_create_orm_resources.valkyrie_engine.rb +19 -0
- data/.dassie/db/migrate/20210921150122_add_model_type_to_orm_resources.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150123_change_model_type_to_internal_model.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150124_create_path_gin_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150125_create_internal_resource_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150126_create_updated_at_index.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20210921150127_add_optimistic_locking_to_orm_resources.valkyrie_engine.rb +7 -0
- data/.dassie/db/migrate/20211130181150_create_default_administrative_set.rb +8 -0
- data/.dassie/db/schema.rb +20 -1
- data/.dassie/db/seeds.rb +70 -15
- data/.env +7 -4
- data/.github/release.yml +26 -0
- data/.github/workflows/main.yml +17 -0
- data/.github/workflows/release.yml +17 -0
- data/.gitignore +4 -0
- data/.regen +1 -1
- data/.rubocop_fixme.yml +3 -1
- data/CONTAINERS.md +13 -10
- data/Dockerfile +2 -1
- data/README.md +37 -0
- data/app/actors/hyrax/actors/file_actor.rb +6 -4
- data/app/actors/hyrax/actors/transfer_request_actor.rb +3 -7
- data/app/assets/javascripts/hyrax/admin/graphs.es6 +34 -37
- data/app/assets/javascripts/hyrax/analytics_events.js +75 -0
- data/app/assets/javascripts/hyrax/autocomplete/linked_data.es6 +1 -3
- data/app/assets/javascripts/hyrax/collapse.js +24 -0
- data/app/assets/javascripts/hyrax/collections.js +1 -2
- data/app/assets/javascripts/hyrax/ga_events.js +2 -8
- data/app/assets/javascripts/hyrax/reports-buttons.js +33 -0
- data/app/assets/javascripts/hyrax.js +2 -1
- data/app/assets/stylesheets/_bootstrap-default-overrides.scss +9 -0
- data/app/authorities/qa/authorities/collections.rb +4 -5
- data/app/authorities/qa/authorities/find_works.rb +1 -1
- data/app/controllers/concerns/hyrax/breadcrumbs_for_collection_analytics.rb +26 -0
- data/app/controllers/concerns/hyrax/breadcrumbs_for_works_analytics.rb +26 -0
- data/app/controllers/concerns/hyrax/controller.rb +43 -0
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +83 -59
- data/app/controllers/hyrax/admin/admin_sets_controller.rb +105 -19
- data/app/controllers/hyrax/admin/analytics/analytics_controller.rb +40 -0
- data/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +61 -0
- data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +122 -0
- data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +12 -19
- data/app/controllers/hyrax/batch_edits_controller.rb +12 -3
- data/app/controllers/hyrax/batch_uploads_controller.rb +4 -0
- data/app/controllers/hyrax/citations_controller.rb +1 -1
- data/app/controllers/hyrax/collections_controller.rb +4 -1
- data/app/controllers/hyrax/dashboard/collections_controller.rb +34 -16
- data/app/controllers/hyrax/dashboard_controller.rb +8 -0
- data/app/controllers/hyrax/stats_controller.rb +3 -1
- data/app/forms/hyrax/forms/administrative_set_form.rb +19 -1
- data/app/forms/hyrax/forms/batch_edit_form.rb +1 -1
- data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +21 -6
- data/app/forms/hyrax/forms/pcdm_collection_form.rb +4 -0
- data/app/forms/hyrax/forms/permission_template_form.rb +17 -9
- data/app/forms/hyrax/forms/resource_form.rb +9 -5
- data/app/helpers/hyrax/collections_helper.rb +14 -0
- data/app/helpers/hyrax/membership_helper.rb +1 -1
- data/app/helpers/hyrax/trophy_helper.rb +1 -1
- data/app/helpers/hyrax/url_helper.rb +1 -1
- data/app/indexers/hyrax/administrative_set_indexer.rb +8 -2
- data/app/indexers/hyrax/deep_indexing_service.rb +1 -1
- data/app/indexers/hyrax/file_set_indexer.rb +1 -0
- data/app/indexers/hyrax/pcdm_collection_indexer.rb +3 -1
- data/app/indexers/hyrax/thumbnail_indexer.rb +31 -0
- data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +7 -7
- data/app/indexers/hyrax/valkyrie_indexer.rb +4 -2
- data/app/indexers/hyrax/valkyrie_work_indexer.rb +13 -0
- data/app/inputs/controlled_vocabulary_input.rb +2 -0
- data/app/jobs/change_depositor_event_job.rb +47 -0
- data/app/jobs/characterize_job.rb +66 -3
- data/app/jobs/concerns/hyrax/members_permission_job_behavior.rb +1 -1
- data/app/jobs/content_depositor_change_event_job.rb +2 -1
- data/app/jobs/hyrax/propagate_change_depositor_job.rb +32 -0
- data/app/jobs/inherit_permissions_job.rb +1 -1
- data/app/jobs/valkyrie_create_derivatives_job.rb +25 -0
- data/app/jobs/valkyrie_ingest_job.rb +124 -0
- data/app/models/admin_set.rb +2 -2
- data/app/models/collection_branding_info.rb +8 -6
- data/app/models/concerns/hyrax/ability.rb +26 -5
- data/app/models/concerns/hyrax/collection_behavior.rb +2 -2
- data/app/models/concerns/hyrax/file_set/characterization.rb +7 -1
- data/app/models/concerns/hyrax/solr_document/metadata.rb +2 -0
- data/app/models/concerns/hyrax/solr_document_behavior.rb +9 -3
- data/app/models/file_download_stat.rb +4 -4
- data/app/models/hyrax/administrative_set.rb +36 -1
- data/app/models/hyrax/collection_type.rb +2 -2
- data/app/models/hyrax/default_administrative_set.rb +42 -0
- data/app/models/hyrax/file_metadata.rb +5 -1
- data/app/models/hyrax/file_set.rb +42 -1
- data/app/models/hyrax/pcdm_collection.rb +56 -0
- data/app/models/hyrax/permission_template.rb +11 -5
- data/app/models/hyrax/statistic.rb +31 -4
- data/app/models/hyrax/work.rb +91 -0
- data/app/models/proxy_deposit_request.rb +1 -1
- data/app/presenters/hyrax/admin/dashboard_presenter.rb +8 -6
- data/app/presenters/hyrax/admin/repository_growth_presenter.rb +10 -5
- data/app/presenters/hyrax/admin/user_activity_presenter.rb +8 -12
- data/app/presenters/hyrax/admin_set_presenter.rb +2 -2
- data/app/presenters/hyrax/file_set_presenter.rb +2 -0
- data/app/presenters/hyrax/menu_presenter.rb +4 -0
- data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +3 -3
- data/app/presenters/hyrax/work_show_presenter.rb +9 -2
- data/app/presenters/hyrax/work_usage.rb +1 -0
- data/app/search_builders/hyrax/README.md +1 -1
- data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +2 -2
- data/app/search_builders/hyrax/dashboard/managed_search_filters.rb +44 -4
- data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +2 -2
- data/app/search_builders/hyrax/my/collections_search_builder.rb +12 -5
- data/app/services/hyrax/access_control_list.rb +13 -0
- data/app/services/hyrax/admin_set_create_service.rb +94 -48
- data/app/services/hyrax/analytics/google/events.rb +37 -0
- data/app/services/hyrax/analytics/google/events_daily.rb +72 -0
- data/app/services/hyrax/analytics/google/visits.rb +44 -0
- data/app/services/hyrax/analytics/google/visits_daily.rb +49 -0
- data/app/services/hyrax/analytics/google.rb +204 -0
- data/app/services/hyrax/analytics/matomo.rb +193 -0
- data/app/services/hyrax/analytics/results.rb +79 -0
- data/app/services/hyrax/analytics.rb +12 -82
- data/app/services/hyrax/change_content_depositor_service.rb +2 -2
- data/app/services/hyrax/change_depositor_service.rb +70 -0
- data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +134 -0
- data/app/services/hyrax/collections/nested_collection_query_service.rb +32 -15
- data/app/services/hyrax/custom_queries/navigators/child_file_sets_navigator.rb +45 -0
- data/app/services/hyrax/custom_queries/navigators/child_filesets_navigator.rb +7 -2
- data/app/services/hyrax/custom_queries/navigators/parent_work_navigator.rb +54 -0
- data/app/services/hyrax/default_middleware_stack.rb +3 -0
- data/app/services/hyrax/file_set_derivatives_service.rb +21 -2
- data/app/services/hyrax/file_set_type_service.rb +2 -5
- data/app/services/hyrax/listeners/acl_index_listener.rb +3 -1
- data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +3 -1
- data/app/services/hyrax/listeners/batch_notification_listener.rb +3 -1
- data/app/services/hyrax/listeners/file_metadata_listener.rb +38 -0
- data/app/services/hyrax/listeners/file_set_lifecycle_listener.rb +6 -2
- data/app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb +6 -2
- data/app/services/hyrax/listeners/member_cleanup_listener.rb +26 -3
- data/app/services/hyrax/listeners/metadata_index_listener.rb +48 -3
- data/app/services/hyrax/listeners/object_lifecycle_listener.rb +9 -3
- data/app/services/hyrax/listeners/proxy_deposit_listener.rb +16 -8
- data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +3 -0
- data/app/services/hyrax/listeners/workflow_listener.rb +3 -1
- data/app/services/hyrax/listeners.rb +8 -0
- data/app/services/hyrax/location_service.rb +33 -0
- data/app/services/hyrax/multiple_membership_checker.rb +44 -1
- data/app/services/hyrax/resource_visibility_propagator.rb +1 -1
- data/app/services/hyrax/restriction_service.rb +4 -0
- data/app/services/hyrax/simple_schema_loader.rb +5 -1
- data/app/services/hyrax/solr_query_service.rb +12 -7
- data/app/services/hyrax/statistics/users/over_time.rb +8 -5
- data/app/services/hyrax/statistics/works/over_time.rb +10 -0
- data/app/services/hyrax/thumbnail_path_service.rb +1 -1
- data/app/services/hyrax/work_uploads_handler.rb +2 -9
- data/app/utils/hyrax/data_destroyers/collection_branding_destroyer.rb +29 -0
- data/app/utils/hyrax/data_destroyers/collection_types_destroyer.rb +26 -0
- data/app/utils/hyrax/data_destroyers/default_admin_set_id_cache_destroyer.rb +26 -0
- data/app/utils/hyrax/data_destroyers/featured_works_destroyer.rb +27 -0
- data/app/utils/hyrax/data_destroyers/permission_templates_destroyer.rb +30 -0
- data/app/utils/hyrax/data_destroyers/repository_metadata_destroyer.rb +42 -0
- data/app/utils/hyrax/data_destroyers/stats_destroyer.rb +33 -0
- data/app/utils/hyrax/data_maintenance.rb +51 -0
- data/app/utils/hyrax/required_data_seeder.rb +21 -0
- data/app/utils/hyrax/required_data_seeders/collection_seeder.rb +26 -0
- data/app/utils/hyrax/required_data_seeders/collection_type_seeder.rb +36 -0
- data/app/utils/hyrax/test_data_seeder.rb +24 -0
- data/app/utils/hyrax/test_data_seeders/collection_seeder.rb +91 -0
- data/app/utils/hyrax/test_data_seeders/collection_type_seeder.rb +72 -0
- data/app/utils/hyrax/test_data_seeders/user_seeder.rb +52 -0
- data/app/validators/hyrax/collection_membership_validator.rb +38 -0
- data/app/views/catalog/_index_header_list_hyrax_pcdm_collection.html.erb +4 -0
- data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/_form_workflow.erb +1 -1
- data/app/views/hyrax/admin/analytics/_date_range_form.html.erb +11 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_custom_range.html.erb +39 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_monthly_summary.html.erb +48 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_summary.html.erb +55 -0
- data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +55 -0
- data/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +70 -0
- data/app/views/hyrax/admin/analytics/collection_reports/show.html.erb +94 -0
- data/app/views/hyrax/admin/analytics/work_reports/_custom_range.html.erb +43 -0
- data/app/views/hyrax/admin/analytics/work_reports/_monthly_summary.html.erb +35 -0
- data/app/views/hyrax/admin/analytics/work_reports/_summary.html.erb +60 -0
- data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +33 -0
- data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +40 -0
- data/app/views/hyrax/admin/analytics/work_reports/_work_counts.html.erb +18 -0
- data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +41 -0
- data/app/views/hyrax/admin/analytics/work_reports/index.html.erb +77 -0
- data/app/views/hyrax/admin/analytics/work_reports/show.html.erb +90 -0
- data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
- data/app/views/hyrax/admin/stats/show.html.erb +1 -1
- data/app/views/hyrax/base/_form.html.erb +1 -1
- data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
- data/app/views/hyrax/base/_relationships_parent_row.html.erb +0 -1
- data/app/views/hyrax/base/show.html.erb +6 -0
- data/app/views/hyrax/collections/show.html.erb +4 -0
- data/app/views/hyrax/dashboard/_repository_growth.html.erb +5 -5
- data/app/views/hyrax/dashboard/_resource_type_graph.html.erb +41 -0
- data/app/views/hyrax/dashboard/_sidebar.html.erb +4 -1
- data/app/views/hyrax/dashboard/_tabs.html.erb +11 -0
- data/app/views/hyrax/dashboard/_user_activity.html.erb +17 -23
- data/app/views/hyrax/dashboard/_user_activity_graph.html.erb +55 -0
- data/app/views/hyrax/dashboard/_visibility_graph.html.erb +31 -0
- data/app/views/hyrax/dashboard/_work_type_graph.html.erb +41 -0
- data/app/views/hyrax/dashboard/collections/_default_group.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form.html.erb +23 -16
- data/app/views/hyrax/dashboard/collections/_form_discovery.html.erb +6 -3
- data/app/views/hyrax/dashboard/collections/_form_share.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +3 -3
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +2 -2
- data/app/views/hyrax/dashboard/show_admin.html.erb +24 -45
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +22 -0
- data/app/views/hyrax/dashboard/works/_default_group.html.erb +1 -1
- data/app/views/hyrax/dashboard/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/file_sets/_actions.html.erb +4 -3
- data/app/views/hyrax/file_sets/show.html.erb +6 -0
- data/app/views/hyrax/my/_facet_pagination.html.erb +12 -9
- data/app/views/hyrax/my/_work_action_menu.html.erb +8 -9
- data/app/views/hyrax/my/collections/_default_group.html.erb +2 -2
- data/app/views/hyrax/my/collections/_list_collections.html.erb +2 -2
- data/app/views/hyrax/my/collections/index.html.erb +4 -3
- data/app/views/hyrax/my/works/_default_group.html.erb +1 -1
- data/app/views/hyrax/my/works/_list_works.html.erb +1 -2
- data/app/views/hyrax/my/works/index.html.erb +4 -2
- data/app/views/hyrax/stats/_downloads.html.erb +18 -0
- data/app/views/hyrax/stats/_pageviews.html.erb +18 -0
- data/app/views/hyrax/stats/work.html.erb +17 -9
- data/app/views/layouts/_head_tag_content.html.erb +7 -2
- data/app/views/{_ga.html.erb → shared/_ga.html.erb} +3 -7
- data/app/views/shared/_matomo.html.erb +15 -0
- data/chart/hyrax/Chart.yaml +2 -2
- data/chart/hyrax/README.md +22 -1
- data/chart/hyrax/values.yaml +1 -1
- data/config/i18n-tasks.yml +2 -2
- data/config/initializers/listeners.rb +5 -6
- data/config/locales/hyrax.de.yml +200 -5
- data/config/locales/hyrax.en.yml +201 -21
- data/config/locales/hyrax.es.yml +204 -9
- data/config/locales/hyrax.fr.yml +196 -1
- data/config/locales/hyrax.it.yml +197 -2
- data/config/locales/hyrax.pt-BR.yml +196 -1
- data/config/locales/hyrax.zh.yml +196 -1
- data/config/metadata/basic_metadata.yaml +2 -0
- data/config/metadata/core_metadata.yaml +1 -1
- data/config/routes.rb +4 -0
- data/docker-compose.yml +48 -42
- data/documentation/developing-your-hyrax-based-app.md +2 -2
- data/documentation/legacyREADME.md +1 -1
- data/hyrax.gemspec +3 -1
- data/lib/generators/hyrax/templates/config/analytics.yml +13 -7
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +0 -13
- data/lib/generators/hyrax/templates/db/migrate/20211130181150_create_default_administrative_set.rb.erb +8 -0
- data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +3 -1
- data/lib/hyrax/administrative_set_name.rb +18 -0
- data/lib/hyrax/collection_name.rb +2 -0
- data/lib/hyrax/configuration.rb +77 -5
- data/lib/hyrax/controlled_vocabularies/location.rb +9 -2
- data/lib/hyrax/controlled_vocabularies/resource_label_caching.rb +42 -0
- data/lib/hyrax/controlled_vocabularies.rb +1 -0
- data/lib/hyrax/engine.rb +7 -6
- data/lib/hyrax/publisher.rb +49 -0
- data/lib/hyrax/schema.rb +16 -13
- data/lib/hyrax/specs/capybara.rb +1 -1
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +11 -4
- data/lib/hyrax/specs/shared_specs/indexers.rb +117 -3
- data/lib/hyrax/transactions/admin_set_create.rb +23 -0
- data/lib/hyrax/transactions/admin_set_destroy.rb +22 -0
- data/lib/hyrax/transactions/admin_set_update.rb +21 -0
- data/lib/hyrax/transactions/collection_destroy.rb +22 -0
- data/lib/hyrax/transactions/collection_update.rb +3 -2
- data/lib/hyrax/transactions/container.rb +97 -22
- data/lib/hyrax/transactions/create_work.rb +3 -0
- data/lib/hyrax/transactions/destroy_work.rb +3 -0
- data/lib/hyrax/transactions/steps/apply_collection_permission_template.rb +2 -0
- data/lib/hyrax/transactions/steps/apply_permission_template.rb +2 -0
- data/lib/hyrax/transactions/steps/apply_visibility.rb +2 -0
- data/lib/hyrax/transactions/steps/change_depositor.rb +46 -0
- data/lib/hyrax/transactions/steps/check_for_empty_admin_set.rb +36 -0
- data/lib/hyrax/transactions/steps/delete_access_control.rb +32 -0
- data/lib/hyrax/transactions/steps/delete_resource.rb +19 -3
- data/lib/hyrax/transactions/steps/destroy_work.rb +3 -1
- data/lib/hyrax/transactions/steps/ensure_permission_template.rb +2 -0
- data/lib/hyrax/transactions/steps/save.rb +24 -6
- data/lib/hyrax/transactions/steps/save_access_control.rb +2 -2
- data/lib/hyrax/transactions/steps/save_work.rb +3 -0
- data/lib/hyrax/transactions/steps/set_user_as_creator.rb +41 -0
- data/lib/hyrax/transactions/steps/update_work_members.rb +51 -0
- data/lib/hyrax/transactions/update_work.rb +4 -3
- data/lib/hyrax/transactions/work_create.rb +1 -1
- data/lib/hyrax/transactions/work_destroy.rb +2 -1
- data/lib/hyrax/transactions/work_update.rb +19 -0
- data/lib/hyrax/version.rb +1 -1
- data/lib/tasks/regenerate_derivatives.rake +1 -1
- data/lib/wings/attribute_transformer.rb +5 -1
- data/lib/wings/setup.rb +18 -1
- data/lib/wings/valkyrie/persister.rb +18 -0
- data/lib/wings/valkyrie/query_service.rb +2 -1
- data/lib/wings/valkyrie/storage.rb +7 -1
- data/template.rb +1 -1
- data/vendor/assets/javascripts/morris/morris.min.js +1 -7
- data/vendor/assets/stylesheets/morris.js/0.5.1/morris.css +1 -1
- metadata +124 -11
- data/app/views/hyrax/dashboard/_repository_objects.html.erb +0 -28
@@ -76,6 +76,8 @@ module Hyrax
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def perform_ingest_file_through_valkyrie(io) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
79
|
+
Deprecation.warn "FileActor support for Valkyrie was experimental and " \
|
80
|
+
"is slated to be removed in favor of WorkUploadsHandler."
|
79
81
|
file =
|
80
82
|
begin
|
81
83
|
Hyrax.storage_adapter.upload(resource: file_set, file: io, original_filename: io.original_name, use: relation)
|
@@ -85,12 +87,12 @@ module Hyrax
|
|
85
87
|
end
|
86
88
|
file_metadata = Hyrax.custom_queries.find_file_metadata_by(id: file.id)
|
87
89
|
create_version(file_metadata, user)
|
88
|
-
|
89
|
-
file_set.file_ids << id
|
90
|
-
file_set.original_file_id = id
|
90
|
+
|
91
|
+
file_set.file_ids << file_metadata.id
|
92
|
+
file_set.original_file_id = file_metadata.id
|
91
93
|
Hyrax.persister.save(resource: file_set)
|
92
94
|
Hyrax.publisher.publish('object.metadata.updated', object: file_set, user: user)
|
93
|
-
CharacterizeJob.perform_later(file_set, id.to_s, pathhint(io))
|
95
|
+
CharacterizeJob.perform_later(file_set, file_metadata.id.to_s, pathhint(io))
|
94
96
|
file_metadata
|
95
97
|
end
|
96
98
|
|
@@ -1,17 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
3
|
module Actors
|
4
|
-
##
|
5
|
-
# @deprecated transfer requests are now carried out in response to published
|
6
|
-
# 'object.deposited' events.
|
7
|
-
#
|
8
4
|
# Notify the provided owner that their proxy wants to make a
|
9
5
|
# deposit on their behalf
|
10
6
|
class TransferRequestActor < AbstractActor
|
11
7
|
# @param [Hyrax::Actors::Environment] env
|
12
8
|
# @return [Boolean] true if create was successful
|
13
9
|
def create(env)
|
14
|
-
Deprecation.warn('Use Hyrax::Listeners::ProxyDepositListener instead.')
|
15
10
|
next_actor.create(env) && create_proxy_deposit_request(env)
|
16
11
|
end
|
17
12
|
|
@@ -20,8 +15,9 @@ module Hyrax
|
|
20
15
|
def create_proxy_deposit_request(env)
|
21
16
|
proxy = env.curation_concern.on_behalf_of
|
22
17
|
return true if proxy.blank?
|
23
|
-
|
24
|
-
|
18
|
+
work = env.curation_concern
|
19
|
+
user = ::User.find_by_user_key(proxy)
|
20
|
+
Hyrax::ChangeDepositorService.call(work, user, false)
|
25
21
|
true
|
26
22
|
end
|
27
23
|
end
|
@@ -1,46 +1,44 @@
|
|
1
1
|
export default class {
|
2
|
-
|
3
2
|
constructor(data) {
|
4
3
|
this.userSelector = 'user-activity'
|
5
4
|
this.growthSelector = 'dashboard-growth'
|
6
5
|
this.statusSelector = 'dashboard-repository-objects'
|
7
|
-
|
8
6
|
if (this.hasSelector(this.userSelector))
|
9
7
|
this.userActivity(data.userActivity);
|
10
8
|
if (this.hasSelector(this.growthSelector))
|
11
9
|
this.repositoryGrowth(data.repositoryGrowth);
|
12
10
|
if (this.hasSelector(this.statusSelector))
|
13
11
|
this.objectStatus(data.repositoryObjects);
|
14
|
-
|
15
12
|
}
|
16
|
-
|
17
13
|
// Don't attempt to initialize Morris if the selector is not on the page
|
18
14
|
// otherwise it raises a "Graph container element not found" error
|
19
15
|
hasSelector(selector) {
|
20
|
-
|
16
|
+
return $(`#${selector}`).length > 0;
|
21
17
|
}
|
22
|
-
|
23
18
|
// Draws a bar chart of new user signups
|
24
19
|
userActivity(data) {
|
25
|
-
if (typeof data ===
|
26
|
-
return
|
20
|
+
if (typeof data === 'undefined') return
|
27
21
|
Morris.Bar({
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
22
|
+
element: this.userSelector,
|
23
|
+
data: data,
|
24
|
+
xkey: 'y',
|
25
|
+
ykeys: ['new_users', 'new_visitors', 'returning_visitors', 'total_visitors'],
|
26
|
+
labels: ['New Users', 'New Visitors', 'Returning Visitors', 'Total Visitors'],
|
27
|
+
// TODO: use the ykeys and labels below when the returning_users method in
|
28
|
+
// user_activity_presenter.rb returns data
|
29
|
+
// ykeys: ['new_users', 'returning_users', 'new_visitors', 'returning_visitors', 'total_visitors'],
|
30
|
+
// labels: ['New Users', 'Returning Users', 'New Visitors', 'Returning Visitors', 'Total Visitors'],
|
31
|
+
barColors: [
|
32
|
+
'#001219','#005f73','#0a9396','#94d2bd','#e9d8a6',
|
33
|
+
'#ee9b00','#ca6702','#bb3e03','#ae2012','#9b2226'
|
34
|
+
],
|
35
|
+
gridTextSize: '12px',
|
36
|
+
hideHover: true,
|
37
|
+
resize: true,
|
38
|
+
gridLineColor: '#E5E5E5',
|
39
|
+
stacked: true
|
40
|
+
});
|
42
41
|
}
|
43
|
-
|
44
42
|
// Draws a donut chart of active/inactive objects
|
45
43
|
objectStatus(data) {
|
46
44
|
if (typeof data === "undefined")
|
@@ -48,28 +46,27 @@ export default class {
|
|
48
46
|
Morris.Donut({
|
49
47
|
element: this.statusSelector,
|
50
48
|
data: data,
|
51
|
-
colors: ['#
|
52
|
-
gridTextSize: '
|
49
|
+
colors: ['#001219','#005f73','#0a9396','#94d2bd','#e9d8a6','#ee9b00','#ca6702','#bb3e03','#ae2012','#9b2226'],
|
50
|
+
gridTextSize: '12px',
|
53
51
|
resize: true
|
54
52
|
});
|
55
53
|
}
|
56
|
-
|
57
54
|
// Creates a line graph of collections and object in the last 90 days
|
58
55
|
repositoryGrowth(data) {
|
59
56
|
if (typeof data === "undefined")
|
60
57
|
return
|
61
58
|
Morris.Line({
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
59
|
+
element: this.growthSelector,
|
60
|
+
data: data,
|
61
|
+
xkey: 'y',
|
62
|
+
ykeys: ['works','collections'],
|
63
|
+
labels: ['Works','Collections'],
|
64
|
+
resize: true,
|
65
|
+
hideHover: true,
|
66
|
+
xLabels: 'day',
|
67
|
+
gridTextSize: '12px',
|
68
|
+
lineColors: ['#001219','#005f73','#0a9396','#94d2bd','#e9d8a6','#ee9b00','#ca6702','#bb3e03','#ae2012','#9b2226'],
|
69
|
+
gridLineColor: '#E5E5E5'
|
73
70
|
});
|
74
71
|
}
|
75
72
|
}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
class TrackingTags {
|
2
|
+
constructor(provider) {
|
3
|
+
this.provider = provider
|
4
|
+
}
|
5
|
+
|
6
|
+
analytics() {
|
7
|
+
if(this.provider === "matomo") {
|
8
|
+
return _paq;
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
return _gaq;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
pageView() {
|
16
|
+
if(this.provider === "matomo") {
|
17
|
+
return 'trackPageView'
|
18
|
+
} else {
|
19
|
+
return '_trackPageview'
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
trackEvent() {
|
24
|
+
if(this.provider === "matomo") {
|
25
|
+
return 'trackEvent'
|
26
|
+
} else {
|
27
|
+
return '_trackEvent'
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
function trackPageView() {
|
33
|
+
window.trackingTags.analytics().push([window.trackingTags.pageView()]);
|
34
|
+
}
|
35
|
+
|
36
|
+
function trackAnalyticsEvents() {
|
37
|
+
$('span.analytics-event').each(function(){
|
38
|
+
var eventSpan = $(this)
|
39
|
+
window.trackingTags.analytics().push([window.trackingTags.trackEvent(), eventSpan.data('category'), eventSpan.data('action'), eventSpan.data('name')]);
|
40
|
+
})
|
41
|
+
}
|
42
|
+
|
43
|
+
function setupTracking() {
|
44
|
+
var provider = $('meta[name="analytics-provider"]').prop('content')
|
45
|
+
if (provider === undefined) {
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
window.trackingTags = new TrackingTags(provider)
|
49
|
+
trackPageView()
|
50
|
+
trackAnalyticsEvents()
|
51
|
+
}
|
52
|
+
|
53
|
+
if (typeof Turbolinks !== 'undefined') {
|
54
|
+
$(document).on('turbolinks:load', function() {
|
55
|
+
setupTracking()
|
56
|
+
})
|
57
|
+
} else {
|
58
|
+
$(document).on('ready', function() {
|
59
|
+
setupTracking()
|
60
|
+
})
|
61
|
+
}
|
62
|
+
|
63
|
+
$(document).on('click', '#file_download', function(e) {
|
64
|
+
var provider = $('meta[name="analytics-provider"]').prop('content')
|
65
|
+
if (provider === undefined) {
|
66
|
+
return;
|
67
|
+
}
|
68
|
+
window.trackingTags = new TrackingTags(provider)
|
69
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set', 'file-set-download', $(this).data('label')]);
|
70
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set-in-work', 'file-set-in-work-download', $(this).data('work-id')]);
|
71
|
+
$(this).data('collection-ids').forEach(function (collection) {
|
72
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'file-set-in-collection', 'file-set-in-collection-download', collection]);
|
73
|
+
window.trackingTags.analytics().push([trackingTags.trackEvent(), 'work-in-collection', 'work-in-collection-download', collection]);
|
74
|
+
});
|
75
|
+
});
|
@@ -40,11 +40,9 @@ export default class LinkedData {
|
|
40
40
|
// Called when Select2 is created to allow the user to initialize the
|
41
41
|
// selection based on the value of the element select2 is attached to.
|
42
42
|
// Essentially this is an id->object mapping function.
|
43
|
-
|
44
|
-
// TODO: Presently we're just showing a URI, but we should show the label.
|
45
43
|
var data = {
|
46
44
|
id: element.val(),
|
47
|
-
label: element.val()
|
45
|
+
label: element[0].dataset.label || element.val()
|
48
46
|
};
|
49
47
|
callback(data);
|
50
48
|
},
|
@@ -62,6 +62,21 @@ function getStatusSettings(){
|
|
62
62
|
}
|
63
63
|
}
|
64
64
|
|
65
|
+
function getStatusAnalytics(){
|
66
|
+
const resultDiv = document.getElementById('collapseAnalytics');
|
67
|
+
const isCollapsed = getCollapsedSettings();
|
68
|
+
if (resultDiv === null) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
else if(isCollapsed){
|
72
|
+
resultDiv.classList.remove("in");
|
73
|
+
resultDiv.setAttribute("aria-expanded", "false");
|
74
|
+
}else{
|
75
|
+
resultDiv.classList.add("in");
|
76
|
+
resultDiv.setAttribute("aria-expanded", "true");
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
65
80
|
function toggleCollapse(input){
|
66
81
|
var type = input.href;
|
67
82
|
var start = type.indexOf("#");
|
@@ -76,6 +91,15 @@ function toggleCollapse(input){
|
|
76
91
|
}
|
77
92
|
}
|
78
93
|
|
94
|
+
if (type === "collapseReports"){
|
95
|
+
const isCollapsedReports = getCollapsedReports();
|
96
|
+
if(isCollapsedReports){
|
97
|
+
localStorage.setItem('collapsedReports', 'un-collapsed');
|
98
|
+
}else{
|
99
|
+
localStorage.setItem('collapsedReports', 'collapsed');
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
79
103
|
if (type === "collapseSettings"){
|
80
104
|
const isCollapsedSettings = getCollapsedSettings();
|
81
105
|
if(isCollapsedSettings){
|
@@ -319,10 +319,9 @@ Blacklight.onLoad(function () {
|
|
319
319
|
submitModalAjax(url, 'POST', data, $(this));
|
320
320
|
});
|
321
321
|
|
322
|
-
|
323
322
|
// Handle add a subcollection button click on the collections show page
|
324
323
|
$('.sub-collections-wrapper button.add-subcollection').on('click', function (e) {
|
325
324
|
$('#add-subcollection-modal-' + $(this).data('presenterId')).modal('show');
|
326
325
|
});
|
327
326
|
|
328
|
-
});
|
327
|
+
});
|
@@ -1,10 +1,4 @@
|
|
1
1
|
// Callbacks for tracking events using Google Analytics
|
2
|
-
|
3
|
-
// Note: there is absence of testing here. I'm not sure how or to what extent we can test what's getting
|
4
|
-
// sent to Google Analytics.
|
5
|
-
|
6
2
|
$(document).on('click', '#file_download', function(e) {
|
7
|
-
_gaq.push(['_trackEvent', 'Files', 'Downloaded', $(this).data('label')]);
|
8
|
-
|
9
|
-
});
|
10
|
-
|
3
|
+
_gaq.push(['_trackEvent', 'Files', 'Downloaded', $(this).data('label')]);
|
4
|
+
});
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Blacklight.onLoad(function() {
|
2
|
+
var summaryButton = $('#summary-btn');
|
3
|
+
var monthlyButton = $('#monthly-btn');
|
4
|
+
var rangeButton = $('#range-btn');
|
5
|
+
|
6
|
+
$('#monthly-btn').on('click', function() {
|
7
|
+
$(this).addClass('btn-primary');
|
8
|
+
$(this).removeClass('btn-default');
|
9
|
+
summaryButton.removeClass('btn-primary');
|
10
|
+
summaryButton.addClass('btn-default');
|
11
|
+
rangeButton.removeClass('btn-primary');
|
12
|
+
rangeButton.addClass('btn-default');
|
13
|
+
});
|
14
|
+
|
15
|
+
$('#summary-btn').on('click', function() {
|
16
|
+
|
17
|
+
$(this).addClass('btn-primary');
|
18
|
+
$(this).removeClass('btn-default');
|
19
|
+
monthlyButton.removeClass('btn-primary');
|
20
|
+
monthlyButton.addClass('btn-default');
|
21
|
+
rangeButton.removeClass('btn-primary');
|
22
|
+
rangeButton.addClass('btn-default');
|
23
|
+
});
|
24
|
+
|
25
|
+
$('#range-btn').on('click', function() {
|
26
|
+
$(this).addClass('btn-primary');
|
27
|
+
$(this).removeClass('btn-default');
|
28
|
+
monthlyButton.removeClass('btn-primary');
|
29
|
+
monthlyButton.addClass('btn-default');
|
30
|
+
summaryButton.removeClass('btn-primary');
|
31
|
+
summaryButton.addClass('btn-default');
|
32
|
+
});
|
33
|
+
});
|
@@ -56,7 +56,7 @@
|
|
56
56
|
//= require hyrax/search
|
57
57
|
//= require hyrax/content_blocks
|
58
58
|
//= require hyrax/nav_safety
|
59
|
-
//= require hyrax/
|
59
|
+
//= require hyrax/analytics_events
|
60
60
|
//= require hyrax/select_submit
|
61
61
|
//= require hyrax/tabs
|
62
62
|
//= require hyrax/user_search
|
@@ -107,6 +107,7 @@
|
|
107
107
|
//= require hyrax/i18n_helper
|
108
108
|
//= require hyrax/collapse
|
109
109
|
//= require hyrax/skip_to_content
|
110
|
+
//= require hyrax/reports-buttons
|
110
111
|
|
111
112
|
// this needs to be after batch_select so that the form ids get setup correctly
|
112
113
|
//= require hyrax/batch_edit
|
@@ -18,3 +18,12 @@ $brand-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
|
+
|
22
|
+
// Date picker on safari placeholder text was misaligned
|
23
|
+
@media screen {
|
24
|
+
@media screen and (-webkit-min-device-pixel-ratio: 0) {
|
25
|
+
input[type="date"].form-control {
|
26
|
+
line-height: 16px;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
@@ -7,12 +7,11 @@ module Qa::Authorities
|
|
7
7
|
def search(_q, controller)
|
8
8
|
# The Hyrax::CollectionSearchBuilder expects a current_user
|
9
9
|
return [] unless controller.current_user
|
10
|
-
response,
|
10
|
+
response, = search_response(controller)
|
11
11
|
docs = response.documents
|
12
|
+
|
12
13
|
docs.map do |doc|
|
13
|
-
id
|
14
|
-
title = doc.title
|
15
|
-
{ id: id, label: title, value: id }
|
14
|
+
{ id: doc.id, label: doc.title, value: doc.id }
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
@@ -32,7 +31,7 @@ module Qa::Authorities
|
|
32
31
|
access = controller.params[:access] || 'read'
|
33
32
|
|
34
33
|
search_service(controller).search_results do |builder|
|
35
|
-
builder.
|
34
|
+
builder.with({ q: controller.params[:q] })
|
36
35
|
.with_access(access)
|
37
36
|
.rows(100)
|
38
37
|
end
|
@@ -33,7 +33,7 @@ module Qa::Authorities
|
|
33
33
|
access = controller.params[:access] || 'read'
|
34
34
|
|
35
35
|
search_service(controller).search_results do |builder|
|
36
|
-
builder.
|
36
|
+
builder.with({ q: controller.params[:q] })
|
37
37
|
.with_access(access)
|
38
38
|
.rows(100)
|
39
39
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
module BreadcrumbsForCollectionAnalytics
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
include Hyrax::Breadcrumbs
|
6
|
+
|
7
|
+
included do
|
8
|
+
before_action :build_breadcrumbs, only: [:index, :show]
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_breadcrumb_for_controller
|
12
|
+
add_breadcrumb I18n.t('hyrax.dashboard.breadcrumbs.collections_report'), hyrax.admin_analytics_collection_reports_path
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_breadcrumb_for_action
|
16
|
+
case action_name
|
17
|
+
when 'show'
|
18
|
+
add_breadcrumb params[:id].to_s, hyrax.admin_analytics_collection_reports_path(params[:id]), mark_active_action
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def mark_active_action
|
23
|
+
{ "aria-current" => "page" }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
module BreadcrumbsForWorksAnalytics
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
include Hyrax::Breadcrumbs
|
6
|
+
|
7
|
+
included do
|
8
|
+
before_action :build_breadcrumbs, only: [:index, :show]
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_breadcrumb_for_controller
|
12
|
+
add_breadcrumb I18n.t('hyrax.dashboard.breadcrumbs.works_report'), hyrax.admin_analytics_work_reports_path
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_breadcrumb_for_action
|
16
|
+
case action_name
|
17
|
+
when 'show'
|
18
|
+
add_breadcrumb params[:id].to_s, hyrax.admin_analytics_work_reports_path(params[:id]), mark_active_action
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def mark_active_action
|
23
|
+
{ "aria-current" => "page" }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -17,6 +17,9 @@ module Hyrax::Controller
|
|
17
17
|
helper_method :create_work_presenter
|
18
18
|
before_action :set_locale
|
19
19
|
before_action :check_read_only, except: [:show, :index]
|
20
|
+
|
21
|
+
class_attribute :search_service_class
|
22
|
+
self.search_service_class = Hyrax::SearchService
|
20
23
|
end
|
21
24
|
|
22
25
|
# Provide a place for Devise to send the user to after signing in
|
@@ -29,6 +32,46 @@ module Hyrax::Controller
|
|
29
32
|
super.merge(locale: I18n.locale)
|
30
33
|
end
|
31
34
|
|
35
|
+
##
|
36
|
+
# @deprecated provides short-term compatibility with Blacklight 6
|
37
|
+
# @return [Class<Blacklight::SearchBuilder>]
|
38
|
+
def search_builder_class
|
39
|
+
return super if defined?(super)
|
40
|
+
Deprecation.warn("Avoid direct calls to `#search_builder_class`; this" \
|
41
|
+
" method provides short-term compatibility to" \
|
42
|
+
" Blacklight 6 clients.")
|
43
|
+
blacklight_config.search_builder_class
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# @deprecated provides short-term compatibility with Blacklight 6
|
48
|
+
# @return [Blacklight::AbstractRepository]
|
49
|
+
def repository
|
50
|
+
return super if defined?(super)
|
51
|
+
Deprecation.warn("Avoid direct calls to `#repository`; this method" \
|
52
|
+
" provides short-term compatibility to Blacklight 6 " \
|
53
|
+
" clients.")
|
54
|
+
blacklight_config.repository
|
55
|
+
end
|
56
|
+
|
57
|
+
# @note for Blacklight 6/7 compatibility
|
58
|
+
def search_results(*args)
|
59
|
+
return super if defined?(super) # use the upstream if present (e.g. in BL 6)
|
60
|
+
|
61
|
+
search_service(*args).search_results
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# @note for Blacklight 6/7 compatibility
|
66
|
+
def search_service(**search_params)
|
67
|
+
return super if defined?(super) && search_params.empty?
|
68
|
+
|
69
|
+
search_service_class.new(config: blacklight_config,
|
70
|
+
scope: self,
|
71
|
+
user_params: search_params,
|
72
|
+
search_builder_class: search_builder_class)
|
73
|
+
end
|
74
|
+
|
32
75
|
private
|
33
76
|
|
34
77
|
##
|