hyrax 5.0.0 → 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/autocomplete/linked_data.es6 +3 -0
- data/app/assets/javascripts/hyrax/collapse.js +4 -4
- data/app/assets/javascripts/hyrax/editor/controlled_vocabulary.es6 +38 -5
- 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/_file_upload.scss +6 -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/assets/stylesheets/hyrax/controlled_vocabulary.scss +2 -2
- 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 +33 -7
- data/app/controllers/hyrax/my/works_controller.rb +20 -0
- data/app/controllers/hyrax/single_use_links_viewer_controller.rb +9 -2
- 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/collection.rb +13 -1
- 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 +3 -4
- 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/pcdm_member_presenter_factory.rb +2 -2
- data/app/presenters/hyrax/stats_usage_presenter.rb +2 -1
- data/app/presenters/hyrax/work_show_presenter.rb +15 -19
- 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/file_set_file_service.rb +10 -1
- data/app/services/hyrax/listeners/file_listener.rb +39 -0
- data/app/services/hyrax/listeners/file_metadata_listener.rb +0 -30
- data/app/services/hyrax/lock_manager.rb +7 -7
- 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 +14 -9
- 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/_js_templates.html.erb +9 -9
- data/app/views/hyrax/uploads/_js_templates_branding.html.erb +3 -3
- data/app/views/hyrax/uploads/_js_templates_versioning.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/Chart.yaml +1 -1
- data/chart/hyrax/templates/deployment-worker.yaml +2 -2
- data/chart/hyrax/templates/deployment.yaml +12 -0
- data/chart/hyrax/values.yaml +10 -0
- 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 +4 -4
- data/hyrax.gemspec +7 -12
- 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/publisher.rb +11 -0
- data/lib/hyrax/rubocop/custom_cops.rb +30 -0
- data/lib/hyrax/specs/capybara.rb +10 -6
- data/{spec → lib/hyrax/specs/shared_specs}/factories/admin_sets.rb +2 -0
- data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_embargo.rb +4 -0
- data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_lease.rb +4 -0
- data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_work.rb +26 -1
- 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_all_file_metadata.rb +4 -5
- 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 +118 -94
- data/.koppie/scripts/db-migrate-seed.sh +0 -9
- data/.koppie/scripts/entrypoint.sh +0 -10
- data/spec/support/book_resource.rb +0 -36
- data/spec/support/can_can_overrides.rb +0 -43
- data/spec/support/clean_solr.rb +0 -7
- data/spec/support/controller_level_helpers.rb +0 -27
- data/spec/support/factory_helpers.rb +0 -94
- data/spec/support/fakes/fake_actor.rb +0 -22
- data/spec/support/fakes/fake_authority.rb +0 -14
- data/spec/support/fakes/fake_search_builder_scope.rb +0 -44
- data/spec/support/fakes/indexing_adapter.rb +0 -17
- data/spec/support/fakes/test_hydra_group_service.rb +0 -55
- data/spec/support/features/batch_edit_actions.rb +0 -37
- data/spec/support/features/session_helpers.rb +0 -15
- data/spec/support/features/workflow.rb +0 -10
- data/spec/support/features.rb +0 -11
- data/spec/support/form_with_validations.rb +0 -15
- data/spec/support/input_support.rb +0 -12
- data/spec/support/logging_formatter.rb +0 -67
- data/spec/support/matchers/api_responses.rb +0 -27
- data/spec/support/matchers/collection_type_property_matchers.rb +0 -30
- data/spec/support/matchers/embargo.rb +0 -9
- data/spec/support/matchers/lease.rb +0 -9
- data/spec/support/matchers/match_valkyrie_ids_with_af_ids.rb +0 -12
- data/spec/support/matchers/pcdm_matchers.rb +0 -34
- data/spec/support/matchers/permission.rb +0 -31
- data/spec/support/matchers/response_matchers.rb +0 -8
- data/spec/support/optional_example.rb +0 -17
- data/spec/support/rake.rb +0 -42
- data/spec/support/selectors.rb +0 -112
- data/spec/support/shared_examples_for_collection_presenter.rb +0 -44
- data/spec/support/simple_work.rb +0 -28
- data/spec/support/spec_statistic.rb +0 -24
- data/spec/support/speedup.rb +0 -7
- data/spec/support/statistic_helper.rb +0 -10
- data/spec/support/valkyrie_indexing.rb +0 -2
- data/spec/support/wings_models.rb +0 -9
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/access_control.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/admin_sets_lw.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/administrative_sets.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/api_items.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/collection_branding_infos.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/collection_type_participants.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/collection_types.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/collections.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/collections_factory.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/content_blocks.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/counter_metrics.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/featured_works.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/file_sets.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/generic_works.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_collection.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_default_admin_set.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_file_metadata.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_file_set.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_resource.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/object_id.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/operations.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/permission.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/permission_template_accesses.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/permission_templates.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/proxy_deposit_requests.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/single_use_links.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/sipity_entities.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/uploaded_files.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/users.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/workflow_actions.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/workflow_states.rb +0 -0
- /data/{spec → lib/hyrax/specs/shared_specs}/factories/workflows.rb +0 -0
@@ -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
|
});
|
@@ -18,6 +18,9 @@ export default class LinkedData {
|
|
18
18
|
let result = this.element.select2("data")
|
19
19
|
this.element.select2("destroy")
|
20
20
|
this.element.val(result.label).attr("readonly", "readonly")
|
21
|
+
// Adding d-block class to the remove button to show it after a selection is made.
|
22
|
+
let removeButton = this.element.closest('.field-wrapper').find('.input-group-btn.field-controls .remove')
|
23
|
+
removeButton.addClass('d-block')
|
21
24
|
this.setIdentifier(result.id)
|
22
25
|
}
|
23
26
|
|
@@ -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
|
|
@@ -31,6 +31,8 @@ export default class ControlledVocabulary extends FieldManager {
|
|
31
31
|
this.paramKey = paramKey
|
32
32
|
this.fieldName = this.element.data('fieldName')
|
33
33
|
this.searchUrl = this.element.data('autocompleteUrl')
|
34
|
+
// Used to prevent index collisions for existing words when removing and adding back in values.
|
35
|
+
this.postRemovalAdjustment = 0
|
34
36
|
}
|
35
37
|
|
36
38
|
// Overrides FieldManager, because field manager uses the wrong selector
|
@@ -49,6 +51,15 @@ export default class ControlledVocabulary extends FieldManager {
|
|
49
51
|
// this._manageFocus()
|
50
52
|
// }
|
51
53
|
|
54
|
+
// Overrides FieldManager in order to display Remove button for values that exist at initial load time
|
55
|
+
_createRemoveControl() {
|
56
|
+
if (this.element.find('input.multi-text-field').val()) {
|
57
|
+
this.remover.addClass('d-block')
|
58
|
+
this.remover.addClass('has-existing-value')
|
59
|
+
}
|
60
|
+
$(this.fieldWrapperClass + ' .field-controls', this.element).append(this.remover)
|
61
|
+
}
|
62
|
+
|
52
63
|
// Overrides FieldManager in order to avoid doing a clone of the existing field
|
53
64
|
createNewField($activeField) {
|
54
65
|
let $newField = this._newFieldTemplate()
|
@@ -68,20 +79,24 @@ export default class ControlledVocabulary extends FieldManager {
|
|
68
79
|
}
|
69
80
|
|
70
81
|
_newFieldTemplate() {
|
71
|
-
let index = this._maxIndex()
|
82
|
+
let index = this._maxIndex() + this.postRemovalAdjustment
|
72
83
|
let rowTemplate = this._template()
|
73
84
|
let controls = this.controls.clone()//.append(this.remover)
|
74
85
|
let row = $(rowTemplate({ "paramKey": this.paramKey,
|
75
86
|
"name": this.fieldName,
|
76
87
|
"index": index,
|
77
|
-
"class": "controlled_vocabulary"
|
88
|
+
"class": "controlled_vocabulary",
|
89
|
+
"placeholder": "Search for a location..." }))
|
78
90
|
.append(controls)
|
91
|
+
let removeButton = row.find('.remove');
|
92
|
+
removeButton.removeClass('d-block')
|
93
|
+
removeButton.removeClass('has-existing-value')
|
79
94
|
return row
|
80
95
|
}
|
81
96
|
|
82
97
|
get _source() {
|
83
98
|
return "<li class=\"field-wrapper input-group input-append\">" +
|
84
|
-
"<input class=\"string {{class}} optional form-control {{paramKey}}_{{name}} form-control multi-text-field\" name=\"{{paramKey}}[{{name}}_attributes][{{index}}][hidden_label]\" value=\"\" id=\"{{paramKey}}_{{name}}_attributes_{{index}}_hidden_label\" data-attribute=\"{{name}}\" type=\"text\">" +
|
99
|
+
"<input class=\"string {{class}} optional form-control {{paramKey}}_{{name}} form-control multi-text-field\" name=\"{{paramKey}}[{{name}}_attributes][{{index}}][hidden_label]\" value=\"\" id=\"{{paramKey}}_{{name}}_attributes_{{index}}_hidden_label\" data-attribute=\"{{name}}\" type=\"text\" placeholder=\"{{placeholder}}\">" +
|
85
100
|
"<input name=\"{{paramKey}}[{{name}}_attributes][{{index}}][id]\" value=\"\" id=\"{{paramKey}}_{{name}}_attributes_{{index}}_id\" type=\"hidden\" data-id=\"remote\">" +
|
86
101
|
"<input name=\"{{paramKey}}[{{name}}_attributes][{{index}}][_destroy]\" id=\"{{paramKey}}_{{name}}_attributes_{{index}}__destroy\" value=\"\" data-destroy=\"true\" type=\"hidden\"></li>"
|
87
102
|
}
|
@@ -114,9 +129,27 @@ export default class ControlledVocabulary extends FieldManager {
|
|
114
129
|
// '_destroy' hidden parameter
|
115
130
|
removeFromList( event ) {
|
116
131
|
event.preventDefault()
|
132
|
+
// Changing behavior of the remove button to add a new field if the last field is removed
|
133
|
+
// Using querySelector to find elements with data-attribute="based_near"
|
134
|
+
const inputElements = this.element.find('input' + this.inputTypeClass)
|
135
|
+
const parentsArray = Array.from(inputElements).map(element => element.parentElement)
|
136
|
+
const nonHiddenElements = parentsArray.filter(element => element.style.display !== 'none')
|
137
|
+
const nonHiddenCount = nonHiddenElements.length
|
138
|
+
if (nonHiddenCount < 2){
|
139
|
+
let $listing = $(event.target).closest(this.inputTypeClass).find(this.listClass)
|
140
|
+
let $activeField = $listing.children('li').last()
|
141
|
+
$listing.append(this.createNewField($activeField))
|
142
|
+
this.postRemovalAdjustment += 1
|
143
|
+
}
|
117
144
|
let field = $(event.target).parents(this.fieldWrapperClass)
|
118
|
-
field
|
119
|
-
|
145
|
+
// Removes field if a value hasn't been selected, otherwise marks it for destruction.
|
146
|
+
// Prevents bug caused by marking empty fields for destruction.
|
147
|
+
if (field.find('.has-existing-value').length > 0) {
|
148
|
+
field.find('[data-destroy]').val('true')
|
149
|
+
field.hide()
|
150
|
+
} else {
|
151
|
+
field.remove()
|
152
|
+
}
|
120
153
|
this.element.trigger("managed_field:remove", field)
|
121
154
|
}
|
122
155
|
}
|
@@ -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)
|