hyrax 3.0.0.pre.rc2 → 3.0.0.pre.rc3
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 +5 -5
- data/.dassie/.env +4 -0
- data/.dassie/.gitignore +27 -0
- data/.dassie/Gemfile +57 -0
- data/.dassie/README.md +3 -0
- data/.dassie/Rakefile +6 -0
- data/.dassie/app/actors/hyrax/actors/generic_work_actor.rb +8 -0
- data/.dassie/app/actors/hyrax/actors/namespaced_works/nested_work_actor.rb +8 -0
- data/.dassie/app/assets/config/manifest.js +3 -0
- data/.dassie/app/assets/images/.keep +0 -0
- data/.dassie/app/assets/images/unauthorized.png +0 -0
- data/.dassie/app/assets/images/us_404.svg +91 -0
- data/.dassie/app/assets/javascripts/application.js +26 -0
- data/.dassie/app/assets/javascripts/blacklight_gallery.js +1 -0
- data/.dassie/app/assets/javascripts/cable.js +13 -0
- data/.dassie/app/assets/javascripts/channels/.keep +0 -0
- data/.dassie/app/assets/javascripts/openseadragon.js +2 -0
- data/.dassie/app/assets/stylesheets/application.css +16 -0
- data/.dassie/app/assets/stylesheets/hyrax.scss +17 -0
- data/.dassie/app/assets/stylesheets/openseadragon.css +3 -0
- data/.dassie/app/channels/application_cable/channel.rb +4 -0
- data/.dassie/app/channels/application_cable/connection.rb +4 -0
- data/.dassie/app/controllers/application_controller.rb +14 -0
- data/.dassie/app/controllers/catalog_controller.rb +300 -0
- data/.dassie/app/controllers/concerns/.keep +0 -0
- data/.dassie/app/controllers/hyrax/generic_works_controller.rb +14 -0
- data/.dassie/app/controllers/hyrax/monographs_controller.rb +17 -0
- data/.dassie/app/controllers/hyrax/namespaced_works/nested_works_controller.rb +14 -0
- data/.dassie/app/forms/hyrax/generic_work_form.rb +9 -0
- data/.dassie/app/forms/hyrax/namespaced_works/nested_work_form.rb +9 -0
- data/.dassie/app/forms/monograph_form.rb +20 -0
- data/.dassie/app/helpers/application_helper.rb +2 -0
- data/.dassie/app/helpers/hyrax_helper.rb +6 -0
- data/.dassie/app/indexers/generic_work_indexer.rb +18 -0
- data/.dassie/app/indexers/monograph_indexer.rb +16 -0
- data/.dassie/app/indexers/namespaced_works/nested_work_indexer.rb +18 -0
- data/.dassie/app/jobs/application_job.rb +2 -0
- data/.dassie/app/mailers/application_mailer.rb +4 -0
- data/.dassie/app/models/ability.rb +21 -0
- data/.dassie/app/models/application_record.rb +3 -0
- data/.dassie/app/models/collection.rb +8 -0
- data/.dassie/app/models/concerns/.keep +0 -0
- data/.dassie/app/models/file_set.rb +5 -0
- data/.dassie/app/models/generic_work.rb +14 -0
- data/.dassie/app/models/monograph.rb +8 -0
- data/.dassie/app/models/namespaced_works/nested_work.rb +16 -0
- data/.dassie/app/models/qa.rb +5 -0
- data/.dassie/app/models/qa/local_authority.rb +2 -0
- data/.dassie/app/models/qa/local_authority_entry.rb +3 -0
- data/.dassie/app/models/search_builder.rb +16 -0
- data/.dassie/app/models/solr_document.rb +28 -0
- data/.dassie/app/models/time_span.rb +22 -0
- data/.dassie/app/models/user.rb +26 -0
- data/.dassie/app/presenters/hyrax/generic_work_presenter.rb +6 -0
- data/.dassie/app/presenters/hyrax/namespaced_works/nested_work_presenter.rb +6 -0
- data/.dassie/app/views/hyrax/generic_works/_generic_work.html.erb +2 -0
- data/.dassie/app/views/hyrax/monographs/_monograph.html.erb +2 -0
- data/.dassie/app/views/hyrax/namespaced_works/nested_works/_nested_work.html.erb +2 -0
- data/.dassie/app/views/layouts/application.html.erb +15 -0
- data/.dassie/app/views/layouts/mailer.html.erb +13 -0
- data/.dassie/app/views/layouts/mailer.text.erb +1 -0
- data/.dassie/bin/bundle +3 -0
- data/.dassie/bin/rails +9 -0
- data/.dassie/bin/rake +9 -0
- data/.dassie/bin/setup +36 -0
- data/.dassie/bin/spring +17 -0
- data/.dassie/bin/update +31 -0
- data/.dassie/bin/yarn +11 -0
- data/.dassie/config.ru +5 -0
- data/.dassie/config/analytics.yml +6 -0
- data/.dassie/config/application.rb +22 -0
- data/.dassie/config/arkivo.yml +6 -0
- data/.dassie/config/authorities/licenses.yml +46 -0
- data/.dassie/config/authorities/resource_types.yml +41 -0
- data/.dassie/config/authorities/rights_statements.yml +37 -0
- data/.dassie/config/blacklight.yml +9 -0
- data/.dassie/config/boot.rb +4 -0
- data/.dassie/config/browse_everything_providers.yml +2 -0
- data/.dassie/config/cable.yml +10 -0
- data/.dassie/config/credentials.yml.enc +1 -0
- data/.dassie/config/environment.rb +5 -0
- data/.dassie/config/environments/development.rb +69 -0
- data/.dassie/config/environments/production.rb +94 -0
- data/.dassie/config/environments/test.rb +51 -0
- data/.dassie/config/fedora.yml +15 -0
- data/.dassie/config/initializers/arkivo_constraint.rb +12 -0
- data/.dassie/config/initializers/assets.rb +2 -0
- data/.dassie/config/initializers/clamav.rb +2 -0
- data/.dassie/config/initializers/cookies_serializer.rb +1 -0
- data/.dassie/config/initializers/devise.rb +13 -0
- data/.dassie/config/initializers/filter_parameter_logging.rb +1 -0
- data/.dassie/config/initializers/hydra_config.rb +6 -0
- data/.dassie/config/initializers/hyrax.rb +48 -0
- data/.dassie/config/initializers/mailboxer.rb +21 -0
- data/.dassie/config/initializers/mime_types.rb +4 -0
- data/.dassie/config/initializers/mini_magick.rb +6 -0
- data/.dassie/config/initializers/redis_config.rb +4 -0
- data/.dassie/config/initializers/riiif.rb +27 -0
- data/.dassie/config/initializers/simple_form.rb +28 -0
- data/.dassie/config/initializers/simple_form_bootstrap.rb +143 -0
- data/.dassie/config/initializers/wrap_parameters.rb +3 -0
- data/.dassie/config/locales/blacklight.en.yml +3 -0
- data/.dassie/config/locales/devise.en.yml +65 -0
- data/.dassie/config/locales/generic_work.de.yml +8 -0
- data/.dassie/config/locales/generic_work.en.yml +8 -0
- data/.dassie/config/locales/generic_work.es.yml +10 -0
- data/.dassie/config/locales/generic_work.fr.yml +8 -0
- data/.dassie/config/locales/generic_work.it.yml +8 -0
- data/.dassie/config/locales/generic_work.pt-BR.yml +8 -0
- data/.dassie/config/locales/generic_work.zh.yml +10 -0
- data/.dassie/config/locales/hyrax.de.yml +58 -0
- data/.dassie/config/locales/hyrax.en.yml +58 -0
- data/.dassie/config/locales/hyrax.es.yml +58 -0
- data/.dassie/config/locales/hyrax.fr.yml +58 -0
- data/.dassie/config/locales/hyrax.it.yml +58 -0
- data/.dassie/config/locales/hyrax.pt-BR.yml +58 -0
- data/.dassie/config/locales/hyrax.zh.yml +58 -0
- data/.dassie/config/locales/namespaced_works/nested_work.de.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.en.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.es.yml +10 -0
- data/.dassie/config/locales/namespaced_works/nested_work.fr.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.it.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.pt-BR.yml +8 -0
- data/.dassie/config/locales/namespaced_works/nested_work.zh.yml +10 -0
- data/.dassie/config/metadata/monograph.yaml +55 -0
- data/.dassie/config/metadata/sample_metadata.yaml +3 -0
- data/.dassie/config/puma.rb +6 -0
- data/.dassie/config/redis.yml +9 -0
- data/.dassie/config/role_map.yml +24 -0
- data/.dassie/config/routes.rb +35 -0
- data/.dassie/config/solr.yml +7 -0
- data/.dassie/config/spring.rb +6 -0
- data/.dassie/config/storage.yml +7 -0
- data/.dassie/config/tinymce.yml +12 -0
- data/.dassie/config/uv/uv-config.json +3 -0
- data/.dassie/config/uv/uv.html +87 -0
- data/.dassie/config/valkyrie_index.yml +12 -0
- data/.dassie/config/workflows/default_workflow.json +21 -0
- data/.dassie/config/workflows/mediated_deposit_workflow.json +76 -0
- data/.dassie/config/zotero.yml +6 -0
- data/.dassie/db/migrate/20200821212749_create_searches.blacklight.rb +17 -0
- data/.dassie/db/migrate/20200821212750_create_bookmarks.blacklight.rb +19 -0
- data/.dassie/db/migrate/20200821212751_add_polymorphic_type_to_bookmarks.blacklight.rb +9 -0
- data/.dassie/db/migrate/20200821212803_devise_create_users.rb +44 -0
- data/.dassie/db/migrate/20200821212806_add_devise_guests_to_users.rb +15 -0
- data/.dassie/db/migrate/20200821212828_create_version_committers.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212829_create_checksum_audit_logs.hyrax.rb +19 -0
- data/.dassie/db/migrate/20200821212830_create_single_use_links.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212831_add_social_to_users.hyrax.rb +13 -0
- data/.dassie/db/migrate/20200821212832_add_ldap_attrs_to_user.hyrax.rb +27 -0
- data/.dassie/db/migrate/20200821212833_add_avatars_to_users.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212834_create_trophies.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212835_add_linkedin_to_users.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212836_create_tinymce_assets.hyrax.rb +8 -0
- data/.dassie/db/migrate/20200821212837_create_content_blocks.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212838_create_featured_works.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212839_add_external_key_to_content_blocks.hyrax.rb +6 -0
- data/.dassie/db/migrate/20200821212840_create_proxy_deposit_rights.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212841_create_proxy_deposit_requests.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212842_create_file_view_stats.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212843_create_file_download_stats.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212844_add_orcid_to_users.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212845_create_user_stats.hyrax.rb +19 -0
- data/.dassie/db/migrate/20200821212846_create_work_view_stats.hyrax.rb +12 -0
- data/.dassie/db/migrate/20200821212847_add_works_to_user_stats.hyrax.rb +13 -0
- data/.dassie/db/migrate/20200821212848_change_trophy_generic_file_id_to_work_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212849_change_proxy_deposit_generic_file_id_to_work_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212850_change_audit_log_generic_file_id_to_file_set_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212851_change_proxy_deposit_request_generic_file_id_to_work_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212852_create_uploaded_files.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212853_create_features.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212854_create_operations.hyrax.rb +23 -0
- data/.dassie/db/migrate/20200821212855_change_featured_work_generic_file_id_to_work_id.hyrax.rb +6 -0
- data/.dassie/db/migrate/20200821212856_add_arkivo_to_users.hyrax.rb +8 -0
- data/.dassie/db/migrate/20200821212857_create_sipity.hyrax.rb +163 -0
- data/.dassie/db/migrate/20200821212858_create_sipity_workflow_methods.hyrax.rb +10 -0
- data/.dassie/db/migrate/20200821212859_create_permission_template.hyrax.rb +11 -0
- data/.dassie/db/migrate/20200821212860_create_permission_template_access.hyrax.rb +11 -0
- data/.dassie/db/migrate/20200821212861_add_release_to_permission_templates.hyrax.rb +6 -0
- data/.dassie/db/migrate/20200821212862_add_permission_template_to_sipity_workflow.hyrax.rb +26 -0
- data/.dassie/db/migrate/20200821212863_tidy_up_because_of_bad_exception.hyrax.rb +13 -0
- data/.dassie/db/migrate/20200821212864_add_allows_access_grant_to_workflow.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212865_change_checksum_audit_log.hyrax.rb +18 -0
- data/.dassie/db/migrate/20200821212866_create_job_io_wrappers.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212867_create_collection_types.hyrax.rb +17 -0
- data/.dassie/db/migrate/20200821212868_update_collection_type_column_names.hyrax.rb +9 -0
- data/.dassie/db/migrate/20200821212869_update_collection_type_column_options.hyrax.rb +17 -0
- data/.dassie/db/migrate/20200821212870_create_collection_branding_infos.hyrax.rb +15 -0
- data/.dassie/db/migrate/20200821212871_create_collection_type_participants.hyrax.rb +11 -0
- data/.dassie/db/migrate/20200821212872_rename_admin_set_id_to_source_id.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212873_add_preferred_locale_to_users.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212874_add_collection_type_sharing_options.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212875_add_unique_constraint_to_permission_template_accesses.hyrax.rb +8 -0
- data/.dassie/db/migrate/20200821212876_add_branding_to_collection_type.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212877_add_badge_color_to_collection_types.hyrax.rb +5 -0
- data/.dassie/db/migrate/20200821212878_update_single_use_links_column_names.hyrax.rb +6 -0
- data/.dassie/db/migrate/20200821212879_change_sipity_entity_specific_responsibility.hyrax.rb +9 -0
- data/.dassie/db/migrate/20200821212880_create_mailboxer.mailboxer_engine.rb +65 -0
- data/.dassie/db/migrate/20200821212881_add_conversation_optout.mailboxer_engine.rb +15 -0
- data/.dassie/db/migrate/20200821212882_add_missing_indices.mailboxer_engine.rb +20 -0
- data/.dassie/db/migrate/20200821212883_add_delivery_tracking_info_to_mailboxer_receipts.mailboxer_engine.rb +8 -0
- data/.dassie/db/migrate/20200821212884_create_qa_local_authorities.rb +10 -0
- data/.dassie/db/migrate/20200821212885_create_qa_local_authority_entries.rb +12 -0
- data/.dassie/db/migrate/20200821212902_create_minter_states.noid_rails_engine.rb +17 -0
- data/.dassie/db/migrate/20200821212903_rename_minter_state_random_to_rand.noid_rails_engine.rb +8 -0
- data/.dassie/db/schema.rb +563 -0
- data/.dassie/db/seeds.rb +14 -0
- data/.dassie/lib/assets/.keep +0 -0
- data/.dassie/lib/tasks/.keep +0 -0
- data/.dassie/log/.keep +0 -0
- data/.dassie/package.json +17 -0
- data/.dassie/public/404.html +67 -0
- data/.dassie/public/422.html +67 -0
- data/.dassie/public/500.html +66 -0
- data/.dassie/public/apple-touch-icon-precomposed.png +0 -0
- data/.dassie/public/apple-touch-icon.png +0 -0
- data/.dassie/public/favicon.ico +0 -0
- data/.dassie/public/robots.txt +1 -0
- data/.dassie/solr/conf/_rest_managed.json +3 -0
- data/.dassie/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/.dassie/solr/conf/schema.xml +367 -0
- data/.dassie/solr/conf/scripts.conf +24 -0
- data/.dassie/solr/conf/solrconfig.xml +208 -0
- data/.dassie/solr/conf/stopwords.txt +58 -0
- data/.dassie/solr/conf/stopwords_en.txt +58 -0
- data/.dassie/solr/conf/xslt/example.xsl +132 -0
- data/.dassie/solr/conf/xslt/example_atom.xsl +67 -0
- data/.dassie/solr/conf/xslt/example_rss.xsl +66 -0
- data/.dassie/solr/conf/xslt/luke.xsl +337 -0
- data/.dassie/solr/sample_solr_documents.yml +2692 -0
- data/.dassie/storage/.keep +0 -0
- data/.dassie/values.stage.yaml +7 -0
- data/.dassie/values.yaml +15 -0
- data/.dassie/vendor/.keep +0 -0
- data/.dockerignore +11 -0
- data/.env +26 -0
- data/.github/CODE_OF_CONDUCT.md +4 -4
- data/.github/CONTRIBUTING.md +1 -1
- data/.github/SUPPORT.md +13 -1
- data/.gitignore +1 -1
- data/.regen +1 -1
- data/.rubocop.yml +1 -0
- data/.rubocop_fixme.yml +4 -0
- data/CODE_OF_CONDUCT.md +4 -4
- data/CONTAINERS.md +148 -0
- data/CONTRIBUTING.md +1 -1
- data/Dockerfile +75 -0
- data/Gemfile +26 -35
- data/README.md +61 -288
- data/app/actors/hyrax/actors/attach_members_actor.rb +7 -5
- data/app/actors/hyrax/actors/base_actor.rb +0 -1
- data/app/actors/hyrax/actors/create_with_files_ordered_members_actor.rb +28 -28
- data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +2 -3
- data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +23 -28
- data/app/actors/hyrax/actors/default_admin_set_actor.rb +20 -21
- data/app/actors/hyrax/actors/file_actor.rb +32 -32
- data/app/actors/hyrax/actors/file_set_actor.rb +4 -15
- data/app/actors/hyrax/actors/initialize_workflow_actor.rb +8 -0
- data/app/actors/hyrax/actors/transfer_request_actor.rb +5 -0
- data/app/assets/javascripts/hyrax.js +1 -0
- data/app/assets/javascripts/hyrax/skip_to_content.js +15 -0
- data/app/assets/stylesheets/hyrax/_usage-stats.scss +1 -1
- data/app/authorities/qa/authorities/collections.rb +18 -8
- data/app/authorities/qa/authorities/find_works.rb +20 -5
- data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +15 -6
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +62 -31
- data/app/controllers/hyrax/dashboard/collections_controller.rb +22 -12
- data/app/controllers/hyrax/dashboard/works_controller.rb +3 -4
- data/app/controllers/hyrax/file_sets_controller.rb +19 -10
- data/app/controllers/hyrax/homepage_controller.rb +11 -11
- data/app/controllers/hyrax/my/collections_controller.rb +5 -6
- data/app/controllers/hyrax/my/highlights_controller.rb +2 -3
- data/app/controllers/hyrax/my/shares_controller.rb +2 -3
- data/app/controllers/hyrax/my/works_controller.rb +1 -6
- data/app/controllers/hyrax/my_controller.rb +10 -2
- data/app/controllers/hyrax/permissions_controller.rb +1 -0
- data/app/controllers/hyrax/single_use_links_viewer_controller.rb +11 -5
- data/app/controllers/hyrax/users_controller.rb +5 -10
- data/app/forms/hyrax/forms/failed_submission_form_wrapper.rb +136 -0
- data/app/forms/hyrax/forms/resource_form.rb +8 -4
- data/app/helpers/hyrax/collections_helper.rb +1 -1
- data/app/helpers/hyrax/dashboard_helper_behavior.rb +7 -2
- data/app/helpers/hyrax/embargo_helper.rb +5 -1
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +10 -5
- data/app/helpers/hyrax/lease_helper.rb +5 -1
- data/app/indexers/hyrax/pcdm_collection_indexer.rb +21 -0
- data/app/indexers/hyrax/resource_indexer.rb +3 -1
- data/app/indexers/hyrax/valkyrie_collection_indexer.rb +3 -12
- data/app/indexers/hyrax/valkyrie_indexer.rb +45 -17
- data/app/indexers/hyrax/valkyrie_work_indexer.rb +16 -0
- data/app/jobs/attach_files_to_work_job.rb +3 -41
- data/app/jobs/embargo_expiry_job.rb +15 -0
- data/app/jobs/event_job.rb +14 -7
- data/app/jobs/hyrax/application_job.rb +6 -1
- data/app/jobs/import_url_job.rb +11 -5
- data/app/jobs/inherit_permissions_job.rb +6 -25
- data/app/jobs/lease_expiry_job.rb +15 -0
- data/app/models/admin_set.rb +1 -1
- data/app/models/concerns/hyrax/ability.rb +192 -21
- data/app/models/concerns/hyrax/ability/admin_set_ability.rb +0 -5
- data/app/models/concerns/hyrax/collection_behavior.rb +7 -13
- data/app/models/concerns/hyrax/permissions/writable.rb +2 -2
- data/app/models/concerns/hyrax/solr_document/characterization.rb +35 -2
- data/app/models/concerns/hyrax/solr_document_behavior.rb +37 -5
- data/app/models/hyrax/change_set.rb +5 -1
- data/app/models/hyrax/collection_type.rb +59 -22
- data/app/models/hyrax/event.rb +5 -7
- data/app/models/hyrax/file_metadata.rb +15 -4
- data/app/models/hyrax/pcdm_collection.rb +13 -0
- data/app/models/hyrax/uploaded_file.rb +9 -2
- data/app/models/hyrax/{active_job_proxy.rb → valkyrie_global_id_proxy.rb} +6 -5
- data/app/models/hyrax/virus_scanner.rb +2 -1
- data/app/models/hyrax/work.rb +1 -1
- data/app/models/sipity.rb +6 -0
- data/app/models/sipity/entity.rb +1 -1
- data/app/models/sipity/workflow.rb +23 -3
- data/app/presenters/hyrax/admin/repository_object_presenter.rb +7 -2
- data/app/presenters/hyrax/collection_presenter.rb +1 -1
- data/app/presenters/hyrax/file_set_presenter.rb +3 -0
- data/app/presenters/hyrax/iiif_manifest_presenter.rb +3 -3
- data/app/presenters/hyrax/permission_badge.rb +1 -1
- data/app/presenters/hyrax/presenter_factory.rb +0 -2
- data/app/presenters/hyrax/select_collection_type_presenter.rb +16 -3
- data/app/presenters/hyrax/select_type_presenter.rb +3 -2
- data/app/presenters/hyrax/stats_usage_presenter.rb +0 -1
- data/app/presenters/hyrax/work_show_presenter.rb +1 -1
- data/app/renderers/hyrax/renderers/attribute_renderer.rb +16 -6
- data/app/search_builders/hyrax/README.md +3 -3
- data/app/search_builders/hyrax/admin_admin_set_member_search_builder.rb +8 -2
- data/app/search_builders/hyrax/collection_member_search_builder.rb +21 -7
- data/app/search_builders/hyrax/dashboard/managed_search_filters.rb +1 -1
- data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +1 -1
- data/app/search_builders/hyrax/embargo_search_builder.rb +0 -1
- data/app/search_builders/hyrax/filter_by_type.rb +3 -1
- data/app/search_builders/hyrax/lease_search_builder.rb +0 -1
- data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +12 -2
- data/app/search_builders/hyrax/search_builder.rb +1 -4
- data/app/search_builders/hyrax/search_filters.rb +0 -2
- data/app/services/hyrax/access_control_list.rb +33 -2
- data/app/services/hyrax/adapters/nesting_index_adapter.rb +26 -7
- data/app/services/hyrax/admin_set_member_service.rb +18 -4
- data/{lib/hyrax/callbacks/registry.rb → app/services/hyrax/callbacks.rb} +23 -0
- data/app/services/hyrax/change_content_depositor_service.rb +4 -1
- data/app/services/hyrax/collection_member_service.rb +5 -1
- data/app/services/hyrax/collection_types/permissions_service.rb +0 -2
- data/app/services/hyrax/collections/collection_member_service.rb +44 -64
- data/app/services/hyrax/collections/managed_collections_service.rb +15 -2
- data/app/services/hyrax/collections/migration_service.rb +9 -3
- data/app/services/hyrax/collections/nested_collection_persistence_service.rb +1 -1
- data/app/services/hyrax/collections/nested_collection_query_service.rb +39 -19
- data/app/services/hyrax/collections/permissions_service.rb +0 -1
- data/app/services/hyrax/collections_service.rb +12 -12
- data/app/services/hyrax/custom_queries/find_collections_by_type.rb +1 -1
- data/app/services/hyrax/custom_queries/navigators/child_collections_navigator.rb +14 -3
- data/app/services/hyrax/custom_queries/navigators/child_filesets_navigator.rb +14 -3
- data/app/services/hyrax/custom_queries/navigators/child_works_navigator.rb +10 -3
- data/app/services/hyrax/custom_queries/navigators/collection_members.rb +1 -0
- data/app/services/hyrax/custom_queries/navigators/find_files.rb +3 -0
- data/app/services/hyrax/database_migrator.rb +13 -10
- data/app/services/hyrax/default_middleware_stack.rb +0 -6
- data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +27 -0
- data/app/services/hyrax/file_set_fixity_check_service.rb +16 -17
- data/app/services/hyrax/file_set_type_service.rb +55 -0
- data/app/services/hyrax/graph_exporter.rb +64 -8
- data/app/services/hyrax/list_source_exporter.rb +16 -34
- data/app/services/hyrax/listeners.rb +22 -0
- data/app/services/hyrax/listeners/proxy_deposit_listener.rb +20 -0
- data/app/services/hyrax/listeners/workflow_listener.rb +36 -0
- data/app/services/hyrax/multiple_membership_checker.rb +2 -1
- data/app/services/hyrax/quick_classification_query.rb +2 -3
- data/app/services/hyrax/resource_visibility_propagator.rb +1 -1
- data/app/services/hyrax/search_service.rb +108 -0
- data/app/services/hyrax/simple_schema_loader.rb +3 -1
- data/app/services/hyrax/statistics/depositors/summary.rb +0 -1
- data/app/services/hyrax/statistics/system_stats.rb +0 -1
- data/app/services/hyrax/thumbnail_path_service.rb +6 -1
- data/app/services/hyrax/time_service.rb +10 -0
- data/app/services/hyrax/versioning_service.rb +4 -28
- data/app/services/hyrax/work_uploads_handler.rb +166 -0
- data/app/services/hyrax/workflow/action_taken_service.rb +14 -1
- data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +3 -1
- data/app/services/hyrax/workflow/permission_generator.rb +14 -9
- data/app/services/hyrax/workflow/workflow_action_service.rb +1 -1
- data/app/services/hyrax/workflow/workflow_factory.rb +12 -10
- data/app/services/hyrax/working_directory.rb +0 -1
- data/app/services/hyrax/works/managed_works_service.rb +14 -2
- data/app/views/_controls.html.erb +1 -1
- data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
- data/app/views/hyrax/base/_member.html.erb +1 -1
- data/app/views/hyrax/base/_representative_media.html.erb +1 -1
- data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +1 -1
- data/app/views/hyrax/base/show.html.erb +2 -2
- data/app/views/hyrax/batch_select/_add_button.html.erb +1 -1
- data/app/views/hyrax/collections/_default_group.html.erb +2 -0
- data/app/views/hyrax/collections/show.html.erb +1 -1
- data/app/views/hyrax/dashboard/works/_default_group.html.erb +2 -0
- data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +1 -1
- data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +2 -1
- data/app/views/hyrax/my/works/_default_group.html.erb +2 -0
- data/app/views/layouts/hyrax.html.erb +0 -15
- data/bin/db-migrate-seed.sh +9 -0
- data/bin/db-wait.sh +14 -0
- data/bin/hyrax-entrypoint.sh +15 -0
- data/chart/fcrepo/.gitignore +2 -0
- data/chart/fcrepo/.helmignore +23 -0
- data/chart/fcrepo/Chart.yaml +11 -0
- data/chart/fcrepo/README.md +50 -0
- data/chart/fcrepo/templates/NOTES.txt +21 -0
- data/chart/fcrepo/templates/_helpers.tpl +68 -0
- data/chart/fcrepo/templates/configmap-env.yaml +19 -0
- data/chart/fcrepo/templates/deployment.yaml +109 -0
- data/chart/fcrepo/templates/ingress.yaml +41 -0
- data/chart/fcrepo/templates/pvc.yaml +20 -0
- data/chart/fcrepo/templates/secret.yaml +12 -0
- data/chart/fcrepo/templates/service.yaml +15 -0
- data/chart/fcrepo/templates/serviceaccount.yaml +12 -0
- data/chart/fcrepo/templates/tests/test-connection.yaml +15 -0
- data/chart/fcrepo/values.yaml +79 -0
- data/chart/hyrax/.gitignore +2 -0
- data/chart/hyrax/.helmignore +23 -0
- data/chart/hyrax/Chart.yaml +27 -0
- data/chart/hyrax/README.md +69 -0
- data/chart/hyrax/templates/NOTES.txt +21 -0
- data/chart/hyrax/templates/_helpers.tpl +92 -0
- data/chart/hyrax/templates/configmap-env.yaml +32 -0
- data/chart/hyrax/templates/deployment.yaml +79 -0
- data/chart/hyrax/templates/fcrepo-secret.yaml +13 -0
- data/chart/hyrax/templates/hpa.yaml +28 -0
- data/chart/hyrax/templates/ingress.yaml +41 -0
- data/chart/hyrax/templates/secrets.yaml +12 -0
- data/chart/hyrax/templates/service.yaml +15 -0
- data/chart/hyrax/templates/serviceaccount.yaml +12 -0
- data/chart/hyrax/templates/tests/test-connection.yaml +15 -0
- data/chart/hyrax/values.yaml +97 -0
- data/config/initializers/indexing_adapter_initializer.rb +7 -12
- data/config/initializers/listeners.rb +2 -0
- data/config/locales/hyrax.en.yml +1 -1
- data/config/metadata/basic_metadata.yaml +13 -0
- data/db/seeds.rb +20 -0
- data/docker-compose.yml +132 -0
- data/documentation/developing-your-hyrax-based-app.md +271 -0
- data/documentation/legacyREADME.md +336 -0
- data/documentation/note-about-versions.md +15 -0
- data/hyrax.gemspec +7 -8
- data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +4 -6
- data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +1 -1
- data/lib/generators/hyrax/templates/db/seeds.rb +16 -14
- data/lib/generators/hyrax/templates/uv.html +1 -1
- data/lib/generators/hyrax/work_resource/templates/controller.rb.erb +0 -5
- data/lib/generators/hyrax/work_resource/templates/form.rb.erb +1 -1
- data/lib/generators/hyrax/work_resource/templates/work.html.erb_spec.rb.erb +3 -2
- data/lib/hyrax.rb +17 -0
- data/lib/hyrax/configuration.rb +340 -200
- data/lib/hyrax/event_store.rb +5 -0
- data/lib/hyrax/form_fields.rb +1 -1
- data/lib/hyrax/indexer.rb +19 -3
- data/lib/hyrax/publisher.rb +71 -2
- data/lib/hyrax/resource_sync/change_list_writer.rb +1 -1
- data/lib/hyrax/resource_sync/resource_list_writer.rb +1 -1
- data/lib/hyrax/schema.rb +2 -2
- data/lib/hyrax/specs/capybara.rb +98 -0
- data/lib/hyrax/specs/clamav.rb +15 -0
- data/lib/hyrax/specs/disable_animations_in_test_environment.rb +53 -0
- data/lib/hyrax/specs/engine_routes.rb +11 -0
- data/lib/hyrax/specs/shared_specs/change_set.rb +11 -0
- data/lib/hyrax/specs/shared_specs/factories/strategies/json_strategy.rb +13 -0
- data/lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb +0 -11
- data/lib/hyrax/specs/shared_specs/hydra_works.rb +6 -0
- data/lib/hyrax/specs/shared_specs/indexers.rb +22 -5
- data/lib/hyrax/specs/shared_specs/metadata.rb +64 -0
- data/lib/hyrax/specs/spy_listener.rb +52 -26
- data/lib/hyrax/transactions/container.rb +13 -1
- data/lib/hyrax/transactions/steps/add_file_sets.rb +35 -0
- data/lib/hyrax/transactions/steps/save.rb +10 -4
- data/lib/hyrax/transactions/steps/save_access_control.rb +29 -0
- data/lib/hyrax/transactions/steps/set_default_admin_set.rb +1 -1
- data/lib/hyrax/transactions/update_work.rb +3 -1
- data/lib/hyrax/transactions/work_create.rb +3 -1
- data/lib/hyrax/version.rb +1 -1
- data/lib/tasks/collection_type_global_id.rake +22 -0
- data/lib/tasks/default_admin_set.rake +5 -0
- data/lib/wings.rb +1 -1
- data/lib/wings/active_fedora_converter.rb +71 -123
- data/lib/wings/active_fedora_converter/default_work.rb +129 -0
- data/lib/wings/active_fedora_converter/nested_resource.rb +25 -0
- data/lib/wings/attribute_transformer.rb +28 -1
- data/lib/wings/converter_value_mapper.rb +70 -3
- data/lib/wings/model_registry.rb +4 -3
- data/lib/wings/model_transformer.rb +25 -7
- data/lib/wings/orm_converter.rb +19 -23
- data/lib/wings/services/custom_queries/find_collections_by_type.rb +1 -1
- data/lib/wings/services/custom_queries/find_file_metadata.rb +65 -38
- data/lib/wings/services/file_converter_service.rb +6 -55
- data/lib/wings/services/file_metadata_builder.rb +12 -8
- data/lib/wings/setup.rb +56 -9
- data/lib/wings/transformer_value_mapper.rb +1 -0
- data/lib/wings/valkyrie/metadata_adapter.rb +2 -2
- data/lib/wings/valkyrie/persister.rb +13 -14
- data/lib/wings/valkyrie/storage.rb +94 -0
- data/tasks/benchmark.rake +56 -0
- data/template.rb +1 -3
- metadata +346 -54
- data/lib/hyrax/callbacks.rb +0 -27
- data/lib/wings/hydra/pcdm/models/concerns/collection_valkyrie_behavior.rb +0 -28
- data/lib/wings/hydra/pcdm/models/concerns/object_valkyrie_behavior.rb +0 -28
- data/lib/wings/hydra/pcdm/models/concerns/pcdm_valkyrie_behavior.rb +0 -171
- data/lib/wings/hydra/works/models/concerns/collection_valkyrie_behavior.rb +0 -31
- data/lib/wings/hydra/works/models/concerns/file_set_valkyrie_behavior.rb +0 -31
- data/lib/wings/hydra/works/models/concerns/work_valkyrie_behavior.rb +0 -60
- data/lib/wings/models/concerns/collection_behavior.rb +0 -39
- data/lib/wings/models/multi_checksum.rb +0 -18
- data/lib/wings/services/id_converter_service.rb +0 -15
- data/lib/wings/valkyrie/storage/active_fedora.rb +0 -27
@@ -5,6 +5,7 @@ module Hyrax
|
|
5
5
|
# Define collection specific filter facets.
|
6
6
|
def self.configure_facets
|
7
7
|
configure_blacklight do |config|
|
8
|
+
config.search_builder_class = Hyrax::My::WorksSearchBuilder
|
8
9
|
config.add_facet_field "admin_set_sim", limit: 5
|
9
10
|
config.add_facet_field "member_of_collections_ssim", limit: 5
|
10
11
|
end
|
@@ -14,12 +15,6 @@ module Hyrax
|
|
14
15
|
class_attribute :create_work_presenter_class
|
15
16
|
self.create_work_presenter_class = Hyrax::SelectTypeListPresenter
|
16
17
|
|
17
|
-
# Search builder for a list of works that belong to me
|
18
|
-
# Override of Blacklight::RequestBuilders
|
19
|
-
def search_builder_class
|
20
|
-
Hyrax::My::WorksSearchBuilder
|
21
|
-
end
|
22
|
-
|
23
18
|
def index
|
24
19
|
# The user's collections for the "add to collection" form
|
25
20
|
@user_collections = collections_service.search_results(:deposit)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Hyrax
|
3
3
|
class MyController < ApplicationController
|
4
|
+
extend Deprecation
|
4
5
|
include Hydra::Catalog
|
5
6
|
include Hyrax::Collections::AcceptsBatches
|
6
7
|
|
@@ -35,7 +36,9 @@ module Hyrax
|
|
35
36
|
|
36
37
|
def index
|
37
38
|
@user = current_user
|
38
|
-
(
|
39
|
+
Deprecation.silence(Hyrax::MyController) do
|
40
|
+
(@response, @document_list) = query_solr
|
41
|
+
end
|
39
42
|
prepare_instance_variables_for_batch_control_display
|
40
43
|
|
41
44
|
respond_to do |format|
|
@@ -61,7 +64,12 @@ module Hyrax
|
|
61
64
|
end
|
62
65
|
|
63
66
|
def query_solr
|
64
|
-
search_results
|
67
|
+
search_service.search_results
|
68
|
+
end
|
69
|
+
deprecation_deprecate :query_solr
|
70
|
+
|
71
|
+
def search_service
|
72
|
+
Hyrax::SearchService.new(config: blacklight_config, user_params: params, scope: self)
|
65
73
|
end
|
66
74
|
end
|
67
75
|
end
|
@@ -13,15 +13,16 @@ module Hyrax
|
|
13
13
|
self.presenter_class = FileSetPresenter
|
14
14
|
copy_blacklight_config_from(::CatalogController)
|
15
15
|
|
16
|
+
configure_blacklight do |config|
|
17
|
+
config.search_builder_class = SingleUseLinkSearchBuilder
|
18
|
+
end
|
19
|
+
|
16
20
|
def download
|
17
21
|
raise not_found_exception unless single_use_link.path == hyrax.download_path(id: @asset)
|
18
22
|
send_content
|
19
23
|
end
|
20
24
|
|
21
25
|
def show
|
22
|
-
_, document_list = search_results(id: single_use_link.item_id)
|
23
|
-
curation_concern = document_list.first
|
24
|
-
|
25
26
|
# Authorize using SingleUseLinksViewerController::Ability
|
26
27
|
authorize! :read, curation_concern
|
27
28
|
raise not_found_exception unless single_use_link.path == polymorphic_path([main_app, curation_concern])
|
@@ -36,8 +37,13 @@ module Hyrax
|
|
36
37
|
|
37
38
|
private
|
38
39
|
|
39
|
-
def
|
40
|
-
|
40
|
+
def curation_concern
|
41
|
+
response, _document_list = search_service.search_results
|
42
|
+
response.documents.first
|
43
|
+
end
|
44
|
+
|
45
|
+
def search_service
|
46
|
+
Hyrax::SearchService.new(config: blacklight_config, user_params: { id: single_use_link.item_id }, scope: self)
|
41
47
|
end
|
42
48
|
|
43
49
|
def content_options
|
@@ -20,20 +20,15 @@ module Hyrax
|
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
-
|
24
|
-
#
|
25
|
-
# @todo Given that this method sends its methods to ::User, I
|
26
|
-
# believe it could be extracted to User; I don't think the
|
27
|
-
# base_query can be as it may require controller level context
|
28
|
-
#
|
29
|
-
# Returns a list of users excluding the system users and guest_users
|
23
|
+
##
|
30
24
|
# @param query [String] the query string
|
25
|
+
#
|
26
|
+
# @return [Enumerable] a list of users excluding the system users and guest_users
|
31
27
|
def search(query)
|
32
28
|
base = ::User
|
33
29
|
clause = query.blank? ? nil : "%#{base.sanitize_sql_like(query.downcase)}%"
|
34
30
|
base = base.where(*Array.wrap(base_query))
|
35
|
-
# This may have some DB adapter specific behavior
|
36
|
-
# definitely logic I'd like to keep out of a controller.
|
31
|
+
# This may have some DB adapter specific behavior.
|
37
32
|
base = base.where("LOWER(#{base.user_key_field}) LIKE :clause OR LOWER(display_name) LIKE :clause", clause: clause) if clause.present?
|
38
33
|
base.registered
|
39
34
|
.without_system_accounts
|
@@ -62,7 +57,7 @@ module Hyrax
|
|
62
57
|
|
63
58
|
def find_user
|
64
59
|
@user = ::User.from_url_component(params[:id])
|
65
|
-
redirect_to root_path, alert: "User
|
60
|
+
redirect_to root_path, alert: "User does not exist" unless @user
|
66
61
|
end
|
67
62
|
|
68
63
|
def sort_value
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Hyrax
|
3
|
+
module Forms
|
4
|
+
# @deprecated This class should be removed when we switch to
|
5
|
+
# Valkyrie::ChangeSet instead of Hydra::Forms.
|
6
|
+
#
|
7
|
+
# This object is responsible for exposing the user submitted
|
8
|
+
# params from a failed POST/PUT/PATCH.
|
9
|
+
#
|
10
|
+
# @see https://github.com/samvera/hyrax/issues/3978
|
11
|
+
class FailedSubmissionFormWrapper < SimpleDelegator
|
12
|
+
# @param form
|
13
|
+
# @param input_params [ActionController::Parameters]
|
14
|
+
#
|
15
|
+
# @param permitted_params [Hash] this likely comes from a class
|
16
|
+
# method on the given form. It's used for enforcing
|
17
|
+
# strong parameters. It's more of a schema for what the
|
18
|
+
# input parameters should be. Why not rely on the
|
19
|
+
# form.class.permitted_params? This is a violation of
|
20
|
+
# the Law of Demeter, and due to object delegation, the
|
21
|
+
# form.class may be a delegate class, and not the one
|
22
|
+
# that has permitted_params.
|
23
|
+
#
|
24
|
+
# @see Hyrax::WorkForm.build_permitted_params
|
25
|
+
def initialize(form:, input_params:, permitted_params: nil)
|
26
|
+
@form = form
|
27
|
+
super(@form)
|
28
|
+
@input_params = input_params
|
29
|
+
@exposed_params = {}
|
30
|
+
@permitted_params = permitted_params || __default_permitted_params__(form: form)
|
31
|
+
build_exposed_params!
|
32
|
+
end
|
33
|
+
|
34
|
+
# Yes, I don't want to delegate class to the form, but based on
|
35
|
+
# past experiences, there are times where SimpleForm requests
|
36
|
+
# class.model_name and that had better align with the underlying
|
37
|
+
# form.
|
38
|
+
#
|
39
|
+
# Upon testing, when I don't have this method, the Javascript
|
40
|
+
# for "Requirements" on the new form will not properly
|
41
|
+
# acknowledge that we have re-filled the HTML form with the
|
42
|
+
# submitted non-file fields.
|
43
|
+
def class
|
44
|
+
@form.class
|
45
|
+
end
|
46
|
+
|
47
|
+
def model_name
|
48
|
+
@form.model_name
|
49
|
+
end
|
50
|
+
|
51
|
+
def to_model
|
52
|
+
self
|
53
|
+
end
|
54
|
+
|
55
|
+
def inspect
|
56
|
+
"Hyrax::Forms::FailedSubmissionFormWrapper(#{@form})"
|
57
|
+
end
|
58
|
+
|
59
|
+
def [](key)
|
60
|
+
if @exposed_params.key?(key)
|
61
|
+
@exposed_params.fetch(key)
|
62
|
+
else
|
63
|
+
super
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def method_missing(method_name, *args, &block)
|
70
|
+
if @exposed_params.key?(method_name)
|
71
|
+
@exposed_params.fetch(method_name)
|
72
|
+
else
|
73
|
+
super
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def respond_to_missing?(method_name, *args)
|
78
|
+
return true if @exposed_params.key?(method_name)
|
79
|
+
super
|
80
|
+
end
|
81
|
+
|
82
|
+
def build_exposed_params!
|
83
|
+
@permitted_params.each do |permitted_param|
|
84
|
+
case permitted_param
|
85
|
+
when ::Symbol
|
86
|
+
@exposed_params[permitted_param] = @input_params.fetch(permitted_param) if @input_params.key?(permitted_param)
|
87
|
+
when ::Hash
|
88
|
+
permitted_param.each do |key, value_schema|
|
89
|
+
build_exposed_param_hash_element!(key: key, value_schema: value_schema)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def build_exposed_param_hash_element!(key:, value_schema:)
|
96
|
+
# The input may not include the given key, so don't attempt a fetch.
|
97
|
+
return unless @input_params.key?(key)
|
98
|
+
# I don't have a non-Array example of what this value_schema could be.
|
99
|
+
return unless value_schema.is_a?(::Array)
|
100
|
+
if value_schema.empty?
|
101
|
+
@exposed_params[key] = ::Array.wrap(@input_params.fetch(key))
|
102
|
+
elsif value_schema.is_a?(::Array)
|
103
|
+
# We're expecting nested attributes which will have the form:
|
104
|
+
# { "0" => <Hash with value_schema as keys>, "1" => <Hash with value_schema as keys> }
|
105
|
+
hash = {}
|
106
|
+
@input_params.fetch(key).each_pair do |nested_key, nested_value|
|
107
|
+
hash[nested_key] = nested_value.slice(*value_schema)
|
108
|
+
end
|
109
|
+
@exposed_params[key] = hash
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# This method is specifically named __default_permitted_params__
|
114
|
+
# because the form object may well have a
|
115
|
+
# default_permitted_params; I know it's class most certainly
|
116
|
+
# does.
|
117
|
+
#
|
118
|
+
# In running tests, I'm seeing that in some cases a form object
|
119
|
+
# has an instance method for permitted_params, other times, a
|
120
|
+
# form object has a class method for permitted_params, and
|
121
|
+
# though I haven't seen it in specs, I do see that forms have a
|
122
|
+
# build_permitted_params method.
|
123
|
+
def __default_permitted_params__(form:)
|
124
|
+
if form.respond_to?(:permitted_params)
|
125
|
+
form.permitted_params
|
126
|
+
elsif form.class.respond_to?(:permitted_params)
|
127
|
+
form.class.permitted_params
|
128
|
+
elsif form.class.respond_to?(:build_permitted_params)
|
129
|
+
form.class.build_permitted_params
|
130
|
+
else
|
131
|
+
raise ArgumentError, "Unable to extract a suitable permitted_params from #{form.inspect}"
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -36,7 +36,7 @@ module Hyrax
|
|
36
36
|
#
|
37
37
|
# @note due to historical oddities with Hydra::AccessControls and Hydra
|
38
38
|
# Editor, Hyrax's views rely on `agent_name` and `access` as field
|
39
|
-
# names. we provide these as virtual fields
|
39
|
+
# names. we provide these as virtual fields and prepopulate these from
|
40
40
|
# `Hyrax::Permission`.
|
41
41
|
class Permission < Hyrax::ChangeSet
|
42
42
|
property :agent_name, virtual: true, prepopulator: ->(_opts) { self.agent_name = model.agent }
|
@@ -65,9 +65,13 @@ module Hyrax
|
|
65
65
|
|
66
66
|
class_attribute :model_class
|
67
67
|
|
68
|
-
|
68
|
+
property :human_readable_type, writable: false
|
69
69
|
|
70
|
-
property :
|
70
|
+
property :depositor
|
71
|
+
property :on_behalf_of
|
72
|
+
property :proxy_depositor
|
73
|
+
|
74
|
+
property :visibility, default: VisibilityIntention::PRIVATE
|
71
75
|
|
72
76
|
property :date_modified, readable: false
|
73
77
|
property :date_uploaded, readable: false
|
@@ -85,7 +89,7 @@ module Hyrax
|
|
85
89
|
property :visibility_during_lease, virtual: true, prepopulator: ->(_opts) { self.visibility_during_lease = model.lease&.visibility_during_lease }
|
86
90
|
|
87
91
|
# pcdm relationships
|
88
|
-
property :admin_set_id
|
92
|
+
property :admin_set_id, prepopulator: ->(_opts) { self.admin_set_id = AdminSet::DEFAULT_ID }
|
89
93
|
property :member_ids, default: [], type: Valkyrie::Types::Array
|
90
94
|
property :member_of_collection_ids, default: [], type: Valkyrie::Types::Array
|
91
95
|
|
@@ -101,7 +101,7 @@ module Hyrax
|
|
101
101
|
# @return [String] The CollectionType's title if found, else the gid
|
102
102
|
def collection_type_label(collection_type_gid)
|
103
103
|
CollectionType.find_by_gid!(collection_type_gid).title
|
104
|
-
rescue ActiveRecord::RecordNotFound, URI::BadURIError
|
104
|
+
rescue ActiveRecord::RecordNotFound, URI::InvalidURIError, URI::BadURIError
|
105
105
|
CollectionType.find_or_create_default_collection_type.title
|
106
106
|
end
|
107
107
|
|
@@ -5,8 +5,13 @@ module Hyrax
|
|
5
5
|
params[:controller].match(%r{^hyrax/dashboard|hyrax/my})
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
# @param user [User]
|
9
|
+
# @param where [Hash] applied as the where clause when querying the Hyrax::WorkRelation
|
10
|
+
#
|
11
|
+
# @see Hyrax::WorkRelation
|
12
|
+
def number_of_works(user = current_user, where: { generic_type_sim: "Work" })
|
13
|
+
where_clause = where.merge(DepositSearchBuilder.depositor_field => user.user_key)
|
14
|
+
Hyrax::WorkRelation.new.where(where_clause).count
|
10
15
|
rescue RSolr::Error::ConnectionRefused
|
11
16
|
'n/a'
|
12
17
|
end
|
@@ -20,11 +20,15 @@ module Hyrax
|
|
20
20
|
#
|
21
21
|
# @return [Boolean] whether the resource has an embargo that is currently
|
22
22
|
# enforced (regardless of whether it has expired)
|
23
|
+
#
|
24
|
+
# @note Hyrax::Forms::Failedsubmissionformwrapper is a place
|
25
|
+
# holder until we switch to Valkyrie::ChangeSet instead of Form
|
26
|
+
# objects
|
23
27
|
def embargo_enforced?(resource)
|
24
28
|
case resource
|
25
29
|
when Hydra::AccessControls::Embargoable
|
26
30
|
!resource.embargo_release_date.nil?
|
27
|
-
when HydraEditor::Form
|
31
|
+
when HydraEditor::Form, Hyrax::Forms::FailedSubmissionFormWrapper
|
28
32
|
embargo_enforced?(resource.model)
|
29
33
|
when Valkyrie::ChangeSet
|
30
34
|
Hyrax::EmbargoManager.new(resource: resource.model).enforced?
|
@@ -19,7 +19,7 @@ module Hyrax
|
|
19
19
|
include Hyrax::WorkFormHelper
|
20
20
|
|
21
21
|
# Which translations are available for the user to select
|
22
|
-
# @return [Hash
|
22
|
+
# @return [Hash{String => String}] locale abbreviations as keys and flags as values
|
23
23
|
def available_translations
|
24
24
|
{
|
25
25
|
'de' => 'Deutsch',
|
@@ -105,7 +105,11 @@ module Hyrax
|
|
105
105
|
# @see Blacklight::SearchState#initialize
|
106
106
|
def link_to_field(name, value, label = nil, facet_hash = {})
|
107
107
|
label ||= value
|
108
|
-
params = {
|
108
|
+
params = {}
|
109
|
+
if name.present?
|
110
|
+
params[:search_field] = name
|
111
|
+
params[:q] = "\"#{value}\""
|
112
|
+
end
|
109
113
|
state = search_state_with_facets(params, facet_hash)
|
110
114
|
link_to(label, main_app.search_catalog_path(state))
|
111
115
|
end
|
@@ -124,7 +128,7 @@ module Hyrax
|
|
124
128
|
# A Blacklight helper_method
|
125
129
|
# @param options [Hash{Symbol=>Object}] Blacklight sends :document, :field, :config, :value and whatever else was in options
|
126
130
|
# @option options [Array{String}] :value
|
127
|
-
# @option options [Hash] :config including {:field_name => "my_name"}
|
131
|
+
# @option options [Hash] :config including +{:field_name => "my_name"}+
|
128
132
|
# @option options [Hash] :document
|
129
133
|
# @option options [Array{String}] :value the strings you might otherwise have passed to this method singly
|
130
134
|
# @return [ActiveSupport::SafeBuffer] the html_safe link
|
@@ -171,7 +175,6 @@ module Hyrax
|
|
171
175
|
# @option field [Array] :value array of values for the field
|
172
176
|
# @param show_link [Boolean]
|
173
177
|
# @return [ActiveSupport::SafeBuffer]
|
174
|
-
# @todo stop being a helper_method, start being part of the Blacklight render stack?
|
175
178
|
def iconify_auto_link(field, show_link = true)
|
176
179
|
if field.is_a? Hash
|
177
180
|
options = field[:config].separator_options || {}
|
@@ -302,7 +305,9 @@ module Hyrax
|
|
302
305
|
# rubocop:enable Metrics/MethodLength
|
303
306
|
|
304
307
|
# @param [ActionController::Parameters] params first argument for Blacklight::SearchState.new
|
305
|
-
# @param [Hash] facet
|
308
|
+
# @param [Hash] facet(s)
|
309
|
+
# @return [Hash]
|
310
|
+
#
|
306
311
|
# @note Assumes one facet is passed in. If a second facet is passed, then it must be the depositor
|
307
312
|
# facet used by the Profile page.
|
308
313
|
def search_state_with_facets(params, facet = {})
|
@@ -20,11 +20,15 @@ module Hyrax
|
|
20
20
|
#
|
21
21
|
# @return [Boolean] whether the resource has an lease that is currently
|
22
22
|
# enforced (regardless of whether it has expired)
|
23
|
+
#
|
24
|
+
# @note Hyrax::Forms::Failedsubmissionformwrapper is a place
|
25
|
+
# holder until we switch to Valkyrie::ChangeSet instead of Form
|
26
|
+
# objects
|
23
27
|
def lease_enforced?(resource)
|
24
28
|
case resource
|
25
29
|
when Hydra::AccessControls::Embargoable
|
26
30
|
!resource.lease_expiration_date.nil?
|
27
|
-
when HydraEditor::Form
|
31
|
+
when HydraEditor::Form, Hyrax::Forms::FailedSubmissionFormWrapper
|
28
32
|
lease_enforced?(resource.model)
|
29
33
|
when Valkyrie::ChangeSet
|
30
34
|
Hyrax::LeaseManager.new(resource: resource.model).enforced?
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Hyrax
|
4
|
+
##
|
5
|
+
# Indexes properties common to PCDM Collections
|
6
|
+
class PcdmCollectionIndexer < Hyrax::ValkyrieIndexer
|
7
|
+
include Hyrax::ResourceIndexer
|
8
|
+
include Hyrax::PermissionIndexer
|
9
|
+
include Hyrax::VisibilityIndexer
|
10
|
+
include Hyrax::Indexer(:core_metadata)
|
11
|
+
include Hyrax::Indexer(:basic_metadata)
|
12
|
+
|
13
|
+
def to_solr
|
14
|
+
super.tap do |index_document|
|
15
|
+
index_document[Hyrax.config.collection_type_index_field.to_sym] = Array(resource.try(:collection_type_gid)&.to_s)
|
16
|
+
index_document[:generic_type_sim] = ['Collection']
|
17
|
+
index_document[:thumbnail_path_ss] = Hyrax::CollectionThumbnailPathService.call(resource)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -6,7 +6,9 @@ module Hyrax
|
|
6
6
|
module ResourceIndexer
|
7
7
|
def to_solr
|
8
8
|
super.tap do |index_document|
|
9
|
-
index_document[:
|
9
|
+
index_document[:has_model_ssim] = resource.class.name
|
10
|
+
index_document[:human_readable_type_tesim] = resource.human_readable_type
|
11
|
+
index_document[:alternate_ids_sim] = resource.alternate_ids.map(&:to_s)
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|